Skip to content

Commit a88ecaf

Browse files
authored
Multiple columns for additional Ranks (#1179)
1 parent 2324533 commit a88ecaf

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

src/overrides.lua

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,11 +1027,13 @@ function G.UIDEF.view_deck(unplayed_only)
10271027

10281028
if wheel_flipped > 0 then flip_col = mix_colours(G.C.FILTER, G.C.WHITE, 0.7) end
10291029

1030-
local rank_cols = {}
1031-
for i = #rank_name_mapping, 1, -1 do
1032-
if rank_tallies[rank_name_mapping[i]] ~= 0 or SMODS.add_to_pool(SMODS.Ranks[rank_name_mapping[i]], {suit=''}) then
1030+
local rank_cols = {}
1031+
local temp_cols = {}
1032+
1033+
for i = #rank_name_mapping, 1, -1 do
1034+
if rank_tallies[rank_name_mapping[i]] ~= 0 or SMODS.add_to_pool(SMODS.Ranks[rank_name_mapping[i]], { suit = '' }) then
10331035
local mod_delta = mod_rank_tallies[rank_name_mapping[i]] ~= rank_tallies[rank_name_mapping[i]]
1034-
rank_cols[#rank_cols + 1] = {n = G.UIT.R, config = {align = "cm", padding = 0.07}, nodes = {
1036+
temp_cols[#temp_cols + 1] = {n = G.UIT.R, config = {align = "cm", padding = 0.07}, nodes = {
10351037
{n = G.UIT.C, config = {align = "cm", r = 0.1, padding = 0.04, emboss = 0.04, minw = 0.5, colour = G.C.L_BLACK}, nodes = {
10361038
{n = G.UIT.T, config = {text = SMODS.Ranks[rank_name_mapping[i]].shorthand, colour = G.C.JOKER_GREY, scale = 0.35, shadow = true}},}},
10371039
{n = G.UIT.C, config = {align = "cr", minw = 0.4}, nodes = {
@@ -1041,8 +1043,25 @@ function G.UIDEF.view_deck(unplayed_only)
10411043
colours = { G.C.RED }, scale = 0.4, y_offset = -2, silent = true, shadow = true, pop_in_rate = 10, pop_delay = 4
10421044
})}}
10431045
or {n = G.UIT.T, config = {text = rank_tallies[rank_name_mapping[i]], colour = flip_col, scale = 0.45, shadow = true } },}}}}
1044-
end
1045-
end
1046+
1047+
if #temp_cols >= 13 then
1048+
rank_cols[#rank_cols + 1] = {
1049+
n = G.UIT.C,
1050+
config = { align = "cm" },
1051+
nodes = temp_cols
1052+
}
1053+
temp_cols = {}
1054+
end
1055+
end
1056+
end
1057+
1058+
if #temp_cols > 0 then
1059+
rank_cols[#rank_cols + 1] = {
1060+
n = G.UIT.C,
1061+
config = { align = "cm" },
1062+
nodes = temp_cols
1063+
}
1064+
end
10461065

10471066
local tally_ui = {
10481067
-- base cards

0 commit comments

Comments
 (0)