diff --git a/Geome3Dash/src/game/editor/G3DCameraEditorPopup.h b/Geome3Dash/src/game/editor/G3DCameraEditorPopup.h index 0f38967e..a9183ce3 100644 --- a/Geome3Dash/src/game/editor/G3DCameraEditorPopup.h +++ b/Geome3Dash/src/game/editor/G3DCameraEditorPopup.h @@ -47,8 +47,6 @@ namespace g3d glm::vec3 cubePosition = glm::vec3(0, 105, 400); double cubeRotationZ = 0; glm::vec3 spikePosition = glm::vec3(900, 105, 400); - //sus3d::Model* cube; - //sus3d::Model* spike; SplineGameObjectTransformer* splineTr; SplinePlayerObjectTransformer* splinePlayerTr; diff --git a/Geome3Dash/src/hook/LevelEditorLayer.cpp b/Geome3Dash/src/hook/LevelEditorLayer.cpp index 96b820ae..da446b4c 100644 --- a/Geome3Dash/src/hook/LevelEditorLayer.cpp +++ b/Geome3Dash/src/hook/LevelEditorLayer.cpp @@ -21,30 +21,13 @@ namespace g3d void onStopPlaytest() { LevelEditorLayer::onStopPlaytest(); - m_fields->keyframeEditorLayer->hide(); + const auto enabled = !geode::Mod::get()->getSettingValue("disable-general-3d"); + if (enabled) { m_fields->keyframeEditorLayer->hide(); } } - //std::optional getFrameName(CCSprite* sprite) - //{ - // auto texture = sprite->getTexture(); - // auto rect = sprite->getTextureRect(); - // auto* cachedFrames = CCSpriteFrameCache::sharedSpriteFrameCache()->m_pSpriteFrames; - // for (auto [key, frame] : geode::cocos::CCDictionaryExt(cachedFrames)) - // { - // if (frame->getTexture() == texture && frame->getRect() == rect) { return key; } - // } - // return std::nullopt; - //} void onSplineEditor(CCObject * obj) { - //auto editorUI = dynamic_cast(this->getChildByID("EditorUI")); - //auto playtestButton = this->getChildByIDRecursive("playtest-button"); - //auto playtestButtonSprite = playtestButton->getChildByType(0); - //bool isPlayTesting = false; - //auto cFrame = getFrameName(playtestButtonSprite); - //if (cFrame.has_value() && cFrame.value() == "GJ_pauseEditorBtn_001.png") { isPlayTesting = true; } - //if (isPlayTesting) { editorUI->onPlaytest(playtestButton); } m_fields->curveEditorLayer->show(); } @@ -80,6 +63,9 @@ namespace g3d { if (!LevelEditorLayer::init(p0, p1)) { return false; } + const auto enabled = !geode::Mod::get()->getSettingValue("disable-general-3d"); + if (!enabled) { return true; } + auto settingsButton = this->getChildByIDRecursive("settings-button"); auto settingsMenu = this->getChildByIDRecursive("settings-menu"); diff --git a/Geome3Dash/src/hook/PlayLayer.cpp b/Geome3Dash/src/hook/PlayLayer.cpp index 3981f5ac..81c06c48 100644 --- a/Geome3Dash/src/hook/PlayLayer.cpp +++ b/Geome3Dash/src/hook/PlayLayer.cpp @@ -38,11 +38,15 @@ namespace g3d void resetLevel() { - if (!m_fields->playLayer3D) + const auto enabled = !geode::Mod::get()->getSettingValue("disable-general-3d"); + if (enabled || G3DPlanetLayer::insideThePlanetLayerFlag) { - m_fields->playLayer3D = G3DPlayLayer::create(); - m_fields->playLayer3D->setZOrder(9); - this->addChild(m_fields->playLayer3D); + if (!m_fields->playLayer3D) + { + m_fields->playLayer3D = G3DPlayLayer::create(); + m_fields->playLayer3D->setZOrder(9); + this->addChild(m_fields->playLayer3D); + } } PlayLayer::resetLevel(); } diff --git a/bin/mod.json b/bin/mod.json index 2a3fc491..d6f6a199 100644 --- a/bin/mod.json +++ b/bin/mod.json @@ -19,8 +19,16 @@ "importance": "required" } ], + "settings": { + "disable-general-3d": { + "type": "bool", + "name": "Disable 3D in Non-Story Levels", + "description": "Turn off 3D effects for levels outside Story Mode.", + "default": false + } + }, "resources": { - "sprites": ["resources/sprite/*.png"], + "sprites": ["resources/sprite/G3D_emptyBtn_001-uhd.png"], "files": [ "resources/binaries/win/assimp-vc143-mt.dll", "resources/binaries/win/pugixml.dll",