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

@@ -41,7 +41,7 @@ end
-- public functions
function CombatControls.init()
combatControlsButton = TopMenu.addGameToggleButton('combatControlsButton', tr('Combat Controls'), 'combatcontrols.png', CombatControls.toggle)
combatControlsButton = TopMenu.addRightGameToggleButton('combatControlsButton', tr('Combat Controls'), 'combatcontrols.png', CombatControls.toggle)
combatControlsButton:setOn(true)
combatControlsWindow = g_ui.loadUI('combatcontrols.otui', GameInterface.getRightPanel())
@@ -131,11 +131,43 @@ function CombatControls.check()
end
function CombatControls.online()
local player = g_game.getLocalPlayer()
if(player) then
local char = player:getName()
local lastCombatControls = g_settings.getNode('LastCombatControls')
if(not table.empty(lastCombatControls)) then
if(lastCombatControls[char]) then
g_game.setFightMode(lastCombatControls[char].fightMode)
g_game.setChaseMode(lastCombatControls[char].chaseMode)
g_game.setSafeFight(lastCombatControls[char].safeFight)
end
end
end
combatControlsWindow:setVisible(combatControlsButton:isOn())
CombatControls.update()
end
function CombatControls.offline()
local lastCombatControls = g_settings.getNode('LastCombatControls')
if(not lastCombatControls) then
lastCombatControls = {}
end
local player = g_game.getLocalPlayer()
if(player) then
local char = player:getName()
lastCombatControls[char] = {
fightMode = g_game.getFightMode(),
chaseMode = g_game.getChaseMode(),
safeFight = g_game.isSafeFight()
}
-- save last combat control settings
g_settings.setNode('LastCombatControls', lastCombatControls)
end
end
function CombatControls.toggle()

View File

@@ -1,7 +1,7 @@
Module
name: game_combatcontrols
description: Combat controls window
author: edubart
author: edubart, BeniS
website: www.otclient.info
dependencies: