Bring all features from latest renpy updates into default renpy scripts

This commit is contained in:
Map 2024-10-05 09:42:58 -05:00
parent 902e435e6c
commit 2269086430
5 changed files with 124 additions and 27 deletions

View file

@ -11,7 +11,8 @@ init offset = -2
init python: init python:
gui.init(1920, 1080) gui.init(1920, 1080)
## Enable checks for invalid or unstable properties in screens or transforms
#define config.check_conflicting_properties = True
################################################################################ ################################################################################
## GUI Configuration Variables ## GUI Configuration Variables
@ -362,6 +363,8 @@ define config.history_length = 250
## the cost of performance. ## the cost of performance.
define gui.history_height = 210 define gui.history_height = 210
define gui.history_spacing = 0
## The position, width, and alignment of the label giving the name of the ## The position, width, and alignment of the label giving the name of the
## speaking character. ## speaking character.
define gui.history_name_xpos = 233 define gui.history_name_xpos = 233
@ -419,6 +422,7 @@ define gui.nvl_thought_xalign = 0.0
define gui.nvl_button_xpos = 675 define gui.nvl_button_xpos = 675
define gui.nvl_button_xalign = 0.0 define gui.nvl_button_xalign = 0.0
## Localization ################################################################ ## Localization ################################################################
## This controls where a line break is permitted. The default is suitable ## This controls where a line break is permitted. The default is suitable

BIN
game/gui/bubble.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
game/gui/thoughtbubble.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -235,9 +235,9 @@ init python:
build.documentation('*.txt') build.documentation('*.txt')
## A Google Play license key is required to download expansion files and perform ## A Google Play license key is required to perform in-app purchases. It can be
## in-app purchases. It can be found on the "Services & APIs" page of the Google ## found in the Google Play developer console, under "Monetize" > "Monetization
## Play developer console. ## Setup" > "Licensing".
# define build.google_play_key = "..." # define build.google_play_key = "..."

View file

@ -251,7 +251,7 @@ style choice_button is default:
activate_sound "audio/ui/uiRollover.wav" activate_sound "audio/ui/uiRollover.wav"
style choice_button_text is default: style choice_button_text is default:
properties gui.button_text_properties("choice_button") properties gui.text_properties("choice_button")
## Quick Menu screen ########################################################### ## Quick Menu screen ###########################################################
@ -376,7 +376,7 @@ style navigation_button:
properties gui.button_properties("navigation_button") properties gui.button_properties("navigation_button")
style navigation_button_text: style navigation_button_text:
properties gui.button_text_properties("navigation_button") properties gui.text_properties("navigation_button")
## Main Menu screen ############################################################ ## Main Menu screen ############################################################
@ -576,11 +576,11 @@ style main_menu_ex_frame is main_menu_frame
## This lays out the basic common structure of a game menu screen. It's called ## This lays out the basic common structure of a game menu screen. It's called
## with the screen title, and displays the background, title, and navigation. ## with the screen title, and displays the background, title, and navigation.
## ##
## The scroll parameter can be None, or one of "viewport" or "vpgrid". When ## The scroll parameter can be None, or one of "viewport" or "vpgrid".
## this screen is intended to be used with one or more children, which are ## This screen is intended to be used with one or more children, which are
## transcluded (placed) inside it. ## transcluded (placed) inside it.
screen game_menu(title, scroll=None, yinitial=0.0): screen game_menu(title, scroll=None, yinitial=0.0, spacing=0):
style_prefix "game_menu" style_prefix "game_menu"
@ -613,6 +613,8 @@ screen game_menu(title, scroll=None, yinitial=0.0):
side_yfill True side_yfill True
vbox: vbox:
spacing spacing
transclude transclude
elif scroll == "vpgrid": elif scroll == "vpgrid":
@ -628,6 +630,8 @@ screen game_menu(title, scroll=None, yinitial=0.0):
side_yfill True side_yfill True
spacing spacing
transclude transclude
else: else:
@ -889,6 +893,7 @@ screen file_slots(title, flag=False):
spacing gui.page_spacing spacing gui.page_spacing
textbutton _("<") activate_sound "audio/ui/uiRollover.wav" action FilePagePrevious() textbutton _("<") activate_sound "audio/ui/uiRollover.wav" action FilePagePrevious()
key "save_page_prev" action FilePagePrevious()
if config.has_autosave: if config.has_autosave:
textbutton _("{#auto_page}A") activate_sound "audio/ui/uiClick.wav" action FilePage("auto") textbutton _("{#auto_page}A") activate_sound "audio/ui/uiClick.wav" action FilePage("auto")
@ -901,6 +906,7 @@ screen file_slots(title, flag=False):
textbutton "[page]" activate_sound "audio/ui/uiClick.wav" action FilePage(page) textbutton "[page]" activate_sound "audio/ui/uiClick.wav" action FilePage(page)
textbutton _(">") activate_sound "audio/ui/uiRollover.wav" action FilePageNext(max=9) textbutton _(">") activate_sound "audio/ui/uiRollover.wav" action FilePageNext(max=9)
key "save_page_next" action FilePageNext()
if config.has_sync: if config.has_sync:
if CurrentScreenName() == "save": if CurrentScreenName() == "save":
@ -928,7 +934,7 @@ style page_label:
ypadding 5 ypadding 5
style page_label_text: style page_label_text:
text_align 0.5 textalign 0.5
layout "subtitle" layout "subtitle"
hover_color gui.hover_color hover_color gui.hover_color
@ -936,13 +942,13 @@ style page_button:
properties gui.button_properties("page_button") properties gui.button_properties("page_button")
style page_button_text: style page_button_text:
properties gui.button_text_properties("page_button") properties gui.text_properties("page_button")
style slot_button: style slot_button:
properties gui.button_properties("slot_button") properties gui.button_properties("slot_button")
style slot_button_text: style slot_button_text:
properties gui.button_text_properties("slot_button") properties gui.text_properties("slot_button")
## Preferences screen ########################################################## ## Preferences screen ##########################################################
@ -1137,7 +1143,7 @@ style radio_button:
foreground "gui/button/radio_[prefix_]foreground.png" foreground "gui/button/radio_[prefix_]foreground.png"
style radio_button_text: style radio_button_text:
properties gui.button_text_properties("radio_button") properties gui.text_properties("radio_button")
style check_vbox: style check_vbox:
spacing gui.pref_button_spacing spacing gui.pref_button_spacing
@ -1147,7 +1153,7 @@ style check_button:
foreground "gui/button/check_[prefix_]foreground.png" foreground "gui/button/check_[prefix_]foreground.png"
style check_button_text: style check_button_text:
properties gui.button_text_properties("check_button") properties gui.text_properties("check_button")
style slider_slider: style slider_slider:
xsize 525 xsize 525
@ -1158,7 +1164,7 @@ style slider_button:
left_margin 15 left_margin 15
style slider_button_text: style slider_button_text:
properties gui.button_text_properties("slider_button") properties gui.text_properties("slider_button")
style slider_vbox: style slider_vbox:
xsize 675 xsize 675
@ -1179,7 +1185,7 @@ screen history():
## Avoid predicting this screen, as it can be very large. ## Avoid predicting this screen, as it can be very large.
predict False predict False
use game_menu(_("History"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0): use game_menu(_("History"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0, spacing=gui.history_spacing):
style_prefix "history" style_prefix "history"
@ -1238,7 +1244,7 @@ style history_name:
style history_name_text: style history_name_text:
min_width gui.history_name_width min_width gui.history_name_width
text_align gui.history_name_xalign textalign gui.history_name_xalign
style history_text: style history_text:
xpos gui.history_text_xpos xpos gui.history_text_xpos
@ -1246,7 +1252,7 @@ style history_text:
xanchor gui.history_text_xalign xanchor gui.history_text_xalign
xsize gui.history_text_width xsize gui.history_text_width
min_width gui.history_text_width min_width gui.history_text_width
text_align gui.history_text_xalign textalign gui.history_text_xalign
layout ("subtitle" if gui.history_text_xalign else "tex") layout ("subtitle" if gui.history_text_xalign else "tex")
style history_label: style history_label:
@ -1411,7 +1417,7 @@ screen mouse_help():
text _("Accesses the game menu. Also escapes the Gallery.") text _("Accesses the game menu. Also escapes the Gallery.")
hbox: hbox:
label _("Mouse Wheel Up\nClick Rollback Side") label _("Mouse Wheel Up")
text _("Rolls back to earlier dialogue.") text _("Rolls back to earlier dialogue.")
hbox: hbox:
@ -1433,13 +1439,12 @@ screen gamepad_help():
label _("Right Shoulder") label _("Right Shoulder")
text _("Rolls forward to later dialogue.") text _("Rolls forward to later dialogue.")
hbox: hbox:
label _("D-Pad, Sticks") label _("D-Pad, Sticks")
text _("Navigate the interface.") text _("Navigate the interface.")
hbox: hbox:
label _("Start, Guide") label _("Start, Guide, B/Right Button")
text _("Accesses the game menu.") text _("Accesses the game menu.")
hbox: hbox:
@ -1460,7 +1465,7 @@ style help_button:
xmargin 12 xmargin 12
style help_button_text: style help_button_text:
properties gui.button_text_properties("help_button") properties gui.text_properties("help_button")
style help_label: style help_label:
xsize 375 xsize 375
@ -1529,14 +1534,14 @@ style confirm_frame:
yalign .5 yalign .5
style confirm_prompt_text: style confirm_prompt_text:
text_align 0.5 textalign 0.5
layout "subtitle" layout "subtitle"
style confirm_button: style confirm_button:
properties gui.button_properties("confirm_button") properties gui.button_properties("confirm_button")
style confirm_button_text: style confirm_button_text:
properties gui.button_text_properties("confirm_button") properties gui.text_properties("confirm_button")
## Skip indicator screen ####################################################### ## Skip indicator screen #######################################################
@ -1723,7 +1728,7 @@ style nvl_label:
yanchor 0.0 yanchor 0.0
xsize gui.nvl_name_width xsize gui.nvl_name_width
min_width gui.nvl_name_width min_width gui.nvl_name_width
text_align gui.nvl_name_xalign textalign gui.nvl_name_xalign
style nvl_dialogue: style nvl_dialogue:
xpos gui.nvl_text_xpos xpos gui.nvl_text_xpos
@ -1731,7 +1736,7 @@ style nvl_dialogue:
ypos gui.nvl_text_ypos ypos gui.nvl_text_ypos
xsize gui.nvl_text_width xsize gui.nvl_text_width
min_width gui.nvl_text_width min_width gui.nvl_text_width
text_align gui.nvl_text_xalign textalign gui.nvl_text_xalign
layout ("subtitle" if gui.nvl_text_xalign else "tex") layout ("subtitle" if gui.nvl_text_xalign else "tex")
style nvl_thought: style nvl_thought:
@ -1740,7 +1745,7 @@ style nvl_thought:
ypos gui.nvl_thought_ypos ypos gui.nvl_thought_ypos
xsize gui.nvl_thought_width xsize gui.nvl_thought_width
min_width gui.nvl_thought_width min_width gui.nvl_thought_width
text_align gui.nvl_thought_xalign textalign gui.nvl_thought_xalign
layout ("subtitle" if gui.nvl_text_xalign else "tex") layout ("subtitle" if gui.nvl_text_xalign else "tex")
style nvl_button: style nvl_button:
@ -1752,6 +1757,94 @@ style nvl_button_text:
properties gui.button_text_properties("nvl_button") properties gui.button_text_properties("nvl_button")
## Bubble screen ###############################################################
##
## The bubble screen is used to display dialogue to the player when using speech
## bubbles. The bubble screen takes the same parameters as the say screen, must
## create a displayable with the id of "what", and can create displayables with
## the "namebox", "who", and "window" ids.
##
## https://www.renpy.org/doc/html/bubble.html#bubble-screen
screen bubble(who, what):
style_prefix "bubble"
window:
id "window"
if who is not None:
window:
id "namebox"
style "bubble_namebox"
text who:
id "who"
text what:
id "what"
style bubble_window is empty
style bubble_namebox is empty
style bubble_who is default
style bubble_what is default
style bubble_window:
xpadding 30
top_padding 5
bottom_padding 5
style bubble_namebox:
xalign 0.5
style bubble_who:
xalign 0.5
textalign 0.5
color "#000"
style bubble_what:
align (0.5, 0.5)
text_align 0.5
layout "subtitle"
color "#000"
define bubble.frame = Frame("gui/bubble.png", 55, 55, 55, 95)
define bubble.thoughtframe = Frame("gui/thoughtbubble.png", 55, 55, 55, 55)
define bubble.properties = {
"bottom_left" : {
"window_background" : Transform(bubble.frame, xzoom=1, yzoom=1),
"window_bottom_padding" : 27,
},
"bottom_right" : {
"window_background" : Transform(bubble.frame, xzoom=-1, yzoom=1),
"window_bottom_padding" : 27,
},
"top_left" : {
"window_background" : Transform(bubble.frame, xzoom=1, yzoom=-1),
"window_top_padding" : 27,
},
"top_right" : {
"window_background" : Transform(bubble.frame, xzoom=-1, yzoom=-1),
"window_top_padding" : 27,
},
"thought" : {
"window_background" : bubble.thoughtframe,
}
}
define bubble.expand_area = {
"bottom_left" : (0, 0, 0, 22),
"bottom_right" : (0, 0, 0, 22),
"top_left" : (0, 22, 0, 0),
"top_right" : (0, 22, 0, 0),
"thought" : (0, 0, 0, 0),
}
################################################################################ ################################################################################
## Mobile Variants ## Mobile Variants