Skip to content

Commit

Permalink
disable imgui for macos because it cant compile
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMario211 committed Feb 7, 2024
1 parent 5a1eac5 commit 5a4dd9b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ else()
endif()

set(IMGUI_VERSION "v1.90")
if (APPLE)
message("mat please merge the pr")
CPMAddPackage("gh:ninXout/gd-imgui-cocos#dd044a8")
else()
if (NOT APPLE)
CPMAddPackage("gh:matcool/gd-imgui-cocos#5bc72d6") # specify a commit!
target_link_libraries(${PROJECT_NAME} imgui-cocos)
endif()
target_link_libraries(${PROJECT_NAME} imgui-cocos)

add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)

Expand Down
2 changes: 2 additions & 0 deletions src/ImGui.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <Geode/modify/MenuLayer.hpp>
#ifndef GEODE_IS_MACOS
#include <imgui-cocos.hpp>
#include <codecvt>
#include "PrismButton.hpp"
Expand Down Expand Up @@ -438,3 +439,4 @@ class $modify(MenuLayer) {
return true;
}
};
#endif
4 changes: 4 additions & 0 deletions src/Themes.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once
#include <Geode/Geode.hpp>
#ifndef GEODE_IS_MACOS
#include <imgui-cocos.hpp>
#endif
#include "hacks.hpp"

using namespace geode::prelude;
Expand All @@ -11,6 +13,7 @@ class Themes {
public:
static void addToCurrentThemes();
static matjson::Array getCurrentThemes();
#ifndef GEODE_IS_MACOS
static ImVec4 RGBAToImVec4(matjson::Value rgba) {
float currentOpacity = Hacks::getHack("Menu Opacity")->value.floatValue;
rgba = rgba.as_array();
Expand Down Expand Up @@ -156,6 +159,7 @@ class Themes {
"TextSelectedBg": [60, 55, 152, 255]
*/
}
#endif
static void RGBAToCC(matjson::Value rgba, CCNodeRGBA* obj) {
float currentOpacity = Hacks::getHack("Menu Opacity")->value.floatValue;
rgba = rgba.as_array();
Expand Down
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ class $modify(CCKeyboardDispatcher) {
auto prismButton = typeinfo_cast<PrismButton*>(CCScene::get()->getChildByID("prism-icon"));
if (prismButton == nullptr) return true;
HackItem* menuStyle = Hacks::getHack("Menu Style");
#ifdef GEODE_IS_MACOS
menuStyle->value.intValue = 1;
#endif
if (menuStyle->value.intValue == 0) { // imgui
prismButton->showImGuiMenu = !prismButton->showImGuiMenu;
} else {
Expand Down

0 comments on commit 5a4dd9b

Please sign in to comment.