Skip to content

Commit fdf15b7

Browse files
committed
who said we needed to restart?
1 parent c5db2f9 commit fdf15b7

File tree

4 files changed

+66
-59
lines changed

4 files changed

+66
-59
lines changed

Cryptid.lua

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ if not Cryptid then
2222
Cryptid = {}
2323
end
2424
local mod_path = "" .. SMODS.current_mod.path -- this path changes when each mod is loaded, but the local variable will retain Cryptid's path
25+
Cryptid.path = mod_path
2526
Cryptid_config = SMODS.current_mod.config
2627
-- This will save the current state even when settings are modified
2728
Cryptid.enabled = copy_table(Cryptid_config)
@@ -192,67 +193,65 @@ function SMODS.injectItems(...)
192193
cry_update_obj_registry()
193194
end
194195

195-
local cryptidTabs = function()
196-
return {
196+
local cryptidConfigTab = function()
197+
cry_nodes = {
197198
{
198-
label = localize("cry_set_features"),
199-
chosen = true,
200-
tab_definition_function = function()
201-
cry_nodes = {
202-
{
203-
n = G.UIT.R,
204-
config = { align = "cm" },
205-
nodes = {
206-
{
207-
n = G.UIT.O,
208-
config = {
209-
object = DynaText({
210-
string = localize("cry_set_enable_features"),
211-
colours = { G.C.WHITE },
212-
shadow = true,
213-
scale = 0.4,
214-
}),
215-
},
216-
},
217-
},
218-
},
219-
}
220-
left_settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
221-
right_settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
222-
config =
223-
{ n = G.UIT.R, config = { align = "tm", padding = 0 }, nodes = { left_settings, right_settings } }
224-
cry_nodes[#cry_nodes + 1] = config
225-
cry_nodes[#cry_nodes + 1] = UIBox_button({
226-
button = "your_collection_content_sets",
227-
label = { localize("b_content_sets") },
228-
count = modsCollectionTally(G.P_CENTER_POOLS["Content Set"]),
229-
minw = 5,
230-
minh = 1.7,
231-
scale = 0.6,
232-
id = "your_collection_jokers",
233-
})
234-
--Make this not require a restart later
235-
cry_nodes[#cry_nodes + 1] = create_toggle({
236-
label = localize("cry_family"),
237-
active_colour = G.C.MONEY,
238-
ref_table = Cryptid_config,
239-
ref_value = "family_mode",
240-
})
241-
return {
242-
n = G.UIT.ROOT,
199+
n = G.UIT.R,
200+
config = { align = "cm" },
201+
nodes = {
202+
{
203+
n = G.UIT.O,
243204
config = {
244-
emboss = 0.05,
245-
minh = 6,
246-
r = 0.1,
247-
minw = 10,
248-
align = "cm",
249-
padding = 0.2,
250-
colour = G.C.BLACK,
205+
object = DynaText({
206+
string = localize("cry_set_enable_features"),
207+
colours = { G.C.WHITE },
208+
shadow = true,
209+
scale = 0.4,
210+
}),
251211
},
252-
nodes = cry_nodes,
253-
}
254-
end,
212+
},
213+
},
255214
},
215+
}
216+
left_settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
217+
right_settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
218+
config =
219+
{ n = G.UIT.R, config = { align = "tm", padding = 0 }, nodes = { left_settings, right_settings } }
220+
cry_nodes[#cry_nodes + 1] = config
221+
cry_nodes[#cry_nodes + 1] = UIBox_button({
222+
button = "your_collection_content_sets",
223+
label = { localize("b_content_sets") },
224+
count = modsCollectionTally(G.P_CENTER_POOLS["Content Set"]),
225+
minw = 5,
226+
minh = 1.7,
227+
scale = 0.6,
228+
id = "your_collection_jokers",
229+
})
230+
--Add warning UI later for family mode
231+
cry_nodes[#cry_nodes + 1] = create_toggle({
232+
label = localize("cry_family"),
233+
active_colour = G.C.MONEY,
234+
ref_table = Cryptid_config,
235+
ref_value = "family_mode",
236+
callback = reload_cryptid_localization
237+
})
238+
return {
239+
n = G.UIT.ROOT,
240+
config = {
241+
emboss = 0.05,
242+
minh = 6,
243+
r = 0.1,
244+
minw = 10,
245+
align = "cm",
246+
padding = 0.2,
247+
colour = G.C.BLACK,
248+
},
249+
nodes = cry_nodes,
250+
}
251+
end
252+
253+
local cryptidTabs = function()
254+
return {
256255
{
257256
label = localize("cry_set_music"),
258257
tab_definition_function = function()
@@ -319,3 +318,4 @@ local cryptidTabs = function()
319318
}
320319
end
321320
SMODS.current_mod.extra_tabs = cryptidTabs
321+
SMODS.current_mod.config_tab = cryptidConfigTab

config.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ return {
66
["big_music"] = true,
77
["alt_bg_music"] = true,
88
},
9-
["family_mode"] = true,
9+
["family_mode"] = false,
1010
}

lib/misc.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,3 +611,10 @@ function Cryptid.post_process(center)
611611
end
612612
end
613613
end
614+
615+
-- Wrapper G.FUNCS function to reset localization
616+
-- For resetting localization on the fly for family friendly toggle
617+
function reload_cryptid_localization()
618+
SMODS.handle_loc_file(Cryptid.path)
619+
return init_localization()
620+
end

localization/en-us.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4239,7 +4239,7 @@ return {
42394239
cry_mus_exotic = "Exotic Jokers (Joker in Latin by AlexZGreat)",
42404240
cry_mus_high_score = "High Score (Final Boss [For Your Computer] by AlexZGreat)",
42414241
cry_mus_alt_bg = "Background Music (by MathIsFun_)",
4242-
cry_family = "Family Friendly Mode (Requires Restart",
4242+
cry_family = "Family Friendly Mode",
42434243

42444244
k_cry_program_pack = "Program Pack",
42454245
k_cry_meme_pack = "Meme Pack",

0 commit comments

Comments
 (0)