mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-10 11:40:48 +08:00
Added splash screen to ask whether player wants to start new game or load
This commit is contained in:
@@ -5,6 +5,15 @@ from termios import tcflush, TCIFLUSH
|
||||
import time, sys, os
|
||||
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
|
||||
|
||||
def splash():
|
||||
print("0) New Game\n1) Load Game\n")
|
||||
choice = get_num_options(2)
|
||||
|
||||
if choice == 1:
|
||||
return "load"
|
||||
else:
|
||||
return "new"
|
||||
|
||||
def select_game():
|
||||
with open(YAML_FILE, 'r') as stream:
|
||||
data = yaml.safe_load(stream)
|
||||
@@ -84,14 +93,25 @@ def play_aidungeon_2():
|
||||
del story_manager.story
|
||||
|
||||
print("\n\n")
|
||||
context, prompt = select_game()
|
||||
console_print(instructions())
|
||||
print("\nGenerating story...")
|
||||
|
||||
story_manager.start_new_story(prompt, context=context, upload_story=upload_story)
|
||||
splash_choice = splash()
|
||||
|
||||
if splash_choice == "new":
|
||||
print("\n\n")
|
||||
context, prompt = select_game()
|
||||
console_print(instructions())
|
||||
print("\nGenerating story...")
|
||||
|
||||
story_manager.start_new_story(prompt, context=context, upload_story=upload_story)
|
||||
print("\n")
|
||||
console_print(str(story_manager.story))
|
||||
|
||||
else:
|
||||
load_ID = input("What is the ID of the saved game? ")
|
||||
result = story_manager.load_new_story(load_ID)
|
||||
print("\nLoading Game...\n")
|
||||
print(result)
|
||||
|
||||
print("\n")
|
||||
console_print(str(story_manager.story))
|
||||
while True:
|
||||
tcflush(sys.stdin, TCIFLUSH)
|
||||
action = input("> ")
|
||||
@@ -209,4 +229,3 @@ def play_aidungeon_2():
|
||||
|
||||
if __name__ == '__main__':
|
||||
play_aidungeon_2()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user