begin playertrade, questlog and textbooks modules

This commit is contained in:
Eduardo Bart
2012-04-30 21:20:27 -03:00
parent 5b352ac999
commit 00740b56f3
13 changed files with 193 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
QuestLog = {}
-- g_game.requestQuestLog()
-- g_game.requestQuestLine(questId)
local function onGameQuestLog(questList)
for i,questEntry in pairs(questList) do
local id, name, done = unpack(questEntry)
print(id, name, done)
end
end
local function onGameQuestLine(questId, questMissions)
for i,questMission in pairs(questMissions) do
local name, description = unpack(questMission)
print(name, description)
end
end
function QuestLog.init()
importStyle 'questlogwindow.otui'
connect(g_game, { onQuestLog = onGameQuestLog })
connect(g_game, { onQuestLine= onGameQuestLine })
end
function QuestLog.terminate()
disconnect(g_game, { onQuestLog = onGameQuestLog })
disconnect(g_game, { onQuestLine= onGameQuestLine })
end

View File

@@ -0,0 +1,15 @@
Module
name: game_questlog
description: View game quests status
author: OTClient team
website: https://github.com/edubart/otclient
dependencies:
- game
@onLoad: |
dofile 'questlog'
QuestLog.init()
@onUnload: |
QuestLog.terminate()

View File

@@ -0,0 +1 @@
QuestLogWindow < MainWindow