mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
begin playertrade, questlog and textbooks modules
This commit is contained in:
30
modules/game_questlog/questlog.lua
Normal file
30
modules/game_questlog/questlog.lua
Normal 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
|
15
modules/game_questlog/questlog.otmod
Normal file
15
modules/game_questlog/questlog.otmod
Normal 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()
|
1
modules/game_questlog/questlogwindow.otui
Normal file
1
modules/game_questlog/questlogwindow.otui
Normal file
@@ -0,0 +1 @@
|
||||
QuestLogWindow < MainWindow
|
Reference in New Issue
Block a user