mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
restore containers
* implemente Container class * restore module containers * add lua bindings for std::map * improve grid layout * fixes in UIItem rendering * changes in miniwindow design
This commit is contained in:
@@ -17,8 +17,9 @@ Module
|
||||
- game_skills
|
||||
- game_inventory
|
||||
- game_combatcontrols
|
||||
- game_battle
|
||||
- game_containers
|
||||
- game_viplist
|
||||
- game_battle
|
||||
- game_hotkeys
|
||||
|
||||
@onLoad: |
|
||||
|
@@ -140,10 +140,10 @@ function GameInterface.createThingMenu(menuPosition, lookThing, useThing, creatu
|
||||
if useThing then
|
||||
if useThing:isContainer() then
|
||||
if useThing:getParentContainer() then
|
||||
menu:addOption('Open', function() g_game.open(useThing, useThing:getContainerId()) end)
|
||||
menu:addOption('Open in new window', function() g_game.open(useThing, Containers.getFreeContainerId()) end)
|
||||
menu:addOption('Open', function() g_game.open(useThing, useThing:getParentContainer()) end)
|
||||
menu:addOption('Open in new window', function() g_game.open(useThing, nil) end)
|
||||
else
|
||||
menu:addOption('Open', function() g_game.open(useThing, Containers.getFreeContainerId()) end)
|
||||
menu:addOption('Open', function() g_game.open(useThing, nil) end)
|
||||
end
|
||||
else
|
||||
if useThing:isMultiUse() then
|
||||
@@ -256,10 +256,10 @@ function GameInterface.processMouseAction(menuPosition, mouseButton, autoWalk, l
|
||||
elseif useThing and keyboardModifiers == KeyboardCtrlModifier and (mouseButton == MouseLeftButton or mouseButton == MouseRightButton) then
|
||||
if useThing:isContainer() then
|
||||
if useThing:getParentContainer() then
|
||||
g_game.open(useThing, useThing:getContainerId())
|
||||
g_game.open(useThing, useThing:getParentContainer())
|
||||
return true
|
||||
else
|
||||
g_game.open(useThing, Containers.getFreeContainerId())
|
||||
g_game.open(useThing, nil)
|
||||
return true
|
||||
end
|
||||
elseif useThing:isMultiUse() then
|
||||
@@ -281,10 +281,10 @@ function GameInterface.processMouseAction(menuPosition, mouseButton, autoWalk, l
|
||||
return true
|
||||
elseif multiUseThing:isContainer() then
|
||||
if multiUseThing:getParentContainer() then
|
||||
g_game.open(multiUseThing, multiUseThing:getContainerId())
|
||||
g_game.open(multiUseThing, multiUseThing:getParentContainer())
|
||||
return true
|
||||
else
|
||||
g_game.open(multiUseThing, Containers.getFreeContainerId())
|
||||
g_game.open(multiUseThing, nil)
|
||||
return true
|
||||
end
|
||||
elseif multiUseThing:isMultiUse() then
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Binary file not shown.
Before Width: | Height: | Size: 626 B After Width: | Height: | Size: 758 B |
@@ -1,5 +1,6 @@
|
||||
Item < UIItem
|
||||
size: 34 34
|
||||
padding: 1
|
||||
image-source: /core_styles/styles/images/item.png
|
||||
font: verdana-11px-rounded
|
||||
border-color: white
|
||||
|
@@ -3,7 +3,7 @@ MiniWindow < UIMiniWindow
|
||||
icon-rect: 4 4 16 16
|
||||
width: 192
|
||||
height: 200
|
||||
text-offset: 26 5
|
||||
text-offset: 24 5
|
||||
text-align: topLeft
|
||||
margin-bottom: 2
|
||||
move-policy: free updated
|
||||
@@ -82,7 +82,7 @@ MiniWindowContents < ScrollablePanel
|
||||
id: contentsPanel
|
||||
anchors.fill: parent
|
||||
margin-right: 14
|
||||
padding: 25 6 6 6
|
||||
padding: 24 3 3 5
|
||||
vertical-scrollbar: miniwindowScrollBar
|
||||
|
||||
BorderlessGameWindow < UIWindow
|
||||
|
Reference in New Issue
Block a user