Skip to content

Commit

Permalink
add talk_choice menu too
Browse files Browse the repository at this point in the history
  • Loading branch information
multimokia committed Jul 16, 2020
1 parent 6a48103 commit 5271b8c
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 17 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## July 16, 2020 (1.0.1):
- Added settings pane and option to use the `talk_choice` screen instead of the `mas_gen_scrollable` menu

## July 13, 2020 (1.0.0):
- Initial Release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# All Scrollable Menus
### Oops! All Scrollables!

This submod replaces the standard Ren'Py menus with the MAS `mas_gen_scrollable_menu`.
This submod replaces the standard Ren'Py menus with the MAS `mas_gen_scrollable_menu` (or the `talk_choice` menu if you wish).

As such, the following happens when a menu is open:
- Monika slides to the left
Expand Down
95 changes: 79 additions & 16 deletions game/Submods/All Scrollable Menus/all_menus_are_gen_scrollable.rpy
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
default persistent._gsm_use_talk_choice = False

init -990 python in mas_submod_utils:
Submod(
author="multimokia",
name="All Gen Scrollable Menus",
description="A submod which converts all menus to gen-scrollable-menus so Monika's face is never hidden.",
version="1.0.0",
version_updates={}
version="1.0.1",
version_updates=dict(),
settings_pane="gsm_settings"
)

#START: Settings Pane
screen gsm_settings():
vbox:
box_wrap False
xfill True
xmaximum 1000

hbox:
style_prefix "check"
box_wrap False

textbutton "Use Talk Choice Screen":
action ToggleField(persistent, "_gsm_use_talk_choice")
selected persistent._gsm_use_talk_choice


init 900 python:
def menu_override(items, set_expr):
"""
Expand Down Expand Up @@ -47,38 +66,82 @@ init 900 python:
else:
set = None

#Convert items
formatted_menuitems = [
(x[0], x[1], False, False)
for x in items
]

#Prep before showing the menu
renpy.show("monika", at_list=[t21])

#Get last line
last_line = _history_list[-1].what

#Handle the textbox show to keep the question up during the menu
if last_line.endswith("{nw}"):
renpy.say(m, last_line.replace("{nw}", "{fast}"), interact=False)
_history_list.pop()

elif last_line.endswith("{fast}"):
renpy.say(m, last_line, interact=False)

#Otherwise no text, and we should hide the textbox instead
else:
_window_hide()

picked = renpy.call_screen(
"mas_gen_scrollable_menu",
items=formatted_menuitems,
display_area=store.mas_ui.SCROLLABLE_MENU_TXT_AREA,
scroll_align=store.mas_ui.SCROLLABLE_MENU_XALIGN
)
#If the user wishes to use the talk-choice menu, we'll need to parse the input accordingly
if persistent._gsm_use_talk_choice:
menu_items = list()

#Get the location of the menu as MenuEntries need it
location=renpy.game.context().current

#And now make a formatted list of menu_items
for (label, value) in items:
if value is not None:
action = renpy.ui.ChoiceReturn(label, value, location)
chosen = action.get_chosen()

else:
action = None
chosen = False

if renpy.config.choice_screen_chosen:
me = renpy.MenuEntry((label, action, chosen))
else:
me = renpy.MenuEntry((label, action))

me.caption = label
me.action = action
me.chosen = chosen
menu_items.append(me)

#Then call the screen for it
picked = renpy.call_screen(
"talk_choice",
items=menu_items
)

#Otherwise, we use the gen scrollable menu
else:
#Convert items to the 4 part tuple
formatted_menuitems = [
(x[0], x[1], False, False)
for x in items
]

#And show the screen
picked = renpy.call_screen(
"mas_gen_scrollable_menu",
items=formatted_menuitems,
display_area=store.mas_ui.SCROLLABLE_MENU_TXT_AREA,
scroll_align=store.mas_ui.SCROLLABLE_MENU_XALIGN
)

#Reset Monika's position
renpy.show("monika", at_list=[t11])

#And reset the window
#Reset the window
_window_auto = True

#And pop from hist
if last_line.endswith("{fast}"):
_history_list.pop()

#If we have a set, fill it in with the label of the chosen item.
if set is not None and picked is not None:
for label, value in items:
Expand Down

0 comments on commit 5271b8c

Please sign in to comment.