Divergent/mods/DynaHUD/gamedata/scripts/dynahud_hud_mcm.script

114 lines
7.2 KiB
Plaintext

function USES_EFP_PATCH()
if dynahud_patch_binder.patch_type == 2 then
return true
else return false end
end
-- function get_config(key)
-- if ui_mcm then
-- return ui_mcm.get("dynahud/hud_init_pref/"..key)
-- elseif mcm_config[key] ~= nil then
-- return mcm_config[key]
-- else
-- return ui_config[key]
-- end
-- end
-- function on_mcm_load()
-- printf("dynahud hud style MCM settings loading")
-- op = { id= "hud_init_pref" ,sh=true, text="ui_mcm_dynahud_init_pref" ,gr={
-- { id= "ui" ,sh=true, text="ui_mcm_dynahud_init_pref_ui" ,gr={
-- {id= "title",type= "slide",link= "ui\\dynahud\\Dynahud_Banner.dds",text="ui_mcm_dynahud_init_pref_ui_title",size= {512,50},spacing= 20 },
-- {id = "help", type = "desc", clr = {200, 200, 255, 200}, text="ui_mcm_dynahud_init_pref_ui_help"},
-- {id = "show_ammo_counter_hud",type = "check", val = 1,def = true},
-- {id = "show_ammo_icon_hud",type = "check", val = 1,def = true},
-- },},
-- { id= "fireModeCheck" ,sh=true, text="ui_mcm_dynahud_init_pref_fireModeCheck" ,gr={
-- {id= "title",type= "slide",link= "ui\\dynahud\\Dynahud_Banner.dds",text="ui_mcm_dynahud_init_pref_fireModeCheck_title",size= {512,50},spacing= 20 },
-- {id = "help", type = "desc", clr = {200, 200, 255, 200}, text="ui_mcm_dynahud_init_pref_fireModeCheck_help"},
-- {id = "hideGui",type = "check", val = 1,def = true},
-- { id = "displayMode", type = "radio_h", val = 2, def = 3, content = { { 3, "fireModeCheck_full" }, { 1, "fireModeCheck_text_only" }, { 2, "fireModeCheck_image_only" } } },
-- },},
-- { id= "rax_ammo_check" ,sh=true, text="ui_mcm_dynahud_init_pref_rax_ammo_check" ,gr={
-- {id= "title",type= "slide",link= "ui\\dynahud\\Dynahud_Banner.dds",text="ui_mcm_dynahud_init_pref_rax_ammo_check_title",size= {512,50},spacing= 20 },
-- {id = "help", type = "desc", clr = {200, 200, 255, 200}, text="ui_mcm_dynahud_init_pref_rax_ammo_check_help"},
-- {id = "hidecounter",type = "check", val = 1,def = true},
-- {id = "hideicon",type = "check", val = 1,def = true},
-- },},
-- { id= "hud_configurator" ,sh=true,precondition={USES_EFP_PATCH}, text="ui_mcm_dynahud_init_pref_hud_configurator" ,gr={
-- {id= "title",type= "slide",link= "ui\\dynahud\\Dynahud_Banner.dds",text="ui_mcm_dynahud_init_pref_hud_configurator_title",size= {512,50},spacing= 20 },
-- {id = "help", type = "desc", clr = {200, 200, 255, 200}, text="ui_mcm_dynahud_init_pref_hud_configurator_help"},
-- {id = "background",type = "check", val = 1,def = true},
-- {id = "fire_mode",type = "check", val = 1,def = true},
-- {id = "health_bar",type = "check", val = 1,def = true},
-- {id = "psy_bar",type = "check", val = 1,def = true},
-- {id = "stamina_bar",type = "check", val = 1,def = true},
-- },},
-- }}
-- return op, "dynahud"
-- end
-- function on_mcm_load()
-- printf("dynahud hud style MCM settings loading")
-- op = { id= "dynahud",gr={
-- { id= "hud_init_pref" ,sh=true, text="ui_mcm_dynahud_init_pref" ,gr={
-- {id= "title",type= "slide",link= "ui\\dynahud\\Dynahud_Banner.dds",text="ui_mcm_dynahud_init_pref_ui_title",size= {512,50},spacing= 20 },
-- {id = "help", type = "desc", clr = {200, 200, 255, 200}, text="ui_mcm_dynahud_init_pref_ui_help"},
-- {id = "reset_to_factory",type = "check", val = 1,def = false},
-- }}
-- }}
-- return op
-- end
-- function reset_HUD_Skin_style()
-- local HUD = dynahud_hud_binder.HUD
-- if ui_mcm then
-- ui_mcm.set("dynahud/hud_init_pref/fireModeCheck/hideGui", HUD.mcm_config("fireModeCheck/hideGui"))
-- ui_mcm.set("dynahud/hud_init_pref/fireModeCheck/displayMode", HUD.mcm_config("fireModeCheck/displayMode"))
-- ui_mcm.set("dynahud/hud_init_pref/rax_ammo_check/hidecounter", HUD.mcm_config("rax_ammo_check/hidecounter"))
-- ui_mcm.set("dynahud/hud_init_pref/rax_ammo_check/hideicon", HUD.mcm_config("rax_ammo_check/hideicon"))
-- ui_mcm.set("dynahud/hud_init_pref/ui/show_ammo_counter_hud", HUD.ui_config("rax_ammo_check/hidecounter"))
-- ui_mcm.set("dynahud/hud_init_pref/ui/show_ammo_icon_hud", HUD.ui_config("rax_ammo_check/hideicon"))
-- if USES_EFP_PATCH then
-- ui_mcm.set("dynahud/hud_init_pref/hud_configurator/background", HUD.mcm_config("hud_configurator/background"))
-- ui_mcm.set("dynahud/hud_init_pref/hud_configurator/fire_mode", HUD.mcm_config("hud_configurator/fire_mode"))
-- ui_mcm.set("dynahud/hud_init_pref/hud_configurator/health_bar", HUD.mcm_config("hud_configurator/health_bar"))
-- ui_mcm.set("dynahud/hud_init_pref/hud_configurator/psy_bar", HUD.mcm_config("hud_configurator/psy_bar"))
-- ui_mcm.set("dynahud/hud_init_pref/hud_configurator/stamina_bar", HUD.mcm_config("hud_configurator/stamina_bar"))
-- end
-- end
-- end
function on_option_change()
printf("[dynahud] hud style user settings saving")
-- Save the Hud reskin user preferences
if ui_mcm then
ui_mcm.set("dynahud/hud_init_pref/" .. (dynahud_hud_binder.HUD.style) .. "/fireModeCheck/hideGui", ui_mcm.get("fireModeCheck/hideGui"))
ui_mcm.set("dynahud/hud_init_pref/".. (dynahud_hud_binder.HUD.style) .. "/fireModeCheck/displayMode", ui_mcm.get("fireModeCheck/displayMode"))
ui_mcm.set("dynahud/hud_init_pref/".. (dynahud_hud_binder.HUD.style) .. "/rax_ammo_check/hidecounter", ui_mcm.get("rax_ammo_check/hidecounter"))
ui_mcm.set("dynahud/hud_init_pref/".. (dynahud_hud_binder.HUD.style) .. "/rax_ammo_check/hideicon", ui_mcm.get("rax_ammo_check/hideicon"))
ui_mcm.set("dynahud/hud_init_pref/".. (dynahud_hud_binder.HUD.style) .. "/ui/show_ammo_counter_hud", ui_mcm.get("rax_ammo_check/hidecounter"))
ui_mcm.set("dynahud/hud_init_pref/".. (dynahud_hud_binder.HUD.style) .. "/ui/show_ammo_icon_hud", ui_mcm.get("rax_ammo_check/hideicon"))
if USES_EFP_PATCH then
ui_mcm.set("dynahud/hud_init_pref/".. (dynahud_hud_binder.HUD.style) .. "/hud_configurator/background", ui_mcm.get("hud_configurator/background"))
ui_mcm.set("dynahud/hud_init_pref/".. (dynahud_hud_binder.HUD.style) .. "/hud_configurator/fire_mode", ui_mcm.get("hud_configurator/fire_mode"))
ui_mcm.set("dynahud/hud_init_pref/".. (dynahud_hud_binder.HUD.style) .. "/hud_configurator/health_bar", ui_mcm.get("hud_configurator/health_bar"))
ui_mcm.set("dynahud/hud_init_pref/".. (dynahud_hud_binder.HUD.style) .. "/hud_configurator/psy_bar", ui_mcm.get("hud_configurator/psy_bar"))
ui_mcm.set("dynahud/hud_init_pref/".. (dynahud_hud_binder.HUD.style) .. "/hud_configurator/stamina_bar", ui_mcm.get("hud_configurator/stamina_bar"))
end
end
end
function on_game_start()
RegisterScriptCallback("on_option_change", on_option_change)
end