Skip to content

Commit 6a48103

Browse files
committed
initial commit
0 parents  commit 6a48103

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# All Scrollable Menus
2+
### Oops! All Scrollables!
3+
4+
This submod replaces the standard Ren'Py menus with the MAS `mas_gen_scrollable_menu`.
5+
6+
As such, the following happens when a menu is open:
7+
- Monika slides to the left
8+
- The menu options show up in the top right, with smaller spacing
9+
- When you click the option, Monika slides back to the middle
10+
- Monika's face is no longer covered by menu options
11+
12+
### Please report any and all problems in the `issues` tab.
13+
###### Thank you
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
init -990 python in mas_submod_utils:
2+
Submod(
3+
author="multimokia",
4+
name="All Gen Scrollable Menus",
5+
description="A submod which converts all menus to gen-scrollable-menus so Monika's face is never hidden.",
6+
version="1.0.0",
7+
version_updates={}
8+
)
9+
10+
init 900 python:
11+
def menu_override(items, set_expr):
12+
"""
13+
For the docstring DM Tom: 152088707963289600
14+
15+
:pcrowSip:
16+
"""
17+
global _history_list
18+
global _window_auto
19+
20+
if renpy.config.old_substitutions:
21+
def substitute(s):
22+
return s % renpy.exports.tag_quoting_dict
23+
else:
24+
def substitute(s):
25+
return s
26+
27+
#Filter the list of items to only include ones for which the condition is True.
28+
items = [
29+
(substitute(label), value)
30+
for label, condition, value in items
31+
if renpy.python.py_eval(condition)
32+
]
33+
34+
#Check to see if there's at least one choice in set of items:
35+
if not items:
36+
return None
37+
38+
#Filter the list of items on the set_expr:
39+
if set_expr:
40+
set = renpy.python.py_eval(set_expr)
41+
items = [
42+
(label, value)
43+
for label, value in items
44+
if label not in set
45+
]
46+
47+
else:
48+
set = None
49+
50+
#Convert items
51+
formatted_menuitems = [
52+
(x[0], x[1], False, False)
53+
for x in items
54+
]
55+
56+
#Prep before showing the menu
57+
renpy.show("monika", at_list=[t21])
58+
59+
#Get last line
60+
last_line = _history_list[-1].what
61+
62+
if last_line.endswith("{nw}"):
63+
renpy.say(m, last_line.replace("{nw}", "{fast}"), interact=False)
64+
_history_list.pop()
65+
66+
else:
67+
_window_hide()
68+
69+
picked = renpy.call_screen(
70+
"mas_gen_scrollable_menu",
71+
items=formatted_menuitems,
72+
display_area=store.mas_ui.SCROLLABLE_MENU_TXT_AREA,
73+
scroll_align=store.mas_ui.SCROLLABLE_MENU_XALIGN
74+
)
75+
76+
#Reset Monika's position
77+
renpy.show("monika", at_list=[t11])
78+
79+
#And reset the window
80+
_window_auto = True
81+
82+
#If we have a set, fill it in with the label of the chosen item.
83+
if set is not None and picked is not None:
84+
for label, value in items:
85+
if value == picked:
86+
try:
87+
set.append(label)
88+
except AttributeError:
89+
set.add(label)
90+
91+
return picked
92+
93+
renpy.exports.menu = menu_override

0 commit comments

Comments
 (0)