mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-12-06 03:30:22 -08:00
Some snapshot tools (#680)
variable for easily toggling on and off snapshot mode, and also some simple prints for things like unix time and what snapshot build the game would currently be on upon launch
This commit is contained in:
parent
7ca6fe8611
commit
c41d6fda47
3 changed files with 29 additions and 10 deletions
|
|
@ -39,6 +39,7 @@ const ROM_ASSETS_VERSION := 1
|
|||
var server_version := -1
|
||||
var current_version := -1
|
||||
var version_number := ""
|
||||
var is_snapshot := true
|
||||
|
||||
const LEVEL_THEMES := {
|
||||
"SMB1": SMB1_LEVEL_THEMES,
|
||||
|
|
@ -175,10 +176,10 @@ var p_switch_timer_paused := false
|
|||
var debug_mode := false
|
||||
|
||||
func _ready() -> void:
|
||||
if is_snapshot: get_build_time()
|
||||
if OS.is_debug_build(): debug_mode = false
|
||||
current_version = get_version_number()
|
||||
get_server_version()
|
||||
if OS.is_debug_build():
|
||||
debug_mode = false
|
||||
setup_config_dirs()
|
||||
check_for_rom()
|
||||
|
||||
|
|
@ -279,7 +280,25 @@ func handle_p_switch(delta: float) -> void:
|
|||
AudioManager.stop_music_override(AudioManager.MUSIC_OVERRIDES.PSWITCH)
|
||||
|
||||
func get_build_time() -> void:
|
||||
print(int(Time.get_unix_time_from_system()))
|
||||
# SkyanUltra: Slightly expanded function to make it easier to get snapshot build numbers.
|
||||
var date = Time.get_date_dict_from_system()
|
||||
var year_last_two = date.year % 100
|
||||
var now = Time.get_unix_time_from_system()
|
||||
print("[b][color=cyan]Current unix time:[/color][/b] ", int(now))
|
||||
var start_of_year = Time.get_unix_time_from_datetime_dict({
|
||||
"year": date.year,
|
||||
"month": 1,
|
||||
"day": 1,
|
||||
"hour": 0,
|
||||
"minute": 0,
|
||||
"second": 0
|
||||
})
|
||||
|
||||
var days_since_year_start = int((now - start_of_year) / 86400)
|
||||
@warning_ignore("integer_division")
|
||||
var week = int(days_since_year_start / 7) + 1
|
||||
var build_date = "%02dw%02d" % [year_last_two, week]
|
||||
print_rich("[b][color=cyan]Partial snapshot build ID:[/color][/b] ", build_date)
|
||||
|
||||
func get_version_number() -> int:
|
||||
var number = (FileAccess.open("res://version.txt", FileAccess.READ).get_as_text())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue