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

View File

@ -52,11 +52,11 @@
# style prompt_text is gui_text
# style bar:
# unscrollable gui.unscrollable
# ysize gui.scrollbar_size
# 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)
style bar:
unscrollable gui.unscrollable
ysize gui.scrollbar_size
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)
# style vbar:
# unscrollable gui.unscrollable
@ -119,12 +119,9 @@
# style imagemap:
# activate_sound "sounds/qubodup-click2.ogg"
# style button:
# activate_sound "sounds/qubodup-click2.ogg"
# hover_sound "sounds/qubodup-hover1.ogg"
# insensitive_background "#463b3be6"
# selected_background "#766a6ae6"
# padding (5, 5, 5, 5)
style button:
activate_sound "sounds/qubodup-click2.ogg"
hover_sound "sounds/qubodup-hover1.ogg"
# style dark_button:
# background "#5d5151e6"
@ -284,4 +281,4 @@
# style light_text:
# color settings.get('text_color_day')
# outlines [(1, settings.get('text_outline'), 1, 0)]
# outlines [(1, settings.get('text_outline'), 1, 0)]

File diff suppressed because it is too large Load Diff