Debian Codegraph @

plugins/dm.editing/MissionInfoGuiView.h

raw
1 #pragma once
2
3 #include "igui.h"
4 #include "wxutil/preview/GuiView.h"
5
6 #include "DarkmodTxt.h"
7 #include "ReadmeTxt.h"
8
9 namespace ui
10 {
11
12 /**
13 * greebo: Specialisation of the generic GuiView with regard to the mission info dialog.
14 * The viewport is cropped to the size of a certain windowDef.
15 */
16 class MissionInfoGuiView :
17 public wxutil::GuiView
18 {
19 protected:
20 Vector2 _bgDims;
21
22 std::vector<std::string> backgroundDefList;
23
24 public:
25 MissionInfoGuiView(wxWindow* parent);
26
27 virtual void setGui(const gui::IGuiPtr& gui) override;
28
29 // Loads values into the GUI (state) variables
30 virtual void updateGuiState() = 0;
31
32 protected:
33 virtual void setGLViewPort();
34
35 // Returns the name of the single window def to display
36 virtual std::string getTargetWindowDefName() = 0;
37 };
38
39 // Specialisation for displaying info in darkmod.txt
40 // which will filter itself to the "ModToInstallParent" windowDef
41 class DarkmodTxtGuiView :
42 public MissionInfoGuiView
43 {
44 private:
45 // The file containing the mission info this view is previewing
46 map::DarkmodTxtPtr _file;
47
48 public:
49 DarkmodTxtGuiView(wxWindow* parent);
50
51 void updateGuiState() override;
52
53 void setMissionInfoFile(const map::DarkmodTxtPtr& file);
54
55 protected:
56 virtual std::string getTargetWindowDefName() override;
57 };
58
59 // Specialisation for displaying info in readme.txt
60 // which will filter itself to the "ModInstallationNotesParchment" windowDef
61 class ReadmeTxtGuiView :
62 public MissionInfoGuiView
63 {
64 private:
65 // The file containing the mission info this view is previewing
66 map::ReadmeTxtPtr _file;
67
68 public:
69 ReadmeTxtGuiView(wxWindow* parent);
70
71 void updateGuiState() override;
72
73 void setMissionInfoFile(const map::ReadmeTxtPtr& file);
74
75 protected:
76 virtual std::string getTargetWindowDefName() override;
77 };
78
79 } // namespace