BeniS 8850528091 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.
2012-07-13 04:45:22 +12:00

88 lines
2.4 KiB
Lua

QuestLog = {}
local questLogButton
local questLogWindow
local questLineWindow
local function onGameQuestLog(quests)
QuestLog.destroyWindows()
questLogWindow = g_ui.createWidget('QuestLogWindow', rootWidget)
local questList = questLogWindow:getChildById('questList')
for i,questEntry in pairs(quests) do
local id, name, completed = unpack(questEntry)
local questLabel = g_ui.createWidget('QuestLabel', questList)
questLabel:setOn(completed)
questLabel:setText(name)
questLabel.onDoubleClick = function()
questLogWindow:hide()
g_game.requestQuestLine(id)
end
end
questLogWindow.onDestroy = function()
questLogWindow = nil
end
end
local function onGameQuestLine(questId, questMissions)
if questLogWindow then questLogWindow:hide() end
if questLineWindow then questLineWindow:destroy() end
questLineWindow = g_ui.createWidget('QuestLineWindow', rootWidget)
local missionList = questLineWindow:getChildById('missionList')
local missionDescription = questLineWindow:getChildById('missionDescription')
connect(missionList, { onChildFocusChange = function(self, focusedChild)
if focusedChild == nil then return end
missionDescription:setText(focusedChild.description)
end })
for i,questMission in pairs(questMissions) do
local name, description = unpack(questMission)
local missionLabel = g_ui.createWidget('MissionLabel', missionList)
missionLabel:setText(name)
missionLabel.description = description
end
questLineWindow.onDestroy = function()
if questLogWindow then questLogWindow:show() end
questLineWindow = nil
end
end
function QuestLog.init()
g_ui.importStyle('questlogwindow.otui')
g_ui.importStyle('questlinewindow.otui')
questLogButton = TopMenu.addLeftGameButton('questLogButton', tr('Quest Log'), 'questlog.png', function() g_game.requestQuestLog() end)
connect(g_game, { onQuestLog = onGameQuestLog })
connect(g_game, { onQuestLine= onGameQuestLine })
end
function QuestLog.destroyWindows()
if questLogWindow then
questLogWindow:destroy()
questLogWindow = nil
end
if questLineWindow then
questLineWindow:destroy()
questLineWindow = nil
end
end
function QuestLog.terminate()
disconnect(g_game, { onQuestLog = onGameQuestLog })
disconnect(g_game, { onQuestLine= onGameQuestLine })
QuestLog.destroyWindows()
questLogButton:destroy()
questLogButton = nil
end