Updated Top Menu, Health Info, Combat Controls, Console (Channels), Game Toggle Buttons, Minimap Layout, Game Interface Prompts, and Creature Draw Info.

* Added new left and right game button panels.
* Relocated main game toggle buttons to the right side of the screen to make it easier to toggle miniwindows.
* Added table.empty(t) function to table lib.
* Renamed module game_healthbar to game_healthinfo.
* Combat controls now save per character (e.g. Fight mode, chase mode, safe fight mode)
* Last channels open now save per character.
* Fixed typo in containers.lua.
* Added logout prompting window message when you logout via the logout button.
* Added exit promting window message when you attempt to exit the client.
* Repositioned some minimap buttons.
* Fixed so when creatures health percent is < 1 it will not draw the creature information.

Known Issues:
* If you move a container widget into the map rect if you move an item onto itself it will allow this to execute still dropping the item on the ground.
* The server is calling to open channels after onGameStart is executed causing it to focus the last tab opened. Fix: Don't save channels to the settings that are opened by the server.
This commit is contained in:
BeniS
2012-07-13 04:45:22 +12:00
parent 9523b5cde5
commit 8850528091
54 changed files with 500 additions and 293 deletions

View File

@@ -4,7 +4,8 @@ TopMenu = {}
local topMenu
local leftButtonsPanel
local rightButtonsPanel
local gameButtonsPanel
local leftGameButtonsPanel
local rightGameButtonsPanel
-- private functions
local function addButton(id, description, icon, callback, panel, toggle)
@@ -32,10 +33,12 @@ function TopMenu.init()
leftButtonsPanel = topMenu:getChildById('leftButtonsPanel')
rightButtonsPanel = topMenu:getChildById('rightButtonsPanel')
gameButtonsPanel = topMenu:getChildById('gameButtonsPanel')
leftGameButtonsPanel = topMenu:getChildById('leftGameButtonsPanel')
rightGameButtonsPanel = topMenu:getChildById('rightGameButtonsPanel')
if g_game.isOnline() then
gameButtonsPanel:show()
leftGameButtonsPanel:show()
rightGameButtonsPanel:show()
end
end
@@ -45,7 +48,8 @@ function TopMenu.terminate()
leftButtonsPanel = nil
rightButtonsPanel = nil
gameButtonsPanel = nil
leftGameButtonsPanel = nil
rightGameButtonsPanel = nil
topMenu:destroy()
topMenu = nil
@@ -69,20 +73,30 @@ function TopMenu.addRightToggleButton(id, description, icon, callback, right)
return addButton(id, description, icon, callback, rightButtonsPanel, true)
end
function TopMenu.addGameButton(id, description, icon, callback)
return addButton(id, description, icon, callback, gameButtonsPanel, false)
function TopMenu.addLeftGameButton(id, description, icon, callback)
return addButton(id, description, icon, callback, leftGameButtonsPanel, false)
end
function TopMenu.addGameToggleButton(id, description, icon, callback, right)
return addButton(id, description, icon, callback, gameButtonsPanel, true)
function TopMenu.addLeftGameToggleButton(id, description, icon, callback, right)
return addButton(id, description, icon, callback, leftGameButtonsPanel, true)
end
function TopMenu.addRightGameButton(id, description, icon, callback)
return addButton(id, description, icon, callback, rightGameButtonsPanel, false)
end
function TopMenu.addRightGameToggleButton(id, description, icon, callback, right)
return addButton(id, description, icon, callback, rightGameButtonsPanel, true)
end
function TopMenu.hideGameButtons()
gameButtonsPanel:hide()
leftGameButtonsPanel:hide()
rightGameButtonsPanel:hide()
end
function TopMenu.showGameButtons()
gameButtonsPanel:show()
leftGameButtonsPanel:show()
rightGameButtonsPanel:show()
end
function TopMenu.getButton(id)

View File

@@ -57,18 +57,12 @@ TopPanel
anchors.left: parent.left
TopMenuButtonsPanel
id: gameButtonsPanel
id: leftGameButtonsPanel
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: prev.right
visible: false
TopMenuButtonsPanel
id: rightButtonsPanel
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
UILabel
id: frameCounter
text-align: right
@@ -76,7 +70,7 @@ TopPanel
color: white
id: frameCounter
anchors.top: parent.top
anchors.right: prev.left
anchors.left: prev.right
margin-top: 8
margin-right: 5
@onSetup: |
@@ -88,3 +82,16 @@ TopPanel
--print(text)
end
end, 250)
TopMenuButtonsPanel
id: rightButtonsPanel
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
TopMenuButtonsPanel
id: rightGameButtonsPanel
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: prev.left
visible: false