Skip to content

Commit

Permalink
StoreCommands (2099) - Use kCodeTags.tag instead of custom tag reader
Browse files Browse the repository at this point in the history
  • Loading branch information
jetrotal committed Dec 22, 2023
1 parent d5f00c3 commit 47940ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "utils.h"
#include <iostream>
#include <map>
#include <unordered_map>
#include <string>

class Constants {
Expand Down
9 changes: 7 additions & 2 deletions src/game_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5099,7 +5099,6 @@ bool Game_Interpreter::CommandStoreCommands(lcf::rpg::EventCommand const& com) {
}

std::string rawCommand = " ";
Constants constList;

const auto& list = evtType == 1 ? common_event->GetList() : page->event_commands;
int index = 0;
Expand All @@ -5122,8 +5121,14 @@ bool Game_Interpreter::CommandStoreCommands(lcf::rpg::EventCommand const& com) {
std::string preffix(list[i].indent, ' ');
std::string suffix = i < list.size() - 1 ? "\n" : "";

auto cmd_tag = lcf::rpg::EventCommand::kCodeTags.tag(list[i].code);
std::string command_id;

if (!cmd_tag) command_id = std::to_string(list[i].code);
else command_id = cmd_tag;

rawCommand += fmt::format("{}${}, \"{}\", [{}], {};{}",
preffix, constList.get("EventCode", std::to_string(list[i].code), 1), inputString, ss.str(), list[i].indent, suffix);
preffix, command_id, inputString, ss.str(), list[i].indent, suffix);
}

Game_Strings::Str_Params str_params = { targetStrVar,0, 0 };
Expand Down

0 comments on commit 47940ef

Please sign in to comment.