mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 13:03:11 +01:00
Use std::string for TitleSequence names
Co-authored-by: Gabriel Guedes <gabriel.guedesaz@gmail.com>
This commit is contained in:
@@ -159,7 +159,7 @@ public:
|
||||
{
|
||||
if (!SkipToNextLoadCommand() || _position == entryPosition)
|
||||
{
|
||||
Console::Error::WriteLine("Unable to load any parks from %s.", _sequence->Name);
|
||||
Console::Error::WriteLine("Unable to load any parks from %s.", _sequence->Name.c_str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/*****************************************************************************
|
||||
* Copyright (c) 2014-2020 OpenRCT2 developers
|
||||
*
|
||||
* For a complete list of all authors, please refer to contributors.md
|
||||
@@ -89,7 +89,7 @@ std::unique_ptr<TitleSequence> LoadTitleSequence(const utf8* path)
|
||||
auto commands = LegacyScriptRead(reinterpret_cast<utf8*>(script.data()), script.size(), saves);
|
||||
|
||||
auto seq = CreateTitleSequence();
|
||||
seq->Name = Path::GetFileNameWithoutExtension(path);
|
||||
seq->Name = Path::GetFileNameWithoutExtension(std::string(path));
|
||||
seq->Path = String::Duplicate(path);
|
||||
for (auto* save : saves)
|
||||
{
|
||||
@@ -102,7 +102,6 @@ std::unique_ptr<TitleSequence> LoadTitleSequence(const utf8* path)
|
||||
|
||||
void FreeTitleSequence(TitleSequence& seq)
|
||||
{
|
||||
Memory::Free(seq.Name);
|
||||
Memory::Free(seq.Path);
|
||||
}
|
||||
|
||||
@@ -527,7 +526,7 @@ static std::string LegacyScriptWrite(const TitleSequence& seq)
|
||||
auto sb = StringBuilder(128);
|
||||
|
||||
sb.Append("# SCRIPT FOR ");
|
||||
sb.Append(seq.Name);
|
||||
sb.Append(seq.Name.c_str());
|
||||
sb.Append("\n");
|
||||
for (const auto& command : seq.Commands)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ struct TitleCommand
|
||||
|
||||
struct TitleSequence
|
||||
{
|
||||
const utf8* Name = nullptr;
|
||||
std::string Name;
|
||||
const utf8* Path = nullptr;
|
||||
|
||||
std::vector<TitleCommand> Commands;
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace TitleSequenceManager
|
||||
{
|
||||
std::string path = GetNewTitleSequencePath(std::string(name), true);
|
||||
auto seq = CreateTitleSequence();
|
||||
seq->Name = String::Duplicate(name);
|
||||
seq->Name = name;
|
||||
seq->Path = String::Duplicate(path.c_str());
|
||||
seq->IsZip = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user