Skip to content

Commit

Permalink
add camera movement when switching startpositions
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleeym committed Oct 10, 2023
1 parent 9e68b4a commit c1ad19c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions api/include/MoreTabs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#include <Geode/modify/EditorUI.hpp>
#include <Geode/binding/EditButtonBar.hpp>
#include <Geode/utils/cocos.hpp>
#include <Geode/binding/CCMenuItemToggler.hpp>
#include <Geode/binding/EditButtonBar.hpp>
#include <Geode/binding/GameManager.hpp>
#include <Geode/binding/CCMenuItemSpriteExtra.hpp>
#include <Geode/modify/EditorUI.hpp>
#include <geode.custom-keybinds/include/Keybinds.hpp>

using namespace geode::prelude;

Expand Down
6 changes: 0 additions & 6 deletions api/src/MoreTabs.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#include <MoreTabs.hpp>
#include <Geode/binding/CCMenuItemToggler.hpp>
#include <Geode/binding/EditButtonBar.hpp>
#include <Geode/binding/GameManager.hpp>
#include <Geode/binding/CCMenuItemSpriteExtra.hpp>
#include <Geode/modify/EditorUI.hpp>
#include <geode.custom-keybinds/include/Keybinds.hpp>

using namespace keybinds;
using namespace editor_api;
Expand Down
5 changes: 5 additions & 0 deletions src/features/StartPosSwitcher/StartPosButtonBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void StartPosButtonBar::onNext(CCObject*) {

StartPosManager::get()->next();
this->setStartPosCounters();
editor_api::moveGameLayerTo(m_editor->m_editorUI, StartPosManager::get()->getStartPosFromPoint(StartPosManager::get()->getActive()));
}

void StartPosButtonBar::onPrevious(CCObject*) {
Expand All @@ -150,4 +151,8 @@ void StartPosButtonBar::onPrevious(CCObject*) {

StartPosManager::get()->previous();
this->setStartPosCounters();
if (StartPosManager::get()->getActive() == CCPointZero) {
return;
}
editor_api::moveGameLayerTo(m_editor->m_editorUI, StartPosManager::get()->getStartPosFromPoint(StartPosManager::get()->getActive()));
}
1 change: 1 addition & 0 deletions src/features/StartPosSwitcher/StartPosButtonBar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <Geode/Geode.hpp>
#include <vector>
#include <algorithm>
#include <Utils.hpp>

#include "StartPosManager.hpp"

Expand Down

0 comments on commit c1ad19c

Please sign in to comment.