aboutsummaryrefslogtreecommitdiff
path: root/srb.py
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2024-04-05 12:07:53 -0400
committerB. Stack <bgstack15@gmail.com>2024-04-05 12:07:53 -0400
commit219e0ff7b8e40d49a1b386823bfbef9f25e94166 (patch)
treea38e7dd4a0b6369394d29e2607bd9de6594e7ef8 /srb.py
parenttk: moved flash_entry to lib, added frame_backgrounds checkbox (diff)
downloadsrb_lib-219e0ff7b8e40d49a1b386823bfbef9f25e94166.tar.gz
srb_lib-219e0ff7b8e40d49a1b386823bfbef9f25e94166.tar.bz2
srb_lib-219e0ff7b8e40d49a1b386823bfbef9f25e94166.zip
lib: rename to completed_levels, tk: show enabled levels
Diffstat (limited to 'srb.py')
-rwxr-xr-xsrb.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/srb.py b/srb.py
index c7b7f88..725ab88 100755
--- a/srb.py
+++ b/srb.py
@@ -13,7 +13,7 @@
# Reference:
# bgconf.py
# Improve:
-# still some confusion around the --unlock-everything --lock-everything and the levelset available levels.
+# still some confusion around the --unlock-everything --lock-everything and the levelset completed levels.
# Documentation: README.md
# Dependencies:
@@ -54,7 +54,7 @@ parser.add_argument("--set-level-status",action="append",help="Set completion st
parser.add_argument("--set-level-balloons",action="append",help="Set balloon status for this level for profile. Example value to pass: \"0,all\" or \"0,none\"")
parser.add_argument("--set-level-letters",action="append",help="Set collected letters for level for profile. Examples: 0,all 15,none")
parser.add_argument("--get-levelset",help="Print status for this levelset for profile.")
-parser.add_argument("--set-levelset-available-levels",action="append",help="Set number of available levels in this levelset for profile.")
+parser.add_argument("--set-levelset-completed-levels",action="append",help="Set number of completed levels in this levelset for profile.")
parser.add_argument("--get-name",action="store_true",help="Print name for profile.")
parser.add_argument("--set-name",help="Set name for profile.")
parser.add_argument("--get-profile-in-use",action="store_true",help="Print if profile is in use.")
@@ -89,7 +89,7 @@ profile_id = args.profile
#print(f"profile_id={profile_id}")
# New actions that need --profile must be added here.
-if not profile_id and (args.get_money or args.set_money or args.get_weapon or args.set_weapon or args.get_level or args.get_name or args.set_name or args.get_profile_in_use or args.get_purchased_weapons or args.get_tutorial_completed or args.add_purchased_weapons or args.remove_purchased_weapons or args.get_health or args.get_stunt or args.get_gun or args.set_health or args.set_stunt or args.set_gun or args.get_levelset or args.get_purchased_planes or args.add_purchased_planes or args.remove_purchased_planes or args.set_level_status or args.set_level_balloons or args.set_levelset_available_levels or args.set_level_letters or args.unlock_everything or args.lock_everything or args.buy_everything or args.unbuy_everything or args.set_level or args.set_profile_in_use):
+if not profile_id and (args.get_money or args.set_money or args.get_weapon or args.set_weapon or args.get_level or args.get_name or args.set_name or args.get_profile_in_use or args.get_purchased_weapons or args.get_tutorial_completed or args.add_purchased_weapons or args.remove_purchased_weapons or args.get_health or args.get_stunt or args.get_gun or args.set_health or args.set_stunt or args.set_gun or args.get_levelset or args.get_purchased_planes or args.add_purchased_planes or args.remove_purchased_planes or args.set_level_status or args.set_level_balloons or args.set_levelset_completed_levels or args.set_level_letters or args.unlock_everything or args.lock_everything or args.buy_everything or args.unbuy_everything or args.set_level or args.set_profile_in_use):
ferror("Warning: Cannot perform most actions without --profile. Not all tasks may run.")
else:
if args.get_money:
@@ -233,17 +233,17 @@ else:
ferror(f"Failed to add purchased planes {args.remove_purchased_planes} because {message}")
else:
srb_lib.write_file(args.file,0,data)
- if args.set_levelset_available_levels:
- for l in args.set_levelset_available_levels:
+ if args.set_levelset_completed_levels:
+ for l in args.set_levelset_completed_levels:
levelset_num = -1
try:
levelset_num, count = l.split(",")
except:
- ferror(f"Warning! Skipping un-parseable levelset available spec {l}. Please use \"0,all\" format.")
+ ferror(f"Warning! Skipping un-parseable levelset completed spec {l}. Please use \"0,all\" format.")
if levelset_num != -1:
- data, message = srb_lib.set_levelset_available_levels(args.file,profile_id,levelset_num,count)
+ data, message = srb_lib.set_levelset_completed_levels(args.file,profile_id,levelset_num,count)
if (type(data) == int and data == -1) or message != "":
- ferror(f"Failed to set profile {profile_id} level {levelset_num} available levels to {count} because {message}")
+ ferror(f"Failed to set profile {profile_id} level {levelset_num} completed levels to {count} because {message}")
else:
srb_lib.write_file(args.file,0,data)
if args.set_level_letters:
@@ -256,13 +256,13 @@ else:
if level_num != -1:
data, message = srb_lib.set_level_letters(args.file,profile_id,level_num, count)
if (type(data) == int and data == -1) or message != "":
- ferror(f"Failed to set profile {profile_id} level {levelset_num} available levels to {count} because {message}")
+ ferror(f"Failed to set profile {profile_id} level {levelset_num} completed levels to {count} because {message}")
else:
#print(f"good?")
srb_lib.write_file(args.file,0,data)
if args.unlock_everything:
data = srb_lib._get_data_from_data_object(args.file)
- # counting backwards helps the levelset available levels count.
+ # counting backwards helps the levelset completed levels count.
for i in range(len(srb_lib.LEVELS)-1,0,-1):
data, new_status, message = srb_lib.set_level_status(data,profile_id,i,"general")
if message != "":
@@ -277,7 +277,7 @@ else:
ferror(f"Failed on loop {i}, set_level_letters, {message}")
break
for i in range(len(srb_lib.LEVELSETS)-1,0,-1):
- data, message = srb_lib.set_levelset_available_levels(data,profile_id,i,"all")
+ data, message = srb_lib.set_levelset_completed_levels(data,profile_id,i,"all")
if message != "":
ferror(f"Failed on levelset loop {i}, {message}")
break
@@ -287,7 +287,7 @@ else:
srb_lib.write_file(args.file,0,data)
if args.lock_everything:
data = srb_lib._get_data_from_data_object(args.file)
- # counting backwards helps the levelset available levels count.
+ # counting backwards helps the levelset completed levels count.
for i in range(len(srb_lib.LEVELS)-1,0,-1):
data, new_status, message = srb_lib.set_level_status(data,profile_id,i,"none")
if message != "":
@@ -302,7 +302,7 @@ else:
ferror(f"Failed on loop {i}, set_level_letters, {message}")
break
for i in range(len(srb_lib.LEVELSETS)-1,0,-1):
- data, message = srb_lib.set_levelset_available_levels(data,profile_id,i,"none")
+ data, message = srb_lib.set_levelset_completed_levels(data,profile_id,i,"none")
if message != "":
ferror(f"Failed on levelset loop {i}, {message}")
break
bgstack15