Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Creating Multiple Language Options in Trainer

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials
View previous topic :: View next topic  
Author Message
Aylin
Expert Cheater
Reputation: 1

Joined: 16 Feb 2017
Posts: 154

PostPosted: Thu Mar 01, 2018 7:28 am    Post subject: Creating Multiple Language Options in Trainer Reply with quote

Trainere, Put multiple language options for the user.
and that language, Button or
Move the selection with the image (Country Flag Image).

My advice; the selection window, you can create within the GroupBox.
This opens and closes the window with a single Button.

Place a GroupBox on the table and
name: get 'Language'. (Except the quotation marks)

Firstly;
let's code an interaction function that we have a choice of language.
Let's start with 4 language options. Wink

Code:
function LanguageChange(sender)
if Lang == '0' then
English()
end
if Lang == '1' then
Portuguese()
end
if Lang == '2' then
Espanol()
end
if Lang == '3' then
Germany()
end
end


then write the interaction codes and translations for the languages:
There are 4 languages in the example and 4 buttons to activate them.
Assign an OnClick language option for each button on the Tablodan.
CEButton1, onClick, English etc.

Code:
function English()
Lang = '0'
control_setCaption(UDF1_CEButton1, "English")
control_setCaption(UDF1_CEButton2, "English")
control_setCaption(UDF1_CEButton3, "English")
control_setCaption(UDF1_CEButton4, "English")
end

function Portuguese()
Lang = '1'
control_setCaption(UDF1_CEButton1, "Portuguese")
control_setCaption(UDF1_CEButton2, "Portuguese")
control_setCaption(UDF1_CEButton3, "Portuguese")
control_setCaption(UDF1_CEButton4, "Portuguese")
end

function Espanol()
Lang = '2'
control_setCaption(UDF1_CEButton1, "Espanol")
control_setCaption(UDF1_CEButton2, "Espanol")
control_setCaption(UDF1_CEButton3, "Espanol")
control_setCaption(UDF1_CEButton4, "Espanol")
end

function Germany()
Lang = '3'
control_setCaption(UDF1_CEButton1, "Germany")
control_setCaption(UDF1_CEButton2, "Germany")
control_setCaption(UDF1_CEButton3, "Germany")
control_setCaption(UDF1_CEButton4, "Germany")
end


If you have a pop-up message
Let's do 2 buttons for 'INFO' or 'DESCRIPTION'.
Let's put 2 Buttons as an example:
showMessage and messageDialog..

Code:
function CEButton5Click(sender)
if Lang == '0' then
showMessage("Language English")
end
if Lang == '1' then
showMessage("Language Portuguese")
end
if Lang == '2' then
showMessage("Language Espanol")
end
if Lang == '3' then
showMessage("Language Germany")
end
end

function CEButton6Click(sender)
if Lang == '0' then
messageDialog( "Language English", 4, 0); -- Focus on the window you want; 'OK' or 'Yes' ; ", 4, 1); or ", 3, 1);
end
if Lang == '1' then
messageDialog( "Language Portuguese", 4, 1);
end
if Lang == '2' then
messageDialog( "Language Espanol", 4, 2);
end
if Lang == '3' then
messageDialog( "Language Germany", 4, 3);
end
end



Now we have 1 GroupBox and 6 buttons in total,
We have 4 language options.
Add a Button or Image and open the GroupBox (Language) window.

Code:
function CEButton7Click(sender) -- or Image ;)
UDF1.Language.visible = true
UDF1.CEButton7.visible = false
LanguageChange(sender)
end


After the language selection has been made, you want the selection window to close.
If so, add the following code to the language selection functions:

Code:
UDF1.Language.visible = false
UDF1.CEButton7.visible = true


Code:

Code:
function English()
Lang = '0'
control_setCaption(UDF1_CEButton1, "English")
control_setCaption(UDF1_CEButton2, "English")
control_setCaption(UDF1_CEButton3, "English")
control_setCaption(UDF1_CEButton4, "English")
UDF1.Language.visible = false
UDF1.CEButton7.visible = true
end


---------------------------->>>>
4 Total combination of language encoding:

Code:
function CEButton7Click(sender)
UDF1.Language1.visible = true
UDF1.CEButton7.visible = false
LanguageChange(sender)
end


function LanguageChange(sender)
if Lang == '0' then
English()
end
if Lang == '1' then
Portuguese()
end
if Lang == '2' then
Espanol()
end
if Lang == '3' then
Germany()
end
end



function English()
Lang = '0'
control_setCaption(UDF1_CEButton1, "English")
control_setCaption(UDF1_CEButton2, "English")
control_setCaption(UDF1_CEButton3, "English")
control_setCaption(UDF1_CEButton4, "English")
end

function Portuguese()
Lang = '1'
control_setCaption(UDF1_CEButton1, "Portuguese")
control_setCaption(UDF1_CEButton2, "Portuguese")
control_setCaption(UDF1_CEButton3, "Portuguese")
control_setCaption(UDF1_CEButton4, "Portuguese")
end

function Espanol()
Lang = '2'
control_setCaption(UDF1_CEButton1, "Espanol")
control_setCaption(UDF1_CEButton2, "Espanol")
control_setCaption(UDF1_CEButton3, "Espanol")
control_setCaption(UDF1_CEButton4, "Espanol")
end

function Germany()
Lang = '3'
control_setCaption(UDF1_CEButton1, "Germany")
control_setCaption(UDF1_CEButton2, "Germany")
control_setCaption(UDF1_CEButton3, "Germany")
control_setCaption(UDF1_CEButton4, "Germany")
end

function CEButton5Click(sender)
if Lang == '0' then
showMessage("Language English")
end
if Lang == '1' then
showMessage("Language Portuguese")
end
if Lang == '2' then
showMessage("Language Espanol")
end
if Lang == '3' then
showMessage("Language Germany")
end
end

function CEButton6Click(sender)
if Lang == '0' then
messageDialog( "Language English", 4, 0);
end
if Lang == '1' then
messageDialog( "Language Portuguese", 4, 1);
end
if Lang == '2' then
messageDialog( "Language Espanol", 4, 2);
end
if Lang == '3' then
messageDialog( "Language Germany", 4, 3);
end
end

UDF1.CEButton7.visible = true
UDF1.Language.visible = false
form_show(UDF1)


Maybe this forum has been pre-processed!
But I did not find any end result.
I hope it will work. Wink

Enjoy!

_________________
See Hitler ! This Trainer is for you!
http://forum.cheatengine.org/viewtopic.php?t=606786
Enthusiastic people: Always one step ahead!
Do not underestimate me Master: You were a beginner in the past!
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites