Skip to content

Commit

Permalink
Merge pull request #3398 from PsyCommando/add-modpack-config-hooks
Browse files Browse the repository at this point in the history
Modpack config handling
  • Loading branch information
MistakeNot4892 authored Oct 2, 2023
2 parents 6efdaa2 + 8b07a59 commit f4fbb49
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions code/controllers/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,9 @@ var/global/list/gamemode_cache = list()
config.show_typing_indicator_for_whispers = TRUE

else
log_misc("Unknown setting in configuration: '[name]'")
//crappy hook to get modpacks to load any extra config
if(!load_mod_config(name, value))
log_misc("Unknown setting in configuration: '[name]'")

else if(type == "game_options")
if(!value)
Expand Down Expand Up @@ -945,7 +947,9 @@ var/global/list/gamemode_cache = list()
config.disable_daycycle = TRUE

else
log_misc("Unknown setting in configuration: '[name]'")
//crappy hook to get modpacks to load any extra config
if(!load_mod_config(name, value))
log_misc("Unknown setting in game_options configuration: '[name]'")

fps = round(fps)
if(fps <= 0)
Expand Down Expand Up @@ -989,7 +993,9 @@ var/global/list/gamemode_cache = list()
if ("password")
sqlpass = value
else
log_misc("Unknown setting in configuration: '[name]'")
//crappy hook to get modpacks to load any extra config
if(!load_mod_dbconfig(name, value))
log_misc("Unknown setting in DB configuration: '[name]'")

/datum/configuration/proc/pick_mode(mode_name)
// I wish I didn't have to instance the game modes in order to look up
Expand All @@ -1011,3 +1017,19 @@ var/global/list/gamemode_cache = list()
var/event_info = safe_file2text(filename, FALSE)
if(event_info)
custom_event_msg = event_info

///Hook stub for loading modpack specific configs. Just override in modpack.
/datum/configuration/proc/load_mod_config(var/name, var/value)
//Force it to run parents overrides, so other modpacks don't just completely break config loading for one another
SHOULD_CALL_PARENT(TRUE)
return

///Hook stub for loading modpack specific game_options. Just override in modpack.
/datum/configuration/proc/load_mod_game_options(var/name, var/value)
SHOULD_CALL_PARENT(TRUE)
return

///Hook stub for loading modpack specific dbconfig. Just override in modpack.
/datum/configuration/proc/load_mod_dbconfig(var/name, var/value)
SHOULD_CALL_PARENT(TRUE)
return

0 comments on commit f4fbb49

Please sign in to comment.