From 16bff7403765c8600958826cbb2f2cc440d346ec Mon Sep 17 00:00:00 2001 From: Johnny Date: Fri, 21 Oct 2022 19:12:16 +0200 Subject: [PATCH 1/3] Proofreading --- .../mirror/events/a_bad_time_to_disrobe.rpy | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/game/scripts/minigames/mirror/events/a_bad_time_to_disrobe.rpy b/game/scripts/minigames/mirror/events/a_bad_time_to_disrobe.rpy index 9fbadfa1..d1f5c8aa 100644 --- a/game/scripts/minigames/mirror/events/a_bad_time_to_disrobe.rpy +++ b/game/scripts/minigames/mirror/events/a_bad_time_to_disrobe.rpy @@ -100,8 +100,8 @@ label a_bad_time_to_disrobe_part_1: her "I did, sir...{w=0.4} I snuck into the boys dormitory using the cloak, as you suggested." ("soft", "happyCl", "base", "mid") gen "Naked?" ("base", xpos="far_left", ypos="head") her "Naked...{w=0.2} --ish." ("disgust", "base", "base", "R") - gen "How can you be naked...{w=0.2} -ish?" ("base", xpos="far_left", ypos="head") - her "Well, I had to keep my underwear on...{w=0.2} I'd be cold otherwise." ("soft", "narrow", "base", "R") + gen "How can you be naked...{w=0.2} --ish?" ("base", xpos="far_left", ypos="head") + her "Well, I had to keep my underwear on...{w=0.2} I'd get cold otherwise." ("soft", "narrow", "base", "R") gen "Cold? How would you be cold with the cloak on?" ("base", xpos="far_left", ypos="head") her "*Ehm*..." ("digust", "base", "base", "mid") gen "*Sigh*... Just tell me what happened next." ("base", xpos="far_left", ypos="head") @@ -158,7 +158,7 @@ label a_bad_time_to_disrobe_part_1: her "..." ("upset", "base", "base", "mid", tears="mascara_soft",xpos="right",ypos="base") gen "What the-- What, happened? Where's your shirt?" ("base", xpos="far_left", ypos="head") - her "What happened? What do you think?!" ("upset", "base", "base", "mid", tears="mascara_soft") + her "What do you think has happened?!" ("upset", "base", "base", "mid", tears="mascara_soft") gen "Well, I know what I think... But I'd like to hear it from you." ("base", xpos="far_left", ypos="head") her "I didn't want to disappoint, sir, so I did what you asked..." ("soft", "base", "base", "mid", tears="mascara_soft") her "I went into the girls changing room at the Quidditch pitch, undressing and leaving my clothes in one of the lockers." ("base", "base", "base", "mid", tears="mascara_soft") @@ -171,7 +171,7 @@ label a_bad_time_to_disrobe_part_1: gen "Right, so your--" ("base", xpos="far_left", ypos="head") her "My feet were completely visible the whole time!" ("upset", "base", "angry", "mid", tears="mascara") gen "..." ("angry", xpos="far_left", ypos="head") - her "One of the boys saw them and began moving closer to see what they were, so I tried to get away, but I slipped...{w=0.4} and...{w=0.4} and." ("upset", "wide", "base", "shocked", tears="mascara") + her "And before I knew it, one of the boys were moving closer to inspect them, so I tried to get away, but I slipped...{w=0.4} and...{w=0.4} and." ("upset", "wide", "base", "shocked", tears="mascara") gen "And what?" ("angry", xpos="far_left", ypos="head") her "My butt fell out!" ("scream", "wide", "worried", "stare", tears="mascara") @@ -192,8 +192,8 @@ label a_bad_time_to_disrobe_part_1: call her_walk ("door", "base") - her "(I suppose he's right... Surely nobody would recognize me just from my body...)" ("soft", "base", "base", "R", cheeks="blush", tears="mascara", flip=True) - her "(would they?)" ("annoyed", "narrow", "base", "mid", cheeks="blush", tears="mascara") + her "(I suppose he's right... Surely nobody would recognize me based on the lower half of my body...)" ("soft", "base", "base", "R", cheeks="blush", tears="mascara", flip=True) + her "(Would they?)" ("annoyed", "narrow", "base", "mid", cheeks="blush", tears="mascara") call her_chibi("leave") @@ -304,7 +304,7 @@ label a_bad_time_to_disrobe_part_2: gen "Magic cupboard." ("grin", xpos="far_left", ypos="head") her "Right... I'll just start from the beginning, shall I?" ("base", "narrow", "base", "R_soft") her "..." ("base", "base", "base", "mid", cheeks="blush") - her "So... I went to the boys changing room when they busy with their Quidditch practice." ("open", "narrow", "worried", "down") + her "So... I went to the boys changing room when they were busy with their Quidditch practice." ("open", "narrow", "worried", "down") gen "{size=+2}*CRUNCH*{/size}" ("base", xpos="far_left", ypos="head") her "It's very messy in there... And here I thought that the girls changing room was bad..." ("base", "narrow", "base", "down") gen "{size=+3}*CRUNCH* *Chew* *Chew*{/size}" ("base", xpos="far_left", ypos="head") @@ -312,13 +312,13 @@ label a_bad_time_to_disrobe_part_2: her "Anyway... so I rummaged around in that mess..." ("annoyed", "base", "worried", "mid") her "I knew it had to be somewhere between the showers and the doorway..." ("base", "base", "base", "mid") her "And after looking around for a while, I noticed that the cloak had been pushed underneath one of the benches lining the wall." ("open", "narrow", "worried", "down") - her "So as I grabbed it, I thought to myself... Well, I've already managed to sneak in there so perhaps I could earn myself some points as well..." ("open", "narrow", "worried", "down") - her "So I took my clothes off again, and while draping the cloak over me, I began making to the showers." ("base", "narrow", "base", "down") - her "But, just as I was about to enter, one of the boys emerged in front of me!" ("clench", "base", "worried", "mid") + her "So as I was grabbing for it, I thought to myself... Well, I've already managed to sneak in there so perhaps I could earn myself some points as well..." ("open", "narrow", "worried", "down") + her "So I took my clothes off again, and while draping the cloak over me, I began walking to the showers." ("base", "narrow", "base", "down") + her "But, just as I was about to enter, one of the Slytherin boys emerged in front of me!" ("clench", "base", "worried", "mid") gen "{size=+6}*CRUNCH*{/size}" ("base", xpos="far_left", ypos="head") her "Professor!" ("scream", "base", "angry", "mid") gen "*Cough* *Cough*...{w=0.4} Sorry." ("angry", xpos="far_left", ypos="head") - her "It is hard enough to talk about this as it is without your chewing distracting me." ("annoyed", "base", "angry", "mid") + her "It is hard enough to talk about this as it is, without your chewing distracting me." ("annoyed", "base", "angry", "mid") call play_sound("gulp") gen "*Gulp*" ("base", xpos="far_left", ypos="head") @@ -330,22 +330,22 @@ label a_bad_time_to_disrobe_part_2: gen "Smart." ("base", xpos="far_left", ypos="head") her "..." ("base", "base", "base", "mid", cheeks="blush") her "If I had been smart, I would've taken into consideration why someone might go to the changing room before practice is finished..." ("base", "narrow", "base", "down") - gen "To drain the ole--" ("grin", xpos="far_left", ypos="head") + gen "To drain the snake no doubt." ("grin", xpos="far_left", ypos="head") her "Do you want me to continue or not?" ("annoyed", "narrow", "annoyed", "mid") gen "You're the one receiving the points here, I'm just providing the means of earning them." ("base", xpos="far_left", ypos="head") her "*Hmph*..." ("normal", "narrow", "worried", "down") her "As I was saying..." ("base", "narrow", "base", "down") - her "At this point it was already too late, I was already inside one of the toilets and I began hearing the shuffling of the boy outside." ("base", "closed", "base", "mid") - her "Since the room was so small, I tried to back into a corner... But once he had entered, I knew it wasn't going to work..." ("base", "narrow", "base", "down", cheeks="blush") - her "So, the only thing I could do was pray that he wasn't about to sit down, and to position myself right up against the back of the toilet... With my legs around the base." ("clench", "happyCl", "worried", "mid") + her "At this point it was already too late... Just as I realised my mistake, he had already opened the door." ("base", "closed", "base", "mid") + her "Since the room was so small, I tried to back into a corner... But to no avail..." ("base", "narrow", "base", "down", cheeks="blush") + her "The only thing I could do was pray that he wasn't about to sit down, and to position myself right up against the back of the toilet... With my legs around the base." ("clench", "happyCl", "worried", "mid") her "..." ("disgust", "narrow", "base", "down") gen "And did he?" ("base", xpos="far_left", ypos="head") her "No... But he was close enough for me to feel his..." ("mad", "squint", "worried", "up") her "His..." ("base", "slit", "worried", "ahegao") gen "His what, Miss Granger?" ("base", xpos="far_left", ypos="head") - her "His penis..." ("annoyed", "closed", "base", "mid", cheeks="blush") + her "His penis... It brushed up against the robes" ("annoyed", "closed", "base", "mid", cheeks="blush") gen "How did he manage that?" ("base", xpos="far_left", ypos="head") - her "Well... The boy weren't there for the purpose of relieving himself... Well, at least not in the way--" ("open", "closed", "angry", "mid", cheeks="blush") + her "Well... The boy wasn't there for the purpose of relieving himself... Well, at least not how one would expect it..." ("open", "closed", "angry", "mid", cheeks="blush") gen "He was jacking it!?" ("base", xpos="far_left", ypos="head") her "*Ehm*... Yes... And I suppose he was too busy to notice that his tip was brushing up against--" ("normal", "base", "worried", "mid", cheeks="blush") her "*Ahem*..." ("open", "base", "worried", "R", cheeks="blush") From f8d7a6915c9a7f8739786175135bb82a5559cd83 Mon Sep 17 00:00:00 2001 From: Johnny28 Date: Sat, 22 Oct 2022 02:04:18 +0200 Subject: [PATCH 2/3] Fix * Fixed sound not playing. --- game/scripts/characters/hermione/events/items/vibrators.rpy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/game/scripts/characters/hermione/events/items/vibrators.rpy b/game/scripts/characters/hermione/events/items/vibrators.rpy index 8c5fd557..aa08cf6a 100644 --- a/game/scripts/characters/hermione/events/items/vibrators.rpy +++ b/game/scripts/characters/hermione/events/items/vibrators.rpy @@ -3460,8 +3460,6 @@ label hg_vibrators_public_return: # Strength was set to high before #Hermione is denied an orgasm, the boys doesn't notice. #Vagina is wet - play sound "sounds/click4.ogg" - play bg_sounds "sounds/vibrator_low.ogg" show her_vibrators_public eyes_clenched mouth_open as xray_child show her_vibrators_public_proxy eyes_clenched mouth_open as xray_overlay @@ -3576,6 +3574,9 @@ label hg_vibrators_public_return: show vibrator_interface vibration_low low_disabled + play sound "sounds/click4.ogg" + play bg_sounds "sounds/vibrator_low.ogg" + # Hermione does not reach orgasm. if _vibrator_last == "medium": # Strength was set to medium before. (worst ending) From 8edc533830d67c6dc6b59ad49836cd2192edee2c Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Wed, 26 Oct 2022 22:55:33 +0100 Subject: [PATCH 3/3] Translation tools * Added CLI translation generation tool --- game/scripts/utility/translation.rpy | 211 +++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 game/scripts/utility/translation.rpy diff --git a/game/scripts/utility/translation.rpy b/game/scripts/utility/translation.rpy new file mode 100644 index 00000000..e2eba6f8 --- /dev/null +++ b/game/scripts/utility/translation.rpy @@ -0,0 +1,211 @@ +rpy python 3 + +init python in cli: + import os + import collections + import itertools + from renpy.translation import quote_unicode + from renpy.parser import elide_filename + + tl_file_cache = {} + + def open_tl_file(fn, mode): + + if fn in tl_file_cache: + f = tl_file_cache[fn] + + if f.mode == mode: + return f + + # elif not f.closed: + # # PY 2 only + # f.close() + + if not os.path.exists(fn): + dn = os.path.dirname(fn) + + try: + os.makedirs(dn) + except Exception: + pass + + f = open(fn, mode, encoding="utf-8") + f.write(u"\ufeff") + + else: + f = open(fn, mode, encoding="utf-8") + + tl_file_cache[fn] = f + + return f + + def scan_strings(strings, min_priority=0, max_priority=299, common_only=False): + + strings.sort(key=lambda s : s.sort_key) + + rv = [ ] + seen = set() + + for s in strings: + + if s.priority < min_priority: + continue + + if s.priority > max_priority: + continue + + if common_only and not s.common: + continue + + if s.text in seen: + continue + + seen.add(s.text) + rv.append(s) + + return rv + + def write_strings(language, strings): + + stl = renpy.game.script.translator.strings[language] + stringfiles = collections.defaultdict(list) + seen = set() + + nstrings = len(strings)-1 + + for i, s in enumerate(strings): + n = round(float(i)/(nstrings)*100) + print("\rGenerating strings for {} ... Total progress:{} % ... Stage 2/2".format(language, n), end="") + + tlfn = renpy.translation.generation.translation_filename(s) + + if tlfn is None: + continue + + if s.text in seen: + continue + + seen.add(s.text) + + if language == "None" and tlfn == "common.rpy": + tlfn = "common.rpym" + + stringfiles[tlfn].append(s) + + for tlfn, sl in list(stringfiles.items()): + tlfn = os.path.join(renpy.config.gamedir, renpy.config.tl_directory, language, tlfn) + + f = open_tl_file(tlfn, mode="w") + f.write(u"translate {} strings:\n".format(language)) + f.write(u"\n") + + for s in sl: + original = s.text + translation = stl.translate(s.text) # Keeps translated strings + + f.write(u" # {}:{}\n".format(elide_filename(s.filename), s.line)) + f.write(u" old \"{}\"\n".format(quote_unicode(original))) + f.write(u" new \"{}\"\n".format(quote_unicode(translation))) + f.write(u"\n") + + def retranslate(): + translator = renpy.game.script.translator + generation = renpy.translation.generation + scanstrings = renpy.translation.scanstrings + + parser = renpy.arguments.ArgumentParser() + parser.add_argument("--rebuild", action="store_true", help="Rebuilds the translation pointers and adds missing entries.") + parser.add_argument("--empty", action="store_true", help="When combined with rebuild parameter, it will insert an empty string into added entires. Does nothing on its own.") + parser.add_argument("--clean", action="store_true", help="Removes translation files that are no longer present within the game files.") + parser.add_argument("--dry", action="store_true", help="Simulates the removal of translation files that are no longer present within the game files.") + parser.add_argument("--include-mods", action="store_true", help="Include mod files when generating translations.") + args = parser.parse_args() + + scripts = generation.translate_list_files() + + if not args.include_mods: + mods_dir = os.path.join(renpy.config.gamedir, "mods") + scripts = [f for f in scripts if not f.startswith(mods_dir)] + + strings = [] + nscripts = len(scripts)-1 + + for i, filepath in enumerate(scripts): + n = round(float(i)/(nscripts)*100) + + for language in translator.languages: + + print("\rGenerating dialogues for {} ... Total progress:{} % ... Stage 1/2".format(language, n), end="") + + for _, trans in translator.file_translates[filepath]: + + trans_new = translator.language_translates.get((trans.identifier, language)) + filter = generation.null_filter + + if trans_new is None: + if not args.rebuild: + continue + + trans_new = trans + + if args.empty: + filter = generation.empty_filter + + if hasattr(trans, "alternate") and (trans.alternate, language) in translator.language_translates: + continue + + fp = os.path.relpath(filepath, renpy.config.gamedir) + fp = os.path.join(renpy.config.gamedir, renpy.config.tl_directory, language, fp) + + f = open_tl_file(fp, mode="w") + + f.write(u"# {}:{}\n".format(trans.filename, trans.linenumber)) + f.write(u"translate {} {}:\n".format(language, trans.identifier.replace(".", "_"))) + f.write(u"\n") + + for n in trans.block: + f.write(u" # " + n.get_code() + "\n") + + for n in trans_new.block: + f.write(u" " + n.get_code(filter) + "\n") + + f.write(u"\n") + + strings.extend(scanstrings.scan_strings(filepath)) + + strings = scan_strings(strings) + + for language in translator.languages: + + write_strings(language, strings) + + if args.clean: + translations = [f for f in renpy.list_files() if f.startswith(renpy.config.tl_directory) and f.endswith((".rpy", ".rpym"))] + + for filepath in translations: + fn = os.path.basename(filepath) + fp = os.path.relpath(filepath, os.path.join(renpy.config.tl_directory, language)) + fp = os.path.join(renpy.config.gamedir, fp) + + if fp not in scripts: + if fn == "common.rpy": + continue + + if fp in tl_file_cache: + f = tl_file_cache.pop(tl_file_cache) + f.close() + + if args.dry: + print("Removal required: {}".format(filepath)) + else: + os.unlink(filepath) + os.unlink(filepath + "c") + + for f in list(tl_file_cache.values()): + f.close() + + tl_file_cache.clear() + + return False + + renpy.arguments.register_command("retranslate", retranslate)