Remove dumb scene_name variables

This commit is contained in:
JeremyStar™ 2023-05-30 02:42:05 +02:00
parent 0e843d3d8f
commit d5f4874100

24
smgr.gd
View file

@ -42,18 +42,18 @@ func remove_game() -> bool:
Logger.info("smgr","Removed game scene")
return true
func add_menu(scene_name:String,resname:String) -> bool:
Logger.info("smgr","Adding menu scene \"" + scene_name + "\"")
if ccr_menu_names.has(scene_name):
Logger.error("smgr","Failed adding menu scene: Menu scene with name \"" + scene_name + "\" already exists")
func add_menu(resname:String) -> bool:
Logger.info("smgr","Adding menu scene \"" + resname + "\"")
if ccr_menu_names.has(resname):
Logger.error("smgr","Failed adding menu scene: Menu scene with name \"" + resname + "\" already exists")
return false
var res = core.resmgr.getres(resname)
if res == null or res.get_class() != "PackedScene":
Logger.error("smgr","Resource is not type of PackedScene")
return false
ccr_menu.add_child(res.instantiate())
ccr_menu_names.append(scene_name)
Logger.info("smgr","Added menu scene \"" + scene_name + "\"")
ccr_menu_names.append(resname)
Logger.info("smgr","Added menu scene \"" + resname + "\"")
return true
func remove_menu(scene_name:String) -> bool:
@ -92,18 +92,18 @@ func remove_cutscene() -> bool:
Logger.info("smgr","Removed cutscene scene")
return true
func add_debug(scene_name:String,resname:String) -> bool:
Logger.info("smgr","Adding debug scene \"" + scene_name + "\"")
if ccr_debug_names.has(scene_name):
Logger.error("smgr","Failed adding debug scene: Debug scene with name \"" + scene_name + "\" already exists")
func add_debug(resname:String) -> bool:
Logger.info("smgr","Adding debug scene \"" + resname + "\"")
if ccr_debug_names.has(resname):
Logger.error("smgr","Failed adding debug scene: Debug scene with name \"" + resname + "\" already exists")
return false
var res = core.resmgr.getres(resname)
if res == null or res.get_class() != "PackedScene":
Logger.error("smgr","Resource is not type of PackedScene")
return false
ccr_debug.add_child(res.instantiate())
ccr_debug_names.append(scene_name)
Logger.info("smgr","Added debug scene \"" + scene_name + "\"")
ccr_debug_names.append(resname)
Logger.info("smgr","Added debug scene \"" + resname + "\"")
return true
func remove_debug(scene_name:String) -> bool: