• 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 Need help, moving FreeCapacity down.

Joined
Oct 12, 2020
Messages
45
Solutions
1
Reaction score
5
Location
Detroit, MI
The problem is I'd like some space in-between my cap: text and the free cap of the player.

CapProblem.png

Inventory.lua
Lua:
function onFreeCapacityChange(player, freeCapacity)
    if not freeCapacity then
        return
    end
    if freeCapacity > 99 then
        freeCapacity = math.floor(freeCapacity * 10) / 10
    end
    if freeCapacity > 999 then
        freeCapacity = math.floor(freeCapacity)
    end
    if freeCapacity > 99999 then
        freeCapacity = math.min(9999, math.floor(freeCapacity / 1000)) .. "k"
    end
    capLabel:setText(tr(tostring(math.floor(freeCapacity * 100))))
end

Skills.lua
Lua:
function onFreeCapacityChange(localPlayer, freeCapacity)
    setSkillValue("capacity", freeCapacity * 100)
    checkAlert("capacity", freeCapacity, localPlayer:getTotalCapacity(), 20)
end

function onTotalCapacityChange(localPlayer, totalCapacity)
    checkAlert("capacity", localPlayer:getFreeCapacity(), totalCapacity, 20)
end

Any help would be nice, Thank you!
 
Last edited:
mess around with the margin-top maybe:
Thanks, that's for the CapLabel though mine doesn't move, its on the image. soulcap.png

Changing the values has no effect.
 
Last edited:
@psilocybusmaxim
Post your OTUI. In case of default 'cap' OTUI I would try with 'margin-top'.
Lua:
ExperienceBar < ProgressBar
  id: experienceBar
  background-color: #B6E866
  anchors.top: prev.bottom
  anchors.left: parent.left
  anchors.right: parent.right
  margin: 1
  margin-top: 3

SoulLabel < GameLabel
  id: soulLabel
  text-align: right
  color: white
  font: verdana-11px-rounded
  anchors.bottom: parent.bottom
  anchors.right: parent.right
  anchors.left: parent.horizontalCenter
  margin-top: 5
  margin-right: 3
  on: true

  $!on:
    visible: false
    margin-top: 0
    height: 0

CapLabel < GameLabel
  id: capLabel
  color: white
  font: verdana-11px-rounded
  anchors.bottom: parent.bottom
  anchors.left: parent.left
  anchors.left: parent.horizontalCenter
  margin-top: 5
  margin-left: 3
  on: true

  $!on:
    visible: false
    margin-top: 0
    height: 0

ConditionWidget < UIWidget
  size: 10 10

  $!first:
    margin-left: 2
     
HealthOverlay < UIWidget
  id: healthOverlay
  anchors.fill: parent
  phantom: true

  HealthBar
    id: topHealthBar
    anchors.top: parent.top
    anchors.left: parent.left
    anchors.right: parent.horizontalCenter
    phantom: true

  ManaBar
    id: topManaBar
    anchors.top: parent.top
    anchors.right: parent.right
    anchors.left: parent.horizontalCenter
    phantom: true
   
  UIProgressBar
    id: healthCircle
    anchors.horizontalCenter: parent.horizontalCenter
    anchors.verticalCenter: parent.verticalCenter
    image-source: /images/game/circle/left_empty
    margin-right: 169
    margin-bottom: 16
    opacity: 0.5
    phantom: true

  UIProgressBar
    id: healthCircleFront
    anchors.horizontalCenter: parent.horizontalCenter
    anchors.verticalCenter: parent.verticalCenter
    image-source: /images/game/circle/left_full
    margin-right: 169
    margin-bottom: 16
    opacity: 0.5
    phantom: true

  UIProgressBar
    id: manaCircle
    anchors.horizontalCenter: parent.horizontalCenter
    anchors.verticalCenter: parent.verticalCenter
    image-source: /images/game/circle/right_empty  
    margin-left: 130
    margin-bottom: 16
    opacity: 0.5
    phantom: true

  UIProgressBar
    id: manaCircleFront
    anchors.horizontalCenter: parent.horizontalCenter
    anchors.verticalCenter: parent.verticalCenter
    image-source: /images/game/circle/right_full
    margin-left: 130
    margin-bottom: 16  
    opacity: 0.4
    image-color: #0000FFFF
    phantom: true

HealthInfoWindow < HeadlessMiniWindow
  icon:
  text:
  height: 100
  &forceOpen: true
  icon: /images/topbuttons/healthinfo
  !text: tr('Health Info')

  MiniWindowContents
    margin-top: 2
   
    HealthBar
      id: healthBar
      anchors.top: parent.top
      anchors.left: parent.left
      anchors.right: parent.right
      margin: 2
      margin-top: 0
      phantom: true
     
    ManaBar
      id: manaBar
      anchors.top: prev.bottom
      anchors.left: parent.left
      anchors.right: parent.right
      margin: 2
      margin-bottom: 0
      phantom: true
     
    ExperienceBar
    Panel
      id: conditionPanel
      layout:
        type: horizontalBox
      height: 15
      margin-top: 6
      padding: 0
      anchors.top: prev.bottom
      anchors.left: parent.left
      anchors.right: parent.right
      border-width: 1
      border-color: #00000077
      background-color: #ffffff11
    SoulLabel
    CapLabel

Try with text-offset.

Where should I put it??

I tried
Lua:
CapLabel < GameLabel
  id: capLabel
  color: white
  font: verdana-11px-rounded
  anchors.bottom: parent.bottom
  anchors.left: parent.left
  anchors.left: parent.horizontalCenter
  margin-top: 5
  margin-left: 3
  on: true
  text-offset: 1 1
 
Last edited:
Back
Top