mirror of
https://github.com/ershisan99/Fantoms-Preview.git
synced 2025-12-16 12:32:48 +00:00
changed size of button
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
--
|
||||
-- The heart of this library: it replicates the game's score evaluation.
|
||||
|
||||
if not FN.SIM.run then
|
||||
function FN.SIM.run()
|
||||
local null_ret = {score = {min=0, exact=0, max=0}, dollars = {min=0, exact=0, max=0}}
|
||||
if #G.hand.highlighted < 1 then return null_ret end
|
||||
@@ -418,3 +419,5 @@ function FN.SIM.simulate_joker(joker_obj, context)
|
||||
local joker_simulation_function = FN.SIM.JOKERS["simulate_" .. joker_obj.id]
|
||||
if joker_simulation_function then joker_simulation_function(joker_obj, context) end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -7,7 +7,7 @@
|
||||
"prefix": "fn",
|
||||
"main_file": "CorePreview.lua",
|
||||
"priority": 0,
|
||||
"version": "2.1.0",
|
||||
"version": "2.2.0",
|
||||
"dependencies": [],
|
||||
"conflicts": []
|
||||
}
|
||||
|
||||
@@ -8,28 +8,13 @@ function create_UIBox_HUD()
|
||||
local contents = orig_hud()
|
||||
|
||||
|
||||
local score_node_wrap = {n=G.UIT.R, config={id = "fn_pre_score_wrap", align = "cm", padding = 0.05}, nodes={}}
|
||||
local score_node_wrap = {n=G.UIT.R, config={id = "fn_pre_score_wrap", align = "cm", padding = 0.1}, nodes={}}
|
||||
table.insert(score_node_wrap.nodes, FN.PRE.get_score_node())
|
||||
local calculate_score_button = {n = G.UIT.R,
|
||||
config = {
|
||||
align = "cm",
|
||||
padding = 0.01,
|
||||
},
|
||||
nodes = {
|
||||
UIBox_button({
|
||||
id = "calculate_score_button",
|
||||
label = {
|
||||
"Calculate Score"
|
||||
},
|
||||
colour = G.C.RED,
|
||||
button = "calculate_score_button",
|
||||
scale = 0.5,
|
||||
}),
|
||||
},
|
||||
}
|
||||
local calculate_score_button_wrap = {n=G.UIT.R, config={id = "fn_calculate_score_button_wrap", align = "cm", padding = 0.1}, nodes={}}
|
||||
table.insert(calculate_score_button_wrap.nodes, FN.PRE.get_calculate_score_button())
|
||||
|
||||
table.insert(contents.nodes[1].nodes[1].nodes[4].nodes[1].nodes, score_node_wrap)
|
||||
table.insert(contents.nodes[1].nodes[1].nodes[4].nodes[1].nodes, calculate_score_button)
|
||||
table.insert(contents.nodes[1].nodes[1].nodes[4].nodes[1].nodes, calculate_score_button_wrap)
|
||||
|
||||
--[[local dollars_node_wrap = {n=G.UIT.C, config={id = "fn_pre_dollars_wrap", align = "cm"}, nodes={}}
|
||||
if G.SETTINGS.FN.preview_dollars then table.insert(dollars_node_wrap.nodes, FN.PRE.get_dollars_node()) end
|
||||
@@ -42,6 +27,16 @@ function G.FUNCS.calculate_score_button()
|
||||
FN.PRE.start_new_coroutine()
|
||||
end
|
||||
|
||||
function FN.PRE.get_calculate_score_button()
|
||||
|
||||
return {n=G.UIT.C, config={id = "calculate_score_button", button = "calculate_score_button", align = "cm", minh = 0.42, padding = 0.05, r = 0.02, colour = G.C.RED, hover = true, shadow = true}, nodes={
|
||||
{n=G.UIT.R, config={align = "cm"}, nodes={
|
||||
{n=G.UIT.T, config={text = " Calculate Score ", colour = G.C.UI.TEXT_LIGHT, shadow = true, scale = 0.36}}
|
||||
}}
|
||||
}}
|
||||
end
|
||||
|
||||
|
||||
function FN.PRE.get_score_node()
|
||||
local text_scale = nil
|
||||
if true then text_scale = 0.5
|
||||
|
||||
@@ -805,26 +805,27 @@ FNSJ.simulate_seeing_double = function(joker_obj, context)
|
||||
-- Account for all 'real' suits:
|
||||
for _, card in ipairs(context.scoring_hand) do
|
||||
if card.ability.effect ~= "Wild Card" then
|
||||
if FN.SIM.is_suit(card, "Hearts") then inc_suit("Hearts") end
|
||||
if FN.SIM.is_suit(card, "Diamonds") then inc_suit("Diamonds") end
|
||||
if FN.SIM.is_suit(card, "Spades") then inc_suit("Spades") end
|
||||
if FN.SIM.is_suit(card, "Clubs") then inc_suit("Clubs") end
|
||||
if DV.SIM.is_suit(card, "Hearts") then inc_suit("Hearts") end
|
||||
if DV.SIM.is_suit(card, "Diamonds") then inc_suit("Diamonds") end
|
||||
if DV.SIM.is_suit(card, "Spades") then inc_suit("Spades") end
|
||||
if DV.SIM.is_suit(card, "Clubs") then inc_suit("Clubs") end
|
||||
end
|
||||
end
|
||||
|
||||
-- Let Wild Cards fill in the gaps:
|
||||
for _, card in ipairs(context.scoring_hand) do
|
||||
if card.ability.effect == "Wild Card" then
|
||||
if suit_count["Clubs"] == 0 then inc_suit("Clubs")
|
||||
elseif FN.SIM.is_suit(card, "Diamonds") and suit_count["Diamonds"] == 0 then inc_suit("Diamonds")
|
||||
elseif FN.SIM.is_suit(card, "Spades") and suit_count["Spades"] == 0 then inc_suit("Spades")
|
||||
elseif FN.SIM.is_suit(card, "Hearts") and suit_count["Hearts"] == 0 then inc_suit("Hearts")
|
||||
-- IMPORTANT: Clubs must come first here, because Clubs are required for xmult. This is in line with game's implementation.
|
||||
if DV.SIM.is_suit(card, "Clubs") and suit_count["Clubs"] == 0 then inc_suit("Clubs")
|
||||
elseif DV.SIM.is_suit(card, "Hearts") and suit_count["Hearts"] == 0 then inc_suit("Hearts")
|
||||
elseif DV.SIM.is_suit(card, "Diamonds") and suit_count["Diamonds"] == 0 then inc_suit("Diamonds")
|
||||
elseif DV.SIM.is_suit(card, "Spades") and suit_count["Spades"] == 0 then inc_suit("Spades")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if suit_count["Clubs"] > 0 and (suit_count["Hearts"] > 0 or suit_count["Diamonds"] > 0 or suit_count["Spades"] > 0) then
|
||||
FN.SIM.x_mult(joker_obj.ability.extra)
|
||||
DV.SIM.x_mult(joker_obj.ability.extra)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user