Compare commits

...

4 Commits

Author SHA1 Message Date
afee5de501 Move back global variables to storyline 2024-08-20 22:09:17 -03:00
2d793f86af - Move variables out of utility
- Add increase_points functions
2024-08-20 22:09:04 -03:00
fb64284d84 Add chapter select buttons 2024-08-20 22:08:08 -03:00
72ea3dd640 Add chapter_select 2024-08-20 22:07:43 -03:00
4 changed files with 113 additions and 21 deletions

View File

@ -1,12 +1,86 @@
screen label_selector():
tag menu
define chapter_tuple_1 = [
("1", "chapter_1"),
("2", "chapter_2"),
("3", "chapter_3"),
("4", "chapter_4"),
("5", "chapter_5"),
("6", "chapter_6")
]
define chapter_tuple_2 = [
("7", "chapter_7"),
("8", "chapter_8"),
("9", "chapter_9"),
("10", "chapter_10"),
("11", "chapter_11")
]
define tuples_index = [
("1-6", chapter_tuple_1),
("7-11", chapter_tuple_2)
]
default selected_tuple = None
init python:
def select_chapter():
global selected_tuple, current_chapter
selected_tuple = renpy.display_menu(tuples_index)
current_chapter = renpy.display_menu(selected_tuple)
set_stats()
def set_stats():
global chapter_list_length, chapter_list_index, ending_route_number, is_end_reached
chapter_list_length = len(chapter_list) - 1
find_chapter_in_array()
renpy.call(current_chapter)
def find_chapter_in_array():
global chapter_list_index, current_chapter
try:
chapter_list_index = chapter_list.index(current_chapter)
except ValueError:
chapter_list_index = -1
current_chapter = ""
label chapter_select:
scene black
stop sound
stop music
menu:
"Initialize scores:"
"Ending 1":
$ anon_score = 0
$ fang_score = 0
"Ending 2":
$ anon_score = 0
$ fang_score = 4
"Ending 3":
$ anon_score = 4
$ fang_score = 0
"Ending 4":
$ anon_score = 4
$ fang_score = 4
$ lock_scores = True
call initstats(anon_score, fang_score) from _call_initstats_2
$ select_chapter()
frame:
align (0.5, 0.5)
padding (20, 20)
vbox:
spacing 10
text "Choose a Label:"
for label in chapter_list:
textbutton label:
action Call(label)

View File

@ -358,6 +358,10 @@ screen navigation():
textbutton _("Save") activate_sound "audio/ui/uiClick.wav" action ShowMenu("save")
textbutton _("Load") activate_sound "audio/ui/uiClick.wav" action ShowMenu("load")
textbutton _("Delete") activate_sound "audio/ui/uiClick.wav" action ShowMenu("delete")
if config.developer and persistent.enable_chapter_select:
textbutton _("Chapter Select") activate_sound "audio/ui/uiClick.wav" action Start("chapter_select")
textbutton _("Options") activate_sound "audio/ui/uiClick.wav" action ShowMenu("preferences")
#textbutton _("Extras") action ShowMenu("extras")
textbutton _("Return") activate_sound "audio/ui/uiBack.wav" action Return()
@ -1287,7 +1291,7 @@ screen extrasnavigation():
[ _("Help"), ShowMenu("help") ],
[ _("About"), ShowMenu("about") ],
[ _("Gallery"), ShowMenu("cg_gallery") ],
*([(_("Chapter Select"), ShowMenu("label_selector"))] if persistent.enable_chapter_select else []),
*([(_("Chapter Select"), Start("chapter_select"))] if persistent.enable_chapter_select else []),
[ _("Mods"), ShowMenu("mod_menu") ],
[ _("Return"), ShowMenu("main_menu") ]
] )

View File

@ -11,6 +11,15 @@ define ending_routes = {
1: ["chapter_11A", "chapter_12A", "chapter_12_5D", "chapter_13A", "chapter_14A"]
}
# Chapter related variables
default chapter_list_length = len(chapter_list) - 1
default chapter_list_index = 0 # Index number for the current position of the chapter_list array
default current_chapter = chapter_list[chapter_list_index] # Store the name of the label as a string
# Ending related variables
default ending_route_number = None
default is_end_reached = False # consider moving variables out of here
init -1 python:
def ending_image():

View File

@ -9,15 +9,6 @@ label initstats(anon=0, fang=0):
$ fangscore = fang
$ wingStory = False
# Chapter related variables
$ chapter_list_length = len(chapter_list) - 1
$ chapter_list_index = 0 # Index number for the current position of the chapter_list array
$ current_chapter = chapter_list[chapter_list_index] # Store the name of the label as a string
# Ending related variables
$ ending_route_number = None
$ is_end_reached = False
if persistent.enable_debug_scores:
$ debug_story_variables(False)
$ debug_story_variables(True)
@ -54,3 +45,17 @@ init python:
renpy.unwatch(item)
def increase_anon_points():
global anonscore, lock_scores
if not lock_scores:
anonscore += 1
def inscrease_fang_points():
global fangscore, lock_scores
if not lock_scores:
fangscore += 1