Ir para conteúdo
  • 0

Images de pokebolas no lugar da mana


Darckx13

Pergunta

Eae pessoal

 

estou tendo um trampo pra fazer isso se alguem puder me ajudar vou postar os codigos base que pensei em usar ai vcs citam oque pode estar errado ou um jeito mais facil de fazer

 

tipo se o player tiver 1 pokebola na bp o script reconhece como MANA == 1 e coloca uma imagem na mana bar e assim por diante

 

Variaveis

balls = {}
balls[0] = { tooltip = tr('you no have pokemons'), path = 'img/mball', id = 'mb0' }
balls[2] = { tooltip = tr('you have 1 pokemons'), path = 'img/mball1', id = 'mb1' }
balls[3] = { tooltip = tr('you have 2 pokemons'), path = 'img/mball2', id = 'mb2' }
balls[4] = { tooltip = tr('you have 3 pokemons'), path = 'img/mball3', id = 'mb3' }
balls[5] = { tooltip = tr('you have 4 pokemons'), path = 'img/mball4', id = 'mb4' }
balls[6] = { tooltip = tr('you have 5 pokemons'), path = 'img/mball5', id = 'mb5' }
balls[7] = { tooltip = tr('you have 6 pokemons'), path = 'img/mball6', id = 'mb6' }

 

função de carregar as images

--Função de carregar pokeballs
function toggleBalls(bitChanged)
 local content = inventoryWindow:recursiveGetChildById('manaBar')
 local balls = content:getChildById(Icons[bitChanged].id)
 if balls then
   balls:destroy()
 else
   balls = loadBalls(bitChanged)
   balls:setParent(content)
 end
end

function loadBalls(bitChanged)
local balls = g_ui.createWidget('ManaBar', content)
 balls:setId(balls[bitChanged].id)
 balls:setImageSource(balls[bitChanged].path)
 balls:setTooltip(balls[bitChanged].tooltip)
 return balls
end
--

 

eu pensei em usar ifs tipo

 

IF MANA == 1 ENTÃO

COLOCA A IMA E ASSIM POR DIANTE ATE 6 MAS N CONSEGUI

 

alguem me da uma Lux ai plz =p

post-362372-0-38714500-1368921020.png

post-362372-0-57297100-1368921025.png

Link para o comentário
https://xtibia.com/forum/topic/214617-images-de-pokebolas-no-lugar-da-mana/
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

×
×
  • Criar Novo...