2024-02-25 14:46:47 +00:00
|
|
|
#pragma once
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
#include "StarQuests.hpp"
|
|
|
|
#include "StarPane.hpp"
|
|
|
|
|
|
|
|
namespace Star {
|
|
|
|
|
|
|
|
STAR_CLASS(QuestManager);
|
|
|
|
STAR_CLASS(Player);
|
|
|
|
STAR_CLASS(Cinematic);
|
|
|
|
STAR_CLASS(UniverseClient);
|
|
|
|
STAR_CLASS(PaneManager);
|
|
|
|
STAR_CLASS(ItemBag);
|
|
|
|
|
|
|
|
class QuestLogInterface : public Pane {
|
|
|
|
public:
|
|
|
|
QuestLogInterface(QuestManagerPtr manager, PlayerPtr player, CinematicPtr cinematic, UniverseClientPtr client);
|
|
|
|
virtual ~QuestLogInterface() {}
|
|
|
|
|
|
|
|
virtual void displayed() override;
|
2023-07-20 14:58:49 +00:00
|
|
|
virtual void tick(float dt) override;
|
2023-06-20 04:33:09 +00:00
|
|
|
virtual PanePtr createTooltip(Vec2I const& screenPosition) override;
|
|
|
|
|
|
|
|
void fetchData();
|
|
|
|
|
|
|
|
void pollDialog(PaneManager* paneManager);
|
|
|
|
|
|
|
|
private:
|
|
|
|
WidgetPtr getSelected();
|
|
|
|
void setSelected(WidgetPtr selected);
|
|
|
|
void toggleTracking();
|
|
|
|
void abandon();
|
|
|
|
void showQuests(List<QuestPtr> quests);
|
|
|
|
|
|
|
|
QuestManagerPtr m_manager;
|
|
|
|
PlayerPtr m_player;
|
|
|
|
CinematicPtr m_cinematic;
|
|
|
|
UniverseClientPtr m_client;
|
|
|
|
|
|
|
|
String m_trackLabel;
|
|
|
|
String m_untrackLabel;
|
|
|
|
|
|
|
|
ItemBagPtr m_rewardItems;
|
|
|
|
int m_refreshRate;
|
|
|
|
int m_refreshTimer;
|
|
|
|
};
|
|
|
|
|
|
|
|
class QuestPane : public Pane {
|
|
|
|
protected:
|
|
|
|
QuestPane(QuestPtr const& quest, PlayerPtr player);
|
|
|
|
|
|
|
|
void commonSetup(Json config, String bodyText, String const& portraitName);
|
|
|
|
virtual void close();
|
2024-04-05 12:09:57 +00:00
|
|
|
virtual void decline();
|
2023-06-20 04:33:09 +00:00
|
|
|
virtual void accept();
|
|
|
|
virtual PanePtr createTooltip(Vec2I const& screenPosition) override;
|
|
|
|
|
|
|
|
QuestPtr m_quest;
|
|
|
|
PlayerPtr m_player;
|
|
|
|
};
|
|
|
|
|
|
|
|
class NewQuestInterface : public QuestPane {
|
|
|
|
public:
|
2024-04-05 12:09:57 +00:00
|
|
|
enum class QuestDecision {
|
|
|
|
Declined,
|
|
|
|
Accepted,
|
|
|
|
Cancelled
|
|
|
|
};
|
|
|
|
|
2023-06-20 04:33:09 +00:00
|
|
|
NewQuestInterface(QuestManagerPtr const& manager, QuestPtr const& quest, PlayerPtr player);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void close() override;
|
2024-04-05 12:09:57 +00:00
|
|
|
void decline() override;
|
2023-06-20 04:33:09 +00:00
|
|
|
void accept() override;
|
|
|
|
void dismissed() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QuestManagerPtr m_manager;
|
2024-04-05 12:09:57 +00:00
|
|
|
QuestDecision m_decision;
|
2023-06-20 04:33:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class QuestCompleteInterface : public QuestPane {
|
|
|
|
public:
|
|
|
|
QuestCompleteInterface(QuestPtr const& quest, PlayerPtr player, CinematicPtr cinematic);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void close() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
PlayerPtr m_player;
|
|
|
|
CinematicPtr m_cinematic;
|
|
|
|
};
|
|
|
|
|
|
|
|
class QuestFailedInterface : public QuestPane {
|
|
|
|
public:
|
|
|
|
QuestFailedInterface(QuestPtr const& quest, PlayerPtr player);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|