Implement new choice menu

This commit is contained in:
LoafyLemon 2024-05-21 00:08:41 +01:00
parent b6091a839d
commit 18b1b271bb
9 changed files with 210 additions and 177 deletions

BIN
game/gui/creamy_pumpkin_pie/choice.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
game/gui/creamy_pumpkin_pie/choice_arrow.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
game/gui/creamy_pumpkin_pie/choice_bar_empty.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
game/gui/creamy_pumpkin_pie/choice_bar_full.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
game/gui/creamy_pumpkin_pie/fade_bottom.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
game/gui/creamy_pumpkin_pie/fade_top.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -349,23 +349,16 @@ init -1 python:
def menu_hints(queue, filter): def menu_hints(queue, filter):
filtered_queue = queue.list_filtered() if filter is False else queue.list_filtered(filter) filtered_queue = queue.list_filtered() if filter is False else queue.list_filtered(filter)
total_applicable = len(filtered_queue) total_applicable = len(filtered_queue)
total_events = len(queue.queue) # total_events = len(queue.queue)
completed = 0 completed = 0
icons = []
for ev in filtered_queue: for ev in filtered_queue:
if ev.completed: if ev.completed:
icons.append(f"interface/icons/small/heart_red.webp")
completed += 1 completed += 1
elif ev.completed_failed: elif ev.completed_failed:
icons.append(f"interface/icons/small/heart_black.webp")
completed += 1 completed += 1
else:
icons.append(f"interface/icons/small/heart_empty.webp")
hints = f" {completed}/{total_applicable}/{total_events}" return (completed, total_applicable)
return (hints, icons)
l = [] l = []
@ -373,11 +366,7 @@ init -1 python:
if isinstance(queue, str): if isinstance(queue, str):
queue = getattr(store, queue) queue = getattr(store, queue)
hints, icons = menu_hints(queue, filter) progress = menu_hints(queue, filter)
title = f"-{title}-"
if config.developer:
title += hints
if ( ev := queue.next()) and ev.requirements_met(): if ( ev := queue.next()) and ev.requirements_met():
action = queue action = queue
@ -391,7 +380,7 @@ init -1 python:
if action in ("disabled", "noncompliant"): if action in ("disabled", "noncompliant"):
_kwargs["style"] = "disabled" _kwargs["style"] = "disabled"
elif report_progress: elif report_progress:
_kwargs = {"progress": icons} _kwargs = {"progress": progress}
location = renpy.game.context().current location = renpy.game.context().current
choice = ui.ChoiceReturn(title, action, location, kwargs=_kwargs) choice = ui.ChoiceReturn(title, action, location, kwargs=_kwargs)

View File

@ -52,11 +52,11 @@
# style prompt_text is gui_text # style prompt_text is gui_text
# style bar: style bar:
# unscrollable gui.unscrollable unscrollable gui.unscrollable
# ysize gui.scrollbar_size ysize gui.scrollbar_size
# base_bar Frame("scrollbar_horizontal_[prefix_]bar", gui.slider_borders, tile=gui.slider_tile) base_bar Frame("scrollbar_horizontal_[prefix_]bar", gui.slider_borders, tile=gui.slider_tile)
# thumb Frame("scrollbar_horizontal_[prefix_]thumb", gui.slider_borders, tile=gui.slider_tile) thumb Frame("scrollbar_horizontal_[prefix_]thumb", gui.slider_borders, tile=gui.slider_tile)
# style vbar: # style vbar:
# unscrollable gui.unscrollable # unscrollable gui.unscrollable
@ -119,12 +119,9 @@
# style imagemap: # style imagemap:
# activate_sound "sounds/qubodup-click2.ogg" # activate_sound "sounds/qubodup-click2.ogg"
# style button: style button:
# activate_sound "sounds/qubodup-click2.ogg" activate_sound "sounds/qubodup-click2.ogg"
# hover_sound "sounds/qubodup-hover1.ogg" hover_sound "sounds/qubodup-hover1.ogg"
# insensitive_background "#463b3be6"
# selected_background "#766a6ae6"
# padding (5, 5, 5, 5)
# style dark_button: # style dark_button:
# background "#5d5151e6" # background "#5d5151e6"

File diff suppressed because it is too large Load Diff