Skip to content

Commit 56258c4

Browse files
committed
Merge branch 'main' into addon
2 parents 3100d39 + 5cf7f08 commit 56258c4

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
# IDEs
3+
.idea
4+
.vscode
5+
6+
# mac thing
7+
**/.DS_Store

addons/mod_loader_tools/mod_loader.gd

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -186,30 +186,27 @@ func mod_log(text:String, mod_name:String = "Unknown-Mod", pretty:bool = false)-
186186
var date_time = Time.get_datetime_dict_from_system()
187187

188188
# Add leading zeroes if needed
189-
var hour = date_time.hour
190-
var mins = date_time.minute
191-
var secs = date_time.second
192-
hour = hour if str(hour).length() > 1 else str("0", hour)
193-
mins = mins if str(mins).length() > 1 else str("0", mins)
194-
secs = secs if str(secs).length() > 1 else str("0", secs)
189+
var hour := (date_time.hour as String).pad_zeros(2)
190+
var mins := (date_time.minute as String).pad_zeros(2)
191+
var secs := (date_time.second as String).pad_zeros(2)
195192

196-
var date_time_string = str(date_time.day,'.',date_time.month,'.',date_time.year,' - ', hour,':',mins,':',secs)
193+
var date_time_string := "%s.%s.%s - %s:%s:%s" % [date_time.day, date_time.month, date_time.year, hour, mins, secs]
197194

198195
print(str(date_time_string,' ', prefix, text))
199196

200197
var log_file = File.new()
201198

202199
if(!log_file.file_exists(MOD_LOG_PATH)):
203200
log_file.open(MOD_LOG_PATH, File.WRITE)
204-
log_file.store_string("\n" + str(date_time_string,' ', 'Created mod.log!'))
201+
log_file.store_string('%s Created mod.log!' % date_time_string)
205202
log_file.close()
206203

207204
var _error = log_file.open(MOD_LOG_PATH, File.READ_WRITE)
208-
if(_error):
205+
if _error:
209206
print(_error)
210207
return
211208
log_file.seek_end()
212-
if(pretty):
209+
if pretty:
213210
log_file.store_string("\n" + str(date_time_string,' ', prefix, JSON.print(text, " ")))
214211
else:
215212
log_file.store_string("\n" + str(date_time_string,' ', prefix, text))
@@ -529,7 +526,7 @@ func _get_local_folder_dir(subfolder:String = ""):
529526
var game_install_directory = OS.get_executable_path().get_base_dir()
530527

531528
if OS.get_name() == "OSX":
532-
game_install_directory = game_install_directory.get_base_dir().get_base_dir().get_base_dir()
529+
game_install_directory = game_install_directory.get_base_dir().get_base_dir()
533530

534531
# Fix for running the game through the Godot editor (as the EXE path would be
535532
# the editor's own EXE, which won't have any mod ZIPs)

0 commit comments

Comments
 (0)