BEAWARE all game functionality is disabled with this commit for a while

* rework client modules
* hide main window when loading
* remake top menu functions
* rework modules autoload
* improve path resolving for otml and lua
* move core_widgets to core_lib
* fix tooltip issues
* split some styles
* add bit32 lua library
* fix assert issues
* fix compilation on linux 32 systems
* rework gcc compile options
* renable and fix some warnings
* remove unused constants
* speedup sprite cache
* move UIGame to lua (not funcional yet)
* fix a lot of issues in x11 window
* fix crash handler
* add some warnings do uiwidget
and much more...
This commit is contained in:
Eduardo Bart
2012-02-20 00:27:08 -02:00
parent 96358b317d
commit e03bf33f58
201 changed files with 1443 additions and 707 deletions

View File

@@ -1,50 +0,0 @@
Inventory = {}
-- private variables
local inventoryWindow
local inventoryButton
-- public functions
function Inventory.create()
inventoryWindow = displayUI('inventory.otui', { parent = g_game.gameRightPanel })
inventoryButton = TopMenu.addGameButton('inventoryButton', 'Inventory (Ctrl+I)', 'inventory.png', Inventory.toggle)
inventoryButton:setOn(true)
Keyboard.bindKeyDown('Ctrl+I', Inventory.toggle)
end
function Inventory.destroy()
Keyboard.unbindKeyDown('Ctrl+I')
inventoryWindow:destroy()
inventoryWindow = nil
inventoryButton:destroy()
inventoryButton = nil
end
function Inventory.toggle()
local visible = not inventoryWindow:isExplicitlyVisible()
inventoryWindow:setVisible(visible)
inventoryButton:setOn(visible)
end
-- hooked events
function Inventory.onInventoryChange(slot, item)
local itemWidget = inventoryWindow:getChildById('slot' .. slot)
itemWidget:setItem(item)
end
function Inventory.onFreeCapacityChange(freeCapacity)
local widget = inventoryWindow:getChildById('capacity')
widget:setText("Cap:\n" .. freeCapacity)
end
function Inventory.onSoulChange(soul)
local widget = inventoryWindow:getChildById('soul')
widget:setText("Soul:\n" .. soul)
end
connect(g_game, { onGameStart = Inventory.create,
onGameEnd = Inventory.destroy,
onInventoryChange = Inventory.onInventoryChange,
onFreeCapacityChange = Inventory.onFreeCapacityChange,
onSoulChange = Inventory.onSoulChange })

View File

@@ -1,7 +0,0 @@
Module
name: game_inventory
description: View local player equipments window
author: OTClient team
website: https://github.com/edubart/otclient
onLoad: |
dofile 'inventory'

View File

@@ -1,114 +0,0 @@
UIWindow
width: 192
height: 154
margin-top: 10
margin-left: 6
margin-right: 6
Item
// head
id: slot1
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
&position: {x=65535, y=1, z=0}
Item
// armor
id: slot4
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin-top: 5
&position: {x=65535, y=4, z=0}
Item
// legs
id: slot7
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin-top: 5
&position: {x=65535, y=7, z=0}
Item
// feet
id: slot8
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin-top: 5
&position: {x=65535, y=8, z=0}
Item
// necklace
id: slot2
anchors.top: parent.top
anchors.right: slot1.left
margin-top: 10
margin-right: 5
&position: {x=65535, y=2, z=0}
Item
// left
id: slot6
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin-top: 5
&position: {x=65535, y=6, z=0}
Item
// ring
id: slot9
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin-top: 5
&position: {x=65535, y=9, z=0}
Item
// backpack
id: slot3
anchors.top: parent.top
anchors.left: slot1.right
margin-top: 10
margin-left: 5
&position: {x=65535, y=3, z=0}
Item
// right
id: slot5
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin-top: 5
&position: {x=65535, y=5, z=0}
Item
// ammo
id: slot10
anchors.top: prev.bottom
anchors.horizontalCenter: prev.horizontalCenter
margin-top: 5
&position: {x=65535, y=10, z=0}
GameLabel
id: soul
anchors.top: slot9.bottom
anchors.bottom: slot8.bottom
anchors.left: slot9.left
anchors.right: slot9.right
margin-top: 5
text-align: center
image-source: /core_styles/images/panel_flat.png
image-border: 1
GameLabel
id: capacity
anchors.top: slot10.bottom
anchors.bottom: slot8.bottom
anchors.left: slot10.left
anchors.right: slot10.right
margin-top: 5
text-align: center
image-source: /core_styles/images/panel_flat.png
image-border: 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B