Compare commits

...

11 Commits

9 changed files with 87 additions and 242 deletions

View File

@ -1001,11 +1001,6 @@ screen preferences():
textbutton _("After Choices") action [Function(onclick_audio, preferences.skip_after_choices), ToggleVariable("preferences.skip_after_choices", True, False)]
textbutton _("Transitions") action [Function(onclick_audio, preferences.transitions, True), ToggleVariable("preferences.transitions", 0, 2)]
vbox:
style_prefix "check"
label _("Performance")
textbutton _("Cache Surfaces") action [Function(onclick_audio, config.cache_surfaces), ToggleVariable("config.cache_surfaces", True, False)]
## Additional vboxes of type "radio_pref" or "check_pref" can be
## added here, to add additional creator-defined preferences.
@ -1265,7 +1260,7 @@ screen extrasnavigation():
[
[ "Help", ShowMenu("help") ],
[ "About", ShowMenu("about") ],
[ "Gallery", ShowMenu("cg_gallery_0") ],
[ "Gallery", ShowMenu("cg_gallery") ],
[ "Mods", ShowMenu("mod_menu") ],
[ "Return", ShowMenu("main_menu") ]
] )
@ -1784,7 +1779,7 @@ screen extrasnavigation(): #Updates are removed (not even supported by Ren'Py)
[
[ "Help", ShowMenu("help") ],
[ "About", ShowMenu("about") ],
[ "Gallery", ShowMenu("cg_gallery_0") ],
[ "Gallery", ShowMenu("cg_gallery") ],
[ "Mods", ShowMenu("mod_menu") ],
[ "Return", ShowMenu("main_menu") ]
] )

View File

@ -3,7 +3,6 @@ init 2 python:
import json
# CONST PARAMS
ALLOW_ZOOM = False
GALLERY_COLS = 4
PREFERRED_WIDTH = 432 #px (1920 * 0.225)
PREFERRED_HEIGHT = 243 #px (1080 * 0.225)
@ -11,219 +10,110 @@ init 2 python:
DEFAULT_WIDTH_SCALE_RATIO = round(float(PREFERRED_WIDTH) / float(1920), 4)
DEFAULT_HEIGHT_SCALE_RATIO = round(float(PREFERRED_HEIGHT) / float(1080), 4)
NOT_UNLOCKED_COVER = im.FactorScale("gui/gallery/unlocked_cg_button_cover.png", DEFAULT_WIDTH_SCALE_RATIO, DEFAULT_HEIGHT_SCALE_RATIO)
ACCEPTED_EXTENSIONS = ["jpg", "png", "webm"]
CG_PATHS = []
#path: folder, name: shows up in gallery, eval: runs eval() on string
"""
Data structure that holds the data for each cg and button
item is name, fn is fullpath
ext is the file extension
{ item: str; fn: str; cg: Displayable; ext: str; wh: [] }[]
item is name, cg is the image definition
{ item: str; cg: Displayable; }
(reference in this init python, actually used in screens)
"""
gallery_items = []
# key dict pair, cg <-> cgs' galleryitems []
gallery_dic = {} #
for cp in CG_PATHS:
gallery_dic[cp['name']] = [] #
gallery_dic = {}
# Make a scaled cg button
# (cg: string; ext: string; w: float
def cg_(fname, ext, w):
# Makes a scaled down cg button
def cg_(fname, w):
scale = PREFERRED_WIDTH / w
#scale = box_ratio(wh)
#image = im.FactorScale(fname, scale, scale, True)
if type(fname) is str:
image = im.FactorScale(fname, scale, scale, True)
return image
else:
return Transform(fname, zoom=scale)
#return Transform(fname, crop=(0,0,1920,1080), zoom=scale)
# For testing purposes, unlocks all images in the gallery (And by extension the bonus chapters)
def unlock_all():
for key in gallery_dic.keys():
for image in gallery_dic[key]:
renpy.mark_image_seen(image["item"])
# Reads /images/cgs dir for all image files
# Populates galleryItems
# () -> None
def add_(str, _str, ext, cpname):
image = renpy.image_size(Image(_str))
item = {
"item": str,
"fn": _str,
"cg": cg_(_str, ext, image[0]),
"ext": ext,
"wh": image
}
gallery_dic[cpname].append(item)
pass
def loadGallery():
list_img = renpy.list_images()
#if ext is "webm":
# Add each image to the gallery
for str in list_img:
for cp in CG_PATHS:
for ext in ACCEPTED_EXTENSIONS:
path = cp['path']
_str = path+str+"."+ext
if renpy.loadable(_str): #brute force
add_(str, _str, ext, cp['name'])
return
# Call to loading the gallery
#loadGallery()
#renpy.start_predict_screen("cg_gallery")
#sort
#for zooming in and out
zoom_arr = [0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1.0, 1.125, 1.25, 1.5, 1.75, 2.0]
"""
for x in range(1,5):
_zoom = 1.0
_zoom *= 1+(x*0.25)
zoom_arr.append(_zoom)
for y in range(9,1,-1):
_zoom = 1.0
_zoom *= (y*0.125)
zoom_arr.append(_zoom)
zoom_arr.sort()
"""
def jsonloadandpop():
#CACHE_PATH = config.basedir.replace("\\","/") + "/game/cache/"
FILENAME = os.path.join(config.basedir, 'game/src/gallery_dataset.json')
#CACHE_PATH = config.basedir.replace("\\","/") + "/game/cache/"
fp = renpy.open_file('src/gallery_dataset.json')
data = json.load(fp)
list_img = renpy.list_images()
for x in data['tabs']:
for tab in data['tabs']:
tab_name = _(x['tab_name'])
tab_name = _(tab['tab_name'])
_eval = None
if 'eval' in x.keys():
_eval = x['eval']
if 'eval' in tab.keys():
_eval = tab['eval']
CG_PATHS.append({'path': None, 'name': tab_name, 'eval': _eval})
CG_PATHS.append({'name': tab_name, 'eval': _eval})
gallery_dic[tab_name] = []
#gallery_dataset
if 'items' in x.keys():
for y in x['items']:
name = y["name"]
cg = y["image"]
if 'items' in tab.keys():
for image in tab['items']:
name = image["name"]
cg = image["image"]
rcg = renpy.get_registered_image(cg)
#print(rcg.get_size())
image_dimensions = (1920, 1080) #renpy.image_size(rcg)
item = {
"item": name,
"fn": rcg,
"cg": cg_(rcg, None, image_dimensions[0]),
"ext": None,
"wh": image_dimensions
"image": rcg,
"cg": cg_(rcg, 1920),
}
gallery_dic[tab_name].append(item)
elif 'folders' in x.keys(): #folders
for str in list_img:
for cp in x['folders']:
for ext in ACCEPTED_EXTENSIONS:
path = cp #cp['path']
_str = path+str+"."+ext
#print(_str)
if renpy.loadable(_str): #brute force
add_(str, _str, ext, tab_name) #cp['name'])
#print(data)
pass
jsonloadandpop()
# hard code the webm because renpy is really dumb and doesn't add Movies properly until much later
fang_webm = 'fang thumb'
webm_rcg = Fixed(Color("#000"), Text("Fang", size=280, xalign=0.5, yalign=0.5), xsize=1920)
renpy.seen_label('fang_movie')
gallery_dic['Animations'] = [{
"item": 'fang tail',
"fn": 'images/animations/fang tail.webm',
"image": 'images/animations/fang tail thumbnail.webp',
"cg": 'images/animations/fang tail thumbnail.webp',
"ext": 'webm',
"wh": [1920, 1080]
}]
renpy.image("fang tail", Movie(loop=True,play='images/animations/fang tail.webm')) # Since we are hard-coding might as well.
pass
"""
'Recursive' / Loopable / Roundtrip Screens
_0 <-> _1
"""
#There is renpy.restart_interaction but since I wrote all this, it's too late
#screen cg_gallery(flag, __yoffset = 0, origin = 'CG'):
screen cg_gallery_0(__yoffset = 0, origin = 'CG'):
tag menu
use cg_gallery('1', __yoffset, origin)
screen cg_gallery_1( __yoffset = 0, origin = 'CG'):
tag menu
use cg_gallery('0', __yoffset, origin)
#screen view_image(fn, _origin, zoom=1):
screen view_image_a(fn, _origin = 0, zoom = zoom_arr.index(1.0)):
tag menu
use view_image(fn, _origin, zoom, 'b')
screen view_image_b(fn, _origin, zoom = zoom_arr.index(1.0)):
tag menu
use view_image(fn, _origin, zoom, 'a')
# Bullshit for the scrollbar to reset back to the beggining. Bless the renpy Discord :pray:
default adjust = ui.adjustment()
"""
CG Gallery screen - A screen that shows the image gallery
Basically Gallery Object has terrible defaults, so I just wrote my own stuff
Built-in Gallery Object has terrible defaults, so I just wrote my own stuff
"""
screen cg_gallery(flag, __yoffset = 0, origin = 'CG'):
screen cg_gallery(origin = 'CG'):
if main_menu:
key "game_menu" action ShowMenu("main_menu")
frame:
pass
# Bg for frame
add gui.main_menu_background
# Frame
add gui.game_menu_background
tag menu
python:
empty_spaces = gallery_rows = item_counter = 0
empty_spaces = gallery_rows = item_counter = 0
gallery_items = gallery_dic[origin]
items = len(gallery_items)
gallery_rows = (items / GALLERY_COLS) + 1
empty_spaces = GALLERY_COLS - (items % GALLERY_COLS)
vbox:
vbox id "vbx":
transform:
zoom 0.95
hbox:
@ -237,69 +127,54 @@ screen cg_gallery(flag, __yoffset = 0, origin = 'CG'):
textbutton _(cp['name']) text_color gui.selected_color text_xalign 0.5
else:
if cp['eval'] is None:
textbutton _(cp['name']) activate_sound "audio/ui/uiClick.wav" action ShowMenu('cg_gallery_'+flag, 0, cp['name']) text_xalign 0.5
textbutton _(cp['name']) text_color gui.idle_color text_hover_color gui.hover_color activate_sound "audio/ui/uiClick.wav" action (ShowMenu('cg_gallery', cp['name']),SetField(adjust, 'value', 0)) text_xalign 0.5
elif eval(cp['eval']):
textbutton _(cp['name']) activate_sound "audio/ui/uiClick.wav" action ShowMenu('cg_gallery_'+flag, 0, cp['name']) text_xalign 0.5
textbutton _(cp['name']) text_color gui.idle_color text_hover_color gui.hover_color activate_sound "audio/ui/uiClick.wav" action (ShowMenu('cg_gallery', cp['name']),SetField(adjust, 'value', 0)) text_xalign 0.5
else:
textbutton _(cp['name']) text_xalign 0.5
textbutton _("Return") activate_sound "audio/ui/uiBack.wav" action ShowMenu('main_menu') text_xalign 0.5
if _in_replay:
textbutton _("End Replay") activate_sound "audio/ui/uiBack.wav" action EndReplay(confirm=True)
elif not main_menu:
textbutton _("Main Menu") activate_sound "audio/ui/uiBack.wav" action MainMenu()
transform:
zoom 0.95
xcenter 0.525
ycenter 0.525
vpgrid id "vpg":
#yinitial __yoffset
scrollbars "vertical"
if gallery_rows>=4:
scrollbars "vertical"
mousewheel True
draggable True
pagekeys True
xfill True
yadjustment adjust
xcenter 0.5
#ycenter 0.5
spacing 20
#rows gallery_rows
cols GALLERY_COLS
for item in gallery_items:
# Should properly fix with actual margin difference but good
# enough or the actual position
python:
item_counter += 1
#yoffset = int( yoffset + (PREFERRED_HEIGHT * 1.15))
yoffset = int(item_counter / 3 * PREFERRED_HEIGHT + ((item_counter / 3)))
use flag_button(item, yoffset, origin)
use flag_button(item, origin)
for i in range(0, empty_spaces):
null height 20
"""
if/else flow control & extra parameters for Buttons
"""
screen flag_button(item, yoffset, origin):
python:
flag = renpy.seen_image(item['item'])
screen flag_button(item, origin):
$ flag = renpy.seen_image(item['item'])
if flag:
button:
if item['ext'] == "webm":
#action Replay('fang_movie')
action ShowMenu('view_movie', item, ShowMenu('cg_gallery_0', yoffset, origin))
if item in gallery_dic['Animations']:
action ShowMenu('view_movie', item, ShowMenu('cg_gallery', origin))
else:
action ShowMenu('view_image_a', item, ShowMenu('cg_gallery_0', yoffset, origin))
#action Show('view_image', None, item, ShowMenu('cg_gallery_0', yoffset, origin), _zorder=1)
action ShowMenu('view_image', item, ShowMenu('cg_gallery',origin))
xcenter 0.5 ycenter 0.5
vbox:
yminimum PREFERRED_HEIGHT xminimum PREFERRED_WIDTH
@ -310,25 +185,16 @@ screen flag_button(item, yoffset, origin):
xcenter 0.5 ycenter 0.5
add NOT_UNLOCKED_COVER
screen view_movie(item, _origin):
tag menu
key "game_menu" action [Hide('view_movie'), _origin ]
key "button_alternate" action [Hide('view_movie'), _origin ]
add item['item']
hbox:
style_prefix "quick"
xalign 0.5
yalign 0.975
if (ALLOW_ZOOM) and renpy.variant("small"):
use quick_buttons("gui/button/uioptionbuttons/template_idle.png",
[
[ "+", zoom_a_f ],
[ "-", zoom_b_f ],
[ "Return", zoom_b_f ]
] )
elif renpy.variant("small"):
if renpy.variant("small"):
hbox:
style_prefix "quick"
xalign 0.5
yalign 0.975
use quick_buttons("gui/button/uioptionbuttons/template_idle.png",
[
[ "Return", _origin ]
@ -337,27 +203,10 @@ screen view_movie(item, _origin):
"""
view_image, Loads the image in fullscreen with viewport control.
"""
screen view_image(item, _origin, zoom = zoom_arr.index(1.0), flag='a'):
python:
#_origin = Show('cg_gallery_0', 0, _origin)
zoom_a = zoom+1
zoom_a_f = ShowMenu('view_image_'+flag, item, _origin, zoom_a)
zoom_b = zoom-1
zoom_b_f = ShowMenu('view_image_'+flag, item, _origin, zoom_b)
screen view_image(item, _origin):
tag menu
key "game_menu" action [Hide('view_image'), _origin ] #Show('cg_gallery_0')] #_origin
key "button_alternate" action [Hide('view_image'), _origin ] # Show('cg_gallery_0')]
#key "button_alternate" action _origin
# mousewheel & insert+delete
if (ALLOW_ZOOM):
if zoom < len(zoom_arr)-1: #zoom in
key 'mousedown_4' action zoom_a_f
key 'K_INSERT' action zoom_a_f
if zoom > 0: #and (item['wh'][0] <= 1920 or item['wh'][1] <= 1080):
key 'mousedown_5' action zoom_b_f
key 'K_DELETE' action zoom_b_f
key "game_menu" action (Hide('view_image'), _origin)
key "button_alternate" action (Hide('view_image'), _origin)
viewport id "vie":
#Ren'Py isn't smart enough to not edgescroll while pressed,
@ -369,23 +218,16 @@ screen view_image(item, _origin, zoom = zoom_arr.index(1.0), flag='a'):
pagekeys True
xfill False
yfill False
add item['fn'] zoom zoom_arr[zoom] anchor (0.55, 0.55)
add item['image'] zoom 1.0 anchor (0.55, 0.55)
#Reuse quick buttons, Ren'Py handles touch input lazy, it doesn't have
#double finger pinch zoom, it translates taps as mouse events - have to use
#buttons
hbox:
style_prefix "quick"
xalign 0.5
yalign 0.975
if (ALLOW_ZOOM) and renpy.variant("small"):
use quick_buttons("gui/button/uioptionbuttons/template_idle.png",
[
[ "+", zoom_a_f ],
[ "-", zoom_b_f ],
[ "Return", zoom_b_f ]
] )
elif renpy.variant("small"):
#Reuse quick buttons. Ren'Py handles touch input lazy, it doesn't have
#double finger pinch zoom, it translates taps as mouse events - have to use
#buttons
if renpy.variant("small"):
hbox:
style_prefix "quick"
xalign 0.5
yalign 0.975
use quick_buttons("gui/button/uioptionbuttons/template_idle.png",
[
[ "Return", _origin ]

View File

@ -85,7 +85,7 @@ init python:
import os
if renpy.android:
if renpy.android and not config.developer:
moddir = os.path.join(os.environ["ANDROID_PUBLIC"], "game")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -4354,7 +4354,7 @@ translate es lMendingThings_f85dffef:
translate es lMendingThings_e5042600:
# A "Stella! Im not feeling it right now, maybe later, okay?"
A "¡Stela! No en este momento, tal vez más tarde, ¿de acuerdo?"
A "¡Stella! No en este momento, tal vez más tarde, ¿de acuerdo?"
# game/script/11.school-assignment-and-route-lock.rpy:2785
translate es lMendingThings_0c89b04b:

View File

@ -3652,7 +3652,7 @@ translate es lPostCheckLinkOut_447c0c64:
translate es lPostCheckLinkOut_1a80d4f4:
# "Nope,{w=.3} nuh uh,{w=.3} no way,{w=.3} abort!"
"No, {w=.3} nah, em, {w=.3} no hay manera, {w=.3} ¡aborta!"
"No, {w=.3} nah ah,{w=.3} no hay manera,{w=.3} no señor"
# game/script/2.fourth-day-of-school.rpy:2324
translate es lPostCheckLinkOut_41f6b0ac:
@ -3670,7 +3670,7 @@ translate es lPostCheckLinkOut_01808fd1:
translate es lPostCheckLinkOut_fd4432ca:
# FRT "Ohfuck.{w=.4} Sorry Anon, we gotta bail."
FRT "Ohmierda.{w=.4} Lo siento Anon, tenemos que irnos."
FRT "Ohmierda.{w=.4} Lo siento, Anon, tenemos que irnos."
# game/script/2.fourth-day-of-school.rpy:2369
translate es lPostCheckLinkOut_8e946ebb:

View File

@ -394,7 +394,7 @@ translate es chapter_5_e9675bd7:
translate es chapter_5_721cbee1:
# "God damn it, first my schedule and the lunch card and now this?"
"Maldita sea, primero mi horario y la tarjeta de almuerzo ¿y ahora esto?"
"Maldita sea, primero mi horario y la tarjeta de almuerzo, ¿y ahora esto?"
# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:322
translate es chapter_5_b3adb603:
@ -556,7 +556,7 @@ translate es chapter_5_cbccf60e:
translate es chapter_5_688f51e3:
# "I get a pair of gloves and some loppers and rejoin Fang at the ladder."
"Agarro un par de guantes y unas tenazas y me reúno con Fang en la escalera."
"Agarro un par de guantes, unas tenazas y me reúno con Fang en la escalera."
# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:463
translate es chapter_5_c8ea5d43:
@ -766,13 +766,13 @@ translate es movie_b245dd51:
translate es movie_435211c7:
# "Suddenly stars explode in my sight impaired eyes and I fall backwards."
"De repente, las estrellas explotan en mis incapacitados ojos y caigo de espaldas."
"De repente, estrellas explotan en mis incapacitados ojos y caigo de espaldas."
# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:617
translate es movie_a345276a:
# "Theres a ringing in my ears and I try to blink the vines and stars away."
"Hay un zumbido en mis oídos y trato de apartar las enredaderas y las estrellas."
"Siento un zumbido en los oídos y trato de pestañear para deshacerme de las enredaderas y las estrellas."
# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:629
translate es movie_ede74c7e:
@ -832,7 +832,7 @@ translate es movie_d6b2dc21:
translate es movie_0a57edb9:
# A "Because I couldnt see because YOU kept dropping fucking vines in my eyes!"
A "¡Porque no podía ver porque TÚ seguías arrojando putas enredaderas a mis ojos!"
A "¡No podía ver porque TÚ seguías arrojando putas enredaderas a mis ojos!"
# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:654
translate es movie_c65d1051:
@ -1138,7 +1138,7 @@ translate es movie_2212de5c:
translate es movie_a17f0fa9:
# Ro "An-{w=.2}on!{w=.4} Why are you still in there?{w=.4} Get up niño, get up!"
Ro "¡An-{w=.2}on!{w=.4} ¿Por qué sigues ahí?{w=.4} ¡Levántate, niño, levántate!"
Ro "¡Anon!{w=.4} ¿Por qué sigues ahí?{w=.4} ¡Levántate, niño, levántate!"
# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:863
translate es movie_1984e428:
@ -1606,7 +1606,7 @@ translate es movie_6fa61357:
translate es movie_8a32a287:
# A "If you think so little of Rosa and Stella and everyone, why hang out with them?"
A "Si piensas tan mal de Rosa y Stella y de todos, ¿por qué pasar el rato con ellas?"
A "Si piensas tan mal de Rosa, Stella y de todos, ¿por qué pasar el rato con ellas?"
# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:1100
translate es movie_7bcf2930:
@ -2206,7 +2206,7 @@ translate es lpostAnonLaughReveal_1c0ad98b:
translate es lpostAnonLaughReveal_bd5b94a1:
# St "You should go find Fang and apologize. And bring her back."
St "Deberías ir por Fang y disculparte. Y traerla de vuelta."
St "Deberías ir por Fang, disculparte y traerla de vuelta."
# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:1513
translate es lpostAnonLaughReveal_49d71a17:
@ -2446,7 +2446,7 @@ translate es lpostAnonLaughReveal_8f7d1152:
translate es lpostAnonLaughReveal_13f0ede2:
# A "{cps=*.1}...{/cps}Youre right for being angry at me, youre talented and skilled, and I got nothing to show for myself, and what I did was wrong{cps=*.1}..{/cps}"
A "{cps=*.1}...{/cps}Tienes razón al enojarte conmigo, eres hábil y tienes talento, y yo no tengo nada que mostrar, y lo que hice estuvo mal{cps=*.1}...{/cps}"
A "{cps=*.1}...{/cps}Tienes razón al enojarte conmigo, eres hábil y tienes talento, yo no tengo nada que mostrar, y lo que hice estuvo mal{cps=*.1}...{/cps}"
# game/script/5.fang-and-anon-cut-class-to-talk-on-the-roof.rpy:1714
translate es lpostAnonLaughReveal_8140bbf8:

View File

@ -7336,3 +7336,11 @@ translate es strings:
old "No way am I paying forty bucks on this shit."
new "De ninguna manera voy a pagar cuarenta dólares por esta mierda."
# TODO: Translation updated at 2023-01-01 01:22
# game/script/6.anon-helps-fang-find-a-venue-for-band.rpy:391
translate es chapter_6_c0d5c475:
# FD "{cps=12.5}{i}Executioner.{/i}{/cps}"
FD "{cps=12.5}{i}Verdugo.{/i}{/cps}"

View File

@ -1192,7 +1192,7 @@ translate es PostCableConundrum_31a88fe5:
translate es PostCableConundrum_f490d15c:
# "Fang wrapped her arms and wings around me and kept rocking back and forth."
"Fang me rodeó con sus brazos y alas y me sostuvo balanceándome de un lado a otro."
"Fang me rodeó con sus brazos y alas meciéndome de atrás hacia adelante."
# game/script/7.concert-day.rpy:858
translate es PostCableConundrum_7fc86e19: