• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient Helps with OTC UI

sabodden

Member
Joined
Sep 27, 2019
Messages
138
Reaction score
18
I need 2 helps to create UIs on OTC on my starting mod: sabodden/elfotc (https://github.com/sabodden/elfotc)

1-
How to when player press X button

Call the function OnOff()
just like shift+f12

2-
I trying to when user clicks in 'Healing' button open a new secondary window...
How to do?

I tried this:
But it not work... What do i doing wrong?
 
Last edited:
Solution
instead of keep bumping read the already existing otui files and code to see how they do it.
 
I need 2 helps to create UIs on OTC on my starting mod: sabodden/elfotc (https://github.com/sabodden/elfotc)

1-
How to when player press X button

Call the function OnOff()
just like shift+f12

2-
I trying to when user clicks in 'Healing' button open a new secondary window...
How to do?

I tried this:
But it not work... What do i doing wrong?
What u wanna do? By press X, do "OnOff" u mean something in module otui hide or show?
 
instead of keep bumping read the already existing otui files and code to see how they do it.
what are u mean? what is it?
send me i could try


What u wanna do? By press X, do "OnOff" u mean something in module otui hide or show?

Yes!
I think this is it:


 
Find the X button in OTUI files of the module and add
Lua:
@onClick: onoff()
alternatively you can do this in your init/create function of the module
Lua:
someXbuttonVariable.onClick = onoff
 
Your window is defined as miniwindow so you should find the miniwindow style in data/styles (in original OTC)
edubart/otclient (https://github.com/edubart/otclient/blob/872abf05f49180f08436ea9248220319a2cbe680/data/styles/30-miniwindow.otui#L30)

In this case, when you have your style defined in data/styles and you don't want to edit it globally you should define the onClick action in init/create function. In original OTC it would be:

Lua:
mainWindow:getChildById('closeButton').onClick = onoff
 
Solution
Your window is defined as miniwindow so you should find the miniwindow style in data/styles (in original OTC)
edubart/otclient (https://github.com/edubart/otclient/blob/872abf05f49180f08436ea9248220319a2cbe680/data/styles/30-miniwindow.otui#L30)

In this case, when you have your style defined in data/styles and you don't want to edit it globally you should define the onClick action in init/create function. In original OTC it would be:

Lua:
mainWindow:getChildById('closeButton').onClick = onoff

TYY !
 
Back
Top