aboutsummaryrefslogtreecommitdiff
path: root/srb.py
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2024-04-04 21:30:43 -0400
committerB. Stack <bgstack15@gmail.com>2024-04-04 21:30:43 -0400
commiteabb9cd4c47c9e28e870ce7be0df851ea1f22d49 (patch)
tree7eb0e740a44a903814b0cf900c9cb10cd2dbfbd1 /srb.py
parenttk: add equipped weapon image (diff)
downloadsrb_lib-eabb9cd4c47c9e28e870ce7be0df851ea1f22d49.tar.gz
srb_lib-eabb9cd4c47c9e28e870ce7be0df851ea1f22d49.tar.bz2
srb_lib-eabb9cd4c47c9e28e870ce7be0df851ea1f22d49.zip
add set-profile-in-use
Diffstat (limited to 'srb.py')
-rwxr-xr-xsrb.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/srb.py b/srb.py
index 4225e14..c7b7f88 100755
--- a/srb.py
+++ b/srb.py
@@ -58,6 +58,7 @@ parser.add_argument("--set-levelset-available-levels",action="append",help="Set
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.")
+parser.add_argument("--set-profile-in-use",choices=["True","False"],help="Print if profile is in use.")
parser.add_argument("--get-tutorial-completed",action="store_true",help="Print if profile has completed the tutorial.")
parser.add_argument("--set-tutorial-completed",choices=["True","False"],help="Set tutorial-completed for profile.")
parser.add_argument("--get-health",action="store_true",help="Print stat health for profile.")
@@ -88,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):
+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):
ferror("Warning: Cannot perform most actions without --profile. Not all tasks may run.")
else:
if args.get_money:
@@ -161,6 +162,10 @@ else:
srb_lib.write_file(args.file,0,data)
if args.get_profile_in_use:
print(f"Profile {profile_id} in use is {srb_lib.get_profile_in_use(args.file,profile_id)}")
+ if args.set_profile_in_use:
+ thisbool = False if args.set_profile_in_use == "False" else True
+ data, newstatus = srb_lib.set_profile_in_use(args.file, profile_id, thisbool)
+ srb_lib.write_file(args.file,0,data)
if args.get_purchased_weapons:
print(f"Profile {profile_id} has weapons {srb_lib.get_purchased_weapons(args.file,profile_id)}")
if args.add_purchased_weapons:
bgstack15