Tool RenPy Translation tool

5.00 star(s) 4 Votes

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,110
14,783
Looks like we are talking about different things. I was wrining about opening brace -> {, and you wrote about opening quote -> ".
Oops, should have slept a little more :D
This said, what I said still apply, you can have almost whatever character between them. Ren'py will not understand something like
Code:
"{color=var.list_attribute[rank]} blablabla"
but still :
Code:
"{font="this is [a] valid filename"} blablabla"
should be take in count.

Personally, like you take the value directly from the Ren'py script, I wouldn't care about its validity. Either it's valid, and you don't have to care, or it's not valid, and Ren'py would have complained to the dev and crashed.
What you need to find is something like this :
Code:
^\s*(?:[^"']+?(?:\s+[^"']+?)*?)*?\s*(".+"|'.+')??(?:\(.*\))?$
This because all this is valid :
Code:
"string"
charObj "string"
charObj img_attribute "string"
charObj img_attribute img_attribute "string"
"string" ( parameter = value )
charObj "string" ( parameter = value )
charObj img_attribute "string" (parameter = value )
charObj img_attribute img_attribute "string" (parameter = value )
charObj "string" ( parameter = callable( var.list_attribute[rank] ) )
In the end, if it was me, I probably would have used something that looks like this (in pseudo-code) :
Code:
line = the ren'py line
pos = 0

while pos < len( line ):
   if line[pos] in [ '"', "'" ]: exit loop
   if line[pos] !~ [\s\w]: treat next line
   pos++

startAt = pos
pos++

while pos < len( line ):
    if line[pos] == line[startAt] and line[pos-1] != '\': exit loop
    pos++

if line[pos] != line[startAt]:
   you found a not closed string

effectiveLine = line[startAt, pos]
 
  • Like
Reactions: v01d_08

v01d_08

Member
Modder
Jan 2, 2018
233
304
Wow, thanks. I'm not so good with python, actually I am a c++/c# dev who stopped professional programming several years ago and just wanted to create something useful for community and refresh my skills. So looks like I have a lot to improve in my tool. I'm glad you pointed possible issues, I really appreciate that.
 
  • Like
Reactions: revoluta

revoluta

New Member
Dec 15, 2018
10
3
63.jpg

I had previously asked for a 'netframe work'? error and it was fixed, but I had this problem
It did not work on three computers. windows7, windows10, windows10
It was good until a week ago so I like this program:cry: I hope it works again. [by.google translate]
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
I had previously asked for a 'netframe work'? error and it was fixed, but I had this problem
It did not work on three computers. windows7, windows10, windows10
It was good until a week ago so I like this program:cry: I hope it works again.
Fixed, please redownload. Thanks for using the tool.
 
  • Like
Reactions: revoluta

v01d_08

Member
Modder
Jan 2, 2018
233
304
New version 0.03 uploaded.
See changelog in the first post for additional info. More fixes and improvements are about to come.
Please write here, if you noticed any bug. Also please attach a log file called Log.txt, after an error occurred. It is located in the same directory with the tool.
 
  • Like
Reactions: revoluta

revoluta

New Member
Dec 15, 2018
10
3
64.jpg
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at TranslateRenPy.Translator.ExportTranslations(String fileName, String gameLocation, String& error)
at TranslateRenPy.FormMain.BtnExportTransFile_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3260.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
TranslateRenPy
Assembly Version: 0.0.3.0
Win32 Version: 0.0.3.0
CodeBase: file:///C:/Users/Modern/Downloads/renpy%207.13/Backup/TimeloopHunter/empty/game/tl/korean/TranslateRenPy.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3314.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3056.0 built by: NET472REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.



click "Export dialogues from translation file"
I use v0.3 The previous problem was solved, but there was a new problem.
Am I a problem?:unsure: All errors only happen to me
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
click "Export dialogues from translation file"
I use v0.3 The previous problem was solved, but there was a new problem.
Am I a problem?:unsure: All errors only happen to me
It is very good that you find errors, it gives me possibilities to improve the tool, you are helping a lot. I wrote you a private message to get more info.
Errors are an integral part of any development process, especially at it's early stage.
 
  • Like
Reactions: revoluta

revoluta

New Member
Dec 15, 2018
10
3
It is very good that you find errors, it gives me possibilities to improve the tool, you are helping a lot. I wrote you a private message to get more info.
Errors are an integral part of any development process, especially at it's early stage.
Oh, this error does not generate a log but I found a reason.
Maybe the original text of the 'translations.txt' file has been modified
Then the characters in the file are not deleted, but fortunately they are moved
Thank you for your interest.
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
Maybe the original text of the 'translations.txt' file has been modified
Then the characters in the file are not deleted, but fortunately they are moved
So does it work for you now? I've just upload a version with more error handling, so this should not appear again.
 

melquisedeque

New Member
Aug 3, 2018
7
1
1547153588059.png
Consulte o final desta mensagem para obter detalhes sobre como chamar a
depuração just-in-time (JIT) em vez desta caixa de diálogo.

************** Texto de Exceção **************
System.ArgumentOutOfRangeException: Comprimento não pode ser menor que zero.
Nome do parâmetro: length
em System.String.Substring(Int32 startIndex, Int32 length)
em TranslateRenPy.FormMain.BtnTranslateYandex_Click(Object sender, EventArgs e)
em System.Windows.Forms.Control.OnClick(EventArgs e)
em System.Windows.Forms.Button.OnClick(EventArgs e)
em System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
em System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
em System.Windows.Forms.Control.WndProc(Message& m)
em System.Windows.Forms.ButtonBase.WndProc(Message& m)
em System.Windows.Forms.Button.WndProc(Message& m)
em System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Assemblies Carregados **************
mscorlib
Versão do Assembly: 4.0.0.0
Versão do Win32: 4.7.3260.0 built by: NET472REL1LAST_C
Base de Código: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
TranslateRenPy
Versão do Assembly: 0.0.3.0
Versão do Win32: 0.0.3.0
Base de Código: file:///C:/Users/Melqui/Desktop/TranslateRenPy/TranslateRenPy.exe
----------------------------------------
System.Windows.Forms
Versão do Assembly: 4.0.0.0
Versão do Win32: 4.7.3260.0 built by: NET472REL1LAST_C
Base de Código: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Versão do Assembly: 4.0.0.0
Versão do Win32: 4.7.3314.0 built by: NET472REL1LAST_B
Base de Código: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Versão do Assembly: 4.0.0.0
Versão do Win32: 4.7.3190.0 built by: NET472REL1LAST_C
Base de Código: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Versão do Assembly: 4.0.0.0
Versão do Win32: 4.7.3190.0 built by: NET472REL1LAST_C
Base de Código: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Versão do Assembly: 4.0.0.0
Versão do Win32: 4.7.3260.0 built by: NET472REL1LAST_C
Base de Código: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Versão do Assembly: 4.0.0.0
Versão do Win32: 4.7.3190.0 built by: NET472REL1LAST_C
Base de Código: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
mscorlib.resources
Versão do Assembly: 4.0.0.0
Versão do Win32: 4.7.3190.0 built by: NET472REL1LAST_C
Base de Código: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_pt-BR_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Windows.Forms.resources
Versão do Assembly: 4.0.0.0
Versão do Win32: 4.7.3190.0 built by: NET472REL1LAST_C
Base de Código: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_pt-BR_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** Depuração JIT **************
Para habilitar a depuração just-in-time (JIT), o arquivo .config deste
aplicativo ou computador (machine.config) deve ter o valor
jitDebugging definido na seção system.windows.forms.
O aplicativo também deve ser compilado com a depuração
habilitada.

Por exemplo:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

Quando a depuração JIT está habilitada, qualquer exceção sem tratamento
será enviada ao depurador JIT registrado no computador,
em vez de ser tratada nesta caixa de diálogo.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Estou fazendo algo de errado ou isso é algum erro?
 

agonzlop

New Member
Nov 5, 2017
8
1
I was able to translate all the game's languages and import them back to the "LT" folder, now I have a problem adding the lines of code to the "screens.rpy" file, since I try to place the best possible but it always throws me error the game, you could indicate me exactly where the code should be placed to select the language please, I leave the contents of the screens.rpy file



screen main_menu tag menu:

window:
style "mm_root"

imagebutton auto "bg/menu_18/website_%s.png" xalign 0.99 yalign 0.99 action OpenURL(" ")


imagebutton auto "bg/menu_18/continue_%s.png" xalign 0.01 yalign 0.99 action Start()
imagebutton auto "bg/menu_18/load_%s.png" xalign 0.175 yalign 0.99 action ShowMenu("load")
imagebutton auto "bg/menu_18/config_%s.png" xalign 0.33 yalign 0.99 action ShowMenu("preferences")
imagebutton auto "bg/menu_18/credits_%s.png" xalign 0.48 yalign 0.99 action ShowMenu("scr_credits6")
imagebutton auto "bg/menu_18/rewards_%s.png" xalign 0.65 yalign 0.99 action ShowMenu("gallery")

if renpy.loadable("2ds0hn.key"):
imagebutton idle "gui/extras_on2.png" xalign 0.01 yalign 0.01





add "bg/mm_logo_2.png" xalign 0.99 yalign 0.92




screen navigation:


frame:
style_group "menu_choice"
xalign .5
yalign .9999

has hbox

textbutton _("Save Game") action ShowMenu('save')
textbutton _("Load Game") action ShowMenu("load")
textbutton _("Settings") action ShowMenu("preferences")
textbutton _("Main Menu") action MainMenu()
textbutton _("Rewards") action ShowMenu("gallery")
textbutton _("Return") action Return()
textbutton _("Quit") action Quit()

screen choice(items):

window:
style "menu_window"
xalign 0.5
yalign 0.99

has vbox:
style "menu"
spacing 2

$ index = 0
for caption, action, chosen in items:

$ index += 1
if action:

button:
action action
style "menu_choice_button"

text caption style "menu_choice"
keysym "K_" + str(index)

else:
text caption style "menu_caption"

init -2:
style menu_window is frame:
yminimum 10


style menu_choice_button is button:
xminimum int(config.screen_width * 0.75)
xmaximum int(config.screen_width * 0.75)





screen preferences() tag menu:


add "gui/bg_settings.jpg"

use navigation


grid 4 1:
style_group "menu_choice"
xfill True
ypos 0.15


vbox:
frame:
style_group "mm"
has vbox:
xfill True
label _("Display") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
textbutton _("Window") action Preference("display", "window") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)
textbutton _("Fullscreen") action Preference("display", "fullscreen") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)

frame:
style_group "mm"
has vbox:
xfill True
label _("Transitions") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
textbutton _("All") action Preference("transitions", "all") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)
textbutton _("None") action Preference("transitions", "none") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)

frame:
style_group "mm"
has vbox:
xfill True
label _("Text Speed") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
bar value Preference("text speed") xalign .5 yalign .9999




vbox:
frame:
style_group "mm"
has vbox:
xfill True
label _("Skip") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
textbutton _("Seen Messages") action Preference("skip", "seen") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)
textbutton _("All Messages") action Preference("skip", "all") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)

frame:
style_group "mm"
has vbox:
xfill True
textbutton _("Begin Skipping") action Skip() xalign .5 yalign .9999 text_size 20 padding (10,10,10,10)

frame:
style_group "mm"
has vbox:
xfill True
label _("After Choices") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
textbutton _("Stop Skipping") action Preference("after choices", "stop") xalign .5 yalign .9999 text_size 20 padding (10,10,10,10)
textbutton _("Keep Skipping") action Preference("after choices", "skip") xalign .5 yalign .9999 text_size 20 padding (10,10,10,10)

frame:
style_group "mm"
has vbox:
xfill True
label _("Auto-Forward Time") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
bar value Preference("auto-forward time")

if config.has_voice:
textbutton _("Wait for Voice") action Preference("wait for voice", "toggle") xalign .5 yalign .9999 text_size 20 padding (10,10,10,10)

vbox:
frame:
style_group "mm"
has vbox:
xfill True
label _("Music Volume") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
bar value Preference("music volume")

frame:
style_group "mm"
has vbox:
xfill True
label _("Sound Volume") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
bar value Preference("sound volume")
frame:
style_group "mm"
has vbox:
xfill True
label _("Language") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
textbutton "English" text_font "DejaVuSans.ttf" action Language(None) text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)







if config.sample_sound:
textbutton _("Test"):
action Play("sound", config.sample_sound)
style "soundtest_button"

if config.has_voice:
frame:
style_group "pref"
has vbox

label _("Voice Volume")
bar value Preference("voice volume")

textbutton _("Voice Sustain") action Preference("voice sustain", "toggle")
if config.sample_voice:
textbutton _("Test"):
action Play("voice", config.sample_voice)
style "soundtest_button"

vbox:
frame:
style_group "mm"
has vbox:
xfill True

text _("Clear Persistent Data")
textbutton _("Delete Persistent") action Function(persistent._clear, progress=True) xalign 0.5




init -2 python:
x=0
y=0


screen load_save_slot:
$ x1=x+45
$ y1=y+25
add FileScreenshot(number) xpos x1 ypos y1

screen load_save_slot2:
$ x2=x+100
$ y2=y+100
add FileScreenshot(number) xpos x2 ypos y2




screen save() tag menu:

add "gui/bg_picker_save.jpg"

use file_picker("save")


screen load() tag menu:

add "gui/bg_picker_load.jpg"

use file_picker("load")







screen modal_input:
modal True
window style "input_window":
has vbox

text prompt style "input_prompt"
input id "input" style "input_text" length 80

init -2 python:
class get_save_name(FileSave):
def __init__(self, name, confirm=True, newest=True, page=None, cycle=False):
super(get_save_name,self).__init__(name=name,confirm=confirm,newest=newest,page=page,cycle=cycle)
def __call__(self):
renpy.call_in_new_context("get_save_name")
return super(get_save_name,self).__call__()

label get_save_name:
show screen save
$ save_name = "" + "%@" + str(v_stat_d_friend) + "%@" + str(v_stat_d_love) + "%@" + str(v_corruption)
$ save_name = renpy.call_screen("modal_input", prompt="Enter a description for your save file:", default="(None)", length=10)
$ save_name = save_name + "%@" + str(v_stat_d_friend) + "%@" + str(v_stat_d_love) + "%@" + str(v_corruption)
$ renpy.retain_after_load()
return


init python:
def get_extra_stuff(data):
if '%@' in data:
s_description,load_fp, load_lp,load_cl = data.split('%@', 3)
else:
load_fp = ''
load_lp = ''
load_cl = ''
s_description ='(No description)'
return (s_description,load_fp, load_lp,load_cl)

screen end_block:
imagebutton:
idle "bg invisible" xalign 0 yalign 0

screen file_picker(currentScreen):
use navigation
frame:
style "file_picker_frame"
ypos 0.1

has vbox



hbox:
style_group "menu_choice"
textbutton _("<<"):
if not persistent._file_page == "2":
action FilePage(1)
textbutton _("<"):
action FilePagePrevious()


for i in range(0, 13):
if not persistent._file_page or persistent._file_page == "auto" or persistent._file_page == "quick":
$ j =0
else:
if int(persistent._file_page)%12 == 0:
$ j = int(persistent._file_page)/12-1
else:
$ j = int(persistent._file_page)/12
textbutton str(j*12+i):
action FilePage(j*12+i)


textbutton _(">"):
action FilePageNext()

$ columns = 2
$ rows = 3


grid columns rows:
transpose True
xfill True
style_group "file_picker"


for i in range(1, columns * rows + 1):


button:
left_padding 10
right_padding 2
top_padding 10
bottom_padding 0
left_margin 0
right_margin 0
top_margin 0
bottom_margin 0
xysize (700, 175)


if currentScreen == "save":
action [SetVariable("save_name",_last_say_what[:50]), get_save_name(i)]
else:
action FileAction(i)
xfill True

if FileLoadable(i):
textbutton "Delete" action FileDelete(i) xalign 0.9959 yalign 0.95

add FileScreenshot(i)

$ file_name = FileSlotName(i, columns * rows)
$ file_time = FileTime(i, empty=_("Empty Slot."))
$ save_name = FileSaveName(i)
$ s_description, load_fp, load_lp,load_cl = get_extra_stuff(FileSaveName(i))
text "[file_name]. [file_time!t]\n" xpos 0.45
text "[s_description]" xpos 0.55 xalign 0.2 yalign 0.4 xminimum 0.5 xmaximum 0.5 text_align 0.5

text "{color=#284e35}FP: [load_fp]{/color} - {color=#ba3030}LP: [load_lp]{/color} - {color=#434343}CL: [load_cl]{/color}" xpos 0.45 yalign 0.9
key "save_delete" action FileDelete(i)







screen yesno_prompt:
on "show" action Play("sound", "sfx/alert.wav")
modal True

add "gui/yesno_ground.jpg"
imagebutton auto "gui/yesno_yes_%s.png" xpos 267 ypos 269 action yes_action hover_sound "sfx/click.wav"
imagebutton auto "gui/yesno_no_%s.png" xpos 836 ypos 269 action no_action hover_sound "sfx/click.wav"

if message == layout.ARE_YOU_SURE:
add "gui/yesno_are_you_sure.png"
elif message == layout.DELETE_SAVE:
add "gui/yesno_delete_save.png"
elif message == layout.OVERWRITE_SAVE:
add "gui/yesno_overwrite_save.png"
elif message == layout.LOADING:
add "gui/yesno_loading.png"
elif message == layout.QUIT:
add "gui/yesno_quit.png"
elif message == layout.MAIN_MENU:
add "gui/yesno_main_menu.png"





screen say:
default side_image = None
window:
id "window"
has vbox:
style "say_vbox"
if who:
text who id "who"
text what id "what"

if side_image:
add side_image
else:
add SideImage() xalign 0.0 yalign 1.0




init:
$ style.say_dialogue.drop_shadow = (2, 2)
$ style.say_dialogue.drop_shadow_color = "#000000"
# Decompiled by unrpyc:
Python:
screen main_menu tag menu:





    window:
        style "mm_root"

    imagebutton auto "bg/menu_18/website_%s.png" xalign 0.99 yalign 0.99 action OpenURL("https://www.dmdgame.com")


    imagebutton auto "bg/menu_18/continue_%s.png" xalign 0.01 yalign 0.99 action Start()
    imagebutton auto "bg/menu_18/load_%s.png" xalign 0.175 yalign 0.99 action ShowMenu("load")
    imagebutton auto "bg/menu_18/config_%s.png" xalign 0.33 yalign 0.99 action ShowMenu("preferences")
    imagebutton auto "bg/menu_18/credits_%s.png" xalign 0.48 yalign 0.99 action ShowMenu("scr_credits6")
    imagebutton auto "bg/menu_18/rewards_%s.png" xalign 0.65 yalign 0.99 action ShowMenu("gallery")

    if renpy.loadable("2ds0hn.key"):
        imagebutton idle "gui/extras_on2.png" xalign 0.01 yalign 0.01





    add "bg/mm_logo_2.png" xalign 0.99 yalign 0.92




screen navigation:


    frame:
        style_group "menu_choice"
        xalign .5
        yalign .9999

        has hbox

        textbutton _("Save Game") action ShowMenu('save')
        textbutton _("Load Game") action ShowMenu("load")
        textbutton _("Settings") action ShowMenu("preferences")
        textbutton _("Main Menu") action MainMenu()
        textbutton _("Rewards") action ShowMenu("gallery")
        textbutton _("Return") action Return()
        textbutton _("Quit") action Quit()

screen choice(items):

    window:
        style "menu_window"
        xalign 0.5
        yalign 0.99

        has vbox:
            style "menu"
            spacing 2

        $ index = 0
        for caption, action, chosen in items:

            $ index += 1
            if action:

                button:
                    action action
                    style "menu_choice_button"

                    text caption style "menu_choice"
                    keysym "K_" + str(index)

            else:
                text caption style "menu_caption"

init -2:
    style menu_window is frame:
        yminimum 10


    style menu_choice_button is button:
        xminimum int(config.screen_width * 0.75)
        xmaximum int(config.screen_width * 0.75)





screen preferences() tag menu:


    add "gui/bg_settings.jpg"

    use navigation


    grid 4 1:
        style_group "menu_choice"
        xfill True
        ypos 0.15


        vbox:
            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("Display") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
                textbutton _("Window") action Preference("display", "window") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)
                textbutton _("Fullscreen") action Preference("display", "fullscreen") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)

            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("Transitions") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
                textbutton _("All") action Preference("transitions", "all") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)
                textbutton _("None") action Preference("transitions", "none") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)

            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("Text Speed") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
                bar value Preference("text speed") xalign .5 yalign .9999




        vbox:
            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("Skip") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
                textbutton _("Seen Messages") action Preference("skip", "seen") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)
                textbutton _("All Messages") action Preference("skip", "all") text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)

            frame:
                style_group "mm"
                has vbox:
                    xfill True
                textbutton _("Begin Skipping") action Skip() xalign .5 yalign .9999 text_size 20 padding (10,10,10,10)

            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("After Choices") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
                textbutton _("Stop Skipping") action Preference("after choices", "stop") xalign .5 yalign .9999 text_size 20 padding (10,10,10,10)
                textbutton _("Keep Skipping") action Preference("after choices", "skip") xalign .5 yalign .9999 text_size 20 padding (10,10,10,10)

            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("Auto-Forward Time") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
                bar value Preference("auto-forward time")

                if config.has_voice:
                    textbutton _("Wait for Voice") action Preference("wait for voice", "toggle") xalign .5 yalign .9999 text_size 20 padding (10,10,10,10)

        vbox:
            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("Music Volume") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
                bar value Preference("music volume")

            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("Sound Volume") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
                bar value Preference("sound volume")
            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("Language") xalign .5 yalign .9999 text_size 25 padding (10,10,10,10)
                textbutton "English" text_font "DejaVuSans.ttf" action Language(None) text_size 20 xalign .5 yalign .9999 padding (10,10,10,10)







                if config.sample_sound:
                    textbutton _("Test"):
                        action Play("sound", config.sample_sound)
                        style "soundtest_button"

            if config.has_voice:
                frame:
                    style_group "pref"
                    has vbox

                    label _("Voice Volume")
                    bar value Preference("voice volume")

                    textbutton _("Voice Sustain") action Preference("voice sustain", "toggle")
                    if config.sample_voice:
                        textbutton _("Test"):
                            action Play("voice", config.sample_voice)
                            style "soundtest_button"

        vbox:
            frame:
                style_group "mm"
                has vbox:
                    xfill True

                text _("Clear Persistent Data")
                textbutton _("Delete Persistent") action Function(persistent._clear, progress=True) xalign 0.5




init -2 python:
    x=0
    y=0


screen load_save_slot:
    $ x1=x+45
    $ y1=y+25
    add FileScreenshot(number) xpos x1 ypos y1

screen load_save_slot2:
    $ x2=x+100
    $ y2=y+100
    add FileScreenshot(number) xpos x2 ypos y2




screen save() tag menu:

    add "gui/bg_picker_save.jpg"

    use file_picker("save")


screen load() tag menu:

    add "gui/bg_picker_load.jpg"

    use file_picker("load")







screen modal_input:
    modal True
    window style "input_window":
        has vbox

        text prompt style "input_prompt"
        input id "input" style "input_text" length 80

init -2 python:
    class get_save_name(FileSave):
        def __init__(self, name, confirm=True, newest=True, page=None, cycle=False):
            super(get_save_name,self).__init__(name=name,confirm=confirm,newest=newest,page=page,cycle=cycle)
        def __call__(self):
            renpy.call_in_new_context("get_save_name")
            return super(get_save_name,self).__call__()

label get_save_name:
    show screen save
    $ save_name = "" + "%@" + str(v_stat_d_friend) + "%@" + str(v_stat_d_love) + "%@" + str(v_corruption)
    $ save_name = renpy.call_screen("modal_input", prompt="Enter a description for your save file:", default="(None)", length=10)
    $ save_name = save_name + "%@" + str(v_stat_d_friend) + "%@" + str(v_stat_d_love) + "%@" + str(v_corruption)
    $ renpy.retain_after_load()
    return


init python:
    def get_extra_stuff(data):
        if '%@' in data:
            s_description,load_fp, load_lp,load_cl = data.split('%@', 3)
        else:
            load_fp = ''
            load_lp = ''
            load_cl = ''
            s_description ='(No description)'
        return (s_description,load_fp, load_lp,load_cl)

screen end_block:
    imagebutton:
        idle "bg invisible" xalign 0 yalign 0

screen file_picker(currentScreen):
    use navigation
    frame:
        style "file_picker_frame"
        ypos 0.1

        has vbox



        hbox:
            style_group "menu_choice"
            textbutton _("<<"):
                if not persistent._file_page == "2":
                    action FilePage(1)
            textbutton _("<"):
                action FilePagePrevious()


            for i in range(0, 13):
                if not persistent._file_page or persistent._file_page == "auto" or persistent._file_page == "quick":
                    $ j =0
                else:
                    if int(persistent._file_page)%12 == 0:
                        $ j = int(persistent._file_page)/12-1
                    else:
                        $ j = int(persistent._file_page)/12
                textbutton str(j*12+i):
                    action FilePage(j*12+i)


            textbutton _(">"):
                action FilePageNext()

        $ columns = 2
        $ rows = 3


        grid columns rows:
            transpose True
            xfill True
            style_group "file_picker"


            for i in range(1, columns * rows + 1):


                button:
                    left_padding 10
                    right_padding 2
                    top_padding 10
                    bottom_padding 0
                    left_margin 0
                    right_margin 0
                    top_margin 0
                    bottom_margin 0
                    xysize (700, 175)


                    if currentScreen == "save":
                        action [SetVariable("save_name",_last_say_what[:50]), get_save_name(i)]
                    else:
                        action FileAction(i)
                    xfill True

                    if FileLoadable(i):
                        textbutton "Delete" action FileDelete(i) xalign 0.9959 yalign 0.95

                    add FileScreenshot(i)

                    $ file_name = FileSlotName(i, columns * rows)
                    $ file_time = FileTime(i, empty=_("Empty Slot."))
                    $ save_name = FileSaveName(i)
                    $ s_description, load_fp, load_lp,load_cl = get_extra_stuff(FileSaveName(i))
                    text "[file_name]. [file_time!t]\n" xpos 0.45
                    text "[s_description]" xpos 0.55 xalign 0.2 yalign 0.4 xminimum 0.5 xmaximum 0.5 text_align 0.5

                    text "{color=#284e35}FP: [load_fp]{/color} - {color=#ba3030}LP: [load_lp]{/color} - {color=#434343}CL: [load_cl]{/color}" xpos 0.45 yalign 0.9
                    key "save_delete" action FileDelete(i)







screen yesno_prompt:
    on "show" action Play("sound", "sfx/alert.wav")
    modal True

    add "gui/yesno_ground.jpg"
    imagebutton auto "gui/yesno_yes_%s.png" xpos 267 ypos 269 action yes_action hover_sound "sfx/click.wav"
    imagebutton auto "gui/yesno_no_%s.png" xpos 836 ypos 269 action no_action hover_sound "sfx/click.wav"

    if message == layout.ARE_YOU_SURE:
        add "gui/yesno_are_you_sure.png"
    elif message == layout.DELETE_SAVE:
        add "gui/yesno_delete_save.png"
    elif message == layout.OVERWRITE_SAVE:
        add "gui/yesno_overwrite_save.png"
    elif message == layout.LOADING:
        add "gui/yesno_loading.png"
    elif message == layout.QUIT:
        add "gui/yesno_quit.png"
    elif message == layout.MAIN_MENU:
        add "gui/yesno_main_menu.png"





screen say:
    default side_image = None
    window:
        id "window"
        has vbox:
            style "say_vbox"
        if who:
            text who id "who"
        text what id "what"

    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0




init:
    $ style.say_dialogue.drop_shadow = (2, 2)
    $ style.say_dialogue.drop_shadow_color = "#000000"
# Decompiled by unrpyc: https://github.com/CensoredUsername/unrpyc
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
agonzlop, since the screens.rpy file is unique in every game, there is no one exact scenario to modify it.
In your case I would try to do something like this:

Python:
. . .
screen preferences() tag menu:

    add "gui/bg_settings.jpg"

    use navigation

    grid 4 1:
        style_group "menu_choice"
        xfill True
        ypos 0.15

        vbox:
            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("Language")
                textbutton "English" action Language(None)
                textbutton "Russian" action Language("russian")
             
            frame:
. . .
Also I updated the first post with a little more instructions for section "Modifying the game preferences ".
 

agonzlop

New Member
Nov 5, 2017
8
1
agonzlop, since the screens.rpy file is unique in every game, there is no one exact scenario to modify it.
In your case I would try to do something like this:

Python:
. . .
screen preferences() tag menu:

    add "gui/bg_settings.jpg"

    use navigation

    grid 4 1:
        style_group "menu_choice"
        xfill True
        ypos 0.15

        vbox:
            frame:
                style_group "mm"
                has vbox:
                    xfill True
                label _("Language")
                textbutton "English" action Language(None)
                textbutton "Russian" action Language("russian")
            
            frame:
. . .
Also I updated the first post with a little more instructions for section "Modifying the game preferences ".




It works perfectly, thank you very much.
(y)(y)(y)(y)
 

revoluta

New Member
Dec 15, 2018
10
3
66.jpg
It just clicked "generate translation file"
When there are only special characters, numbers and spaces, they are extracted.

"" Comes in two #29,#30
 

v01d_08

Member
Modder
Jan 2, 2018
233
304
It just clicked "generate translation file"
When there are only special characters, numbers and spaces, they are extracted.

"" Comes in two #29,#30
If original string does not contain letters, the tool just copies it and considers as translated.
As for empty quotes - I fixed it, please redownload. Now empty dialogues are ignored.
 
5.00 star(s) 4 Votes