Skip to content

Commit 0335408

Browse files
macOS/iOS (#30)
1 parent 9c904ef commit 0335408

File tree

9 files changed

+16
-5
lines changed

9 files changed

+16
-5
lines changed

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ endif()
1818

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

21-
CPMAddPackage("gh:camila314/uibuilder#3d10e3d")
21+
CPMAddPackage("gh:camila314/uibuilder#04d0075")
2222
add_subdirectory(nodes)
2323

2424
if (WIN32)
@@ -32,8 +32,7 @@ endif()
3232

3333
add_subdirectory(run-info)
3434

35-
# TODO: macos still sucks
36-
if (NOT APPLE)
35+
# if (NOT APPLE)
3736

3837
add_subdirectory(scroll-zoom)
3938

@@ -43,4 +42,4 @@ add_subdirectory(reference-image)
4342
# add_subdirectory(song-search)
4443
add_subdirectory(song-preview)
4544

46-
endif()
45+
# endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.

nodes/nodes.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ class TextInputNode : public cocos2d::CCNode, public TextInputDelegate {
2525

2626
virtual void textChanged(CCTextInputNode*);
2727

28+
~TextInputNode() {
29+
if (input_node) {
30+
input_node->onClickTrackNode(false);
31+
input_node->setDelegate(nullptr);
32+
}
33+
}
34+
2835
void set_value(const std::string& value);
2936
std::string get_value();
3037
};
File renamed without changes.
File renamed without changes.

scroll-zoom/main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ using namespace geode::prelude;
66
class $modify(EditorUI) {
77
void scrollWheel(float y, float x) override {
88
auto kb = CCDirector::sharedDirector()->getKeyboardDispatcher();
9-
if (kb->getControlKeyPressed()) {
9+
#ifdef GEODE_IS_MACOS
10+
auto control = kb->getControlKeyPressed() || kb->getCommandKeyPressed();
11+
#else
12+
auto control = kb->getControlKeyPressed();
13+
#endif
14+
if (control) {
1015
auto zoom = m_editorLayer->m_objectLayer->getScale();
1116
const float mult = 0.015f * Mod::get()->getSettingValue<double>("zoom-mult");
1217
zoom = std::max(0.05, zoom * std::pow(2.7, y * -mult));
File renamed without changes.

0 commit comments

Comments
 (0)