From 09d26d43b5262f480fd55eab9980eff06a71edbb Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 26 Jun 2023 01:42:18 +1000 Subject: 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 --- source/game/StarParallax.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source/game/StarParallax.cpp') 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 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; -- cgit v1.2.3