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 


How to make a panel click make other panels disappear/appear

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
nukiz
How do I cheat?
Reputation: 0

Joined: 17 Mar 2020
Posts: 8
Location: nuclear plant

PostPosted: Fri Apr 17, 2020 3:40 am    Post subject: How to make a panel click make other panels disappear/appear Reply with quote

So, im making a trainer, and i have no idea how to make a UDF2_CEPanel5Click(sender) function make other panels appear / disappear.

Idk how to make this help appreciated Very Happy

_________________
bad ce user with no experience in coding, other than JavaScript, a little of Assembly and Lua
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Fri Apr 17, 2020 7:04 am    Post subject: Reply with quote

Try this example:

Code:
function sucker()
 if UDF1.CEPanel1.Visible == true then
    UDF1.CEPanel1.Visible = false
    print('Oww...yeah')
 else
   UDF1.CEPanel1.Visible = true
   print('More..yeah..yeah')
 end
end

UDF1.CEPanel2.OnClick = sucker

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Licht_denker47
How do I cheat?
Reputation: 0

Joined: 18 Apr 2020
Posts: 2

PostPosted: Sat Apr 18, 2020 12:38 pm    Post subject: Reply with quote

IF᠎ ᠎ you are doing everything script side ~do:
Code:
function function_name()
    form_Name_to_be_Hidden.hide()
    form_Name_to_be_Shown.show()
    --repeat as needed
end

var_Name = createButton(form_Name)
var_Name.Top/Left/Width/Style = interger --you get the idea
...
var_Name.OnClick = function_name()

IF᠎ ᠎ you are using form designer do:

Object Inspector → Click Button → Events → OnClick → Fill with Function_Name

▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁

For Example:
Code:
...
function hideForms()
    form2.hide()
    form3.show()
end

button1 = createButton(form1)
button1.Caption = "Hide Form2"
button1.Top = 30
button1.Left = 30
button1.Height = 30
button1.Width = 100
button1.OnClick = hideForms() --hideForms no() also works
or:
Code:
...
button1 = createButton(form1)
button1.Caption = "Hide Form2"
button1.Top = 30
button1.Left = 30
button1.Height = 30
button1.Width = 100
button1.OnClick = form2.hide()

It is .hide() / .show() that hides / shows form_name
form1 = createForm() creates a form.

You can refer to form1 via form1.property = value᠎᠎ ᠎ OR᠎᠎ ᠎ button1 = createButton(form1)
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1549

PostPosted: Sat Apr 18, 2020 2:33 pm    Post subject: Reply with quote

...

Code:
if form2 then form2.Destroy() form2=nil end
local form1 = createForm()
form1.Position=poDesktopCenter
form1.visible=false

local form2 = createForm()
form2.Position=poDesktopCenter

local b1=createButton(form2)
b1.Left=120 b1.Top=60 b1.caption="visibleForm1"

b1.OnClick=function()
if form1.visible==false then
form1.visible=true
else
form1.visible=false
end
end

local b2=createButton(form1)
b2.Left=120 b2.Top=60 b2.caption="Form1"

_________________
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: 1668

PostPosted: Sun Apr 19, 2020 12:51 am    Post subject: Reply with quote

Why make a simple thing to be complicated?.

I see in original topic he said 'UDF2_CEPanel5Click(sender) function', then that mean he already know how to make a form within form designer or Lua scripting and put events handler on it.

I think my example is fairly enough, if what I think is true.

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
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