diff --git a/assets/1x/back.png b/assets/1x/back.png new file mode 100644 index 0000000..dd16f2d Binary files /dev/null and b/assets/1x/back.png differ diff --git a/assets/1x/martingale.png b/assets/1x/martingale.png index 601c006..c551c1f 100644 Binary files a/assets/1x/martingale.png and b/assets/1x/martingale.png differ diff --git a/assets/2x/back.png b/assets/2x/back.png new file mode 100644 index 0000000..628031a Binary files /dev/null and b/assets/2x/back.png differ diff --git a/assets/2x/blind.png b/assets/2x/blind.png index f435f60..ede8520 100644 Binary files a/assets/2x/blind.png and b/assets/2x/blind.png differ diff --git a/assets/2x/escapey.png b/assets/2x/escapey.png index 293376e..1bdbffb 100644 Binary files a/assets/2x/escapey.png and b/assets/2x/escapey.png differ diff --git a/assets/2x/icon.png b/assets/2x/icon.png index 7516a15..3ff2034 100644 Binary files a/assets/2x/icon.png and b/assets/2x/icon.png differ diff --git a/assets/2x/iphone.png b/assets/2x/iphone.png index 4f73a90..99d1ef9 100644 Binary files a/assets/2x/iphone.png and b/assets/2x/iphone.png differ diff --git a/assets/2x/martingale.png b/assets/2x/martingale.png index a863594..dc65347 100644 Binary files a/assets/2x/martingale.png and b/assets/2x/martingale.png differ diff --git a/assets/2x/seal.png b/assets/2x/seal.png index 7815f30..9ba37fb 100644 Binary files a/assets/2x/seal.png and b/assets/2x/seal.png differ diff --git a/assets/2x/spectral.png b/assets/2x/spectral.png index 5f105f6..2eba88f 100644 Binary files a/assets/2x/spectral.png and b/assets/2x/spectral.png differ diff --git a/src/back.lua b/src/back.lua index 307f5cf..6b9e5ff 100644 --- a/src/back.lua +++ b/src/back.lua @@ -8,60 +8,66 @@ local function save(ret) return ret end -local function back(b) - local key = b.key - local apply = b.apply - local calculate = b.calculate +local back = (function() + local x = 0 - function b:apply(...) - return apply and G.GAME.selected_sleeve ~= "sleeve_Roland_" .. key and save(apply(self, ...)) + return function(b) + local key = b.key + local apply = b.apply + local calculate = b.calculate + + function b:apply(...) + return apply and G.GAME.selected_sleeve ~= "sleeve_Roland_" .. key and save(apply(self, ...)) + end + + function b:calculate(...) + return calculate and G.GAME.selected_sleeve ~= "sleeve_Roland_" .. key and calculate(self, ...) + end + + b.pos = {x = x, y = 0} + b.atlas = "back" + SMODS.Back(b) + x = x + 1 + + ---@diagnostic disable-next-line: undefined-global + if not CardSleeves then + return + end + + ---@diagnostic disable-next-line: undefined-global + CardSleeves.Sleeve { + key = key, + pos = b.pos, + atlas = "void", + config = b.config and f(b.config):into() or nil, + loc_vars = function(self, ...) + local ret = b.loc_vars and b.loc_vars(self, ...) or {} + ret.key = self:is_alt() and self.key .. "_alt" or self.key + return ret + end, + apply = function(self, ...) + return (b.alt_apply and self:is_alt() and b.alt_apply or apply)(self, ...) + end, + calculate = function(self, ...) + return (b.alt_calculate and self:is_alt() and b.alt_calculate or calculate)(self, ...) + end, + is_alt = function(self) + return self.get_current_deck_key() == "b_Roland_" .. key + end, + } end +end)() - function b:calculate(...) - return calculate and G.GAME.selected_sleeve ~= "sleeve_Roland_" .. key and calculate(self, ...) - end +SMODS.Atlas { + key = "back", + path = "back.png", + px = 71, + py = 95, +} - b.atlas = "void" - SMODS.Back(b) - - ---@diagnostic disable-next-line: undefined-global - if not CardSleeves then - return - end - - ---@diagnostic disable-next-line: undefined-global - CardSleeves.Sleeve { - key = key, - pos = b.pos, - atlas = "void", - config = b.config and f(b.config):into() or nil, - loc_vars = function(self, ...) - local ret = b.loc_vars and b.loc_vars(self, ...) or {} - ret.key = self:is_alt() and self.key .. "_alt" or self.key - return ret - end, - apply = function(self, ...) - return (b.alt_apply and self:is_alt() and b.alt_apply or apply)(self, ...) - end, - calculate = function(self, ...) - return (b.alt_calculate and self:is_alt() and b.alt_calculate or calculate)(self, ...) - end, - is_alt = function(self) - return self.get_current_deck_key() == "b_Roland_" .. key - end, - } -end - --- SMODS.Atlas { --- key = "back", --- path = "back.png", --- px = 71, --- py = 95, --- } back { key = "blossom", name = "Blossom", - pos = {x = 0, y = 0}, config = {extra = {times = 2}}, loc_vars = function(self, _, _) return {vars = {self.config.extra.times}} @@ -99,7 +105,6 @@ back { back { key = "go", name = "Go", - pos = {x = 0, y = 0}, config = {extra = {times = 1, alt_times = 5}}, loc_vars = function(self, _, _) return {vars = {self.config.extra.alt_times - self.config.extra.times}}