Skip to content

Commit eeba8f3

Browse files
geode v5
1 parent f7e171b commit eeba8f3

5 files changed

Lines changed: 22 additions & 157 deletions

File tree

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,4 @@ In the mod's settings, you can customize UI visuals and functionality.
1616
# Credits
1717
- **[Cheeseworks](https://gdbrowser.com/u/cheeseworks)** - For helping me make this mod possible since I barely understand some functionality to make things work
1818
- **[CyanBoi](https://gdbrowser.com/u/CyanBoi)** - For beta testing, finding bugs and giving me feedbacks
19-
- **[iCreate Pro](https://icreate.pro/)** - For inspiration on the Custom Move Button feature
20-
21-
# Previews
22-
![UI with button backgrounds](previews/preview-1.png)
23-
![UI without button backgrounds](previews/preview-2.png)
24-
25-
# Known Bugs
26-
- Buttons disappears whenever you copy + paste multiple objects. Appears again whenever you move your editor
27-
*(You can currently prevent this by enabling `Button Presistent` in the settings)*
19+
- **[iCreate Pro](https://icreate.pro/)** - For inspiration on the Custom Move Button feature

about.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
# Quick Move Buttons
22

3-
> <cg>This mod is primarily intended for mobile users, but supports all platforms.</c>
3+
**Quick accessibility move buttons for the level editor!**
44

5-
This mod adds a scalable and moveable UI to the level editor with move, rotate, and flip buttons to help you save time when transforming objects in the level editor! You can find a button to quickly access this mod's settings in the editor pause menu.
5+
<cg>*![ℹ️](frame:GJ_infoIcon_001.png?scale=0.45) This mod is primarily intended for mobile users. But can be used on PC/Mac.*</c>
66

7-
In the mod's settings, you can customize UI visuals and functionality.
7+
---
8+
### About
9+
This mod adds a <cg>scalable and moveable UI</c> to the level editor with move, rotate, and flip buttons to help you save time when transforming objects in the level editor! You can find a button to quickly access this <co>mod's settings</c> in the editor pause menu.
810

9-
# How to Use
10-
1. Select an object to show the transform buttons in the editor.
11-
2. Hold the draggable area of the buttons to move the menu.
12-
3. Press the center button to toggle the move units.
11+
<cy>*![⚙️](frame:geode.loader/settings.png?scale=0.45) You can customize button visuals and functionality in the mod settings!*</c>
1312

14-
# Credits
13+
---
14+
15+
### Credits
1516
- **[Cheeseworks](user:6408873)** - For helping me make this mod possible since I barely understand some functionality to make things work
1617
- **[CyanBoi](user:14497367)** - For beta testing, finding bugs and giving me feedbacks
1718
- **[iCreate Pro](https://icreate.pro/)** - For inspiration on the Custom Move Button feature
1819

19-
# Previews
20-
![UI with button backgrounds](arcticwoof.quickmovebuttons/preview-1.png)
21-
![UI without button backgrounds](arcticwoof.quickmovebuttons/preview-2.png)
22-
23-
# Known Bugs
24-
- Buttons disappears whenever you copy + paste multiple objects. Appears again whenever you move your editor
25-
*(You can currently prevent this by enabling `Button Presistent` in the settings)*
20+
![King Clawthorne](arcticwoof.rated_layouts/king.png)

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# v1.0.4
2+
- Ported to Geode v5.0.0
3+
- Fixed issue where copying + pasting multiple objects makes the buttons disappear
4+
- Tweaked the button size to be more consistent across
25
- Minor tweaks
36

47
# v1.0.3

mod.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"geode": "4.10.0",
2+
"geode": "5.0.0-alpha.1",
33
"gd": {
4-
"win": "2.2074",
5-
"android": "2.2074",
6-
"ios": "2.2074",
7-
"mac": "2.2074"
4+
"win": "2.2081",
5+
"android": "2.2081",
6+
"ios": "2.2081",
7+
"mac": "2.2081"
88
},
99
"id": "arcticwoof.quickmovebuttons",
1010
"name": "Quick Move Buttons",
11-
"version": "v1.0.3",
11+
"version": "v1.0.4",
1212
"developers": [
1313
"ArcticWoof",
1414
"Cheeseworks"

src/main.cpp

Lines changed: 2 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -2,137 +2,12 @@
22
#include <Geode/modify/EditorPauseLayer.hpp>
33
#include <Geode/modify/EditorUI.hpp>
44
#include <Geode/ui/GeodeUI.hpp>
5-
#include <Geode/utils/NodeIDs.hpp>
6-
#include <Geode/utils/terminate.hpp>
75

86
#include "./QuickMove.hpp"
97

108
using namespace geode::prelude;
119
using namespace quickmove;
1210

13-
// Returns the EditCommand based on object move size and direction
14-
EditCommand getEditCmd(MoveSize moveSize, MoveDirection moveDir) {
15-
switch (moveSize) {
16-
case MoveSize::Tiny:
17-
switch (moveDir) {
18-
case MoveDirection::Up:
19-
return EditCommand::TinyUp;
20-
case MoveDirection::Down:
21-
return EditCommand::TinyDown;
22-
case MoveDirection::Left:
23-
return EditCommand::TinyLeft;
24-
case MoveDirection::Right:
25-
return EditCommand::TinyRight;
26-
};
27-
break;
28-
29-
case MoveSize::Small:
30-
switch (moveDir) {
31-
case MoveDirection::Up:
32-
return EditCommand::SmallUp;
33-
case MoveDirection::Down:
34-
return EditCommand::SmallDown;
35-
case MoveDirection::Left:
36-
return EditCommand::SmallLeft;
37-
case MoveDirection::Right:
38-
return EditCommand::SmallRight;
39-
};
40-
break;
41-
42-
case MoveSize::Half:
43-
switch (moveDir) {
44-
case MoveDirection::Up:
45-
return EditCommand::HalfUp;
46-
case MoveDirection::Down:
47-
return EditCommand::HalfDown;
48-
case MoveDirection::Left:
49-
return EditCommand::HalfLeft;
50-
case MoveDirection::Right:
51-
return EditCommand::HalfRight;
52-
};
53-
break;
54-
55-
case MoveSize::Normal:
56-
switch (moveDir) {
57-
case MoveDirection::Up:
58-
return EditCommand::Up;
59-
case MoveDirection::Down:
60-
return EditCommand::Down;
61-
case MoveDirection::Left:
62-
return EditCommand::Left;
63-
case MoveDirection::Right:
64-
return EditCommand::Right;
65-
};
66-
break;
67-
68-
case MoveSize::Big:
69-
switch (moveDir) {
70-
case MoveDirection::Up:
71-
return EditCommand::BigUp;
72-
case MoveDirection::Down:
73-
return EditCommand::BigDown;
74-
case MoveDirection::Left:
75-
return EditCommand::BigLeft;
76-
case MoveDirection::Right:
77-
return EditCommand::BigRight;
78-
};
79-
break;
80-
81-
default:
82-
return EditCommand::SmallUp;
83-
};
84-
85-
return EditCommand::SmallUp;
86-
};
87-
88-
// Get the string name for a move size
89-
std::string getMoveSizeName(MoveSize moveSize) {
90-
switch (moveSize) {
91-
case MoveSize::Tiny:
92-
return "Tiny";
93-
94-
case MoveSize::Small:
95-
return "Small";
96-
97-
case MoveSize::Half:
98-
return "Half";
99-
100-
case MoveSize::Normal:
101-
return "Normal";
102-
103-
case MoveSize::Big:
104-
return "Big";
105-
106-
default:
107-
return "Small";
108-
};
109-
};
110-
111-
// Get the sprite name and scale for arrow icons based on move size
112-
std::pair<std::string, float> getMoveSizeIconInfo(MoveSize moveSize) {
113-
float defScale = 0.875f;
114-
115-
switch (moveSize) {
116-
case MoveSize::Tiny:
117-
return {"edit_upBtn_001.png", 0.625f};
118-
119-
case MoveSize::Small:
120-
return {"edit_upBtn_001.png", defScale};
121-
122-
case MoveSize::Half:
123-
return {"edit_upBtn5_001.png", defScale};
124-
125-
case MoveSize::Normal:
126-
return {"edit_upBtn2_001.png", defScale};
127-
128-
case MoveSize::Big:
129-
return {"edit_upBtn3_001.png", defScale};
130-
131-
default:
132-
return {"edit_upBtn_001.png", defScale};
133-
};
134-
};
135-
13611
class $modify(MyEditorUI, EditorUI) {
13712
struct Fields {
13813
MoveSize moveSize = MoveSize::Small;
@@ -651,12 +526,12 @@ class $modify(MyEditorUI, EditorUI) {
651526

652527
if (clockwiseChildren && clockwiseChildren->count() > 0) {
653528
// The icon should be the last child (added after the button sprite)
654-
clockwiseIcon = dynamic_cast<CCSprite*>(clockwiseChildren->lastObject());
529+
clockwiseIcon = typeinfo_cast<CCSprite*>(clockwiseChildren->lastObject());
655530
};
656531

657532
if (counterClockwiseChildren && counterClockwiseChildren->count() > 0) {
658533
// The icon should be the last child (added after the button sprite)
659-
counterClockwiseIcon = dynamic_cast<CCSprite*>(counterClockwiseChildren->lastObject());
534+
counterClockwiseIcon = typeinfo_cast<CCSprite*>(counterClockwiseChildren->lastObject());
660535
};
661536

662537
if (clockwiseIcon && counterClockwiseIcon) {

0 commit comments

Comments
 (0)