Postado Maio 8, 2023 2 anos TFS 1.2 PokeDash By Pota OTCv8 Hello, i have question. I've added tooltip to my TFS 1.2 and i want to add Image for this ToolTip, but what i need to do? https://imgur.com/LdNZWm3 I added Items.otb/xml to OTCv8 but friend told me to not to do this. So what i need to send Images from items.otb/xml (server) to my client? When i Hover on some item i want to display Image of this item. Like in this: https://imgur.com/qPSo0dD i have Moltres 200lvl, i want to display "helds" etc. Is there any chance to receive it from .spr? (OTCv8 - pokeinfo.lua) in this script i want to Test Image from items.otb/xml pokemonLookWindow = nil function init() pokemonLookWindow = g_ui.displayUI('pokeinfo') if not pokemonLookWindow then print("Error: Failed to load pokeinfo.otui") return end print("pokeinfo.otui loaded successfully") pokemonLookWindow:hide() ProtocolGame.registerExtendedOpcode(200, function(protocol, opcode, buffer) displayPokemonInformation(protocol, opcode, buffer) end) connect(g_game, { onGameStart = nothing, onGameEnd = offline }) end function terminate() disconnect(g_game, { onGameStart = online, onGameEnd = offline }) if pokemonLookWindow then pokemonLookWindow:destroy() pokemonLookWindow = nil end ProtocolGame.unregisterExtendedOpcode(200) end function online() if not g_ui.isLoaded() then return end if not pokemonLookWindow then pokemonLookWindow = g_ui.displayUI('pokeinfo') pokemonLookWindow:hide() end end function offline() if pokemonLookWindow then pokemonLookWindow:hide() end end function onClosePokemonInformation() pokemonLookWindow:hide() end function displayPokemonInformation(protocol, opcode, buffer) print("OTCv8 received opcode:", opcode) print("OTCv8 received buffer:", buffer) local pokemonData = buffer:explode("|") local name = pokemonData[2] local level = tonumber(pokemonData[3]) local boost = tonumber(pokemonData[4]) getPokemonInformation(name, level, boost) end function getPokemonInformation(name, level, boost) pokemonLookWindow:show() pokemonLookWindow:raise() pokemonLookWindow:focus() local infoPanel = pokemonLookWindow:getChildById('full_content'):getChildById('right_content') infoPanel:getChildById('pokemon_name'):setText(tr(name)) infoPanel:getChildById('pokemon_level'):setText(tr("Level: " .. level)) if boost and boost > 0 then infoPanel:getChildById('pokemon_boost'):setText(tr("Boost: " .. boost)) else infoPanel:getChildById('pokemon_boost'):setText(tr("Boost: None")) end end
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.