They look to complicated and each one of them are different and have like million of code parts linked to each line. Like game_shop it needs to add code in onStoreInit like (createShop()) when i dont even have callback like that, so wtf.Why don't you just look at default modules that are adding these icons and use that code?
They look to complicated and each one of them are different and have like million of code parts linked to each line. Like game_shop it needs to add code in onStoreInit like (createShop()) when i dont even have callback like that, so wtf.
skillsButton = modules.client_topmenu.addRightGameToggleButton('skillsButton', tr('Skills'), '/images/topbuttons/skills', toggle, false, 1)
skillsButton:setOn(true)
I dont see how this should even work, it just creates a buttom with zero functionalityAs far as i have investigated by the suggestion of the other user, it should be something like this:
Lua:skillsButton = modules.client_topmenu.addRightGameToggleButton('skillsButton', tr('Skills'), '/images/topbuttons/skills', toggle, false, 1) skillsButton:setOn(true)
There are another functions using this registrered variable on skills.lua at modules
Toggle is the callback that you should change into the callback of your window, this is the documentation for the function that i found lurking on the files:I dont see how this should even work, it just creates a buttom with zero functionality
function addRightGameToggleButton(id, description, icon, callback, front, index)
so if i have this function or im not even sure if its right function to useToggle is the callback that you should change into the callback of your window, this is the documentation for the function that i found lurking on the files:
Lua:function addRightGameToggleButton(id, description, icon, callback, front, index)
function create()
if window then
return
end
window = g_ui.displayUI("crafting")
window:hide()
categories = window:getChildById("categories")
craftPanel = window:getChildById("craftPanel")
itemsList = window:getChildById("itemsList")
local vocDrop = window:recursiveGetChildById("vocations")
if vocDrop:getOptionsCount() == 0 then
vocDrop.onOptionChange = onVocationChange
for i = 1, #vocations do
vocDrop:addOption(vocations[i], i)
end
vocDrop:setCurrentIndex(1)
end
vocDrop.menuHeight = 125
vocDrop.menuScroll = false
local protocolGame = g_game.getProtocolGame()
if protocolGame then
protocolGame:sendExtendedOpcode(CODE, json.encode({action = "fetch"}))
end
end
more ideas?
This code is from my crafting module. Why don't you DM me on discord?so if i have this function or im not even sure if its right function to use
Lua:function create() if window then return end window = g_ui.displayUI("crafting") window:hide() categories = window:getChildById("categories") craftPanel = window:getChildById("craftPanel") itemsList = window:getChildById("itemsList") local vocDrop = window:recursiveGetChildById("vocations") if vocDrop:getOptionsCount() == 0 then vocDrop.onOptionChange = onVocationChange for i = 1, #vocations do vocDrop:addOption(vocations[i], i) end vocDrop:setCurrentIndex(1) end vocDrop.menuHeight = 125 vocDrop.menuScroll = false local protocolGame = g_game.getProtocolGame() if protocolGame then protocolGame:sendExtendedOpcode(CODE, json.encode({action = "fetch"})) end end
it should be
skillsButton = modules.client_topmenu.addRightGameToggleButton('skillsButton', tr('Skills'), '/images/topbuttons/skills', create, false, 1)
skillsButton:setOn(true)
but its false because i tried like this, it creates a button but nothing happens it doesnt call the function
dont want too disturb you, thats why.This code is from my crafting module. Why don't you DM me on discord?
You can always DM me. Adding this button is 30s work.dont want too disturb you, thats why.
Sent you inviteYou can always DM me. Adding this button is 30s work.