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

set Image Source

Helliot1

Owner of Empire Online
Joined
Jul 26, 2017
Messages
315
Solutions
1
Reaction score
57
Hello,

I have a spells bar in my Otclient, and I need make some ajusts.

seTRuwm.png


This panel I created in game_interface.

I wanted to create a function in which, when in the game_hotckeys module, for example, in the F1 key, the name of the spell "inferno" was written. In the game_interface module, the panel would appear, the icon "/images/inferno"

oLd5LQ9.png


But I tried different functions and I could not, like this one:

gameinterface.lua
Lua:
function hotkeys()
  if modules.game_hotkeys:keyCombo('F1') == ('inferno') then
  spellsF1 = gameRootPanel:getChildById('spellsF1')
  spellsF1:setImageSource('/images/inferno')
end

That's the code that's on my image button above

gameinterface.otui
CSS:
  Spells
    id: spellsF1
    size: 34 34
    !text: tr('F1')
    anchors.top: gameModPanel.top
    anchors.left: gameModPanel.left
    @onClick: modules.game_hotkeys.doKeyCombo('F1')
 
Last edited:
Back
Top