forked from Cavemanon/SnootGame
Merge branch 'master' into improved_epilogue_menu
This commit is contained in:
@@ -352,6 +352,18 @@ init 1 python:
|
||||
|
||||
# aight, time for the stuff that isn't gallery required.
|
||||
|
||||
### SPLASHSCREEN
|
||||
|
||||
image caveintrosequence:
|
||||
"caveintro"
|
||||
alpha 0
|
||||
time 0.5
|
||||
linear 3.5 alpha 1
|
||||
time 10
|
||||
linear 1 alpha 0
|
||||
|
||||
|
||||
|
||||
### OTHER
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
91
game/src/rounded_corners.rpy
Normal file
91
game/src/rounded_corners.rpy
Normal file
@@ -0,0 +1,91 @@
|
||||
# RoundedCorners() rounds the corners of a displayable you give it
|
||||
|
||||
python early:
|
||||
import collections, pygame_sdl2 as pygame
|
||||
|
||||
def normalize_color(col):
|
||||
a = col[3] / 255.0
|
||||
r = a * col[0] / 255.0
|
||||
g = a * col[1] / 255.0
|
||||
b = a * col[2] / 255.0
|
||||
return (r, g, b, a)
|
||||
|
||||
_rounded_corners_relative = {
|
||||
None: 0.0,
|
||||
"min": 1.0,
|
||||
"max": 2.0,
|
||||
"width": 3.0,
|
||||
"height": 4.0,
|
||||
}
|
||||
|
||||
def RoundedCorners(child, radius, relative=None, outline_width=0.0, outline_color="#fff", **kwargs):
|
||||
if not isinstance(radius, tuple): radius = (radius,) * 4
|
||||
relative = _rounded_corners_relative[relative]
|
||||
outline_color = normalize_color(Color(outline_color))
|
||||
return Transform(child, mesh=True, shader="shader.rounded_corners", u_radius=radius, u_relative=relative, u_outline_color=outline_color, u_outline_width=outline_width, **kwargs)
|
||||
|
||||
CurriedRoundedCorners = renpy.curry(RoundedCorners)
|
||||
|
||||
renpy.register_shader("shader.rounded_corners", variables="""
|
||||
uniform vec4 u_radius;
|
||||
uniform float u_outline_width;
|
||||
uniform vec4 u_outline_color;
|
||||
uniform float u_relative;
|
||||
uniform sampler2D tex0;
|
||||
attribute vec2 a_tex_coord;
|
||||
varying vec2 v_tex_coord;
|
||||
uniform vec2 u_model_size;
|
||||
""", vertex_200="""
|
||||
v_tex_coord = a_tex_coord;
|
||||
""", fragment_functions="""
|
||||
float rounded_rectangle(vec2 p, vec2 b, float r) {
|
||||
return length(max(abs(p) - b + r, 0.0)) - r;
|
||||
}
|
||||
|
||||
float get_radius(vec2 uv_minus_center, vec4 radius) {
|
||||
vec2 xy = (uv_minus_center.x > 0.0) ? radius.xy : radius.zw;
|
||||
float r = (uv_minus_center.y > 0.0) ? xy.x : xy.y;
|
||||
return r;
|
||||
}
|
||||
""", fragment_200="""
|
||||
vec2 center = u_model_size.xy / 2.0;
|
||||
vec2 uv = (v_tex_coord.xy * u_model_size.xy);
|
||||
|
||||
vec2 uv_minus_center = uv - center;
|
||||
float radius = get_radius(uv_minus_center, u_radius);
|
||||
|
||||
vec4 color = texture2D(tex0, v_tex_coord);
|
||||
|
||||
if (u_relative != 0.0) {
|
||||
float side_size;
|
||||
if (u_relative == 1.0) {
|
||||
side_size = u_model_size.x;
|
||||
} else if (u_relative == 2.0) {
|
||||
side_size = u_model_size.y;
|
||||
} else if (u_relative == 3.0) {
|
||||
side_size = min(u_model_size.x, u_model_size.y);
|
||||
} else {
|
||||
side_size = max(u_model_size.x, u_model_size.y);
|
||||
}
|
||||
|
||||
radius *= side_size;
|
||||
}
|
||||
|
||||
if (u_outline_width > 0.0) {
|
||||
vec2 center_outline = center - u_outline_width;
|
||||
|
||||
float crop1 = rounded_rectangle(uv - center, center, radius);
|
||||
float crop2 = rounded_rectangle(uv - center, center_outline, radius - u_outline_width);
|
||||
|
||||
float coeff1 = smoothstep(1.0, -1.0, crop1);
|
||||
float coeff2 = smoothstep(1.0, -1.0, crop2);
|
||||
|
||||
float outline_coeff = (coeff1 - coeff2);
|
||||
|
||||
gl_FragColor = mix(vec4(0.0), mix(color, u_outline_color, outline_coeff), coeff1);
|
||||
}
|
||||
else {
|
||||
float crop = rounded_rectangle(uv_minus_center, center, radius);
|
||||
gl_FragColor = mix(color, vec4(0.0), smoothstep(0.0, 1.0, crop));
|
||||
}
|
||||
""")
|
@@ -1,24 +1,10 @@
|
||||
|
||||
label splashscreen:
|
||||
$ persistent.splashtype = random.randint(0,2000 - 1)
|
||||
|
||||
image caveintrosequence:
|
||||
"caveintro"
|
||||
alpha 0
|
||||
time 0.5
|
||||
linear 3.5 alpha 1
|
||||
time 10
|
||||
linear 1 alpha 0
|
||||
|
||||
show caveintrosequence
|
||||
play sound 'audio/OST/startup.ogg'
|
||||
pause 11.2
|
||||
stop sound
|
||||
|
||||
if (persistent.languaged_up is None):
|
||||
$ persistent.languaged_up = True
|
||||
$ preferences.set_volume('ui', config.default_sfx_volume) # hack
|
||||
call screen lang_sel
|
||||
if not renpy.get_autoreload():
|
||||
show caveintrosequence
|
||||
play sound 'audio/OST/startup.ogg'
|
||||
pause 11.2
|
||||
stop sound
|
||||
|
||||
|
||||
return
|
||||
|
@@ -36,7 +36,7 @@ init python:
|
||||
notice = _("NOTICE: Please keep in mind this is a fan translation, and as such it may not be completely accurate to the original intent of any written lines.")
|
||||
|
||||
languages = [
|
||||
{'image': 'gui/flag/USofA.png', 'name': 'English', 'value': None },
|
||||
{'image': 'gui/flag/USofA.png', 'name': 'English', 'value': 'en' },
|
||||
{'image': 'gui/flag/Mexico.png', 'name': 'Español', 'value': 'es'},
|
||||
{'image': 'gui/flag/Rus.png', 'name': 'Русский', 'value': 'ru'},
|
||||
{'image': 'gui/flag/Poland.png', 'name': 'Polski', 'value': 'pl'},
|
||||
@@ -106,7 +106,7 @@ screen lang_sel():
|
||||
imagebutton:
|
||||
idle darkie(languages[i]["image"])
|
||||
hover glowie(languages[i]["image"])
|
||||
action If(languages[i]["value"] in persistent.seenWarning or languages[i]["value"] == None,
|
||||
action If(languages[i]["value"] in persistent.seenWarning or languages[i]["value"] == 'en',
|
||||
true = [Language(languages[i]["value"]), MainMenu(False,False)],
|
||||
# Important to change the language before calling notice. Otherwise it will be in english.
|
||||
false = [Language(languages[i]["value"]), AddToSet(set=persistent.seenWarning, value=languages[i]["value"]), Show(screen="OkPrompt", message=notice, go_menu=True)]
|
||||
@@ -122,7 +122,7 @@ screen lang_button(lang):
|
||||
spacing 15
|
||||
textbutton lang["name"]:
|
||||
activate_sound "audio/ui/uiRollover.wav"
|
||||
action If(lang["value"] in persistent.seenWarning or lang["value"] == None,
|
||||
action If(lang["value"] in persistent.seenWarning or lang["value"] == 'en',
|
||||
true = [Language(lang["value"])],
|
||||
false = [Language(lang["value"]), AddToSet(set=persistent.seenWarning, value=lang["value"]), Show(screen="OkPrompt", message=notice, go_menu=False)]
|
||||
)
|
||||
|
Reference in New Issue
Block a user