Merge pull request #369 from a2937/feat/add-cmd-arguments

feat: add cmd arguments
This commit is contained in:
Joe H
2025-09-24 14:03:16 +01:00
committed by GitHub
3 changed files with 10 additions and 4 deletions

View File

@@ -1,16 +1,22 @@
class_name ROMVerifier class_name ROMVerifier
extends Node extends Node
var args = OS.get_cmdline_args()
const VALID_HASH := "c9b34443c0414f3b91ef496d8cfee9fdd72405d673985afa11fb56732c96152b" const VALID_HASH := "c9b34443c0414f3b91ef496d8cfee9fdd72405d673985afa11fb56732c96152b"
func _ready() -> void: func _ready() -> void:
Global.get_node("GameHUD").hide() Global.get_node("GameHUD").hide()
var validRomFound = false
for i in args:
if(is_valid_rom((i))):
on_file_dropped(args)
validRomFound = true
if(!validRomFound):
get_window().files_dropped.connect(on_file_dropped) get_window().files_dropped.connect(on_file_dropped)
await get_tree().physics_frame await get_tree().physics_frame
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_BORDERLESS, false) DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_BORDERLESS, false)
func on_file_dropped(files: PackedStringArray) -> void: func on_file_dropped(files: PackedStringArray) -> void:
for i in files: for i in files:
if i.contains(".zip"): if i.contains(".zip"):