• Sign up for TFS Icon Competition! The prize includes Otland Premium time and a medal, as well as obviously taking part in TFS history.
  • 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
132
Reaction score
17
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

Ascuas Funkeln

Rakkedo Game
Joined
Apr 14, 2013
Messages
510
Solutions
30
Reaction score
256
Location
Poland
GitHub
AscuasFunkeln
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?
 
OP
sabodden

sabodden

Member
Joined
Sep 27, 2019
Messages
132
Reaction score
17
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:


 

Bakasura

Member
Joined
Jan 20, 2019
Messages
14
Solutions
1
Reaction score
18
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
 
OP
sabodden

sabodden

Member
Joined
Sep 27, 2019
Messages
132
Reaction score
17

Bakasura

Member
Joined
Jan 20, 2019
Messages
14
Solutions
1
Reaction score
18
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
OP
sabodden

sabodden

Member
Joined
Sep 27, 2019
Messages
132
Reaction score
17
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 !
 
Top