diff options
author | B. Stack <bgstack15@gmail.com> | 2024-04-03 10:55:22 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2024-04-03 10:55:22 -0400 |
commit | 9e976527636d88faf669dcb096485792a07e2149 (patch) | |
tree | 8f29e70309320ac9945a0e1bbaced59b88bdf073 /srb_lib.py | |
parent | tk: add level names only, and minor improvements to grid spacing (diff) | |
download | srb_lib-9e976527636d88faf669dcb096485792a07e2149.tar.gz srb_lib-9e976527636d88faf669dcb096485792a07e2149.tar.bz2 srb_lib-9e976527636d88faf669dcb096485792a07e2149.zip |
tk: load all values from data
Diffstat (limited to 'srb_lib.py')
-rw-r--r-- | srb_lib.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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. |