mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 23:48:11 +00:00
Add true portable mode (#259)
This commit is contained in:
@@ -6,10 +6,20 @@ extends Object
|
||||
|
||||
|
||||
# Path to the latest log file.
|
||||
const MOD_LOG_PATH := "user://logs/modloader.log"
|
||||
static var MOD_LOG_PATH = get_log_path()
|
||||
|
||||
const _LOG_NAME := "ModLoader:Log"
|
||||
|
||||
static func get_log_path() -> String:
|
||||
var exe_dir = OS.get_executable_path().get_base_dir()
|
||||
var portable_flag = exe_dir.path_join("portable.txt")
|
||||
if FileAccess.file_exists(portable_flag):
|
||||
var log_dir = exe_dir.path_join("config/logs")
|
||||
DirAccess.make_dir_recursive_absolute(log_dir)
|
||||
return log_dir.path_join("modloader.log")
|
||||
else:
|
||||
return "user://logs/modloader.log"
|
||||
|
||||
## Denotes the severity of a log entry
|
||||
enum VERBOSITY_LEVEL {
|
||||
ERROR, ## For errors and fatal errors
|
||||
|
@@ -7,8 +7,15 @@ extends Object
|
||||
const LOG_NAME := "ModLoader:UserProfile"
|
||||
|
||||
# The path where the Mod User Profiles data is stored.
|
||||
const FILE_PATH_USER_PROFILES := "user://mod_user_profiles.json"
|
||||
static var FILE_PATH_USER_PROFILES := get_profiles_path()
|
||||
|
||||
static func get_profiles_path() -> String:
|
||||
var exe_dir = OS.get_executable_path().get_base_dir()
|
||||
var portable_flag = exe_dir.path_join("portable.txt")
|
||||
if FileAccess.file_exists(portable_flag):
|
||||
return exe_dir.path_join("config/mod_user_profiles.json")
|
||||
else:
|
||||
return "user://mod_user_profiles.json"
|
||||
|
||||
# API profile functions
|
||||
# =============================================================================
|
||||
|
Reference in New Issue
Block a user