Ir para conteúdo
  • 0

bug SetText


Aberos

Pergunta

galera fiz um modules de distruiçãod e ponto que recebe atraves de sendcancel os valores do modules , so que qunado o setText atribui os valores o numeros fikam meio cortados , alguem poderia me ajudar ^^

 

post-365437-0-56197900-1396188988_thumb.png

 

otui

 

 

MainWindow
id: optionsWindow
text: Habilidades com Armas
anchors.centerIn: parent
margin-top: 119
; size: 340 300
@onEscape: toggle()
&save: true
UIButton
id: shootgun
image-source: /Barra Skills/shootgun.png
size: 40 40
anchors.top: parent.top
anchors.left: parent.left
margin-top: 10
Label
id: shotlabel
text: Shootgun
anchors.top: parent.top
anchors.left: parent.left
margin-top: 10
margin-left: 50
Label
id: Skilld01
text:-
anchors.top: parent.top
anchors.left: parent.left
margin-top: 40
margin-left: 50
Button
id: add01
text: +
size: 15 15
anchors.top: parent.top
anchors.left: parent.left
margin-top: 40
margin-left: 100
UIButton
id: sniper
image-source: /Barra Skills/sniper.png
size: 40 40
anchors.top: parent.top
anchors.left: parent.left
margin-top: 80
Label
id: sniperlabel
text: Sniper
anchors.top: parent.top
anchors.left: parent.left
margin-top: 80
margin-left: 50
Label
id: Skilld02
text:-
anchors.top: parent.top
anchors.left: parent.left
margin-top: 120
margin-left: 50
Button
id: add02
text: +
size: 15 15
anchors.top: parent.top
anchors.left: parent.left
margin-top: 120
margin-left: 100
UIButton
id: assault
image-source: /Barra Skills/assault.png
size: 40 40
anchors.top: parent.top
anchors.left: parent.left
margin-top: 160
Label
id: assaultlabel
text: Assault
anchors.top: parent.top
anchors.left: parent.left
margin-top: 160
margin-left: 50
Label
id: Skilld03
text:-
anchors.top: parent.top
anchors.left: parent.left
margin-top: 190
margin-left: 50
Button
id: add03
text: +
size: 15 15
anchors.top: parent.top
anchors.left: parent.left
margin-top: 190
margin-left: 100
UIButton
id: Pistola
image-source: /Barra Skills/Pistola.png
size: 40 40
anchors.top: parent.top
anchors.right: parent.right
margin-top: 10
margin-right: 80
Label
id: Pistolatlabel
text: Pistola
anchors.top: parent.top
anchors.right: parent.right
margin-top: 10
margin-right: 30
Label
id: Skilld04
text:-
anchors.top: parent.top
anchors.right: parent.right
margin-top: 40
margin-right: 60
Button
id: add04
text: +
size: 15 15
anchors.top: parent.top
anchors.right: parent.right
margin-top: 40
margin-right:-5
UIButton
id: smg
image-source: /Barra Skills/smg.png
size: 40 40
anchors.top: parent.top
anchors.right: parent.right
margin-top: 80
margin-right: 80
Label
id: smglabel
text: SMG
anchors.top: parent.top
anchors.right: parent.right
margin-top: 80
margin-right: 43
Label
id: Skilld05
text:-
anchors.top: parent.top
anchors.right: parent.right
margin-top: 110
margin-right: 60
Button
id: add05
text: +
size: 15 15
anchors.top: parent.top
anchors.right: parent.right
margin-top: 110
margin-right:-5
UIButton
id: strength
image-source: /Barra Skills/strength.png
size: 40 40
anchors.top: parent.top
anchors.right: parent.right
margin-top: 160
margin-right: 80
Label
id: strengthlabel
text: Strength
anchors.top: parent.top
anchors.right: parent.right
margin-top: 160
margin-right: 18
Label
id: Skilld06
text:-
anchors.top: parent.top
anchors.right: parent.right
margin-top: 190
margin-right: 60
Button
id: add06
text: +
size: 15 15
anchors.top: parent.top
anchors.right: parent.right
margin-top: 190
margin-right:-5
Label
id: total
text: Pontos :
anchors.bottom: parent.bottom
anchors.left: parent.left
Label
id: totalNumber
text:-
anchors.bottom: parent.bottom
anchors.left: parent.left
margin-left: 60
Button
id: close
text: close
anchors.bottom: parent.bottom
anchors.right: parent.right
@onClick: skills.toggle()

lua

skills = {}
topButton = nil
skillWindow = nil
function skills.init()
topButton = modules.client_topmenu.addRightGameToggleButton('Botao', 'Barra Skill', '/Barra Skills/botao.png', skills.toggle)
skillWindow = g_ui.displayUI('Barra Skills.otui')
skillWindow:setVisible(false)
g_keyboard.bindKeyDown('Ctrl+A', skills.toggle)
connect(g_game, {
onGameStart = refresh,
onGameEnd = offline
})
connect(g_game, 'onTextMessage', getPoints)
refresh()
end
function skills.terminate()
skillWindow:destroy()
skillWindow = nil
topButton:destroy()
topButton = nil
end
function autoUpdateTalks()
local player = g_game.getLocalPlayer()
if not player then return end
----------
g_game.talk("#getPoints#")
----------
end
function refresh()
local player = g_game.getLocalPlayer()
if not player then return end
autoUpdateTalks()
end
function getPoints(mode, text)
if not g_game.isOnline() then return end
if mode == MessageModes.Failure then
if string.find(text, "#getPoints#") then
local t = string.explode(text, ",")
local level = skillWindow:recursiveGetChildById("totalNumber")
local skill01 = skillWindow:recursiveGetChildById("Skilld01")
local skill02 = skillWindow:recursiveGetChildById("Skilld02")
local skill03 = skillWindow:recursiveGetChildById("Skilld03")
local skill04 = skillWindow:recursiveGetChildById("Skilld04")
local skill05 = skillWindow:recursiveGetChildById("Skilld05")
local skill06 = skillWindow:recursiveGetChildById("Skilld06")
level:setText(tonumber(t[2]))
skill01:setText(tonumber(t[3]))
skill02:setText(tonumber(t[4]))
skill03:setText(tonumber(t[5]))
skill04:setText(tonumber(t[6]))
skill05:setText(tonumber(t[7]))
skill06:setText(tonumber(t[8]))
end
end
end
function skills.toggle()
if g_game.isOnline() then
if skillWindow:isVisible() then
skillWindow:hide()
else
skillWindow:show()
end
end
end
function skills.online()
if not g_game.isOnline() then
skillWindow:hide()
end
end
function skills.offline()
skillWindow:hide()
end

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

×
×
  • Criar Novo...