margoh
{{ user.title }}
- Joined
- Apr 1, 2013
- Messages
- 806
- Solutions
- 18
- Reaction score
- 350
Hello, here is the module for shop.
This is how it looks:
I have made only one image for Tabs and one for buttons, if you want more do it yourself.
It's using command, example (in shop.lua):
Example in addons.otui:
How to add new button?
Copy whole function:
Change it's name to ex. buyWizard:
Inside function change:
To:
Inside addons.otui copy and paste previous button and change:
To your new function name.
Follow this for all the items in the shop.
Download:
MEGA
Cheers!
This is how it looks:
I have made only one image for Tabs and one for buttons, if you want more do it yourself.
It's using command, example (in shop.lua):
Code:
function buyAssassin()
if acceptWindow then
return true
end
local acceptFunc = function()
g_game.talk('!buyaddon assassin')
acceptWindow:destroy()
acceptWindow = nil
end
local cancelFunc = function() acceptWindow:destroy() acceptWindow = nil end
acceptWindow = displayGeneralBox(tr('Accept transaction'), tr("Do you really want to buy this item?"),
{ { text=tr('Yes'), callback=acceptFunc },
{ text=tr('No'), callback=cancelFunc },
anchor=AnchorHorizontalCenter }, acceptFunc, cancelFunc)
return true
end
Example in addons.otui:
Code:
AddonButton < UIButton
width: 352
height: 68
Code:
AddonButton
image-source: /modules/game_shop/images/buttonimg/addon_assassin
anchors.top: parent.top
anchors.left: parent.left
@onClick: buyAssassin()
How to add new button?
Copy whole function:
Code:
buyAssassin
Code:
function buyWizard()
Code:
g_game.talk('!buyaddon assassin')
Code:
g_game.talk('!buyaddon wizard')
Code:
image-source: /link/to/the/image
@onClick: modules.game_shop.buyAssassin()
Follow this for all the items in the shop.
Download:
MEGA
Cheers!
Last edited: