From 2e485d88a921b9263c44c64d1b07a413d55aa611 Mon Sep 17 00:00:00 2001
From: HJfod <60038575+HJfod@users.noreply.github.com>
Date: Mon, 6 Mar 2023 19:52:49 +0200
Subject: [PATCH] add CurrencyRewardLayer::create and its related enums

---
 bindings/GeometryDash.bro             | 9 ++++++++-
 loader/include/Geode/Enums.hpp        | 8 ++++++++
 loader/include/Geode/utils/Result.hpp | 9 +++++----
 3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/bindings/GeometryDash.bro b/bindings/GeometryDash.bro
index 6fb6f127..3b50b4fa 100644
--- a/bindings/GeometryDash.bro
+++ b/bindings/GeometryDash.bro
@@ -878,6 +878,13 @@ class CurrencyRewardLayer : cocos2d::CCLayer {
     inline CurrencyRewardLayer() {}
     ~CurrencyRewardLayer() = mac 0x447950, win 0x4ffb0;
     virtual void update(float) = mac 0x44a5c0, win 0x52350;
+
+    static CurrencyRewardLayer* create(
+        int, int, int,
+        CurrencySpriteType, int,
+        CurrencySpriteType, int,
+        cocos2d::CCPoint, CurrencyRewardType, float
+    ) = win 0x50050;
 }
 
 class CurrencyRewardDelegate {
@@ -4284,7 +4291,7 @@ class PlayLayer : GJBaseGameLayer, CCCircleWaveDelegate, CurrencyRewardDelegate,
     void shouldBlend(int) = mac 0x771b0;
     void showCompleteEffect() = mac 0x738e0, win 0x1fe060;
     void showCompleteText() = mac 0x73be0, win 0x1fda90;
-    void showEndLayer() = mac 0x74450;
+    void showEndLayer() = mac 0x74450, win 0x1ffd00;
     void showHint() = mac 0x7deb0;
     void showNewBest(bool, int, int, bool, bool, bool) = mac 0x74580, win 0x1fe3a0;
     void showRetryLayer() = mac 0x75ba0;
diff --git a/loader/include/Geode/Enums.hpp b/loader/include/Geode/Enums.hpp
index 42eb3bc3..f7a052d5 100644
--- a/loader/include/Geode/Enums.hpp
+++ b/loader/include/Geode/Enums.hpp
@@ -122,6 +122,14 @@ enum class BoomListType {
     Artist = 0x14,
 };
 
+enum class CurrencySpriteType {
+    // todo
+};
+
+enum class CurrencyRewardType {
+    // todo
+};
+
 enum class MenuAnimationType {
     Scale = 0,
     Move = 1,
diff --git a/loader/include/Geode/utils/Result.hpp b/loader/include/Geode/utils/Result.hpp
index 7f95750a..b4f02cb3 100644
--- a/loader/include/Geode/utils/Result.hpp
+++ b/loader/include/Geode/utils/Result.hpp
@@ -8,6 +8,7 @@
 #include <string_view>
 #include <type_traits>
 #include <variant>
+#include <optional>
 
 namespace geode {
     namespace impl {
@@ -209,7 +210,7 @@ namespace geode {
          * Convert the result into an optional containing the value if Ok, and 
          * nullopt if Err
          */
-        [[nodiscard]] constexpr decltype(auto) ok() const& {
+        [[nodiscard]] constexpr std::optional<T> ok() const& {
             if (this->isOk()) {
                 return std::optional(this->unwrap());
             }
@@ -220,7 +221,7 @@ namespace geode {
          * Convert the result into an optional containing the value if Ok, and 
          * nullopt if Err
          */
-        [[nodiscard]] constexpr decltype(auto) ok() && {
+        [[nodiscard]] constexpr std::optional<T> ok() && {
             if (this->isOk()) {
                 return std::optional(this->unwrap());
             }
@@ -231,7 +232,7 @@ namespace geode {
          * Convert the result into an optional containing the error if Err, and 
          * nullopt if Ok
          */
-        [[nodiscard]] constexpr decltype(auto) err() const& {
+        [[nodiscard]] constexpr std::optional<E> err() const& {
             if (this->isErr()) {
                 return std::optional(this->unwrapErr());
             }
@@ -242,7 +243,7 @@ namespace geode {
          * Convert the result into an optional containing the error if Err, and 
          * nullopt if Ok
          */
-        [[nodiscard]] constexpr decltype(auto) err() && {
+        [[nodiscard]] constexpr std::optional<E> err() && {
             if (this->isErr()) {
                 return std::optional(this->unwrapErr());
             }