From 9e976527636d88faf669dcb096485792a07e2149 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Wed, 3 Apr 2024 10:55:22 -0400 Subject: tk: load all values from data --- srb_lib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'srb_lib.py') diff --git a/srb_lib.py b/srb_lib.py index ec0c7ca..c916c6b 100644 --- a/srb_lib.py +++ b/srb_lib.py @@ -380,7 +380,7 @@ def get_level_status(data_object,profile_id,level,silent=False): collected_breakables = get_collected_breakables(data,profile_id,level_obj["id"],silent=silent) print(f"debug: got collected_breakables {collected_breakables}") # it comes back as an int, but does it look better as a hex? - return hex(profile_level_status) + return hex(profile_level_status), profile_level_balloons, profile_level_letters def get_collected_breakables(data_object,profile_id, level, silent=False): """ Return a list of breakables that the profile has already collected for this level. """ @@ -418,7 +418,7 @@ def set_level_status(data_object,profile_id,level,status): level_obj, message = get_level_info(level) if message != "" or level_obj == -1: ferror(f"Unable to get level status for {level}.") - current_status = get_level_status(data, profile_id, level, silent=True) + current_status, _, _ = get_level_status(data, profile_id, level, silent=True) print(f"Before changing, level {level} has status {current_status}") bits = 0x0 try: @@ -427,7 +427,7 @@ def set_level_status(data_object,profile_id,level,status): return data, "", f"unable-to-set-level-completion-status-{status}" #print(f"debug: will try to set bits {bits:02x}") data = srb_pack('<1I',data,PROFILE_START_POSITION[profile_id]+POS_LEVEL_START+(INT_SIZE*level_obj["pos_r"]),bits) - current_status = get_level_status(data, profile_id, level, silent=True) + current_status, _, _ = get_level_status(data, profile_id, level, silent=True) levelset_available_levels = get_levelset_available_levels(data,profile_id,level_obj["setid"]) print(f"debug: levelset {level_obj['setid']} currently has {levelset_available_levels} available levels.") # if setting to any completed status, if the levelset available levels is less than this level, then make it this. -- cgit