Ir para conteúdo
  • 0

[ Pedido ] Colocar Para Aparecer Outfit do Char no Character list


Developer Berg

Pergunta

Olá Galera, estou editando meu character list do meu otc, e queria pedir a vcs para me ajudar a editar, é o seguinte, queria colocar para aparecer a sprite da outfit que o personagem ta usando no character list, eu conseguir colocar, mais está aparecendo sprites aleatorias ao em vez de aparecer a sprite da outfit que o char ta usando, vou deixar print de como está aparecendo, e vou deixar a script para vcs modificar para mim rs ^^

 

Script

 

 

 

CharacterList = { }
LESELECTED = 1;
-- private variables
local charactersWindow
local loadBox
local characterList
local errorBox
local waitingWindow
local updateWaitEvent
local resendWaitEvent

-- private functions
local function tryLogin(charInfo, tries)
  tries = tries or 1

  if tries > 50 then
    return
  end

  if g_game.isOnline() then
    if tries == 1 then
      g_game.safeLogout()
    end
    scheduleEvent(function() tryLogin(charInfo, tries+1) end, 100)
    return
  end

  CharacterList.hide()

  g_game.loginWorld(G.account, G.password, charInfo.worldName, charInfo.worldHost, charInfo.worldPort, charInfo.characterName)

  loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to game server...'))
  connect(loadBox, { onCancel = function()
                                  loadBox = nil
                                  g_game.cancelLogin()
                                  CharacterList.show()
                                end })

  -- save last used character
  g_settings.set('last-used-character', charInfo.characterName)
  g_settings.set('last-used-world', charInfo.worldName)
end

local function updateWait(timeStart, timeEnd)
  if waitingWindow then
    local time = g_clock.seconds()
    if time <= timeEnd then
      local percent = ((time - timeStart) / (timeEnd - timeStart)) * 100
      local timeStr = string.format("%.0f", timeEnd - time)

      local progressBar = waitingWindow:getChildById('progressBar')
      progressBar:setPercent(percent)

      local label = waitingWindow:getChildById('timeLabel')
      label:setText(tr('Trying to reconnect in %s seconds.', timeStr))

      updateWaitEvent = scheduleEvent(function() updateWait(timeStart, timeEnd) end, 1000 * progressBar:getPercentPixels() / 100 * (timeEnd - timeStart))
      return true
    end
  end

  if updateWaitEvent then
    updateWaitEvent:cancel()
    updateWaitEvent = nil
  end
end

local function resendWait()
  if waitingWindow then
    waitingWindow:destroy()
    waitingWindow = nil

    if updateWaitEvent then
      updateWaitEvent:cancel()
      updateWaitEvent = nil
    end

    if charactersWindow then
      local selected = characterList:getFocusedChild()
      if selected then
        local charInfo = { worldHost = selected.worldHost,
                           worldPort = selected.worldPort,
                           worldName = selected.worldName,
                           characterName = selected.characterName }
        tryLogin(charInfo)
      end
    end
  end
end

local function onLoginWait(message, time)
  CharacterList.destroyLoadBox()

  waitingWindow = g_ui.displayUI('waitinglist')

  local label = waitingWindow:getChildById('infoLabel')
  label:setText(message)

  updateWaitEvent = scheduleEvent(function() updateWait(g_clock.seconds(), g_clock.seconds() + time) end, 0)
  resendWaitEvent = scheduleEvent(resendWait, time * 1000)
end

function onGameLoginError(message)
  CharacterList.destroyLoadBox()
  errorBox = displayErrorBox(tr("Login Error"), message)
  errorBox.onOk = function()
    errorBox = nil
    CharacterList.showAgain()
  end
end

function onGameConnectionError(message, code)
  CharacterList.destroyLoadBox()
  local text = translateNetworkError(code, g_game.getProtocolGame() and g_game.getProtocolGame():isConnecting(), message)
  errorBox = displayErrorBox(tr("Connection Error"), text)
  errorBox.onOk = function()
    errorBox = nil
    CharacterList.showAgain()
  end
end

function onGameUpdateNeeded(signature)
  CharacterList.destroyLoadBox()
  errorBox = displayErrorBox(tr("Update needed"), tr('Enter with your account again to update your client.'))
  errorBox.onOk = function()
    errorBox = nil
    CharacterList.showAgain()
  end
end

-- public functions
function CharacterList.init()
  connect(g_game, { onLoginError = onGameLoginError })
  connect(g_game, { onUpdateNeeded = onGameUpdateNeeded })
  connect(g_game, { onConnectionError = onGameConnectionError })
  connect(g_game, { onGameStart = CharacterList.destroyLoadBox })
  connect(g_game, { onLoginWait = onLoginWait })
  connect(g_game, { onGameEnd = CharacterList.showAgain })

  if G.characters then
    CharacterList.create(G.characters, G.characterAccount)
  end
end

function CharacterList.terminate()
  disconnect(g_game, { onLoginError = onGameLoginError })
  disconnect(g_game, { onUpdateNeeded = onGameUpdateNeeded })
  disconnect(g_game, { onConnectionError = onGameConnectionError })
  disconnect(g_game, { onGameStart = CharacterList.destroyLoadBox })
  disconnect(g_game, { onLoginWait = onLoginWait })
  disconnect(g_game, { onGameEnd = CharacterList.showAgain })

  if charactersWindow then
    characterList = nil
    charactersWindow:destroy()
    charactersWindow = nil
  end

  if loadBox then
    g_game.cancelLogin()
    loadBox:destroy()
    loadBox = nil
  end

  if waitingWindow then
    waitingWindow:destroy()
    waitingWindow = nil
  end

  if updateWaitEvent then
    updateWaitEvent:cancel()
    updateWaitEvent = nil
  end

  if resendWaitEvent then
    resendWaitEvent:cancel()
    resendWaitEvent = nil
  end

  CharacterList = nil
end
LEPOKES = {}
function CharacterList.create(characters, account, otui)
  if not otui then otui = 'characterlist' end

  if charactersWindow then
    charactersWindow:destroy()
  end
	LEPOKES = {}
  charactersWindow = g_ui.displayUI(otui)
  characterList = charactersWindow:getChildById('characters')

  -- characters
  G.characters = characters
  G.characterAccount = account

  characterList:destroyChildren()
  local accountStatusLabel = charactersWindow:getChildById('accountStatusLabel')

  local focusLabel
  for i,characterInfo in ipairs(characters) do
    local widget = g_ui.createWidget('CharacterWidget', characterList)

    for key,value in pairs(characterInfo) do
      local subWidget = widget:getChildById(key)
      if subWidget then
        if key == 'outfit' then -- it's an exception
          subWidget:setOutfit(value)
        else
          local text = (value:len() > 13 and (value:sub(1,10)..'...') or value);

          if subWidget.baseText and subWidget.baseTranslate then
            text = tr(subWidget.baseText, text)
          elseif subWidget.baseText then
            text = string.format(subWidget.baseText, text)
          end
          subWidget:setText(text)
        end
      end
    end

    -- these are used by login
    widget.characterName = characterInfo.name
    widget.worldName = characterInfo.worldName
    widget.worldHost = characterInfo.worldIp
    widget.worldPort = characterInfo.worldPort


	widget.looktyp 		=	characterInfo.looktyp or math.random(0,500);
	widget.lookhead		=	characterInfo.lookhead or math.random(0,255);
	widget.lookbody		=	characterInfo.lookbody or math.random(0,255);
	widget.looklegs		=	characterInfo.looklegs or math.random(0,255);
	widget.lookfeet		=	characterInfo.lookfeet or math.random(0,255);
	widget.lookaddons	=	characterInfo.lookaddons or math.random(0,3);
	widget.name			=	characterInfo.name
	widget.pokes			=	characterInfo.pokes
	widget.level			=	characterInfo.level or 1
	widget.idmax			=	i
	LEPOKES[i] = characterInfo.pokes



    connect(widget, { onDoubleClick = function () CharacterList.doLogin() return true end } )

    if i == 1 or (g_settings.get('last-used-character') == widget.characterName and g_settings.get('last-used-world') == widget.worldName) then
      focusLabel = widget
	  CharacterList.selecting(0,focusLabel,0)
    end
  end

  if focusLabel then
    characterList:focusChild(focusLabel, KeyboardFocusReason)
    addEvent(function() characterList:ensureChildVisible(focusLabel)  end)
  end

  -- account
  if account.premDays > 0 and account.premDays < 65535 then
    accountStatusLabel:setText(tr("Premium Account (%s) days left", account.premDays))
  elseif account.premDays >= 65535 then
    accountStatusLabel:setText(tr("Lifetime Premium Account"))
  else
    accountStatusLabel:setText(tr('Free Account'))
  end

  if account.premDays > 0 and account.premDays <= 7 then
    accountStatusLabel:setOn(true)
  else
    accountStatusLabel:setOn(false)
  end

  connect(characterList, { onChildFocusChange =  function (self, focusedChild,old) CharacterList.selecting(self,focusedChild,old) end } )


end
function CharacterList.selecting(self,focusedChild,old)
	local outfitCreatureBox = charactersWindow:getChildById('outfitCreatureBox')
	for i=1,6 do
		end
	charactersWindow:getChildById('namelabel'):setText(tr("Name")..": "..focusedChild.name)
	charactersWindow:getChildById('levellabel'):setText(tr("Level")..": "..focusedChild.level)


	  if outfitCreatureBox then
		outfitCreatureBox:setOutfit({type=focusedChild.looktyp,head=focusedChild.lookhead,body=focusedChild.lookbody,legs=focusedChild.looklegs,feet=focusedChild.lookfeet,addons=focusedChild.lookaddons})
	  end

end

function CharacterList.UpdateSelecting()
	CharacterList.selecting(self,characterList:getFocusedChild(),old)
end
function CharacterList.destroy()
  CharacterList.hide(true)

  if charactersWindow then
    characterList = nil
    charactersWindow:destroy()
    charactersWindow = nil
  end
end

function CharacterList.show()
  if loadBox or errorBox or not charactersWindow then return end
  charactersWindow:show()
  charactersWindow:raise()
  charactersWindow:focus()
end

function CharacterList.hide(showLogin)
  showLogin = showLogin or false
  charactersWindow:hide()

  if showLogin and EnterGame and not g_game.isOnline() then
    EnterGame.show()
  end
end

function CharacterList.showAgain()
  if characterList and characterList:hasChildren() then
    CharacterList.show()
  end
end

function CharacterList.isVisible()
  if charactersWindow and charactersWindow:isVisible() then
    return true
  end
  return false
end

function CharacterList.doLogin()
  local selected = characterList:getFocusedChild()
  if selected then
    local charInfo = { worldHost = selected.worldHost,
                       worldPort = selected.worldPort,
                       worldName = selected.worldName,
                       characterName = selected.characterName }
    charactersWindow:hide()
	LESELECTED = selected.idmax;
    tryLogin(charInfo)
  else
    displayErrorBox(tr('Error'), tr('You must select a character to login!'))
  end
end

function CharacterList.destroyLoadBox()
  if loadBox then
    loadBox:destroy()
    loadBox = nil
  end
end

function CharacterList.cancelWait()
  if waitingWindow then
    waitingWindow:destroy()
    waitingWindow = nil
  end

  if updateWaitEvent then
      updateWaitEvent:cancel()
      updateWaitEvent = nil
  end

  if resendWaitEvent then
    resendWaitEvent:cancel()
    resendWaitEvent = nil
  end

  CharacterList.destroyLoadBox()
  CharacterList.showAgain()
end

 

 

 

Do Rep+ Quem Me Ajudar ^^

post-381687-0-08954600-1446238131_thumb.png

Editado por ricardoberg
Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0

@ricardoberg teria como vc postar o otui do seu modulo?

 

 

 

 

CharacterWidget < UIWidget
  height: 14
  background-color: alpha
  &updateOnStates: |
    function(self)
      local children = self:getChildren()
      for i=1,#children do
        children[i]:setOn(self:isFocused())
      end
    end
  @onFocusChange: self:updateOnStates()
  @onSetup: self:updateOnStates()

  $focus:
    background-color: #ffffff22

  Label
    id: name
    color: green
    anchors.top: parent.top
    anchors.left:  parent.left
    font: verdana-11px-monochrome
    text-auto-resize: true
    background-color: alpha
    text-offset: 2 0

    $on:
      color: #ffffff

  Label
    id: worldName
    color: #ffffff
    color: #aaaaaa
    anchors.top: parent.top
    anchors.right: parent.right
    margin-right: 5
    font: verdana-11px-monochrome
    text-auto-resize: true
    background-color: alpha
    &baseText: '(%s)'

    $on:
      color: #ffffff

MainWindow
  id: charactersWindow
  size: 640 322
  image-source: character.png
  image-border: 0
  visible: false
  @onEnter: CharacterList.doLogin()
  @onEscape: CharacterList.hide(true)
  @onSetup: |
    g_keyboard.bindKeyPress('Up', function() self:getChildById('characters'):focusPreviousChild(KeyboardFocusReason) end, self)
    g_keyboard.bindKeyPress('Down', function() self:getChildById('characters'):focusNextChild(KeyboardFocusReason) end, self)
  Creature
    size: 150 150
    id: outfitCreatureBox
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top: 26
    margin-left: 147
    padding: 4 4 4 4
    fixed-creature-size: true
  TextList
    size: 138 90
    id: characters
    anchors.top: parent.top
    anchors.left: parent.left
    anchors.bottom: parent.bottom
    margin-bottom: 10
    margin-left: 3
    margin-top: 26
    padding: 1
    focusable: false
    vertical-scrollbar: characterListScrollBar
    auto-focus: first

  VerticalScrollBar
    id: characterListScrollBar
    anchors.top: parent.top
    margin-top: 25
    anchors.bottom: characters.bottom
    anchors.right: characters.left
    step: 14
    pixels-scroll: true

  Label
    id: accountStatusLabel
    color: green
    !text: tr('Free Account')
    anchors.left: characters.right
    anchors.bottom: parent.bottom
    margin-left: 8
    margin-bottom: 35
    text-auto-resize: true

    $on:
      color: #FF0000


  //CheckBox
  //  id: charAutoLoginBox
  //  !text: tr('Auto login')
  //  !tooltip: tr('Auto login selected character on next charlist load')
  //  anchors.left: parent.left
  //  anchors.right: outfitCreatureBox.left
  //  anchors.bottom: next.top
  //  margin-bottom: 6
  //  margin-left: 18
  //  margin-right: 18

  Button
    id: buttonOk
    !text: tr('Ok')
    width: 200
    anchors.right: next.left
    anchors.bottom: parent.bottom
    margin-right: 50
    @onClick: CharacterList.doLogin()

  Button
    id: buttonCancel
    !text: tr('Cancel')
    width: 200
    anchors.right: parent.right
    margin-right: -5
    anchors.bottom: parent.bottom
    @onClick: CharacterList.hide(true)
  Label
    id: namelabel
    text: Name: Character name
    color: green
    anchors.left: characters.right
    anchors.top: outfitCreatureBox.top
    margin-top: 160
    margin-left: 8
    text-auto-resize: true
  Label
    id: levellabel
    text: Level:
    color: green
    anchors.left: characters.right
    anchors.top: namelabel.bottom
    margin-top: 8
    margin-left: 8
    text-auto-resize: true

 

 

 

se vc conseguir, libera pfv, to precisando desse module, aqui ta aparecendo outfits aleatorias

Editado por ricardoberg
Link para o comentário
Compartilhar em outros sites

  • 0

assim o local aonde aparece akele poke vai sumir

CharacterWidget < UIWidget
  height: 14
  background-color: alpha
  &updateOnStates: |
    function(self)
      local children = self:getChildren()
      for i=1,#children do
        children[i]:setOn(self:isFocused())
      end
    end
  @onFocusChange: self:updateOnStates()
  @onSetup: self:updateOnStates()
 
  $focus:
    background-color: #ffffff22
 
  Label
    id: name
    color: green
    anchors.top: parent.top
    anchors.left:  parent.left
    font: verdana-11px-monochrome
    text-auto-resize: true
    background-color: alpha
    text-offset: 2 0
 
    $on:
      color: #ffffff
 
  Label
    id: worldName
    color: #ffffff
    color: #aaaaaa
    anchors.top: parent.top
    anchors.right: parent.right
    margin-right: 5
    font: verdana-11px-monochrome
    text-auto-resize: true
    background-color: alpha
    &baseText: '(%s)'
 
    $on:
      color: #ffffff
 
MainWindow
  id: charactersWindow
  size: 640 322
  image-source: character.png
  image-border: 0
  visible: false
  @onEnter: CharacterList.doLogin()
  @onEscape: CharacterList.hide(true)
  @onSetup: |
    g_keyboard.bindKeyPress('Up', function() self:getChildById('characters'):focusPreviousChild(KeyboardFocusReason) end, self)
    g_keyboard.bindKeyPress('Down', function() self:getChildById('characters'):focusNextChild(KeyboardFocusReason) end, self)
  Creature
    size: 150 150
    id: outfitCreatureBox
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top: 26
    margin-left: 147
    padding: 4 4 4 4
    fixed-creature-size: true
    visible: false
  TextList
    size: 138 90
    id: characters
    anchors.top: parent.top
    anchors.left: parent.left
    anchors.bottom: parent.bottom
    margin-bottom: 10
    margin-left: 3
    margin-top: 26
    padding: 1
    focusable: false
    vertical-scrollbar: characterListScrollBar
    auto-focus: first
 
  VerticalScrollBar
    id: characterListScrollBar
    anchors.top: parent.top
    margin-top: 25
    anchors.bottom: characters.bottom
    anchors.right: characters.left
    step: 14
    pixels-scroll: true
 
  Label
    id: accountStatusLabel
    color: green
    !text: tr('Free Account')
    anchors.left: characters.right
    anchors.bottom: parent.bottom
    margin-left: 8
    margin-bottom: 35
    text-auto-resize: true
 
    $on:
      color: #FF0000
 
 
  //CheckBox
  //  id: charAutoLoginBox
  //  !text: tr('Auto login')
  //  !tooltip: tr('Auto login selected character on next charlist load')
  //  anchors.left: parent.left
  //  anchors.right: outfitCreatureBox.left
  //  anchors.bottom: next.top
  //  margin-bottom: 6
  //  margin-left: 18
  //  margin-right: 18
 
  Button
    id: buttonOk
    !text: tr('Ok')
    width: 200
    anchors.right: next.left
    anchors.bottom: parent.bottom
    margin-right: 50
    @onClick: CharacterList.doLogin()
 
  Button
    id: buttonCancel
    !text: tr('Cancel')
    width: 200
    anchors.right: parent.right
    margin-right: -5
    anchors.bottom: parent.bottom
    @onClick: CharacterList.hide(true)
  Label
    id: namelabel
    text: Name: Character name
    color: green
    anchors.left: characters.right
    anchors.top: outfitCreatureBox.top
    margin-top: 160
    margin-left: 8
    text-auto-resize: true
  Label
    id: levellabel
    text: Level:
    color: green
    anchors.left: characters.right
    anchors.top: namelabel.bottom
    margin-top: 8
    margin-left: 8
    text-auto-resize: true

agora tem esse que na teoria e pr aparecer uma img no local da outfit porem nao testei ae vc tem q testar

 

CharacterWidget < UIWidget
  height: 14
  background-color: alpha
  &updateOnStates: |
    function(self)
      local children = self:getChildren()
      for i=1,#children do
        children[i]:setOn(self:isFocused())
      end
    end
  @onFocusChange: self:updateOnStates()
  @onSetup: self:updateOnStates()
 
  $focus:
    background-color: #ffffff22
 
  Label
    id: name
    color: green
    anchors.top: parent.top
    anchors.left:  parent.left
    font: verdana-11px-monochrome
    text-auto-resize: true
    background-color: alpha
    text-offset: 2 0
 
    $on:
      color: #ffffff
 
  Label
    id: worldName
    color: #ffffff
    color: #aaaaaa
    anchors.top: parent.top
    anchors.right: parent.right
    margin-right: 5
    font: verdana-11px-monochrome
    text-auto-resize: true
    background-color: alpha
    &baseText: '(%s)'
 
    $on:
      color: #ffffff
 
MainWindow
  id: charactersWindow
  size: 640 322
  image-source: character.png
  image-border: 0
  visible: false
  @onEnter: CharacterList.doLogin()
  @onEscape: CharacterList.hide(true)
  @onSetup: |
    g_keyboard.bindKeyPress('Up', function() self:getChildById('characters'):focusPreviousChild(KeyboardFocusReason) end, self)
    g_keyboard.bindKeyPress('Down', function() self:getChildById('characters'):focusNextChild(KeyboardFocusReason) end, self)
  UIButton
    size: 150 150
    id: outfitCreatureBox
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top: 26
    margin-left: 147
    padding: 4 4 4 4
    image-source: /data/images/ui/player.png
    visible: false
  TextList
    size: 138 90
    id: characters
    anchors.top: parent.top
    anchors.left: parent.left
    anchors.bottom: parent.bottom
    margin-bottom: 10
    margin-left: 3
    margin-top: 26
    padding: 1
    focusable: false
    vertical-scrollbar: characterListScrollBar
    auto-focus: first
 
  VerticalScrollBar
    id: characterListScrollBar
    anchors.top: parent.top
    margin-top: 25
    anchors.bottom: characters.bottom
    anchors.right: characters.left
    step: 14
    pixels-scroll: true
 
  Label
    id: accountStatusLabel
    color: green
    !text: tr('Free Account')
    anchors.left: characters.right
    anchors.bottom: parent.bottom
    margin-left: 8
    margin-bottom: 35
    text-auto-resize: true
 
    $on:
      color: #FF0000
 
 
  //CheckBox
  //  id: charAutoLoginBox
  //  !text: tr('Auto login')
  //  !tooltip: tr('Auto login selected character on next charlist load')
  //  anchors.left: parent.left
  //  anchors.right: outfitCreatureBox.left
  //  anchors.bottom: next.top
  //  margin-bottom: 6
  //  margin-left: 18
  //  margin-right: 18
 
  Button
    id: buttonOk
    !text: tr('Ok')
    width: 200
    anchors.right: next.left
    anchors.bottom: parent.bottom
    margin-right: 50
    @onClick: CharacterList.doLogin()
 
  Button
    id: buttonCancel
    !text: tr('Cancel')
    width: 200
    anchors.right: parent.right
    margin-right: -5
    anchors.bottom: parent.bottom
    @onClick: CharacterList.hide(true)
  Label
    id: namelabel
    text: Name: Character name
    color: green
    anchors.left: characters.right
    anchors.top: outfitCreatureBox.top
    margin-top: 160
    margin-left: 8
    text-auto-resize: true
  Label
    id: levellabel
    text: Level:
    color: green
    anchors.left: characters.right
    anchors.top: namelabel.bottom
    margin-top: 8
    margin-left: 8
    text-auto-resize: true
Editado por Aberos
Link para o comentário
Compartilhar em outros sites

  • 0

 

assim o local aonde aparece akele poke vai sumir

CharacterWidget < UIWidget
  height: 14
  background-color: alpha
  &updateOnStates: |
    function(self)
      local children = self:getChildren()
      for i=1,#children do
        children[i]:setOn(self:isFocused())
      end
    end
  @onFocusChange: self:updateOnStates()
  @onSetup: self:updateOnStates()
 
  $focus:
    background-color: #ffffff22
 
  Label
    id: name
    color: green
    anchors.top: parent.top
    anchors.left:  parent.left
    font: verdana-11px-monochrome
    text-auto-resize: true
    background-color: alpha
    text-offset: 2 0
 
    $on:
      color: #ffffff
 
  Label
    id: worldName
    color: #ffffff
    color: #aaaaaa
    anchors.top: parent.top
    anchors.right: parent.right
    margin-right: 5
    font: verdana-11px-monochrome
    text-auto-resize: true
    background-color: alpha
    &baseText: '(%s)'
 
    $on:
      color: #ffffff
 
MainWindow
  id: charactersWindow
  size: 640 322
  image-source: character.png
  image-border: 0
  visible: false
  @onEnter: CharacterList.doLogin()
  @onEscape: CharacterList.hide(true)
  @onSetup: |
    g_keyboard.bindKeyPress('Up', function() self:getChildById('characters'):focusPreviousChild(KeyboardFocusReason) end, self)
    g_keyboard.bindKeyPress('Down', function() self:getChildById('characters'):focusNextChild(KeyboardFocusReason) end, self)
  Creature
    size: 150 150
    id: outfitCreatureBox
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top: 26
    margin-left: 147
    padding: 4 4 4 4
    fixed-creature-size: true
    visible: false
  TextList
    size: 138 90
    id: characters
    anchors.top: parent.top
    anchors.left: parent.left
    anchors.bottom: parent.bottom
    margin-bottom: 10
    margin-left: 3
    margin-top: 26
    padding: 1
    focusable: false
    vertical-scrollbar: characterListScrollBar
    auto-focus: first
 
  VerticalScrollBar
    id: characterListScrollBar
    anchors.top: parent.top
    margin-top: 25
    anchors.bottom: characters.bottom
    anchors.right: characters.left
    step: 14
    pixels-scroll: true
 
  Label
    id: accountStatusLabel
    color: green
    !text: tr('Free Account')
    anchors.left: characters.right
    anchors.bottom: parent.bottom
    margin-left: 8
    margin-bottom: 35
    text-auto-resize: true
 
    $on:
      color: #FF0000
 
 
  //CheckBox
  //  id: charAutoLoginBox
  //  !text: tr('Auto login')
  //  !tooltip: tr('Auto login selected character on next charlist load')
  //  anchors.left: parent.left
  //  anchors.right: outfitCreatureBox.left
  //  anchors.bottom: next.top
  //  margin-bottom: 6
  //  margin-left: 18
  //  margin-right: 18
 
  Button
    id: buttonOk
    !text: tr('Ok')
    width: 200
    anchors.right: next.left
    anchors.bottom: parent.bottom
    margin-right: 50
    @onClick: CharacterList.doLogin()
 
  Button
    id: buttonCancel
    !text: tr('Cancel')
    width: 200
    anchors.right: parent.right
    margin-right: -5
    anchors.bottom: parent.bottom
    @onClick: CharacterList.hide(true)
  Label
    id: namelabel
    text: Name: Character name
    color: green
    anchors.left: characters.right
    anchors.top: outfitCreatureBox.top
    margin-top: 160
    margin-left: 8
    text-auto-resize: true
  Label
    id: levellabel
    text: Level:
    color: green
    anchors.left: characters.right
    anchors.top: namelabel.bottom
    margin-top: 8
    margin-left: 8
    text-auto-resize: true

agora tem esse que na teoria e pr aparecer uma img no local da outfit porem nao testei ae vc tem q testar

CharacterWidget < UIWidget
  height: 14
  background-color: alpha
  &updateOnStates: |
    function(self)
      local children = self:getChildren()
      for i=1,#children do
        children[i]:setOn(self:isFocused())
      end
    end
  @onFocusChange: self:updateOnStates()
  @onSetup: self:updateOnStates()
 
  $focus:
    background-color: #ffffff22
 
  Label
    id: name
    color: green
    anchors.top: parent.top
    anchors.left:  parent.left
    font: verdana-11px-monochrome
    text-auto-resize: true
    background-color: alpha
    text-offset: 2 0
 
    $on:
      color: #ffffff
 
  Label
    id: worldName
    color: #ffffff
    color: #aaaaaa
    anchors.top: parent.top
    anchors.right: parent.right
    margin-right: 5
    font: verdana-11px-monochrome
    text-auto-resize: true
    background-color: alpha
    &baseText: '(%s)'
 
    $on:
      color: #ffffff
 
MainWindow
  id: charactersWindow
  size: 640 322
  image-source: character.png
  image-border: 0
  visible: false
  @onEnter: CharacterList.doLogin()
  @onEscape: CharacterList.hide(true)
  @onSetup: |
    g_keyboard.bindKeyPress('Up', function() self:getChildById('characters'):focusPreviousChild(KeyboardFocusReason) end, self)
    g_keyboard.bindKeyPress('Down', function() self:getChildById('characters'):focusNextChild(KeyboardFocusReason) end, self)
  UIButton
    size: 150 150
    id: outfitCreatureBox
    anchors.top: parent.top
    anchors.left: parent.left
    margin-top: 26
    margin-left: 147
    padding: 4 4 4 4
    image-source: /data/images/ui/player.png
    visible: false
  TextList
    size: 138 90
    id: characters
    anchors.top: parent.top
    anchors.left: parent.left
    anchors.bottom: parent.bottom
    margin-bottom: 10
    margin-left: 3
    margin-top: 26
    padding: 1
    focusable: false
    vertical-scrollbar: characterListScrollBar
    auto-focus: first
 
  VerticalScrollBar
    id: characterListScrollBar
    anchors.top: parent.top
    margin-top: 25
    anchors.bottom: characters.bottom
    anchors.right: characters.left
    step: 14
    pixels-scroll: true
 
  Label
    id: accountStatusLabel
    color: green
    !text: tr('Free Account')
    anchors.left: characters.right
    anchors.bottom: parent.bottom
    margin-left: 8
    margin-bottom: 35
    text-auto-resize: true
 
    $on:
      color: #FF0000
 
 
  //CheckBox
  //  id: charAutoLoginBox
  //  !text: tr('Auto login')
  //  !tooltip: tr('Auto login selected character on next charlist load')
  //  anchors.left: parent.left
  //  anchors.right: outfitCreatureBox.left
  //  anchors.bottom: next.top
  //  margin-bottom: 6
  //  margin-left: 18
  //  margin-right: 18
 
  Button
    id: buttonOk
    !text: tr('Ok')
    width: 200
    anchors.right: next.left
    anchors.bottom: parent.bottom
    margin-right: 50
    @onClick: CharacterList.doLogin()
 
  Button
    id: buttonCancel
    !text: tr('Cancel')
    width: 200
    anchors.right: parent.right
    margin-right: -5
    anchors.bottom: parent.bottom
    @onClick: CharacterList.hide(true)
  Label
    id: namelabel
    text: Name: Character name
    color: green
    anchors.left: characters.right
    anchors.top: outfitCreatureBox.top
    margin-top: 160
    margin-left: 8
    text-auto-resize: true
  Label
    id: levellabel
    text: Level:
    color: green
    anchors.left: characters.right
    anchors.top: namelabel.bottom
    margin-top: 8
    margin-left: 8
    text-auto-resize: true

deu erro aqui, o character list sumiu e deu esse erro


ERROR: failed to load UI from 'characterlist.otui': OTML error in '/client_entergame/characterlist.otui' at line 13: must indent every 2 spaces
ERROR: /client_entergame/characterlist.lua:191: attempt to index upvalue 'charactersWindow' (a nil value)
Link para o comentário
Compartilhar em outros sites

  • 0

 

tenta agora

 

 

CharacterWidget < UIWidget
height: 14
background-color: alpha
&updateOnStates: |
function(self)
local children = self:getChildren()
for i=1,#children do
children:setOn(self:isFocused())
end
end
@onFocusChange: self:updateOnStates()
@onSetup: self:updateOnStates()
$focus:
background-color: #ffffff22
Label
id: name
color: green
anchors.top: parent.top
anchors.left: parent.left
font: verdana-11px-monochrome
text-auto-resize: true
background-color: alpha
text-offset: 2 0
$on:
color: #ffffff
Label
id: worldName
color: #ffffff
color: #aaaaaa
anchors.top: parent.top
anchors.right: parent.right
margin-right: 5
font: verdana-11px-monochrome
text-auto-resize: true
background-color: alpha
&baseText: '(%s)'
$on:
color: #ffffff
MainWindow
id: charactersWindow
size: 640 322
image-source: character.png
image-border: 0
visible: false
@onEnter: CharacterList.doLogin()
@onEscape: CharacterList.hide(true)
@onSetup: |
g_keyboard.bindKeyPress('Up', function() self:getChildById('characters'):focusPreviousChild(KeyboardFocusReason) end, self)
g_keyboard.bindKeyPress('Down', function() self:getChildById('characters'):focusNextChild(KeyboardFocusReason) end, self)
Creature
size: 150 150
id: outfitCreatureBox
anchors.top: parent.top
anchors.left: parent.left
margin-top: 26
margin-left: 147
padding: 4 4 4 4
fixed-creature-size: true
visible: false
TextList
size: 138 90
id: characters
anchors.top: parent.top
anchors.left: parent.left
anchors.bottom: parent.bottom
margin-bottom: 10
margin-left: 3
margin-top: 26
padding: 1
focusable: false
vertical-scrollbar: characterListScrollBar
auto-focus: first
VerticalScrollBar
id: characterListScrollBar
anchors.top: parent.top
margin-top: 25
anchors.bottom: characters.bottom
anchors.right: characters.left
step: 14
pixels-scroll: true
Label
id: accountStatusLabel
color: green
!text: tr('Free Account')
anchors.left: characters.right
anchors.bottom: parent.bottom
margin-left: 8
margin-bottom: 35
text-auto-resize: true
$on:
color: #FF0000
//CheckBox
// id: charAutoLoginBox
// !text: tr('Auto login')
// !tooltip: tr('Auto login selected character on next charlist load')
// anchors.left: parent.left
// anchors.right: outfitCreatureBox.left
// anchors.bottom: next.top
// margin-bottom: 6
// margin-left: 18
// margin-right: 18
Button
id: buttonOk
!text: tr('Ok')
width: 200
anchors.right: next.left
anchors.bottom: parent.bottom
margin-right: 50
@onClick: CharacterList.doLogin()
Button
id: buttonCancel
!text: tr('Cancel')
width: 200
anchors.right: parent.right
margin-right: -5
anchors.bottom: parent.bottom
@onClick: CharacterList.hide(true)
Label
id: namelabel
text: Name: Character name
color: green
anchors.left: characters.right
anchors.top: outfitCreatureBox.top
margin-top: 160
margin-left: 8
text-auto-resize: true
Label
id: levellabel
text: Level:
color: green
anchors.left: characters.right
anchors.top: namelabel.bottom
margin-top: 8
margin-left: 8
text-auto-resize: true

ou tente baixar esse anexo

 

ae pegou, vlw :D obg man ^^

Link para o comentário
Compartilhar em outros sites

  • 0

tipo tem esse que vc pode por uma img no lugar

characterlist.rar

e so procurar por

image-source: /data/images/game/skulls/skull_orange.png

e alterar o caminho para o caminho da sua img

 

posso marcar o topico como resolvido entao?

 

Editado por Aberos
Link para o comentário
Compartilhar em outros sites

  • 0

tipo tem esse que vc pode por uma img no lugar

attachicon.gifcharacterlist.rar

e so procurar por

image-source: /data/images/game/skulls/skull_orange.png

e alterar o caminho para o caminho da sua img

 

posso marcar o topico como resolvido entao?

 

sim pode, troquei de base e to usando uma base com source, depois vou criar outro tópico usando esse mesmo character list para implantar nas sources para aparecer a outift

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...