Ir para conteúdo

Featured Replies

Postado

Olá pessokal tenho um scrip do shop ja feita mas n sei como adicionar novos itens se alguem puder ajudar:

shopWindow = nil
shopButton = nil

function init()
   connect(g_game, {
    onGameStart = refresh,
    onGameEnd = offline
  })
  
  shopButton = modules.client_topmenu.addRightGameToggleButton('shopButton', tr('Shinobi World Shop') .. ' (Ctrl+Y)', '/images/topbuttons/skills', toggle)
  shopButton:setOn(true)


  g_keyboard.bindKeyDown('Ctrl+E', toggle) 
  shopWindow = g_ui.loadUI('shop', modules.game_interface.getMapPanel())
  shopWindow:disableResize()
  refresh()
  shopWindow:setup()
  
  shopWindow:close()
  shopButton:setOn(false)

end

function terminate() 
   disconnect(g_game, {
    onGameStart = refresh,
    onGameEnd = offline
  })
  
  g_keyboard.unbindKeyDown('Ctrl+Y')
  shopWindow:destroy()
  shopButton:destroy()
end

function refresh()
  local player = g_game.getLocalPlayer()
  if not player then return end
end

function getIndex(table, value)
   for _,v in pairs(table) do
      if(v == value)then
         return _
      end
   end
return false
end

function toggle()
  if shopButton:isOn() then
	refresh()
    shopWindow:close()
    shopButton:setOn(false)
  else
    shopWindow:open()
    refresh()    
    shopButton:setOn(true)
  end
end

function onMiniWindowClose()
  shopButton:setOn(false)
end


function requestInfo()
    local player = g_game.getLocalPlayer()
    if not player then return end
    local protocolGame = g_game.getProtocolGame()
    if protocolGame then
    protocolGame:sendExtendedOpcode(55, 1)
    end
end                            

 

Editado por vitinho2300 (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo