Add account components 386-405; Reduce setting, PinInput Cmd+V
Twenty account components: SettingsList, OptionCycler, KeyBindings, ControllerMap, ProfileCard, CharacterCreator, LoginForm, PasswordGrid, SessionList, LanguagePicker, PalettePicker, VolumeMixer, DifficultySelect, AccessibilityOptions, AccountSwitcher, PlayerSelect, TwoFactor, About, PatchNotes and FeedbackForm. The components never check credentials, and no secret reaches the log: LoginForm reports Submitted and the caller counts Failures; each new failure clears the password, refocuses it, shakes the form and names no field. TwoFactor builds on input.PinInput and drains an epoch-aligned period bar. PalettePicker draws each tile in its own palette on a pixel.Pad grid. pixel.Settings.Reduce stills motion like the system preference, the micro font gains '?', display.Face draws avatar faces anywhere, and input.PinInput pastes on Cmd+V as native hosts send it.
This commit is contained in:
38 files changed
+2788
-13
No files matched your search
+1
-1
@@ -193,7 +193,7 @@ func hanging(punct func(rune) bool) func(rune) bool {
|
||||
}
|
||||
|
||||
func TestMicroFont(t *testing.T) {
|
||||
set := "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-#.:/%! "
|
||||
set := "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-#.:/%!? "
|
||||
seen := map[[MicroHeight]uint8]rune{}
|
||||
for _, r := range set {
|
||||
g := microGlyph(r)
|
||||
|
||||
@@ -37,6 +37,14 @@ var messages = map[Locale]map[string]string{
|
||||
"prev_track": "PREVIOUS", "next_track": "NEXT", "play": "PLAY", "volume": "VOLUME", "rec": "REC", "playing": "PLAYING", "seek": "SEEK",
|
||||
"copy": "COPY", "copied": "COPIED!", "command": "COMMAND", "breakpoint": "BREAKPOINT",
|
||||
"tool": "TOOL", "pen": "PEN", "fill": "FILL", "erase": "ERASE", "pick": "PICK", "grid": "GRID", "color": "COLOR", "preview": "PREVIEW",
|
||||
"press_key": "PRESS A KEY", "conflict": "CONFLICT", "name": "NAME", "password": "PASSWORD", "login": "LOGIN",
|
||||
"login_failed": "WRONG NAME OR PASSWORD", "sign_out": "SIGN OUT", "this_device": "THIS DEVICE",
|
||||
"easy": "EASY", "normal": "NORMAL", "hard": "HARD", "nightmare": "NIGHTMARE",
|
||||
"reduce_motion": "REDUCE MOTION", "dot_size": "DOT SIZE", "free_slot": "OPEN",
|
||||
"one_player": "1 PLAYER", "two_players": "2 PLAYERS", "version": "VERSION", "credits": "CREDITS",
|
||||
"added": "ADDED", "fixed": "FIXED", "changed": "CHANGED", "hair": "HAIR", "eyes": "EYES", "outfit": "OUTFIT",
|
||||
"hair_color": "HAIR COLOR", "outfit_color": "OUTFIT COLOR", "bgm": "BGM", "se": "SE", "voice": "VOICE",
|
||||
"styles": "SPIKY BOB BALD", "looks": "DOTS WIDE SLEEPY", "outfits": "TUNIC ROBE ARMOR", "hues": "DARK GOLD RED VIOLET SKY", "time_left": "TIME LEFT", "in_use": "IN USE", "rating": "RATING", "message": "MESSAGE", "symbols": "SYMBOLS",
|
||||
},
|
||||
Zh: {
|
||||
"ok": "确定", "cancel": "取消", "yes": "是", "no": "否", "close": "关闭",
|
||||
@@ -72,6 +80,14 @@ var messages = map[Locale]map[string]string{
|
||||
"prev_track": "上一首", "next_track": "下一首", "play": "播放", "volume": "音量", "rec": "录制", "playing": "正在播放", "seek": "进度",
|
||||
"copy": "复制", "copied": "已复制!", "command": "命令", "breakpoint": "断点",
|
||||
"tool": "工具", "pen": "铅笔", "fill": "填充", "erase": "橡皮", "pick": "吸管", "grid": "网格", "color": "颜色", "preview": "预览",
|
||||
"press_key": "请按键", "conflict": "冲突", "name": "名字", "password": "密码", "login": "登录",
|
||||
"login_failed": "名字或密码错误", "sign_out": "登出", "this_device": "本机",
|
||||
"easy": "简单", "normal": "普通", "hard": "困难", "nightmare": "噩梦",
|
||||
"reduce_motion": "减少动态", "dot_size": "像素大小", "free_slot": "空位",
|
||||
"one_player": "单人", "two_players": "双人", "version": "版本", "credits": "制作人员",
|
||||
"added": "新增", "fixed": "修复", "changed": "改动", "hair": "发型", "eyes": "眼睛", "outfit": "服装",
|
||||
"hair_color": "发色", "outfit_color": "衣色", "bgm": "音乐", "se": "音效", "voice": "语音",
|
||||
"styles": "刺头 短发 光头", "looks": "圆眼 大眼 睡眼", "outfits": "短衣 长袍 铠甲", "hues": "墨 金 红 堇 蓝", "time_left": "剩余时间", "in_use": "使用中", "rating": "评分", "message": "留言", "symbols": "符号",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ var micro = microFont(map[rune]string{
|
||||
'+': "...|.#.|###|.#.|...",
|
||||
'-': "...|...|###|...|...",
|
||||
'#': "#.#|###|#.#|###|#.#",
|
||||
'?': "###|..#|.##|...|.#.",
|
||||
'.': "...|...|...|...|.#.",
|
||||
':': "...|.#.|...|.#.|...",
|
||||
'/': "..#|..#|.#.|#..|#..",
|
||||
|
||||
+3
-1
@@ -24,6 +24,8 @@ type Settings struct {
|
||||
Now func() time.Time
|
||||
// Inert controls take no input, as under a busy veil.
|
||||
Inert bool
|
||||
// Reduce stills motion, as the system preference does.
|
||||
Reduce bool
|
||||
}
|
||||
|
||||
// Kit is one frame's settings, captured by components.
|
||||
@@ -92,7 +94,7 @@ func K(c *ui.Context) Kit {
|
||||
if s.Now != nil {
|
||||
now = s.Now()
|
||||
}
|
||||
return Kit{pal: s.Palette, dot: float32(s.Dot), locale: s.Locale, now: now, clock: s.Now, reduce: c.Preferences().ReduceMotion}
|
||||
return Kit{pal: s.Palette, dot: float32(s.Dot), locale: s.Locale, now: now, clock: s.Now, reduce: c.Preferences().ReduceMotion || s.Reduce}
|
||||
}
|
||||
|
||||
func frameOf(c *ui.Context) *frame {
|
||||
|
||||
@@ -189,3 +189,15 @@ func TestReduceMotionFollowsPreferences(t *testing.T) {
|
||||
t.Fatal("Reduce off after ReduceMotion preference")
|
||||
}
|
||||
}
|
||||
|
||||
func TestReduceSettingStillsMotionInItsScope(t *testing.T) {
|
||||
var outer, inner pixel.Kit
|
||||
ui.NewTester(func(c *ui.Context) {
|
||||
pixel.Use(c, pixel.Settings{Palette: pixel.SpringDay})
|
||||
outer = pixel.K(c)
|
||||
pixel.Scope(c, pixel.Settings{Palette: pixel.SpringDay, Reduce: true}, func() { inner = pixel.K(c) })
|
||||
}, 10, 10)
|
||||
if outer.Reduce() || !inner.Reduce() {
|
||||
t.Fatalf("Reduce: outside %v, inside %v", outer.Reduce(), inner.Reduce())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user