Torch
Loading...
Searching...
No Matches
GruntyQuestionFactory.h
1#pragma once
2
3#include "DialogFactory.h"
4#include <factories/BaseFactory.h>
5#include "factories/bk64/BKHeaderExporter.h"
6
7namespace BK64 {
8
9typedef struct OptionString {
10 uint8_t cmd;
11 uint8_t unk0;
12 uint8_t unk1;
13 std::string str;
15
16// One language's question: the text entries plus the three answer options.
17typedef struct GruntyQuestionLang {
18 std::vector<DialogString> text;
19 std::vector<OptionString> options;
21
22class GruntyQuestionData : public IParsedData {
23 public:
24 // Always set. English on PAL, the lone language on US.
25 std::vector<DialogString> mText;
26 std::vector<OptionString> mOptions;
27
28 // PAL only: index 0=French, 1=German
29 std::vector<GruntyQuestionLang> mExtraLangs;
30
31 GruntyQuestionData(std::vector<DialogString> text, std::vector<OptionString> options)
32 : mText(std::move(text)), mOptions(std::move(options)) {
33 }
34
35 GruntyQuestionData(std::vector<DialogString> text, std::vector<OptionString> options,
36 std::vector<GruntyQuestionLang> extraLangs)
37 : mText(std::move(text)), mOptions(std::move(options)), mExtraLangs(std::move(extraLangs)) {
38 }
39};
40
42 ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName,
43 YAML::Node& node, std::string* replacement) override;
44};
45
47 ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName,
48 YAML::Node& node, std::string* replacement) override;
49};
50
52 ExportResult Export(std::ostream& write, std::shared_ptr<IParsedData> data, std::string& entryName,
53 YAML::Node& node, std::string* replacement) override;
54};
55
57 public:
58 std::optional<std::shared_ptr<IParsedData>> parse(std::vector<uint8_t>& buffer, YAML::Node& data) override;
59 std::optional<std::shared_ptr<IParsedData>> parse_modding(std::vector<uint8_t>& buffer, YAML::Node& data) override;
60 inline std::unordered_map<ExportType, std::shared_ptr<BaseExporter>> GetExporters() override {
61 return { REGISTER(Code, GruntyQuestionCodeExporter) REGISTER(Header, BKHeaderExporter)
62 REGISTER(Binary, GruntyQuestionBinaryExporter) REGISTER(Modding, GruntyQuestionModdingExporter) };
63 }
64 bool SupportModdedAssets() override {
65 return true;
66 }
67};
68} // namespace BK64
Definition BKHeaderExporter.h:8
Definition GruntyQuestionFactory.h:41
Definition GruntyQuestionFactory.h:46
Definition GruntyQuestionFactory.h:56
Definition GruntyQuestionFactory.h:51
Definition BaseFactory.h:96
Definition BaseFactory.h:102
Definition BaseFactory.h:88
Definition GruntyQuestionFactory.h:17
Definition GruntyQuestionFactory.h:9