Skip to content

Commit

Permalink
changes for pro UI
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Oct 15, 2024
1 parent f7906af commit 274fc8a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/features/GridScaling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <Geode/binding/LevelEditorLayer.hpp>
#include <Geode/ui/TextInput.hpp>
#include <utils/Editor.hpp>
#include <utils/Pro.hpp>

using namespace geode::prelude;

Expand Down Expand Up @@ -35,6 +36,9 @@ class $modify(GridUI, EditorUI) {
if (!Mod::get()->template getSettingValue<bool>("grid-size-controls")) {
return true;
}
if (be::isProUIEnabled()) {
return true;
}

// Move position slider a bit out of the way to make space

Expand Down
2 changes: 1 addition & 1 deletion src/utils/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class $modify(HideUI, EditorUI) {
m_currentLayerLabel->setVisible(show);

auto lockBtn = static_cast<CCMenuItemSpriteExtra*>(
this->getChildByID("layer-menu")->getChildByID("lock-layer"_spr)
this->querySelector("layer-menu hjfod.betteredit/lock-layer")
);
if (lockBtn) {
lockBtn->setVisible(show);
Expand Down
11 changes: 11 additions & 0 deletions src/utils/Pro.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "Pro.hpp"

#ifdef BETTEREDIT_PRO
bool be::isProUIEnabled() {
return pro::isNewUIEnabled();
}
#else
bool be::isProUIEnabled() {
return false;
}
#endif
4 changes: 4 additions & 0 deletions src/utils/Pro.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

namespace be {
bool isProUIEnabled();
}

#ifdef BETTEREDIT_PRO
#include <pro/Pro.hpp>
#endif

0 comments on commit 274fc8a

Please sign in to comment.