diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-26 01:42:18 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-26 01:42:18 +1000 |
commit | 09d26d43b5262f480fd55eab9980eff06a71edbb (patch) | |
tree | 1e53765861cd966d204782aeefd15b1a67b3266f /source/game/StarParallax.cpp | |
parent | 13a74602bd4c46149da9949d448387a40b8ebd1c (diff) |
Add string view variant of Star::String and use it
it's 1:30 AM AGAIN !! !!!!!
This might have broken the inventory icons of custom hats a little, need to look into that
Diffstat (limited to 'source/game/StarParallax.cpp')
-rw-r--r-- | source/game/StarParallax.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/game/StarParallax.cpp b/source/game/StarParallax.cpp index a950086..f895d83 100644 --- a/source/game/StarParallax.cpp +++ b/source/game/StarParallax.cpp @@ -41,7 +41,7 @@ ParallaxLayer::ParallaxLayer(Json const& store) : ParallaxLayer() { Json ParallaxLayer::store() const { return JsonObject{ {"textures", jsonFromStringList(textures)}, - {"directives", directives.toString()}, + {"directives", directives.string()}, {"parallaxValue", jsonFromVec2F(parallaxValue)}, {"repeat", jsonFromVec2B(repeat)}, {"tileLimitTop", jsonFromMaybe(tileLimitTop)}, @@ -59,11 +59,14 @@ Json ParallaxLayer::store() const { void ParallaxLayer::addImageDirectives(Directives const& newDirectives) { if (newDirectives) { // TODO: Move to Directives += if (directives) { - List<Directives::Entry> newEntries = *directives.entries; - for (auto const& entry : *newDirectives.entries) - newEntries.push_back(entry); + String newString; - directives = move(newEntries); + for (auto const& entry : newDirectives.shared->entries) { + newString += "+"; + newString += entry.string(*newDirectives.shared); + } + + directives = move(newString); } else directives = newDirectives; |