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

[SOLVED]Loading UI to another

Dricky

New Member
Joined
Sep 14, 2013
Messages
11
Reaction score
0
Hi,

I'm looking to create the health window into my inventory window by loading it

Code:
healthInfoWindow = g_ui.createUI('healthinfo', module.game_inventorysheet.gethealthWindow())

this is my otui in the "inventorysheet" folder

Code:
MiniWindow
  id: healthWindow
  width: 250
  height: 30
  anchors.right: parent.right
  anchors.bottom: parent.bottom
  draggable: false

is this the correct idea? can someone point me in the right direction on how to achieve this? my inventory window is independent of the gameRightPanel

thanks alot
 
Just add 2 bars to the inventory.otui just like in healthinfo and copy the logic that updates these bars.
 
thanks Summ, I tried this with skills also, but I just keep getting "attempt to index local 'skill' (a nil value)"
I think it's related to my refresh function...

Code:
function refresh()

  local player = g_game.getLocalPlayer()
  if not player then return end
  onExperienceChange(player, player:getExperience())
  onLevelChange(player, player:getLevel())


  local player = g_game.getLocalPlayer()
  for i=InventorySlotFirst,InventorySlotLast do
  if g_game.isOnline() then
  onInventoryChange(player, i, player:getInventoryItem(i))
  else
  onInventoryChange(player, i, nil)
  end
   update()
  end
  end

and

Code:
function setSkillValue(id, value)
  local skill = inventoryWindow:recursiveGetChildById(id)
  local widget = skill:getChildById('value')                      // PROBLEM LINE
  widget:setText(value)
end


anyone have an idea?

Thanks

EDIT: problem was solved. I wasn't calling the proper values -.- live and learn I guess.
 
Last edited:

Similar threads

Back
Top