rewrite ItemNameIndex and index all game text

This commit is contained in:
Martin Michelsen
2023-12-31 21:24:12 -08:00
parent ac39db2f36
commit a24d0ad703
110 changed files with 1176 additions and 795 deletions
+3 -3
View File
@@ -764,7 +764,7 @@ string CardDefinition::Effect::str_for_arg(const string& arg) {
}
}
string CardDefinition::Effect::str(const char* separator, const TextArchive* text_archive) const {
string CardDefinition::Effect::str(const char* separator, const TextSet* text_archive) const {
vector<string> tokens;
tokens.emplace_back(string_printf("%hhu:", this->effect_num));
{
@@ -802,7 +802,7 @@ string CardDefinition::Effect::str(const char* separator, const TextArchive* tex
const char* name = nullptr;
if (this->name_index && text_archive) {
try {
name = text_archive->get_string(45, this->name_index).c_str();
name = text_archive->get(45, this->name_index).c_str();
} catch (const exception&) {
}
}
@@ -1061,7 +1061,7 @@ static const char* name_for_assist_ai_param_target(uint8_t target) {
}
}
string CardDefinition::str(bool single_line, const TextArchive* text_archive) const {
string CardDefinition::str(bool single_line, const TextSet* text_archive) const {
string type_str;
try {
type_str = name_for_card_type(this->type);
+3 -3
View File
@@ -15,7 +15,7 @@
#include "../PlayerSubordinates.hh"
#include "../Text.hh"
#include "../TextArchive.hh"
#include "../TextIndex.hh"
namespace Episode3 {
@@ -514,7 +514,7 @@ struct CardDefinition {
bool is_empty() const;
static std::string str_for_arg(const std::string& arg);
std::string str(const char* separator = ", ", const TextArchive* text_archive = nullptr) const;
std::string str(const char* separator = ", ", const TextSet* text_archive = nullptr) const;
} __attribute__((packed));
/* 0000 */ be_uint32_t card_id;
@@ -780,7 +780,7 @@ struct CardDefinition {
CardClass card_class() const;
void decode_range();
std::string str(bool single_line = true, const TextArchive* text_archive = nullptr) const;
std::string str(bool single_line = true, const TextSet* text_archive = nullptr) const;
} __attribute__((packed)); // 0x128 bytes in total
struct CardDefinitionsFooter {