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 


[Was Solved]How to Enable Cross-Function?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1247

PostPosted: Sat Mar 24, 2018 4:25 pm    Post subject: [Was Solved]How to Enable Cross-Function? Reply with quote

There are two separate Language selection GroupBox. (UDF1.Language and UDF2.Language0)
One at the opening, the other at the trainer.
The relevant scenarios are given below.
The first form is also the activated language pack,
How does the Language Function in the second Form become effective?

The first form
UDF2.Language0:


Code:
function Language0Change(sender)
Lang0Client = component_findComponentByName(UDF2,'Language0')
Lang0 = getProperty(Lang0Client,'ItemIndex')
if Lang0 == '0' then
Turkey1()
end
if Lang0 == '1' then
English1()
end
if Lang0 == '2' then
Germany1()
end
if Lang0 == '3' then
France1()
end
if Lang0 == '4' then
Espanol1()
end
end

function English1()
Lang0Client = component_findComponentByName(UDF2,'Language0')
Lang0 = getProperty(Lang0Client,'ItemIndex')
Lang0 = '1'
control_setCaption(UDF2_CELabel200, "Bla..bla.")
control_setCaption(UDF2_CELabel201, "Bla..bla.")
control_setCaption(UDF2_CELabel202, "Bla..bla.")
control_setCaption(UDF2_CELabel203, "Bla..bla.")
control_setCaption(UDF2_CELabel204, "Bla..bla.")
-- UDF1.Language.Lang == '1' -- how active?
end
Rolling Eyes Rolling Eyes

and UDF1.Language:


Code:
function LanguageChange(sender)
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
if Lang == '0' then
Turkey()
end
if Lang == '1' then
English()
end
if Lang == '2' then
Germany()
end
if Lang == '3' then
France()
end
if Lang == '4' then
Espanol()
end
end

function English()
LangClient = component_findComponentByName(UDF1,'Language')
Lang = getProperty(LangClient,'ItemIndex')
Lang = '1'
control_setCaption(UDF1_CEButton6, "Bla..bla..")
control_setCaption(UDF1_CEButton7, "Bla..bla.")
control_setCaption(UDF1_CEButton8, "Bla..bla.")
control_setCaption(UDF1_CEButton9, "Bla..bla.")
control_setCaption(UDF1_CEButton10, "Bla..bla.")
control_setCaption(UDF1_CEButton11, "Bla..bla.")
control_setCaption(UDF1_CEButton12, "Bla..bla.")
end



Thank you in advance for your help.

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past


Last edited by AylinCE on Mon Mar 26, 2018 10:57 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1247

PostPosted: Sat Mar 24, 2018 9:38 pm    Post subject: Reply with quote

Thanks for the example.
But this was more complex. Smile

This language selection: must be active on all buttons,
It should also change the whole label and ShowMessage language. Wink


I installed a simple CT.
Please check.
What I want to do is; Language activated in UDF2,
UDF1 get active in the same language.


https://www.dropbox.com/s/49jd60olk8ijaqs/LanguageCrossFunction.CT?dl=0

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
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 Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Mon Mar 26, 2018 8:12 am    Post subject: Reply with quote

I have re-check again your form both UDF1 and UDF2, then I found these :

1. As long as I try to handle what you wish as on your posts then I feel my self is stupid, because after re-check, you are use "GROUPBOX" not "COMBOBOX".

2. Then a GROUPBOX doesn't have ITEM INDEX. So your code :

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


is USELESS, because 'Lang' as a Item Index will give result = NIL, because both 'Language0' and 'Language1' are GROUPBOX's which doesn't have ITEM INDEX

3. Your CEButton(s) 1,2,3, etc seem work because you assigned a function on click events to them. i.e : UDF2.CEButton11 work because you assign function English() to it, etc and It work not by trigger LanguageChange(sender).

So, in short words, your LanguageChange(sender) doesn't have effect to all properties on your form.
You need try other way if you insist using GROUPBOX instead a COMBOBOX.

Cheers

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1247

PostPosted: Mon Mar 26, 2018 10:49 am    Post subject: Reply with quote

Corroder wrote:
I have re-check again your form both UDF1 and UDF2, then I found these :

1. As long as I try to handle what you wish as on your posts then I feel my self is stupid, because after re-check, you are use "GROUPBOX" not "COMBOBOX".

2. Then a GROUPBOX doesn't have ITEM INDEX. So your code :
Cheers

Smile Smile

But the ComboBox is very classic.
In GroupBox, I opted to activate CEImage with visuals. Smile
You found the problem and the issue was resolved, thank you.
I owe you a new REP points.
  Here's the code:
If no language is selected, with the default language (English)
All Buttons and showMessage are active. Wink

Code:

form_show(UDF2)
English()

function LanguageChange(sender)
--LangClient = component_findComponentByName(UDF2,'Language0')
--Lang = getProperty(LangClient,'ItemIndex')
--LangClient = component_findComponentByName(UDF1,'Language1')
--Lang = getProperty(LangClient,'ItemIndex')
--setProperty(Lang , "ItemIndex", Lang0)
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,'Language1')
--Lang = getProperty(LangClient,'ItemIndex')
Lang = '0'
control_setCaption(UDF1_CEButton1, "English")
control_setCaption(UDF1_CEButton2, "English")
control_setCaption(UDF1_CEButton3, "English")
control_setCaption(UDF1_CEButton4, "English")
control_setCaption(UDF1_CEButton6, "English")
control_setCaption(UDF1_CEButton7, "English")
control_setCaption(UDF2_CEButton11, "English")
control_setCaption(UDF2_CEButton12, "English")
control_setCaption(UDF2_CEButton13, "English")
control_setCaption(UDF2_CEButton14, "English")
end

function Portuguese()
--LangClient = component_findComponentByName(UDF1,'Language1')
--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")
control_setCaption(UDF1_CEButton6, "Portuguese")
control_setCaption(UDF1_CEButton7, "Portuguese")
control_setCaption(UDF2_CEButton11, "Portuguese")
control_setCaption(UDF2_CEButton12, "Portuguese")
control_setCaption(UDF2_CEButton13, "Portuguese")
control_setCaption(UDF2_CEButton14, "Portuguese")
end

--- etc ...


Thanks Corroder

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
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 Visit poster's website 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