menu tree mockup
This commit is contained in:
parent
57543e139a
commit
02e7221149
7 changed files with 145 additions and 23 deletions
33
cli/war_menu.py
Normal file
33
cli/war_menu.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
from cli.campaign_menu import campaign_menu
|
||||
from storage.repository import save_data
|
||||
|
||||
def war_menu(data, war):
|
||||
while True:
|
||||
print(f"\n=== War: {war['name']} ===")
|
||||
print("1. Select campaign")
|
||||
print("2. Append campaign")
|
||||
print("3. Finish war")
|
||||
print("4. Edit/Delete war")
|
||||
print("0. Back")
|
||||
|
||||
choice = input("> ").strip()
|
||||
|
||||
if choice == "1":
|
||||
campaign = select_campaign(war)
|
||||
if campaign:
|
||||
campaign_menu(data, war, campaign)
|
||||
|
||||
elif choice == "2":
|
||||
append_campaign(war)
|
||||
|
||||
elif choice == "0":
|
||||
return
|
||||
|
||||
def append_campaign(war, data):
|
||||
name = input("Campaign name: ")
|
||||
war["campaigns"].append({
|
||||
"name": name,
|
||||
"rounds": [],
|
||||
"completed": False
|
||||
})
|
||||
save_data(data)
|
||||
Loading…
Add table
Add a link
Reference in a new issue