add some addresses + CCDirector::get and CCKeyboardDispatcher::get (does

MSVC actually allow this? what?)
This commit is contained in:
HJfod 2022-09-28 22:38:30 +03:00
parent b8451a58a5
commit 6af42cb41f
4 changed files with 35 additions and 9 deletions
bindings
loader
include/Geode/cocos/cocos2dx
CCDirector.h
robtop/keyboard_dispatcher
src/cocos2d-ext

View file

@ -1101,7 +1101,9 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
}
bool editButton2Usable() = mac 0x0, win 0x8b890, ios 0x0;
void constrainGameLayerPosition() = mac 0x1c6d0, win 0x0, ios 0x0;
inline void constrainGameLayerPosition() {
this->constrainGameLayerPosition(-3.f, -6.f);
}
void create(LevelEditorLayer*) = mac 0x8a80, win 0x0, ios 0x0;
void deselectAll() = mac 0x1f300, win 0x86af0, ios 0x0;
void onDeselectAll(cocos2d::CCObject*) = mac 0x19cd0, win 0x0, ios 0x0;
@ -1119,6 +1121,7 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
virtual void keyDown(cocos2d::enumKeyCodes) = mac 0x30790, win 0x91a30, ios 0x0;
virtual void draw() = mac 0x0, win 0x18fbe0, ios 0x0;
virtual void keyUp(cocos2d::enumKeyCodes key) = mac 0x312b0, win 0x92180, ios 0x0;
virtual void scrollWheel(float y, float x) = mac 0x0, win 0x921d0, ios 0x0;
CreateMenuItem* menuItemFromObjectString(gd::string, int) = mac 0x1e130;
void moveObject(GameObject*, cocos2d::CCPoint) = mac 0x24b10, win 0x8ddb0, ios 0x0;
void onDuplicate(cocos2d::CCObject*) = mac 0x18ba0, win 0x87d20, ios 0x0;

View file

@ -136,6 +136,12 @@ public:
return id;
}
GEODE_ADD(
inline static CCDirector* get() {
return CCDirector::sharedDirector();
}
)
// attribute
/** Get current running Scene. Director can only run one Scene at the time */

View file

@ -14,24 +14,29 @@ RT_ADD(
virtual ~CCKeyboardDispatcher();
void addDelegate(CCKeyboardDelegate* pDelegate);
void removeDelegate(CCKeyboardDelegate* pDelegate);
void forceAddDelegate(CCKeyboardDelegate* pDelegate);
void forceRemoveDelegate(CCKeyboardDelegate* pDelegate);
enumKeyCodes convertKeyCode(enumKeyCodes key);
bool dispatchKeyboardMSG(enumKeyCodes key, bool);
inline bool getAltKeyPressed() const {return m_bAltPressed;}
inline bool getAltKeyPressed() const {
return m_bAltPressed;
}
inline bool getCommandKeyPressed() const {
return m_bCommandPressed;
}
inline bool getControlKeyPressed() const {
return m_bControlPressed;
}
inline bool getShiftKeyPressed() const {
return m_bShiftPressed;
}
inline bool getCommandKeyPressed() const {return m_bCommandPressed;}
inline bool getControlKeyPressed() const {return m_bControlPressed;}
inline bool getShiftKeyPressed() const {return m_bShiftPressed;}
static CCKeyboardDispatcher* get();
const char* keyToString(enumKeyCodes key);

View file

@ -0,0 +1,12 @@
#include <cocos2d.h>
using namespace cocos2d;
#pragma warning(push)
#pragma warning(disable: 4273)
CCKeyboardDispatcher* CCKeyboardDispatcher::get() {
return CCDirector::get()->getKeyboardDispatcher();
}
#pragma warning(pop)