Skip to content

Commit b2fcb57

Browse files
committed
hint color options
1 parent ff43f0b commit b2fcb57

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

addons/mod_loader/api/log.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ static var verbosity: VERBOSITY_LEVEL = VERBOSITY_LEVEL.DEBUG
4343
## Array of mods that should be ignored when logging messages (contains mod IDs as strings)
4444
static var ignored_mods: Array[String] = []
4545

46+
## Highlighting color for hint type log messages
47+
static var hint_color := Color("#70bafa")
4648

4749
## This Sub-Class represents a log entry in ModLoader.
4850
class ModLoaderLogEntry:

addons/mod_loader/mod_loader_store.gd

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,16 @@ var ml_options: ModLoaderOptionsProfile
118118
func _init():
119119
_update_ml_options_from_options_resource()
120120
_update_ml_options_from_cli_args()
121+
_configure_logger()
121122
# ModLoaderStore is passed as argument so the cache data can be loaded on _init()
122123
_ModLoaderCache.init_cache(self)
123124

124125

126+
func _exit_tree() -> void:
127+
# Save the cache to the cache file.
128+
_ModLoaderCache.save_to_file()
129+
130+
125131
# Update ModLoader's options, via the custom options resource
126132
func _update_ml_options_from_options_resource() -> void:
127133
# Path to the options resource
@@ -178,11 +184,6 @@ func _update_ml_options_from_options_resource() -> void:
178184
ml_options = override_options
179185

180186

181-
func _exit_tree() -> void:
182-
# Save the cache to the cache file.
183-
_ModLoaderCache.save_to_file()
184-
185-
186187
# Update ModLoader's options, via CLI args
187188
func _update_ml_options_from_cli_args() -> void:
188189
# Disable mods
@@ -217,3 +218,10 @@ func _update_ml_options_from_cli_args() -> void:
217218
var ignore_mod_names := _ModLoaderCLI.get_cmd_line_arg_value("--log-ignore")
218219
if not ignore_mod_names == "":
219220
ml_options.ignored_mod_names_in_log = ignore_mod_names.split(",")
221+
222+
223+
# Update static variables from the options
224+
func _configure_logger() -> void:
225+
ModLoaderLog.verbosity = ml_options.log_level
226+
ModLoaderLog.ignored_mods = ml_options.ignored_mod_names_in_log
227+
ModLoaderLog.hint_color = ml_options.hint_color

addons/mod_loader/resources/options_profile.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extends Resource
2121
## [code]ModLoader:Dependency[/code] - ignore the exact name [br]
2222
## [code]ModLoader:*[/code] - ignore all beginning with this name [br]
2323
@export var ignored_mod_names_in_log: Array[String] = []
24+
@export var hint_color := Color("#70bafa")
2425

2526
@export_group("Game Data")
2627
## Steam app id, can be found in the steam page url

0 commit comments

Comments
 (0)