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 


[Fixed]Help for the language option box!

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

Joined: 16 Feb 2017
Posts: 154

PostPosted: Tue Feb 27, 2018 8:58 pm    Post subject: [Fixed]Help for the language option box! Reply with quote

Help for the language option box!
I tried coding with ComboBax and GroupBox.
Button functions are working properly.
But the message boxes are not trading.
And I did a CT uses Coding examples.
I would be glad if the Masters observations. Thanks in advance.


Code:
function CEButton5Click(sender)
UDF1.Language.visible = true
UDF1.CEButton5.visible = false
LanguageChange(sender)
end


function LanguageChange(sender)
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
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()
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
control_setCaption(UDF1_CEButton1, "English")
control_setCaption(UDF1_CEButton2, "English")
control_setCaption(UDF1_CEButton3, "English")
control_setCaption(UDF1_CEButton4, "English")
end

function Portuguese()
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
control_setCaption(UDF1_CEButton1, "Portuguese")
control_setCaption(UDF1_CEButton2, "Portuguese")
control_setCaption(UDF1_CEButton3, "Portuguese")
control_setCaption(UDF1_CEButton4, "Portuguese")
end

function Espanol()
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
control_setCaption(UDF1_CEButton1, "Espanol")
control_setCaption(UDF1_CEButton2, "Espanol")
control_setCaption(UDF1_CEButton3, "Espanol")
control_setCaption(UDF1_CEButton4, "Espanol")
end

function Germany()
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
control_setCaption(UDF1_CEButton1, "Germany")
control_setCaption(UDF1_CEButton2, "Germany")
control_setCaption(UDF1_CEButton3, "Germany")
control_setCaption(UDF1_CEButton4, "Germany")
end

function CEButton6Click(sender)
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
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 CEButton7Click(sender)
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
if Lang == '0' then
messageDialog( "Language English")
end
if Lang == '1' then
messageDialog( "Language Portuguese")
end
if Lang == '2' then
messageDialog( "Language Espanol")
end
if Lang == '3' then
messageDialog( "Language Germany")
end
end

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


https://www.dropbox.com/s/tb0877yzlgnks6i/Language4.CT?dl=0

_________________
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!


Last edited by Aylin on Wed Feb 28, 2018 7:03 am; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
Corroder
Grandmaster Cheater
Reputation: 17

Joined: 10 Apr 2015
Posts: 619

PostPosted: Wed Feb 28, 2018 12:24 am    Post subject: Reply with quote

There are no comboBox has created.

Code:
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')


I don't know if a CE groupBox have 'ItemIndex'. Rolling Eyes Question Question

_________________
Singapore Sling + Johnnie Walker + Some Peanuts....
Back to top
View user's profile Send private message
Aylin
Expert Cheater
Reputation: 2

Joined: 16 Feb 2017
Posts: 154

PostPosted: Wed Feb 28, 2018 6:57 am    Post subject: Reply with quote

GroupBox Name: Language1
onChange: ChangeBounds
and Change Code:

Code:
function LanguageChange(sender)
LangClient = component_findComponentByName(UDF1,'Language1')
Lang = getProperty(LangClient,'ItemIndex')
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


CEButton1 or CEImage ..
onClick: English
and Code:

Code:
function English()
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
Lang = '0' --- The important code that ensures correcting! Interacting with sub commands
control_setCaption(UDF1_CEButton1, "English")
control_setCaption(UDF1_CEButton2, "English")
control_setCaption(UDF1_CEButton3, "English")
control_setCaption(UDF1_CEButton4, "English")
end
--end
function Portuguese()
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
Lang = '1'
control_setCaption(UDF1_CEButton1, "Portuguese")
control_setCaption(UDF1_CEButton2, "Portuguese")
control_setCaption(UDF1_CEButton3, "Portuguese")
control_setCaption(UDF1_CEButton4, "Portuguese")
end


and the entire message category works with the selected language. Wink
and Code:

Code:
function CEButton6Click(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
-- Test and use the dialogue approval parameters as you wish. ", 3, 1); or ", 4, 0); etc...
function CEButton7Click(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


Now you can add language options to the Trainer Wink



Ekran Alıntısı.PNG
 Description:
 Filesize:  571.04 KB
 Viewed:  1823 Time(s)

Ekran Alıntısı.PNG



_________________
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
Corroder
Grandmaster Cheater
Reputation: 17

Joined: 10 Apr 2015
Posts: 619

PostPosted: Thu Mar 01, 2018 8:28 am    Post subject: Reply with quote

Corroder wrote:
There are no comboBox has created.

Code:
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')


I mean, there are no CEComboBox has created on this CT file :

https://www.dropbox.com/s/tb0877yzlgnks6i/Language4.CT?dl=0

mean while you said :

Quote:
Help for the language option box!
I tried coding with ComboBax and GroupBox.


But, leave it, You've done with your work event seem like 'Sam FV2 Trainer' for languages option. Well done...

_________________
Singapore Sling + Johnnie Walker + Some Peanuts....
Back to top
View user's profile Send private message
Aylin
Expert Cheater
Reputation: 2

Joined: 16 Feb 2017
Posts: 154

PostPosted: Thu Mar 01, 2018 10:42 am    Post subject: Reply with quote

Corroder wrote:


But, leave it, You've done with your work event seem like 'Sam FV2 Trainer' for languages option. Well done...


Thanks Master @Corroder

The code I found with the research, Originally:
Language options showed in the ComboBox.
I scanned the original code and CT,
I did not find any code listing the ComboBox.
So I opened a forum for help.
But I saw that; can be done in different ways.

I shared this on the forum. everyone should benefit. Smile

EDIT: Your help always took me one step forward. Thank you.
I will never forget the masters.

https://www.youtube.com/watch?v=ZC8RhizylLM

_________________
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 Lua Scripting 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