Skip to content

Commit

Permalink
my fault i didnt test mac
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMario211 committed Feb 8, 2024
1 parent b0a1225 commit 4b596ad
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 17 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# v1.4.1
- Fixed Mac OS issue with not being able to open menu.
# v1.4.0
- Added Dear ImGui back (from request)
- Fixed Accurate Percentage on levels with the End Level Trigger (Thanks dankmeme01!)
Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "2.0.0",
"version": "v1.4.0",
"version": "v1.4.1",
"gd": {
"win": "2.204",
"mac": "2.200",
Expand Down
2 changes: 1 addition & 1 deletion resources/hacks/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"default": "button"
},
{
"name": "Menu Style",
"name": "Menu-Style",
"desc": "",
"opcodes": [],
"type": "dropdown",
Expand Down
4 changes: 2 additions & 2 deletions src/ImGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class $modify(MenuLayer) {
} else if (name == "Button Position Y") {
Hacks::Settings::setSettingValue(&settings, *hack, hack->value.intValue);
if (prismButton != nullptr) prismButton->setPositionY(hack->value.intValue);
} else if (name == "Menu Style") {
} else if (name == "Menu-Style") {
Hacks::Settings::setSettingValue(&settings, *hack, hack->value.intValue);
static_cast<PrismButton*>(prismButton)->showImGuiMenu = false;
} else {
Expand Down Expand Up @@ -390,7 +390,7 @@ class $modify(MenuLayer) {
if (ImGui::Selectable(values[i].as_string().c_str(), isSelected)) {
hack->value.intValue = i;
Hacks::Settings::setSettingValue(&settings, *hack, hack->value.intValue);
if (name == "Menu Style") {
if (name == "Menu-Style") {
prismButton->showImGuiMenu = !prismButton->showImGuiMenu;
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/PrismButton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ class PrismButton : public CCMenu {
return CCMenuItemSpriteExtra::create(myButtonSpr, ret, menu_selector(PrismButton::onButtonClicked));
}
void onButtonClicked(CCObject* p0) {
HackItem* menuStyle = Hacks::getHack("Menu Style");
HackItem* menuStyle = Hacks::getHack("Menu-Style");
#ifdef GEODE_IS_MACOS
menuStyle->value.intValue = 1;
#endif
if (menuStyle->value.intValue == 0) { // imgui
showImGuiMenu = !showImGuiMenu;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/PrismUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ void PrismUIButton::onDropdownBtn(CCObject* sender) {
auto settings = Mod::get()->getSavedValue<SettingHackStruct>("values");
hack->value.intValue = index;
Hacks::Settings::setSettingValue(&settings, *hack, hack->value.intValue);
if (hack->name == "Menu Style") {
if (hack->name == "Menu-Style") {
auto obj = static_cast<PrismUI*>(CCScene::get()->getChildByID("prism-menu"));
obj->onClose(sender);
} else if (hack->name == "Theme") {
Expand Down
10 changes: 1 addition & 9 deletions src/hacks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,7 @@ class Hacks {
value = Hacks::Settings::getSettingValue(settings, name).as_int();
settingExists = true;
} else {
if (name == "Menu Style") {
#ifdef GEODE_IS_ANDROID
value = HackValue(1);
#else
value = HackValue(0);
#endif
} else {
value = HackValue(obj.get<int>("default"));
}
value = HackValue(obj.get<int>("default"));
}
} else if (type == "float") {
if (Hacks::Settings::settingContainsHack(settings, name) && !reset) {
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ class $modify(CCKeyboardDispatcher) {
bool dispatchKeyboardMSG(enumKeyCodes key, bool down, bool arr) {
if (down && (key == KEY_Tab)) {
auto prismButton = typeinfo_cast<PrismButton*>(CCScene::get()->getChildByID("prism-icon"));
if (prismButton == nullptr) return true;
HackItem* menuStyle = Hacks::getHack("Menu Style");
HackItem* menuStyle = Hacks::getHack("Menu-Style");
#ifdef GEODE_IS_MACOS
if (prismButton == nullptr) return true;
menuStyle->value.intValue = 1;
#endif
if (menuStyle->value.intValue == 0) { // imgui
Expand Down

0 comments on commit 4b596ad

Please sign in to comment.