summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-26 02:41:35 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-26 02:41:35 +0300
commit52fdc7544c117b058fb1321a24795d64fe3d3887 (patch)
tree903955c78f5911e09c8cb9a7cf00c720de842f4d
parent3a97fc3fd6f316882af762017443c410632d65eb (diff)
downloadplus-52fdc7544c117b058fb1321a24795d64fe3d3887.tar.gz
plus-52fdc7544c117b058fb1321a24795d64fe3d3887.tar.bz2
plus-52fdc7544c117b058fb1321a24795d64fe3d3887.tar.xz
plus-52fdc7544c117b058fb1321a24795d64fe3d3887.zip
Read all fields from new quest packets and send to quests and skills window.
But for now not using this fields.
-rw-r--r--src/gui/windows/questswindow.cpp8
-rw-r--r--src/gui/windows/questswindow.h6
-rw-r--r--src/gui/windows/skilldialog.cpp10
-rw-r--r--src/gui/windows/skilldialog.h6
-rw-r--r--src/net/eathena/questrecv.cpp36
-rw-r--r--src/net/tmwa/questrecv.cpp8
6 files changed, 45 insertions, 29 deletions
diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp
index fd6678e55..308d38da5 100644
--- a/src/gui/windows/questswindow.cpp
+++ b/src/gui/windows/questswindow.cpp
@@ -336,9 +336,13 @@ void QuestsWindow::action(const ActionEvent &event)
}
}
-void QuestsWindow::updateQuest(const int var, const int val)
+void QuestsWindow::updateQuest(const int var,
+ const int val1,
+ const int val2 A_UNUSED,
+ const int val3 A_UNUSED,
+ const int time A_UNUSED)
{
- mVars[var] = val;
+ mVars[var] = val1;
}
void QuestsWindow::rebuild(const bool playSound)
diff --git a/src/gui/windows/questswindow.h b/src/gui/windows/questswindow.h
index ec2f7da42..08ef852d9 100644
--- a/src/gui/windows/questswindow.h
+++ b/src/gui/windows/questswindow.h
@@ -59,7 +59,11 @@ class QuestsWindow final : public Window,
void action(const ActionEvent &event) override final;
- void updateQuest(const int var, const int val);
+ void updateQuest(const int var,
+ const int val1,
+ const int val2,
+ const int val3,
+ const int time);
void rebuild(const bool playSound);
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index a6ede8245..6aa4c8afb 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -682,7 +682,11 @@ void SkillDialog::updateTabSelection()
}
}
-void SkillDialog::updateQuest(const int var, const int val)
+void SkillDialog::updateQuest(const int var,
+ const int val1,
+ const int val2 A_UNUSED,
+ const int val3 A_UNUSED,
+ const int time A_UNUSED)
{
const int id = var + SKILL_VAR_MIN_ID;
const SkillMap::const_iterator it = mSkills.find(id);
@@ -692,8 +696,8 @@ void SkillDialog::updateQuest(const int var, const int val)
SkillInfo *const info = it->second;
if (info)
{
- PlayerInfo::setSkillLevel(id, val);
- info->level = val;
+ PlayerInfo::setSkillLevel(id, val1);
+ info->level = val1;
info->update();
}
}
diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h
index a24f44a5f..3bd5f1d4a 100644
--- a/src/gui/windows/skilldialog.h
+++ b/src/gui/windows/skilldialog.h
@@ -124,7 +124,11 @@ class SkillDialog final : public Window,
void updateTabSelection();
- void updateQuest(const int var, const int val);
+ void updateQuest(const int var,
+ const int val1,
+ const int val2,
+ const int val3,
+ const int time);
void playUpdateEffect(const int id) const;
diff --git a/src/net/eathena/questrecv.cpp b/src/net/eathena/questrecv.cpp
index ca5f706e8..88f804330 100644
--- a/src/net/eathena/questrecv.cpp
+++ b/src/net/eathena/questrecv.cpp
@@ -51,12 +51,12 @@ void QuestRecv::processAddQuest(Net::MessageIn &msg)
if (questsWindow)
{
- questsWindow->updateQuest(var, val);
+ questsWindow->updateQuest(var, val, 0, 0, 0);
questsWindow->rebuild(true);
}
if (skillDialog)
{
- skillDialog->updateQuest(var, val);
+ skillDialog->updateQuest(var, val, 0, 0, 0);
skillDialog->playUpdateEffect(var + SKILL_VAR_MIN_ID);
}
}
@@ -65,20 +65,20 @@ void QuestRecv::processAddQuest2(Net::MessageIn &msg)
{
const int var = msg.readInt32("quest id");
msg.readUInt8("state");
- const int val = msg.readInt32("count1");
+ const int val1 = msg.readInt32("count1");
// +++ need use all this fields
- msg.readInt32("count2");
- msg.readInt32("count3");
- msg.readInt32("time");
+ const int val2 = msg.readInt32("count2");
+ const int val3 = msg.readInt32("count3");
+ const int time = msg.readInt32("time");
if (questsWindow)
{
- questsWindow->updateQuest(var, val);
+ questsWindow->updateQuest(var, val1, val2, val3, time);
questsWindow->rebuild(true);
}
if (skillDialog)
{
- skillDialog->updateQuest(var, val);
+ skillDialog->updateQuest(var, val1, val2, val3, time);
skillDialog->playUpdateEffect(var + SKILL_VAR_MIN_ID);
}
}
@@ -98,9 +98,9 @@ void QuestRecv::processAddQuests(Net::MessageIn &msg)
msg.readInt16("objectives count");
}
if (questsWindow)
- questsWindow->updateQuest(var, val);
+ questsWindow->updateQuest(var, val, 0, 0, 0);
if (skillDialog)
- skillDialog->updateQuest(var, val);
+ skillDialog->updateQuest(var, val, 0, 0, 0);
}
if (questsWindow)
@@ -115,15 +115,15 @@ void QuestRecv::processAddQuests2(Net::MessageIn &msg)
{
const int var = msg.readInt32("quest id");
msg.readUInt8("state");
- const int val = msg.readInt32("count1");
+ const int val1 = msg.readInt32("count1");
// +++ need use all this fields
- msg.readInt32("count2");
- msg.readInt32("count3");
- msg.readInt32("time");
+ const int val2 = msg.readInt32("count2");
+ const int val3 = msg.readInt32("count3");
+ const int time = msg.readInt32("time");
if (questsWindow)
- questsWindow->updateQuest(var, val);
+ questsWindow->updateQuest(var, val1, val2, val3, time);
if (skillDialog)
- skillDialog->updateQuest(var, val);
+ skillDialog->updateQuest(var, val1, val2, val3, time);
}
if (questsWindow)
@@ -174,12 +174,12 @@ void QuestRecv::processRemoveQuest(Net::MessageIn &msg)
// but changing status to -1
if (questsWindow)
{
- questsWindow->updateQuest(var, val);
+ questsWindow->updateQuest(var, val, 0, 0, 0);
questsWindow->rebuild(true);
}
if (skillDialog)
{
- skillDialog->updateQuest(var, val);
+ skillDialog->updateQuest(var, val, 0, 0, 0);
skillDialog->playUpdateEffect(var + SKILL_VAR_MIN_ID);
}
}
diff --git a/src/net/tmwa/questrecv.cpp b/src/net/tmwa/questrecv.cpp
index b4e0f36b5..43d1b13c0 100644
--- a/src/net/tmwa/questrecv.cpp
+++ b/src/net/tmwa/questrecv.cpp
@@ -38,12 +38,12 @@ void QuestRecv::processSetQuestVar(Net::MessageIn &msg)
const int val = msg.readInt32("value");
if (questsWindow)
{
- questsWindow->updateQuest(var, val);
+ questsWindow->updateQuest(var, val, 0, 0, 0);
questsWindow->rebuild(true);
}
if (skillDialog)
{
- skillDialog->updateQuest(var, val);
+ skillDialog->updateQuest(var, val, 0, 0, 0);
skillDialog->playUpdateEffect(var + SKILL_VAR_MIN_ID);
}
}
@@ -56,9 +56,9 @@ void QuestRecv::processPlayerQuests(Net::MessageIn &msg)
const int var = msg.readInt16("variable");
const int val = msg.readInt32("value");
if (questsWindow)
- questsWindow->updateQuest(var, val);
+ questsWindow->updateQuest(var, val, 0, 0, 0);
if (skillDialog)
- skillDialog->updateQuest(var, val);
+ skillDialog->updateQuest(var, val, 0, 0, 0);
}
if (questsWindow)
questsWindow->rebuild(false);