Skip to content

Commit 129f730

Browse files
committed
md stuff
1 parent 19ce8ae commit 129f730

File tree

4 files changed

+29
-30
lines changed

4 files changed

+29
-30
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@
77
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.
88

99
In the mod's settings, you can customize button visuals and functionality.
10+
1011
# How to use
11-
- Select an object to show the transform buttons in the editor.
12-
- Hold the draggable area of the buttons to move the menu.
13-
- Press the center button to toggle the move units.
12+
1. Select an object to show the transform buttons in the editor.
13+
2. Hold the draggable area of the buttons to move the menu.
14+
3. Press the center button to toggle the move units.
15+
1416
# Credits
1517
- **Cheeseworks** - For helping me make this mod possible since I barely understand some functionality to make things work
1618
- **CyanBoi** - For beta testing, finding bugs and giving me feedbacks
1719
- **iCreate Pro** - For inspiration on the Custom Move Button feature
18-
# Preview
20+
21+
# Previews
1922
![Preview 1 with button background](previews/preview-1.png)
2023
![Preview 2 without button background](previews/preview-2.png)
24+
2125
# Known Bugs
2226
- Buttons disappears whenever you copy + paste multiple objects. Appears again whenever you move your editor
2327
*(Best way to prevent this is enabling Button Presistent since I don't know how to fix this bug)*

about.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,19 @@ This mod adds a scalable and moveable UI to the level editor with move, rotate,
77
In the mod's settings, you can customize button visuals and functionality.
88

99
# How to use
10-
11-
- Select an object to show the transform buttons in the editor.
12-
- Hold the draggable area of the buttons to move the menu.
13-
- Press the center button to toggle the move units.
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.
1413

1514
# Credits
16-
1715
- **Cheeseworks** - For helping me make this mod possible since I barely understand some functionality to make things work
1816
- **CyanBoi** - For beta testing, finding bugs and giving me feedbacks
1917
- **iCreate Pro** - For inspiration on the Custom Move Button feature
2018

21-
# Preview
22-
19+
# Previews
2320
![Preview 1 with button background](arcticwoof.quickmovebuttons/preview-1.png)
24-
2521
![Preview 2 without button background](arcticwoof.quickmovebuttons/preview-2.png)
2622

2723
# Known Bugs
28-
2924
- Buttons disappears whenever you copy + paste multiple objects. Appears again whenever you move your editor
3025
*(Best way to prevent this is enabling Button Presistent since I don't know how to fix this bug)*

src/QuickMove.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
// Namespace with useful enum classes
44
namespace quickmove {
5-
// Type of move
5+
// Type of transform
66
enum class TransformType {
77
Move = 1,
88
Rotate = 2,
99
Flip = 3,
1010
};
1111

12-
// Distance in which the buttons will move the objects
12+
// Distance in which the buttons will move the objects on the grid
1313
enum class MoveSize {
1414
Tiny = 0,
1515
Small = 1,
@@ -18,7 +18,7 @@ namespace quickmove {
1818
Big = 4
1919
};
2020

21-
// Direction in which objects will be moved
21+
// Direction in which objects will be moved on the grid
2222
enum class MoveDirection {
2323
Up = 1,
2424
Down = 2,

src/main.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ class $modify(MyEditorUI, EditorUI) {
183183

184184
m_fields->m_buttonMenu->setPosition(CCPoint(savedX, savedY));
185185
m_fields->m_buttonMenu->setAnchorPoint({ 0.5f, 0.5f });
186-
186+
187187
// Get background size from settings
188188
int bgSize = Mod::get()->getSettingValue<int>("scale-bg");
189189
m_fields->m_buttonMenu->setContentSize({ static_cast<float>(bgSize), static_cast<float>(bgSize) });
190-
190+
191191
m_fields->m_buttonMenu->ignoreAnchorPointForPosition(false);
192192
m_fields->m_buttonMenu->setVisible(false); // Initially invisible since no objects are selected
193193

@@ -501,11 +501,11 @@ class $modify(MyEditorUI, EditorUI) {
501501
// use move or transform depending on the kind of button being pressed
502502
switch (type) {
503503
case TransformType::Move:
504-
this->moveObjectCall(editCommand);
504+
EditorUI::moveObjectCall(editCommand);
505505
break;
506506

507507
default:
508-
this->transformObjectCall(editCommand);
508+
EditorUI::transformObjectCall(editCommand);
509509
break;
510510
};
511511
};
@@ -673,10 +673,10 @@ class $modify(MyEditorUI, EditorUI) {
673673

674674
// Check if persistent button setting is enabled
675675
bool isPersistent = Mod::get()->getSettingValue<bool>("presistent-btn");
676-
676+
677677
// Use tracked UI visibility state instead of this->isVisible()
678678
bool isUIVisible = m_fields->m_isUIVisible;
679-
679+
680680
// Determine if menu should be visible (either has selection OR persistent mode is enabled) AND UI is visible
681681
bool shouldBeVisible = (hasSelection || isPersistent) && isUIVisible;
682682

@@ -993,7 +993,7 @@ class $modify(MyEditorUI, EditorUI) {
993993
int menuBgOpacity = m_fields->m_isDragging ? 25 : 50;
994994
m_fields->m_buttonMenuBg->setOpacity(menuBgOpacity);
995995
}
996-
996+
997997
if (m_fields->m_buttonMenuBgDepth && m_fields->m_buttonMenuBgDepth->isVisible()) {
998998
// Base opacity for depth background is 25, reduce to 15 when dragging
999999
int depthBgOpacity = m_fields->m_isDragging ? 15 : 25;
@@ -1005,17 +1005,17 @@ class $modify(MyEditorUI, EditorUI) {
10051005
if (!m_fields->m_buttonMenuBg || !m_fields->m_buttonMenuBgDepth) return;
10061006

10071007
bool showMenuBG = Mod::get()->getSettingValue<bool>("menu-btn");
1008-
1008+
10091009
// Update visibility for both backgrounds
10101010
m_fields->m_buttonMenuBg->setVisible(showMenuBG);
10111011
m_fields->m_buttonMenuBgDepth->setVisible(showMenuBG);
1012-
1012+
10131013
// Set proper opacity when visibility changes
10141014
if (showMenuBG) {
10151015
// Main background opacity
10161016
int menuBgOpacity = m_fields->m_isDragging ? 25 : 50;
10171017
m_fields->m_buttonMenuBg->setOpacity(menuBgOpacity);
1018-
1018+
10191019
// Depth background opacity (always lower for shadow effect)
10201020
int depthBgOpacity = m_fields->m_isDragging ? 15 : 25;
10211021
m_fields->m_buttonMenuBgDepth->setOpacity(depthBgOpacity);
@@ -1065,19 +1065,19 @@ class $modify(MyEditorUI, EditorUI) {
10651065
int bgSize = Mod::get()->getSettingValue<int>("scale-bg");
10661066
CCSize newSize = { static_cast<float>(bgSize), static_cast<float>(bgSize) };
10671067
CCSize depthSize = { static_cast<float>(bgSize + 6), static_cast<float>(bgSize + 6) }; // Larger for depth
1068-
1068+
10691069
// Update menu content size
10701070
m_fields->m_buttonMenu->setContentSize(newSize);
1071-
1071+
10721072
// Reposition all buttons to match the new center
10731073
repositionButtons();
1074-
1074+
10751075
// Update main background size and position to keep it centered
10761076
if (m_fields->m_buttonMenuBg) {
10771077
m_fields->m_buttonMenuBg->setContentSize(newSize);
10781078
m_fields->m_buttonMenuBg->setPosition({ m_fields->m_buttonMenu->getContentWidth() / 2.f, m_fields->m_buttonMenu->getContentHeight() / 2.f });
10791079
}
1080-
1080+
10811081
// Update depth background size and position (larger but same center position)
10821082
if (m_fields->m_buttonMenuBgDepth) {
10831083
m_fields->m_buttonMenuBgDepth->setContentSize(depthSize);

0 commit comments

Comments
 (0)