Skip to content

Commit

Permalink
fix 1/4, 1/8, and pixel move buttons not working
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Nov 19, 2024
1 parent 9fbb984 commit d0148af
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# BetterEdit 6

## v6.9.1
* Fix <cj>1/4</c>, <cj>1/8</c>, and <cj>Pixel</c> moving buttons not working

## v6.9.0
* Add <cy>LDM Object Count</c> to the pause menu
* Fix <cp>Supporter</c> names overflowing
Expand Down
4 changes: 2 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "4.0.0-beta.2",
"version": "6.9.0",
"geode": "4.0.0",
"version": "6.9.1",
"gd": {
"win": "2.2074",
"mac": "2.2074",
Expand Down
9 changes: 7 additions & 2 deletions src/features/MoveMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class CustomEditMenu : public CCNode {
}
};

class $modify(EditorUI) {
class $modify(MoreButtonsUI, EditorUI) {
$override
bool init(LevelEditorLayer* editor) {
if (!EditorUI::init(editor))
Expand Down Expand Up @@ -356,12 +356,17 @@ class $modify(EditorUI) {
}

void addMoveButton(const char* id, const char* spr, EditCommand command) {
auto btn = this->getSpriteButton(spr, menu_selector(EditorUI::moveObjectCall), nullptr, .9f);
auto btn = this->getSpriteButton(spr, menu_selector(MoreButtonsUI::onMyMoveObject), nullptr, .9f);
btn->setID(id);
btn->setTag(static_cast<int>(command));
m_editButtonBar->m_buttonArray->addObject(btn);
}

// EditorUI::moveObjectCall was resolving to the wrong callback for some reason
void onMyMoveObject(CCObject* sender) {
this->moveObjectCall(static_cast<EditCommand>(sender->getTag()));
}

$override
void toggleMode(CCObject* sender) {
EditorUI::toggleMode(sender);
Expand Down

0 comments on commit d0148af

Please sign in to comment.