Skip to content

Commit 45519ff

Browse files
committed
tweaks
1 parent 4f4cf98 commit 45519ff

4 files changed

Lines changed: 119 additions & 115 deletions

File tree

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# v1.0.4
2+
- Minor tweaks
3+
14
# v1.0.3
25
- Code cleanup
36
- Fixed swipe mode triggering while touching menu [*Windows*, *Android*]

mod.json

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,96 @@
11
{
2-
"geode": "4.6.3",
3-
"gd": {
4-
"win": "2.2074",
5-
"android": "2.2074",
6-
"ios": "2.2074",
7-
"mac": "2.2074"
8-
},
9-
"id": "arcticwoof.quickmovebuttons",
10-
"name": "Quick Move Buttons",
11-
"version": "v1.0.3",
12-
"developers": [
13-
"ArcticWoof",
14-
"Cheeseworks"
15-
],
16-
"links": {
17-
"source": "https://github.com/DumbCaveSpider/QuickMoveButtons",
18-
"homepage": "https://arcticwoof.com.au/",
19-
"community": "https://dsc.gg/arcticwoof"
20-
},
21-
"tags": [
22-
"editor",
23-
"interface",
24-
"enhancement",
25-
"offline",
26-
"utility"
27-
],
28-
"description": "Adds move buttons outside the Edit tab.",
29-
"resources": {
30-
"sprites": [
31-
"previews/*"
32-
]
33-
},
34-
"settings": {
35-
"scale-btns": {
36-
"name": "Button Scale",
37-
"description": "Change the scale of the transform buttons, <co>the draggable area will also be affected</co>. <cr>You must reopen the editor to take effect.</cr>",
38-
"type": "float",
39-
"default": 1,
40-
"min": 0.5,
41-
"max": 2,
42-
"control": {
43-
"slider": true,
44-
"slider-step": 0.125
45-
}
46-
},
47-
"opacity-btn": {
48-
"name": "Button Opacity",
49-
"description": "Change the opacity of the transform buttons. <cr>This does not affect the UI backgrounds and applies whenever you drag the buttons.</cr>",
50-
"type": "int",
51-
"default": 255,
52-
"min": 75,
53-
"max": 255,
54-
"control": {
55-
"slider": true,
56-
"slider-step": 5
57-
}
58-
},
59-
"scale-bg": {
60-
"name": "Draggable Area Scale",
61-
"description": "Change the scale of the draggable area. <cg>Useful if you can't drag properly due to the area size.</cg> <cr>You must reopen the editor to take effect.</cr>",
62-
"type": "int",
63-
"default": 130,
64-
"min": 130,
65-
"max": 200,
66-
"control": {
67-
"slider": true,
68-
"slider-step": 10
69-
}
70-
},
71-
"visible-bg": {
72-
"name": "Show Button Background",
73-
"description": "Show the backgrounds of the transform buttons. <cr>You must reopen the editor to take effect.</cr>",
74-
"type": "bool",
75-
"default": false
76-
},
77-
"menu-btn": {
78-
"name": "Show Draggable Area",
79-
"description": "Show the draggable area for transform buttons.",
80-
"type": "bool",
81-
"default": true
82-
},
83-
"no-dragging": {
84-
"name": "Disable Dragging",
85-
"description": "Disable dragging on the transform buttons, keeping them in a fixed position. <cg>Useful to prevent accidental dragging.</cg>",
86-
"type": "bool",
87-
"default": false
88-
},
89-
"presistent-btn": {
90-
"name": "Persistent Button",
91-
"description": "Always show the transform buttons, even when no objects are selected.",
92-
"type": "bool",
93-
"default": false
94-
}
95-
}
2+
"geode": "4.10.0",
3+
"gd": {
4+
"win": "2.2074",
5+
"android": "2.2074",
6+
"ios": "2.2074",
7+
"mac": "2.2074"
8+
},
9+
"id": "arcticwoof.quickmovebuttons",
10+
"name": "Quick Move Buttons",
11+
"version": "v1.0.3",
12+
"developers": [
13+
"ArcticWoof",
14+
"Cheeseworks"
15+
],
16+
"links": {
17+
"source": "https://github.com/DumbCaveSpider/QuickMoveButtons",
18+
"homepage": "https://arcticwoof.xyz/",
19+
"community": "https://dsc.gg/arcticwoof"
20+
},
21+
"tags": [
22+
"editor",
23+
"interface",
24+
"enhancement",
25+
"offline",
26+
"utility"
27+
],
28+
"description": "Adds move buttons outside the Edit tab.",
29+
"resources": {
30+
"sprites": [
31+
"previews/*"
32+
]
33+
},
34+
"settings": {
35+
"scale-btns": {
36+
"name": "Button Scale",
37+
"description": "Change the scale of the transform buttons, <co>the draggable area will also be affected</co>. <cr>You must reopen the editor to take effect.</cr>",
38+
"type": "float",
39+
"default": 1,
40+
"min": 0.5,
41+
"max": 2,
42+
"control": {
43+
"slider": true,
44+
"slider-step": 0.125
45+
}
46+
},
47+
"opacity-btn": {
48+
"name": "Button Opacity",
49+
"description": "Change the opacity of the transform buttons. <cr>This does not affect the UI backgrounds and applies whenever you drag the buttons.</cr>",
50+
"type": "int",
51+
"default": 255,
52+
"min": 75,
53+
"max": 255,
54+
"control": {
55+
"slider": true,
56+
"slider-step": 5
57+
}
58+
},
59+
"scale-bg": {
60+
"name": "Draggable Area Scale",
61+
"description": "Change the scale of the draggable area. <cg>Useful if you can't drag properly due to the area size.</cg> <cr>You must reopen the editor to take effect.</cr>",
62+
"type": "int",
63+
"default": 130,
64+
"min": 130,
65+
"max": 200,
66+
"control": {
67+
"slider": true,
68+
"slider-step": 10
69+
}
70+
},
71+
"visible-bg": {
72+
"name": "Show Button Background",
73+
"description": "Show the backgrounds of the transform buttons. <cr>You must reopen the editor to take effect.</cr>",
74+
"type": "bool",
75+
"default": false
76+
},
77+
"menu-btn": {
78+
"name": "Show Draggable Area",
79+
"description": "Show the draggable area for transform buttons.",
80+
"type": "bool",
81+
"default": true
82+
},
83+
"no-dragging": {
84+
"name": "Disable Dragging",
85+
"description": "Disable dragging on the transform buttons, keeping them in a fixed position. <cg>Useful to prevent accidental dragging.</cg>",
86+
"type": "bool",
87+
"default": false
88+
},
89+
"presistent-btn": {
90+
"name": "Persistent Button",
91+
"description": "Always show the transform buttons, even when no objects are selected.",
92+
"type": "bool",
93+
"default": false
94+
}
95+
}
9696
}

src/QuickMove.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22

33
// Namespace with useful enum classes
44
namespace quickmove {
5-
// Type of transform
6-
enum class TransformType {
7-
Move = 1,
8-
Rotate = 2,
9-
Flip = 3,
10-
};
11-
125
// Distance in which the buttons will move the objects on the grid
136
enum class MoveSize {
147
Tiny = 0,
@@ -26,6 +19,13 @@ namespace quickmove {
2619
Right = 4
2720
};
2821

22+
// Type of transform
23+
enum class TransformType {
24+
Move = 1,
25+
Rotate = 2,
26+
Flip = 3,
27+
};
28+
2929
// Returns the EditCommand based on object move size and direction
3030
EditCommand getEditCmd(MoveSize moveSize, MoveDirection moveDir) {
3131
switch (moveSize) {

src/main.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using namespace geode::prelude;
1616
using namespace quickmove;
1717

1818
// it's modding time :3
19-
auto qmbMod = getMod();
19+
static auto qmbMod = getMod();
2020

2121
class $modify(MyEditorUI, EditorUI) {
2222
struct Fields {
@@ -86,15 +86,16 @@ class $modify(MyEditorUI, EditorUI) {
8686
m_fields->m_buttonMenu->setAnchorPoint({ 0.5f, 0.5f });
8787

8888
// Get background size from settings
89-
int bgSize = as<int>(qmbMod->getSettingValue<int64_t>("scale-bg"));
90-
m_fields->m_buttonMenu->setContentSize({ as<float>(bgSize), as<float>(bgSize) });
89+
int bgSize = static_cast<int>(qmbMod->getSettingValue<int64_t>("scale-bg"));
90+
m_fields->m_buttonMenu->setContentSize({ static_cast<float>(bgSize), static_cast<float>(bgSize) });
9191

9292
m_fields->m_buttonMenu->ignoreAnchorPointForPosition(false);
9393
m_fields->m_buttonMenu->setVisible(false); // Initially invisible since no objects are selected
9494

95+
CCSize const depthSize = { static_cast<float>(bgSize + 6), static_cast<float>(bgSize + 6) }; // Larger for depth
96+
9597
// create depth background for the menu (behind the main background)
9698
auto buttonMenuBgDepth = CCScale9Sprite::create("square02_001.png");
97-
CCSize depthSize = { as<float>(bgSize + 6), as<float>(bgSize + 6) }; // Larger for depth
9899
buttonMenuBgDepth->setContentSize(depthSize);
99100
buttonMenuBgDepth->ignoreAnchorPointForPosition(false);
100101
buttonMenuBgDepth->setAnchorPoint({ 0.5, 0.5 });
@@ -117,8 +118,8 @@ class $modify(MyEditorUI, EditorUI) {
117118
m_fields->m_buttonMenu->addChild(buttonMenuBg);
118119

119120
// Get current move size icon info
120-
auto iconInfo = getMoveSizeIconInfo(m_fields->moveSize);
121-
auto moveBtnIconSpriteName = iconInfo.first;
121+
auto const iconInfo = getMoveSizeIconInfo(m_fields->moveSize);
122+
auto const moveBtnIconSpriteName = iconInfo.first;
122123
auto iconScale = iconInfo.second;
123124

124125
// create the up btn
@@ -395,7 +396,7 @@ class $modify(MyEditorUI, EditorUI) {
395396
return;
396397
};
397398

398-
log::info("Using edit command: {}", as<int>(editCommand));
399+
log::info("Using edit command: {}", static_cast<int>(editCommand));
399400

400401
// use move or transform depending on the kind of button being pressed
401402
switch (type) {
@@ -614,7 +615,7 @@ class $modify(MyEditorUI, EditorUI) {
614615
if (!m_fields->m_buttonMenu) return;
615616

616617
// Get the scale value from settings
617-
float scaleValue = as<float>(qmbMod->getSettingValue<double>("scale-btns"));
618+
float scaleValue = static_cast<float>(qmbMod->getSettingValue<double>("scale-btns"));
618619

619620
// Apply the scale to the entire button menu
620621
m_fields->m_buttonMenu->setScale(scaleValue);
@@ -849,8 +850,8 @@ class $modify(MyEditorUI, EditorUI) {
849850
if (!m_fields->m_moveUpIcon || !m_fields->m_moveDownIcon ||
850851
!m_fields->m_moveLeftIcon || !m_fields->m_moveRightIcon) return;
851852

852-
auto iconInfo = getMoveSizeIconInfo(m_fields->moveSize);
853-
auto newSpriteName = iconInfo.first;
853+
auto const iconInfo = getMoveSizeIconInfo(m_fields->moveSize);
854+
auto const newSpriteName = iconInfo.first;
854855
auto newScale = iconInfo.second;
855856

856857
// Update up arrow
@@ -898,7 +899,7 @@ class $modify(MyEditorUI, EditorUI) {
898899
if (!m_fields->m_buttonMenu) return;
899900

900901
// Get the opacity value from settings
901-
int baseOpacity = as<int>(qmbMod->getSettingValue<int64_t>("opacity-btn"));
902+
int baseOpacity = static_cast<int>(qmbMod->getSettingValue<int64_t>("opacity-btn"));
902903

903904
// If dragging, reduce opacity by 50
904905
int currentOpacity = m_fields->m_isDragging ? std::max(0, baseOpacity - 50) : baseOpacity;
@@ -966,10 +967,10 @@ class $modify(MyEditorUI, EditorUI) {
966967
if (!m_fields->m_buttonMenu) return;
967968

968969
// Get background size from settings
969-
int bgSize = as<int>(qmbMod->getSettingValue<int64_t>("scale-bg"));
970+
int bgSize = static_cast<int>(qmbMod->getSettingValue<int64_t>("scale-bg"));
970971

971-
CCSize newSize = { as<float>(bgSize), as<float>(bgSize) };
972-
CCSize depthSize = { as<float>(bgSize + 6), as<float>(bgSize + 6) }; // Larger for depth
972+
CCSize const newSize = { static_cast<float>(bgSize), static_cast<float>(bgSize) };
973+
CCSize const depthSize = { static_cast<float>(bgSize + 6), static_cast<float>(bgSize + 6) }; // Larger for depth
973974

974975
// Update menu content size
975976
m_fields->m_buttonMenu->setContentSize(newSize);

0 commit comments

Comments
 (0)