Skip to content

Commit

Permalink
buncha fixes again
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Jul 16, 2024
1 parent c6146a3 commit dd6f5c2
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 5 deletions.
9 changes: 5 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# BetterEdit 6

## v6.6.5

* Should fix issues with BetterEdit not being loaded on Android due to Custom Keybinds missing

## v6.6.5
* Fix <cj>Next Free</c> not taking into account trigger Target Group IDs on Android
* Fix issues with BetterEdit not being loaded on Android due to <cb>Custom Keybinds</c> missing
* Fix layer input misplacement when using <co>UI Scale</c>

## v6.6.4
* Add keybinds for <cp>Increase Grid Size</c> and <cg>Decrease Grid Size</c>
Expand Down
3 changes: 3 additions & 0 deletions src/features/GridScaling.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "GridScaling.hpp"
#include <Geode/modify/EditorUI.hpp>
#include <Geode/modify/ObjectToolbox.hpp>
#include <Geode/binding/GameManager.hpp>
#include <Geode/binding/CCMenuItemSpriteExtra.hpp>
#include <Geode/binding/LevelEditorLayer.hpp>
#include <Geode/ui/TextInput.hpp>
#include <utils/HandleUIHide.hpp>

Expand Down
3 changes: 3 additions & 0 deletions src/features/HideUIButton.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include <Geode/modify/EditorUI.hpp>
#include <Geode/binding/CCMenuItemToggler.hpp>
#include <Geode/binding/LevelEditorLayer.hpp>
#include <Geode/ui/BasedButtonSprite.hpp>
#include <utils/HandleUIHide.hpp>

using namespace geode::prelude;
Expand Down
3 changes: 3 additions & 0 deletions src/features/MoveMenu.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include <Geode/modify/EditButtonBar.hpp>
#include <Geode/modify/EditorUI.hpp>
#include <Geode/binding/CCMenuItemSpriteExtra.hpp>
#include <Geode/binding/GameManager.hpp>
#include <Geode/utils/cocos.hpp>
#include <utils/EditCommandExt.hpp>
#include <utils/HandleUIHide.hpp>
#include <utils/Pro.hpp>
Expand Down
1 change: 0 additions & 1 deletion src/features/NextFreeOffset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ struct GroupIDSource final {
if (auto eobj = typeinfo_cast<EffectGameObject*>(obj)) {
used.insert(eobj->m_centerGroupID);
used.insert(eobj->m_targetGroupID);
log::info("targetGroupID: {}", eobj->m_targetGroupID);
}
}
};
Expand Down
1 change: 1 addition & 0 deletions src/features/ViewTab/ViewTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <Geode/binding/CCMenuItemSpriteExtra.hpp>
#include <Geode/binding/ButtonSprite.hpp>
#include <Geode/binding/EditButtonBar.hpp>
#include <Geode/binding/GameManager.hpp>
#include <Geode/utils/cocos.hpp>
#include <geode.custom-keybinds/include/Keybinds.hpp>
#include <utils/HandleUIHide.hpp>
Expand Down
2 changes: 2 additions & 0 deletions src/features/backups/AutoSave.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <Geode/modify/EditorUI.hpp>
#include <Geode/binding/LevelEditorLayer.hpp>
#include <Geode/ui/Notification.hpp>
#include "Backup.hpp"
#include "QuickSave.hpp"

Expand Down
1 change: 1 addition & 0 deletions src/features/backups/BackupItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <fmt/chrono.h>
#include <utils/EditorViewOnlyMode.hpp>
#include <Geode/ui/BasedButtonSprite.hpp>
#include <Geode/binding/EditLevelLayer.hpp>

bool BackupItem::init(BackupPtr backup) {
if (!CCNode::init())
Expand Down
2 changes: 2 additions & 0 deletions src/features/backups/BackupListPopup.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "BackupListPopup.hpp"
#include "Backup.hpp"
#include <Geode/ui/Scrollbar.hpp>
#include <Geode/ui/General.hpp>

bool BackupListPopup::setup(GJGameLevel* level) {
m_level = level;
Expand Down
17 changes: 17 additions & 0 deletions src/utils/EditableBMLabelProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
EditableBMLabelProxy* EditableBMLabelProxy::create() {
auto ret = new EditableBMLabelProxy();
if (ret && ret->init()) {
ret->scheduleUpdate();
ret->autorelease();
return ret;
}
Expand Down Expand Up @@ -45,6 +46,22 @@ EditableBMLabelProxy* EditableBMLabelProxy::replace(
return proxy;
}

static float getWorldScale(CCNode* node) {
if (auto parent = node->getParent()) {
return getWorldScale(parent) * node->getScale();
}
return node->getScale();
}

void EditableBMLabelProxy::update(float) {
if (m_input) {
m_input->setPosition(
m_inputParent->convertToNodeSpace(this->getParent()->convertToWorldSpace(m_obPosition))
);
m_input->setScale(getWorldScale(this) * 1.15f);
}
}

void EditableBMLabelProxy::setPosition(CCPoint const& pos) {
CCLabelBMFont::setPosition(pos);
if (m_input) m_input->setPosition(
Expand Down
2 changes: 2 additions & 0 deletions src/utils/EditableBMLabelProxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class EditableBMLabelProxy : public CCLabelBMFont, TextInputDelegate {
std::function<void(std::string const&)> onUpdate = nullptr
);

void update(float) override;

#define PROXY_FWD_1(fun, param_ty) \
void fun(param_ty x) override { \
CCLabelBMFont::fun(x); \
Expand Down

0 comments on commit dd6f5c2

Please sign in to comment.