• 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!

OTC OTUI AND TOPMENU QUESTION (help me)

Swiftxd

Member
Joined
Apr 5, 2014
Messages
85
Reaction score
5
Hello, im learning about OTC and i have a few questions.

FIRST: How can i place a icon in the middle of otclient TOPMENU ? instead of using just "modules.client_topmenu.addLeftButton".
xnbuaq.jpg

how is on the picture.

SECOND: i created this mod OTUI, and i want know how to add a text that can be selected on the text list.
MainWindow
id: QueueWindow
height: 350
width: 450
padding: 0
!text: tr("Queue")
&save: true
@onEscape: onoff()

Label
id: Label1
!text: tr('Arenas')
anchors.top: prev.top
anchors.left: parent.left
anchors.bottom: parent.bottom
margin-left: 200
margin-bottom: 300

TextList
id: indexList
anchors.left: parent.left
anchors.top: Label1.top
margin-top: 20
margin-left: 25
focusable: false
size: 400 60
vertical-scrollbar: indexScroll1

VerticalScrollBar
id: indexScroll1
anchors.top: prev.top
anchors.right: prev.right
anchors.bottom: prev.bottom
eb67wm.jpg

i want add a selecionable text in the box ( TextList ), how can i do this ?


THIRD: How can i create a Bar for SOUL ? like health or manabar, i tried send extended opcodes, but nothing works, if someone have a tutorial , can send me a code or help me create one i will glad.

thats all folks, very thanks, kisses
 
First:
You can add special place between left side and right side. And put the "thing" there.

Second:
I don't know what you mean. If you want to select all text, then you need to change the textlist into other list (don't remember which one). If you want to have list here like on quests, then you need to add there labels.

Third:
You can use it like healthbar or manabar.
Code:
function onSoulChange(localPlayer, soul)
  local maxSoul = 255
  soulBar:setText(soul .. ' / ' .. maxSoul)
  soulBar:setValue(soul, 0, maxSoul)
end
I think that should work. Didn't tested.
 
Hello bro, thanks for your reply.

1# yeah, i get it ,thanks, now its working.

2# i have this window, its a battleground window, i wand display a text in the green square, when u select one, change the talkaction that display pressing the "join" button. Get it ?
10h54et.jpg
i want display a text like this:
2qwesnt.jpg

3#i made some changes in the healthinfo.lua and healthinfo.otui ,but im getting this error now:

/game_healthinfo/healthinfo.lua:124: attempt to index global 'soulBar' (a nil value)
stack traceback:
[C]: ?
/game_healthinfo/healthinfo.lua:124: in function </game_healthinfo/healthinfo.lua:122>
 
At the beggining you need to add:
Code:
soulBar = nil
Like other bars there.
In function init:
In connect:
Code:
onSoulChange = onSoulChange
Code:
soulBar = healthInfoWindow:recursiveGetChildById('soulBar')

In function terminate:
Code:
onSoulChange = onSoulChange

In function refresh:
Code:
onSoulChange(player, player:getSoul())

And then you need to add the bar in otui file.

The thing with square is little bit tricky ;) You can just add labels inside in otui with corresponding id's and then, make a function when id1(2, 3, 4, 5) pressed then when you press "Join" it will add you to the 1st(2nd, 3rd, 4th, 5th) arena.
 
hello bro, thx for your help, i get the 2# but still a question.
i dont want the local maxSoul = 255, because i use scripts that incranse the player Maxsoul, 100 to 110 for example.
i want check the player maxsoul . then i made this:
rwjc4h.jpg


but in the screen appears it:
2j51942.jpg


and 3# i know the design, but i dont have ideia how to create it hahaha, but thx, i will study.
 
There is no maxSoul thing inside onSoulChange - you can get only current soul.
 
yeah then i made an Extopcode, doSendPlayerExtendedOpcode(cid,55, getPlayerSoul(cid))

and configurates in the healthinfo.lua ,but still dsnt appears the maxsoul
 
Last edited:
Because sending getPlayerSoul is sending the current ammount of soul. The maxSoul thing is not available, there is no such thing ;)
 
Back
Top