_Aion_
Nothing Else
Hello. Someone can help solve this problem?
I'm trying create a market with "diamond". But i have this error.
this is my init from shop.lua
and this my shop.otui
Whats is wrong on code?
I'm trying create a market with "diamond". But i have this error.
this is my init from shop.lua
Code:
function init()
connect(g_game, { onGameEnd = hide })
connect(g_game, 'onTextMessage', onConfirmBought)
shopWindow = g_ui.displayUI('shop', modules.game_interface.getRootPanel())
shopButton = modules.client_topmenu.addRightGameToggleButton('shopButton', tr('Shop'), '/images/topbuttons/bot', toggle, false, 99999)
playerEmeralds = shopWindow:recursiveGetChildById('emeraldsLabel')
offerSearch = shopWindow:recursiveGetChildById('searchText')
shopButton:setOn(false)
shopWindow:hide()
shopTabBar = shopWindow:recursiveGetChildById('shopTabBar')
shopTabBar:setContentWidget(shopWindow:recursiveGetChildById('shopTabContent'))
shopTabBar.onTabChange = onTabChange
marketPanel = g_ui.loadUI('market')
shopTabBar:addTab('', marketPanel, '/images/game/shop/market')
outfitsPanel = g_ui.loadUI('outfits')
shopTabBar:addTab('', outfitsPanel, '/images/game/shop/outfits')
addonsPanel = g_ui.loadUI('addons')
shopTabBar:addTab('', addonsPanel, '/images/game/shop/addons')
clansPanel = g_ui.loadUI('clans')
shopTabBar:addTab('', clansPanel, '/images/game/shop/clans')
shopTabBar:addButton('', function() g_game.talk('Buy Diamonds') end, '/images/game/shop/buy_emeralds')
end
and this my shop.otui
Code:
ClanWindow < MainWindow
size: 210 100
@onEscape: modules.game_shop.destroyClanWindow()
Label
text: Rank:
width: 38
anchors.top: parent.top
anchors.left: parent.left
margin-top: 2
SpinBox
id: spinBox
step: 1
width: 50
anchors.top: parent.top
anchors.left: prev.right
minimum: 1
maximum: 5
@onValueChange: |
local prize = 40 + 10*(self:getValue()-1)
self:getParent():getChildById('prize'):setText(prize..' Emeralds')
Label
id: prize
color: white
text: 40 Emeralds
text-auto-resize: true
icon-align: left
icon: /images/game/shop/prize
text-offset: 21 0
font: verdana-11px-rounded
anchors.verticalCenter: spinBox.verticalCenter
anchors.left: spinBox.right
margin-left: 3
Button
!text: tr('Cancel')
width: 64
anchors.bottom: parent.bottom
anchors.right: parent.right
@onClick: modules.game_shop.destroyClanWindow()
Button
id: okButton
text: Ok
width: 64
anchors.bottom: parent.bottom
anchors.right: prev.left
margin-right: 5
shopWindow < MainWindow
id: shopWindow
size: 582 336
icon-align: right
icon: /images/ui/shop_window
anchors.centerIn: parent
margin-right: 64
draggable: false
padding: 10
@onEscape: modules.game_shop.hide()
ShopTabBarVertical
id: shopTabBar
phantom: true
height: 326
anchors.top: parent.top
anchors.left: parent.left
margin-left: -10
Panel
id: shopTabContent
height: 242
anchors.left: prev.right
anchors.right: parent.right
anchors.bottom: parent.bottom
margin-left: 10
margin-bottom: 35
Label
id: emeraldsLabel
text-offset: 40 0
text-auto-resize: true
icon: /images/topbuttons/emerald_shop
icon-align: left
font: newfont-16px-rounded
anchors.bottom: parent.bottom
anchors.left: shopTabBar.right
margin-left: 10
margin-bottom: 5
Label
!text: tr('Search')..':'
text-auto-resize: true
anchors.right: next.left
anchors.verticalCenter: next.verticalCenter
margin-right: 5
TextEdit
id: searchText
width: 135
anchors.bottom: parent.bottom
anchors.right: parent.right
margin-right: 10
shift-navigation: true
@onTextChange: searchOffer()
UIButton
id: closeButton
anchors.top: parent.top
anchors.right: parent.right
size: 23 22
image-source: /images/ui/shop_button_close
image-clip: 0 0 23 22
@onClick: modules.game_shop.hide()
$hover:
image-clip: 0 22 23 22
$pressed:
image-clip: 0 44 23 22
Last edited by a moderator: