Skip to content

Commit d646cdc

Browse files
author
blu3
authored
Merge branch 'EclipseMenu:main' into main
2 parents 2bdb0af + 3df17c3 commit d646cdc

63 files changed

Lines changed: 297 additions & 97 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</a>
1414
<img src="https://img.shields.io/github/downloads/EclipseMenu/EclipseMenu/total" alt="Total downloads">
1515
<img src="https://img.shields.io/github/downloads/EclipseMenu/EclipseMenu/latest/total" alt="Latest release downloads">
16-
<a href="LICENSE">
16+
<a href="LICENSE.md">
1717
<img src="https://img.shields.io/github/license/EclipseMenu/EclipseMenu" alt="License">
1818
</a>
1919
<a href="https://github.com/EclipseMenu/EclipseMenu/issues">
@@ -45,14 +45,17 @@
4545
4. Have fun using our mod!
4646

4747
## Features
48-
- 90+ hacks
49-
- Startpos Switcher (with Smart Smartpos!)
48+
- 100+ hacks
49+
- StartPos Switcher (with Smart SmartPos!)
5050
- Fully Customizable Labels
5151
- Show Trajectory
5252
- Internal Recorder
5353
- Replay Bot
5454
- Keybinds
5555
- Theme Customizability (you can theme Eclipse Menu however you want!)
56+
- Crossplatform support (Windows, macOS, Android)
57+
- Community Translations (check the [translations repository](https://github.com/EclipseMenu/translations) on how to contribute)
58+
- An API for other mods to interact with Eclipse
5659

5760
## Build Instructions
5861
1. You must have the following: `CMake`, `MSVC / Clang`, `Git`, `Geode CLI`, `Geode SDK`

about.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ A **next-generation** mod menu for Geometry Dash.
88
4. Have fun using our mod!
99

1010
## Features
11-
- 90+ hacks
12-
- Startpos Switcher (with Smart Smartpos!)
11+
- 100+ hacks
12+
- StartPos Switcher (with Smart SmartPos!)
1313
- Fully Customizable Labels
1414
- Show Trajectory
1515
- Internal Recorder
1616
- Replay Bot
1717
- Keybinds
1818
- Theme Customizability (you can theme Eclipse Menu however you want!)
19+
- Crossplatform support (Windows, macOS, Android)
20+
- Community Translations (check the [translations repository](https://github.com/EclipseMenu/translations) on how to contribute)
21+
- An API for other mods to interact with Eclipse
1922

2023
## Credits
2124
This mod menu would not be possible without the developers from other mod menus teaming up together!

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* <cg>Added</c> Translations (check the [translations repository](https://github.com/EclipseMenu/translations) on how to contribute)
2121
* <cg>Added</c> search bar for hacks
2222
* <cg>Added</c> customization settings for menu open/close animations (tabbed layout)
23+
* Added <cg>Catppuccin Macchiato</c> theme as one of the default ones (thanks to [arvFlash](https://github.com/arvFlash))
2324
* Added <cg>No Level Kick</c>
2425
* Added <cg>Checkpoint Delay</c>
2526
* Added <cg>All Passable</c>

include/components.hpp

Lines changed: 111 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace eclipse::components {
1515
enum class ComponentType {
16-
Label, Toggle
16+
Label, Toggle, Button, InputFloat
1717
};
1818

1919
template <ComponentType T>
@@ -22,27 +22,49 @@ namespace eclipse::components {
2222
constexpr ComponentType getType() const { return T; }
2323
size_t getUniqueID() const { return m_uniqueID; }
2424
explicit Component(size_t id) : m_uniqueID(id) {}
25-
private:
25+
protected:
26+
void setDescriptionImpl(const std::string& description) const;
2627
size_t m_uniqueID = 0;
2728
};
2829

29-
using Label = Component<ComponentType::Label>;
30+
class Label final : public Component<ComponentType::Label> {
31+
public:
32+
explicit Label(size_t uid) : Component(uid) {}
33+
Label& setText(const std::string& text);
34+
Label const& setText(const std::string& text) const;
35+
};
36+
3037
class Toggle final : public Component<ComponentType::Toggle> {
3138
public:
3239
Toggle(size_t uid, std::string id) : Component(uid), m_id(std::move(id)) {}
3340
const std::string& getID() const { return m_id; }
34-
Toggle& setDescription(const std::string& description);
35-
// Toggle& addOptions(const std::function<void()>& options);
41+
Toggle& setDescription(const std::string& description) { setDescriptionImpl(description); return *this; }
42+
43+
bool getValue() const;
3644
private:
3745
std::string m_id;
3846
};
39-
class Button final : public Component<ComponentType::Label> {
47+
48+
class Button final : public Component<ComponentType::Button> {
4049
public:
4150
explicit Button(size_t uid) : Component(uid) {}
42-
Button& setDescription(const std::string& description);
43-
// Button& setText(const std::string& text);
51+
Button& setDescription(const std::string& description) { setDescriptionImpl(description); return *this; }
4452
};
4553

54+
class InputFloat final : public Component<ComponentType::InputFloat> {
55+
public:
56+
InputFloat(size_t uid, std::string id) : Component(uid), m_id(std::move(id)) {}
57+
const std::string& getID() const { return m_id; }
58+
InputFloat& setDescription(const std::string& description) { setDescriptionImpl(description); return *this; }
59+
60+
float getValue() const;
61+
62+
InputFloat& setMinValue(float value);
63+
InputFloat& setMaxValue(float value);
64+
InputFloat& setFormat(const std::string& format);
65+
private:
66+
std::string m_id;
67+
};
4668
}
4769

4870
namespace eclipse {
@@ -54,6 +76,7 @@ namespace eclipse {
5476
components::Toggle addToggle(const std::string& id, const std::string& title, const std::function<void(bool)> &callback) const;
5577
components::Toggle addModSettingToggle(std::shared_ptr<geode::Setting> const& setting) const;
5678
components::Button addButton(const std::string& title, const std::function<void()>& callback) const;
79+
components::InputFloat addInputFloat(const std::string& id, const std::string& title, const std::function<void(float)>& callback) const;
5780

5881
const std::string& getName() const { return m_name; }
5982
private:
@@ -96,6 +119,7 @@ namespace eclipse::events {
96119
using AddLabelEvent = AddComponentEvent<>;
97120
using AddToggleEvent = AddComponentEvent<std::function<void(bool)>>;
98121
using AddButtonEvent = AddComponentEvent<std::function<void()>>;
122+
using AddInputFloatEvent = AddComponentEvent<std::function<void(float)>>;
99123

100124
class SetComponentDescriptionEvent : public geode::Event {
101125
public:
@@ -107,6 +131,32 @@ namespace eclipse::events {
107131
size_t m_id;
108132
std::string m_description;
109133
};
134+
135+
class SetLabelTextEvent : public geode::Event {
136+
public:
137+
SetLabelTextEvent(size_t id, std::string text)
138+
: m_id(id), m_text(std::move(text)) {}
139+
size_t getID() const { return m_id; }
140+
const std::string& getText() const { return m_text; }
141+
private:
142+
size_t m_id;
143+
std::string m_text;
144+
};
145+
146+
class SetInputFloatParamsEvent : public geode::Event {
147+
public:
148+
SetInputFloatParamsEvent(size_t id, std::optional<float> min, std::optional<float> max, std::optional<std::string> format)
149+
: m_id(id), m_min(min), m_max(max), m_format(std::move(format)) {}
150+
size_t getID() const { return m_id; }
151+
std::optional<float> getMin() const { return m_min; }
152+
std::optional<float> getMax() const { return m_max; }
153+
const std::optional<std::string>& getFormat() const { return m_format; }
154+
private:
155+
size_t m_id;
156+
std::optional<float> m_min;
157+
std::optional<float> m_max;
158+
std::optional<std::string> m_format;
159+
};
110160
}
111161

112162
namespace eclipse {
@@ -169,21 +219,68 @@ namespace eclipse {
169219
return components::Button(event.getUniqueID());
170220
}
171221

222+
/// @brief Add an input float to the tab.
223+
/// @param id The ID of the input float.
224+
/// @param title The title of the input float.
225+
/// @param callback The callback function to call when the input float is changed.
226+
inline components::InputFloat MenuTab::addInputFloat(const std::string& id, const std::string& title, const std::function<void(float)>& callback) const {
227+
events::AddInputFloatEvent event(this, id, title, callback);
228+
event.post();
229+
return components::InputFloat(event.getUniqueID(), id);
230+
}
231+
172232
namespace components {
173-
/// @brief Set the description of the toggle.
233+
/// @brief Set the description of the component.
174234
/// @param description The description to set.
175-
inline Toggle& Toggle::setDescription(const std::string& description) {
235+
template <ComponentType T>
236+
void Component<T>::setDescriptionImpl(const std::string& description) const {
176237
events::SetComponentDescriptionEvent(getUniqueID(), description).post();
238+
}
239+
240+
/// @brief Set the text of the label.
241+
/// @param text The text to set.
242+
inline Label& Label::setText(const std::string& text) {
243+
events::SetLabelTextEvent(getUniqueID(), text).post();
177244
return *this;
178245
}
179246

180-
/// @brief Set the description of the button.
181-
/// @param description The description to set.
182-
inline Button& Button::setDescription(const std::string& description) {
183-
events::SetComponentDescriptionEvent(getUniqueID(), description).post();
247+
/// @brief Set the text of the label.
248+
/// @param text The text to set.
249+
inline Label const& Label::setText(const std::string& text) const {
250+
events::SetLabelTextEvent(getUniqueID(), text).post();
251+
return *this;
252+
}
253+
254+
/// @brief Get the value of the toggle.
255+
inline bool Toggle::getValue() const {
256+
return config::get<bool>(m_id, false);
257+
}
258+
259+
/// @brief Get the value of the input float.
260+
inline float InputFloat::getValue() const {
261+
return config::get<float>(m_id, 0.f);
262+
}
263+
264+
/// @brief Set the minimum allowed value of the input float.
265+
/// @param value The value to set.
266+
inline InputFloat& InputFloat::setMinValue(float value) {
267+
events::SetInputFloatParamsEvent(getUniqueID(), value, std::nullopt, std::nullopt).post();
184268
return *this;
185269
}
186270

271+
/// @brief Set the maximum allowed value of the input float.
272+
/// @param value The value to set.
273+
inline InputFloat& InputFloat::setMaxValue(float value) {
274+
events::SetInputFloatParamsEvent(getUniqueID(), std::nullopt, value, std::nullopt).post();
275+
return *this;
276+
}
277+
278+
/// @brief Set the format string of the input float.
279+
/// @param format The format string to set. (e.g. "%.2f")
280+
inline InputFloat& InputFloat::setFormat(const std::string& format) {
281+
events::SetInputFloatParamsEvent(getUniqueID(), std::nullopt, std::nullopt, format).post();
282+
return *this;
283+
}
187284
}
188285
}
189286

include/config.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,20 @@
22
#ifndef ECLIPSE_CONFIG_HPP
33
#define ECLIPSE_CONFIG_HPP
44

5-
#include <string>
65
#include <concepts>
6+
#include <string>
77
#include <utility>
88
#include <Geode/loader/Event.hpp>
99

1010
namespace eclipse::config {
11-
1211
/// @brief Concept for supported types in the config system (bool, int, float, std::string)
1312
template <typename T>
1413
concept SupportedType = requires(T a) {
1514
std::same_as<T, bool> || std::same_as<T, int> || std::same_as<T, float> || std::same_as<T, std::string>;
1615
};
17-
1816
}
1917

2018
namespace eclipse::events {
21-
2219
template <config::SupportedType T>
2320
class RequestConfigValueEvent : public geode::Event {
2421
public:

include/labels.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ namespace eclipse::events {
6161
}
6262

6363
namespace eclipse::label {
64-
6564
/// @brief Formats a string using the RIFT syntax and variables provided by Eclipse.
6665
/// @param fmt The format string to use. (see RIFT documentation)
6766
/// @return The formatted string.
@@ -88,7 +87,6 @@ namespace eclipse::label {
8887
void setVariable(std::string_view name, T value) {
8988
events::SetRiftVariableEvent<T>(name, value).post();
9089
}
91-
9290
}
9391

9492
#endif

include/modules.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <utility>
99

1010
namespace eclipse::events {
11-
1211
class RegisterCheatEvent final : public geode::Event {
1312
public:
1413
RegisterCheatEvent(std::string name, std::function<bool()> isCheatActive)
@@ -21,15 +20,15 @@ namespace eclipse::events {
2120
std::string m_name;
2221
std::function<bool()> m_isCheatActive;
2322
};
24-
2523
}
2624

2725
namespace eclipse::modules {
28-
26+
/// @brief Register a cheat with the given name and callback.
27+
/// @param name The name of the cheat (how it will show up in cheat indicator list).
28+
/// @param isCheatActive The callback to check if the cheat is active.
2929
inline void registerCheat(const std::string& name, const std::function<bool()>& isCheatActive) {
3030
events::RegisterCheatEvent(name, isCheatActive).post();
3131
}
32-
3332
}
3433

3534
#endif // ECLIPSE_MODULES_HPP

mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"android": "2.2074",
77
"ios": "2.2074"
88
},
9-
"version": "v1.0.0-beta.4",
9+
"version": "v1.0.0",
1010
"id": "eclipse.eclipse-menu",
1111
"name": "Eclipse",
1212
"links": {
@@ -15,7 +15,7 @@
1515
"community": "https://discord.gg/NnpwFRDMND"
1616
},
1717
"api": { "include": [ "include/*.hpp" ] },
18-
"tags": ["cheats", "gameplay", "utility", "customization", "interface"],
18+
"tags": ["cheat", "gameplay", "utility", "customization", "interface"],
1919
"developers": ["Eclipse Team", "ninXout", "Prevter", "maxnu", "Firee", "SpaghettDev"],
2020
"description": "A next-generation mod menu for Geometry Dash.",
2121
"early-load": true,

resources/Emojis/1f31a.png

860 Bytes
Loading

resources/Emojis/1f31d.png

858 Bytes
Loading

0 commit comments

Comments
 (0)