|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1253
|
Posted: Sat Mar 24, 2018 4:25 pm Post subject: [Was Solved]How to Enable Cross-Function? |
|
|
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
|
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.
_________________
Last edited by AylinCE on Mon Mar 26, 2018 10:57 am; edited 1 time in total |
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1253
|
Posted: Sat Mar 24, 2018 9:38 pm Post subject: |
|
|
Thanks for the example.
But this was more complex.
This language selection: must be active on all buttons,
It should also change the whole label and ShowMessage language.
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
_________________
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Mar 26, 2018 8:12 am Post subject: |
|
|
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 |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1253
|
Posted: Mon Mar 26, 2018 10:49 am Post subject: |
|
|
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 |
But the ComboBox is very classic.
In GroupBox, I opted to activate CEImage with visuals.
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.
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
_________________
|
|
Back to top |
|
|
|
|
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
|
|