Skip to content

Commit 6dead35

Browse files
SDM0jolly[bot]
andauthored
Missing item deck menu use cases and german fix (#446)
* Added missing use cases * Fixed german translation file * jolly-bot: auto-format Lua files using Stylua --------- Co-authored-by: jolly[bot] <jolly[bot]@users.noreply.github.com>
1 parent 100fe00 commit 6dead35

File tree

4 files changed

+42
-12
lines changed

4 files changed

+42
-12
lines changed

items/enhanced.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,12 @@ return {
366366
G.cry_edeck_select = true
367367
else
368368
if self.edeck_select then
369-
G.PROFILES[G.SETTINGS.profile]["cry_edeck_" .. self.config.center.edeck_type] = self.edeck_select
369+
G.PROFILES[G.SETTINGS.profile]["cry_edeck_" .. self.config.center.edeck_type] =
370+
self.edeck_select
370371
end
371-
G.FUNCS.overlay_menu{
372-
definition = G.UIDEF.run_setup('main_menu_play'),
373-
}
372+
G.FUNCS.overlay_menu({
373+
definition = G.UIDEF.run_setup("main_menu_play"),
374+
})
374375
G.cry_edeck_select = nil
375376
end
376377
end

lib/misc.lua

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,21 @@ function cry_pls(str, vars)
189189
for v in inside:gmatch("[^,]+") do -- adds args to array
190190
table.insert(_table, v)
191191
end
192-
local num = vars[tonumber(string.match(str, ">(%d+)"))] -- gets reference variable
192+
local num = vars[tonumber(string.match(str, ">(%d+)"))] -- gets reference variable
193193
local plural = _table[1] -- default
194-
local checks = { [1] = "=" } -- checks 1 by default
195-
local checks1mod = false -- tracks if 1 was modified
194+
local checks = { [1] = "=" } -- checks 1 by default
195+
local checks1mod = false -- tracks if 1 was modified
196196
if #_table > 1 then
197197
for i = 2, #_table do
198198
local isnum = tonumber(_table[i])
199199
if isnum then
200-
if not checks1mod then checks[1] = nil end -- dumb stuff
201-
checks[isnum] = "<" .. (_table[i + 1] or "") -- do less than for custom values
202-
if isnum == 1 then checks1mod = true end
200+
if not checks1mod then
201+
checks[1] = nil
202+
end -- dumb stuff
203+
checks[isnum] = "<" .. (_table[i + 1] or "") -- do less than for custom values
204+
if isnum == 1 then
205+
checks1mod = true
206+
end
203207
i = i + 1
204208
elseif i == 2 then
205209
checks[1] = "=" .. _table[i]
@@ -213,7 +217,9 @@ function cry_pls(str, vars)
213217
for k in pairs(checks) do
214218
table.insert(keys, k)
215219
end
216-
table.sort(keys, function(a, b) return a < b end)
220+
table.sort(keys, function(a, b)
221+
return a < b
222+
end)
217223
for _, k in ipairs(keys) do
218224
if fch(checks[k], "=") then
219225
if math.abs(to_big(num) - k) < to_big(0.001) then

localization/de.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ return {
2323
"{C:attention}Gewöhnliche{} Joker haben",
2424
"{C:attention}vierfache{} Werte",
2525
},
26+
},
2627
b_cry_beta = {
2728
name = "Nostalgisches Deck",
2829
text = {

lovely/misc.toml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ target = "game.lua"
438438
pattern = "SMODS.OPENED_BOOSTER.config.center:update_pack(dt)"
439439
position = "at"
440440
payload = '''
441-
if not SMODS.OPENED_BOOSTER then
441+
if not SMODS.OPENED_BOOSTER then
442442
G.STATE = G.STATES.SHOP
443443
print('Error: SMODS.OPENED_BOOSTER is nil. Game recovered by setting game state to shop.')
444444
else
@@ -459,4 +459,26 @@ if G.GAME.modifiers.cry_force_enhancement then card:set_ability(G.P_CENTERS[G.GA
459459
if G.GAME.modifiers.cry_force_edition then card:set_edition({[G.GAME.modifiers.cry_force_edition]=true},true,true) end
460460
if G.GAME.modifiers.cry_force_seal then card:set_seal(G.GAME.modifiers.cry_force_seal) end
461461
'''
462+
match_indent = true
463+
464+
# Remove G.cry_edeck_select on back
465+
[[patches]]
466+
[patches.pattern]
467+
target = "functions/button_callbacks.lua"
468+
pattern = "G.FUNCS.setup_run = function(e)"
469+
position = "after"
470+
payload = '''
471+
G.cry_edeck_select = nil
472+
'''
473+
match_indent = true
474+
475+
# Remove G.cry_edeck_select on escape key press
476+
[[patches]]
477+
[patches.pattern]
478+
target = "engine/controller.lua"
479+
pattern = '''if key == "escape" then'''
480+
position = "after"
481+
payload = '''
482+
G.cry_edeck_select = nil
483+
'''
462484
match_indent = true

0 commit comments

Comments
 (0)