Skip to content

Commit cfb45f5

Browse files
authored
Merge pull request #12 from jaames/v1.1
V1.1
2 parents 38c959f + 5ed819c commit cfb45f5

59 files changed

Lines changed: 792 additions & 311 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Source/components/Button.lua

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function Button:init(x, y, w, h, text)
2727

2828
self.variant = 'default'
2929
self.state = 'base'
30+
self.stateTimer = nil
3031

3132
self.padLeft = 16
3233
self.padRight = 16
@@ -54,19 +55,31 @@ function Button:init(x, y, w, h, text)
5455
end
5556

5657
function Button:focus()
58+
if self.stateTimer then
59+
self.stateTimer:remove()
60+
self.stateTimer = nil
61+
end
5762
self.state = 'select'
5863
Button.super.focus(self)
5964
end
6065

6166
function Button:unfocus()
67+
if self.stateTimer then
68+
self.stateTimer:remove()
69+
self.stateTimer = nil
70+
end
6271
self.state = 'base'
6372
Button.super.unfocus(self)
6473
end
6574

6675
function Button:click()
67-
local lastState = self.state
76+
if self.stateTimer then
77+
self.stateTimer:remove()
78+
self.stateTimer = nil
79+
end
80+
local lastState = self.state ~= 'click' and self.state or 'base'
6881
self.state = 'click'
69-
playdate.timer.performAfterDelay(300, function ()
82+
self.stateTimer = playdate.timer.performAfterDelay(300, function ()
7083
self.state = lastState
7184
end)
7285
Button.super.click(self)

Source/components/PageArrow.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
local img <const> = gfx.image.new('./gfx/icon_page_next')
2+
3+
PageArrow = {}
4+
class('PageArrow').extends(ComponentBase)
5+
6+
PageArrow.kTypeNext = 1
7+
PageArrow.kTypePrev = 2
8+
9+
function PageArrow:init(x, y, type)
10+
local w, h = img:getSize()
11+
PageArrow.super.init(self, x, y, w, h)
12+
self:setAnchor('center', 'center')
13+
self:setZIndex(200)
14+
self:setImage(img)
15+
if type == PageArrow.kTypePrev then
16+
self:setImageFlip(gfx.kImageFlippedX)
17+
end
18+
end

Source/data/cy_strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"SETTINGS_RESET_CONFIRM": "Bydd gosodiadau’n cael eu dileu",
2222
"SETTINGS_RESET_DONE": "Mae gosodiadau wedi’u dileu",
2323

24-
"ABOUT_VERSION": "Fersiwn %d",
24+
"ABOUT_VERSION": "Fersiwn %s",
2525
"ABOUT_BUILT_BY": "Gwnaed gan %s",
2626

2727
"CREDITS_HEADER_JAMES": "Dylunio rhyngwyneb a rhaglennu",

Source/data/de_strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"SETTINGS_RESET_CONFIRM": "Alle Einstellungen werden gelöscht",
2222
"SETTINGS_RESET_DONE": "Einstellungen wurden gelöscht",
2323

24-
"ABOUT_VERSION": "Version %d",
24+
"ABOUT_VERSION": "Version %s",
2525
"ABOUT_BUILT_BY": "Kreiert von %s",
2626

2727
"CREDITS_HEADER_JAMES": "Programmierung und UI Design",

Source/data/en_strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"SETTINGS_RESET_CONFIRM": "All settings will be cleared",
2222
"SETTINGS_RESET_DONE": "Settings cleared",
2323

24-
"ABOUT_VERSION": "Version %d",
24+
"ABOUT_VERSION": "Version %s",
2525
"ABOUT_BUILT_BY": "Built by %s",
2626

2727
"CREDITS_HEADER_JAMES": "Programming and UI Design",

Source/data/es_strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"SETTINGS_RESET_CONFIRM": "Cada ajuste se va a restablecer",
2222
"SETTINGS_RESET_DONE": "Se han restablecido los ajustes",
2323

24-
"ABOUT_VERSION": "Versión %d",
24+
"ABOUT_VERSION": "Versión %s",
2525
"ABOUT_BUILT_BY": "Compilado por %s",
2626

2727
"CREDITS_HEADER_JAMES": "Programación y Diseño de UI",

Source/data/fr_strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"SETTINGS_RESET_CONFIRM": "Toutes les options seront réinitialisées",
2222
"SETTINGS_RESET_DONE": "Les options ont été réinitialisées",
2323

24-
"ABOUT_VERSION": "Version %d",
24+
"ABOUT_VERSION": "Version %s",
2525
"ABOUT_BUILT_BY": "Créé par %s",
2626

2727
"CREDITS_HEADER_JAMES": "Programmation et design de l’interface",

Source/data/it_strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"SETTINGS_RESET_CONFIRM": "Le impostazioni verranno ripristinate",
2222
"SETTINGS_RESET_DONE": "Impostazioni cancellate",
2323

24-
"ABOUT_VERSION": "La versione %d",
24+
"ABOUT_VERSION": "La versione %s",
2525
"ABOUT_BUILT_BY": "Costruito da %s",
2626

2727
"CREDITS_HEADER_JAMES": "Programmatore e UI Designer",

Source/data/jp_strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"SETTINGS_RESET_CONFIRM": "すべての設定をリセットします",
2222
"SETTINGS_RESET_DONE": "設定のリセットが完了しました",
2323

24-
"ABOUT_VERSION": "Version %d",
24+
"ABOUT_VERSION": "Version %s",
2525
"ABOUT_BUILT_BY": "開発者: %s",
2626

2727
"CREDITS_HEADER_JAMES": "プログラム&UIデザイン",

Source/data/nl_strings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"SETTINGS_RESET_CONFIRM": "Alle instellingen worden hersteld",
2222
"SETTINGS_RESET_DONE": "Instellingen zijn hersteld",
2323

24-
"ABOUT_VERSION": "Versie %d",
24+
"ABOUT_VERSION": "Versie %s",
2525
"ABOUT_BUILT_BY": "Ontwikkeld door %s",
2626

2727
"CREDITS_HEADER_JAMES": "Programmeren en UI Ontwerp",

0 commit comments

Comments
 (0)