Skip to content

Commit ac87cc2

Browse files
committed
Fixes
1 parent 5c2ab3e commit ac87cc2

8 files changed

Lines changed: 29 additions & 10 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ All things related to objects.
108108
### ​ Single Deselect
109109
- <c-dddddd>Allows for you to hold a modifier to deselect objects within an existing selection.</c>
110110

111-
### Edit Tools
111+
### ​ Edit Tools
112112
- <c-dddddd>Adds a button and keybind to center the selected object to the camera poisiton.</c>
113113
- <c-dddddd>Adds a button and keybind to center the camera to the selected object's position.</c>
114114

‎about.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ All things related to objects.
124124
### ​ Single Deselect
125125
- <c-dddddd>Allows for you to hold a modifier to deselect objects within an existing selection.</c>
126126

127-
### Edit Tools
127+
### ​ Edit Tools
128128
- <c-dddddd>Adds a button and keybind to center the selected object to the camera poisiton.</c>
129129
- <c-dddddd>Adds a button and keybind to center the camera to the selected object's position.</c>
130130

‎changelog.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 1.0.10
2+
- <c-dddddd>Fix a crash when selecting triggers with insane duration amounts</c>
3+
- <c-dddddd>Fix align button alignment (lol) being wrong sometimes</c>
4+
- <c-dddddd>Fix a mistake in the description</c>
5+
- <c-dddddd>Fix scale of object groups popup</c>
6+
17
# 1.0.9
28
- <c-dddddd>Object Groups compatibility fixes for Scrollable Toolbar, Object Tooltips, and Search</c>
39

‎mod.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"id": "alphalaneous.tinker",
1010
"name": "Tinker",
11-
"version": "v1.0.9",
11+
"version": "v1.0.10",
1212
"developer": "Alphalaneous",
1313
"description": "Editor Revamped",
1414
"dependencies": {

‎src/modules/DurationDrag/DurationControl.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ void DurationControl::addObject(EffectGameObject* object) {
173173
void DurationControl::setMenuPosition(const CCPoint& point, const CCPoint& anchor) {
174174
m_buttonsMenu->setPosition(point);
175175
m_buttonsMenu->setAnchorPoint(anchor);
176+
// cocos for some reason isn't updating the positon and anchor properly so I do this
177+
m_buttonsMenu->m_bTransformDirty = true;
178+
m_buttonsMenu->m_bPositionDirty = true;
176179
}
177180

178181
void DurationControl::updateObjects(EditorUI* editorUI) {

‎src/modules/DurationDrag/DurationDrag.cpp‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void DDEditorUI::selectObjects(CCArray* objects, bool ignoreFilter) {
4040
DurationDrag::get()->updateObjects();
4141
}
4242

43-
void DurationDragDraw::drawDottedLine(const CCPoint& start, const CCPoint& end, const LineColor& color, float lineWidth, float dashLength, float gapLength) {
43+
void DurationDragDraw::drawDottedLine(const CCPoint& start, const CCPoint& end, const LineColor& color, float minX, float maxX, float minY, float maxY) {
4444
float dx = end.x - start.x;
4545
float dy = end.y - start.y;
4646
float totalDist = std::sqrt(dx * dx + dy * dy);
@@ -50,16 +50,26 @@ void DurationDragDraw::drawDottedLine(const CCPoint& start, const CCPoint& end,
5050
float dirX = dx / totalDist;
5151
float dirY = dy / totalDist;
5252

53+
constexpr float dashLength = 10.f;
54+
constexpr float lineWidth = 2.f;
55+
constexpr float gapLength = 5.f;
56+
5357
float traveled = 0.f;
5458
while (traveled < totalDist) {
5559
float segmentLength = std::min(dashLength, totalDist - traveled);
5660

5761
ccVertex2F segStart = { start.x + dirX * traveled, start.y + dirY * traveled };
5862
ccVertex2F segEnd = { start.x + dirX * (traveled + segmentLength), start.y + dirY * (traveled + segmentLength) };
5963

60-
DrawGridAPI::get().drawLine(segStart, segEnd, color, lineWidth);
64+
if (segStart.x > maxX || segStart.y > maxY) break;
65+
66+
traveled += (dashLength + gapLength);
6167

62-
traveled += dashLength + gapLength;
68+
if (segEnd.x < minX || segEnd.y < minY) {
69+
continue;
70+
}
71+
72+
DrawGridAPI::get().drawLine(segStart, segEnd, color, lineWidth);
6373
}
6474
}
6575

@@ -127,7 +137,7 @@ void DurationDragDraw::draw(DrawGridLayer* dgl, float minX, float maxX, float mi
127137
end.x = std::max(end.x, 0.f);
128138
}
129139

130-
drawDottedLine(end, centerPoint, {145, 170, 255, 180});
140+
drawDottedLine(end, centerPoint, {145, 170, 255, 180}, minX, maxX, minY, maxY);
131141
}
132142
}
133143
}
@@ -150,7 +160,7 @@ void DurationDragDraw::draw(DrawGridLayer* dgl, float minX, float maxX, float mi
150160

151161
if (object->getPositionX() < 0 && !object->m_isSpawnTriggered) {
152162

153-
drawDottedLine(object->getPosition(), {0, object->getPositionY()}, color);
163+
drawDottedLine(object->getPosition(), {0, object->getPositionY()}, color, minX, maxX, minY, maxY);
154164

155165
if (object->m_objectID == 1006) {
156166
drawPulseLine(object, 0);

‎src/modules/DurationDrag/DurationDrag.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ class $modify(DDEditorUI, EditorUI) {
3131
};
3232

3333
class DurationDragDraw : public DrawNode {
34-
static void drawDottedLine(const CCPoint& start, const CCPoint& end, const LineColor& color, float lineWidth = 2.f, float dashLength = 10.f, float gapLength = 5.f);
34+
static void drawDottedLine(const CCPoint& start, const CCPoint& end, const LineColor& color, float minX, float maxX, float minY, float maxY);
3535
void draw(DrawGridLayer* dgl, float minX, float maxX, float minY, float maxY);
3636
};

‎src/modules/ScrollableObjects.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,8 @@ class $nodeModify(SOGroup, Group) {
640640
removeFromParentAndCleanup(false);
641641
auto nodePos = parent->convertToNodeSpace(worldPos);
642642
setPosition(nodePos);
643+
setScale(menu->getScale());
643644

644-
setScale(parent->getScale());
645645
parent->addChild(this);
646646
}));
647647
});

0 commit comments

Comments
 (0)