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

Condition Panel like in 7.4 (OTClient V8)

Blasphemy

Well-Known Member
Joined
Jan 5, 2012
Messages
387
Reaction score
67
Hi everyone, I'm working on the old client condition panel which looks like in this thread:


Now I've got this, but I don't know the specific code to center the widgets into the soulCap box

Screenshot_1.png Screenshot_2.png
If someone is interested in this feature, please enlighten me in which code I should use to get this working.
Im going to share all of this here if someone like it and want it to use :)!

this is my inventory.otui code:

Code:
    Panel
      id: conditionPanel
      icon-source: /images/game/slots/soulcap
      layout:
        type: horizontalBox
        flow: false
      height: 13
      padding: 2
      anchors.top: slot9.bottom
      anchors.left: slot6.left
      anchors.right: slot8.right
      margin-top: 7
      margin-right: 37
After doing some modifications, I get this:

Screenshot_3.png
Code:
    Panel
      id: conditionPanel
      icon-source: /images/game/slots/soulcap
      layout:
        type: grid
        cell-size: 9 9
        flow: true
      height: 13
      padding: 2
      anchors.top: slot9.bottom
      anchors.left: slot6.left
      anchors.right: slot8.right
      margin-top: 7
      margin-right: 37

is there anyway to center it?


Screenshot_4.png
there are more than 6 conditions now but the max the box can show are 6.
 
Last edited:
Well I'm getting something, but I cant get it perfectly haha

Screenshot_7.png

code actually:

Code:
    Panel
      id: conditionPanel
      icon-source: /images/game/slots/soulcap
      layout:
        type: grid
        cell-size: 9 8
        cell-spacing: 0
        num-columns: 3
        flow: false
      padding: 0
      anchors.top: slot9.bottom
      anchors.horizontalCenter: slot9.horizontalCenter
      text-align: center
      margin-top: 4
      text-offset: 0 3
      width: 36
      height: 20

What do i'm missing?
 
What do i'm missing?
In my code first I collected all conditions and then made switch based on total count. There is max 6, so you have to break the loop if there is more conditions on the player. In each case (1, 2, 3, 4, 5 and 6 conditions) I'm setting each condition position by earlier defined offset, so probably you would neet to do the same in LUA (positioning) and not in OTUI.
 
In my code first I collected all conditions and then made switch based on total count. There is max 6, so you have to break the loop if there is more conditions on the player. In each case (1, 2, 3, 4, 5 and 6 conditions) I'm setting each condition position by earlier defined offset, so probably you would neet to do the same in LUA (positioning) and not in OTUI.
I see.. well I cant do nothing with that.. :C thanks
 
What positions, damn..
If you use good defined grid on panel in .otui that will should do the thing automatically, just bind child of this grid (condition) to the "previous one" and check how many childs that panel have (conditions), if have less or equal to 3 then anchor it horizontal and vertical to the "frame" around this panel (container where positions are displayed) - that will do the trick to become "centered" else anchor it to topLeft and to bottomRight (not centered).
 
What positions, damn..
If you use good defined grid on panel in .otui that will should do the thing automatically, just bind child of this grid (condition) to the "previous one" and check how many childs that panel have (conditions), if have less or equal to 3 then anchor it horizontal and vertical to the "frame" around this panel (container where positions are displayed) - that will do the trick to become "centered" else anchor it to topLeft and to bottomRight (not centered).
I see the point. The case is I don't know all the codes which I can use in .otui files. Is there somewhere when I can read those codes, where do I can get them from? (maybe from a source file, idk)
thanks
 
I see the point. The case is I don't know all the codes which I can use in .otui files. Is there somewhere when I can read those codes, where do I can get them from? (maybe from a source file, idk)
thanks
did you manage to achieve this?
 
did you manage to achieve this?
no i couldnt :(... im not expert on it, i was trying to read through this forum for the solution, but with no luck
Post automatically merged:

did you manage to achieve this?
but here is the solution tho

 
Back
Top