mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-23 07:57:51 -05:00
Merge branch 'main' of https://github.com/geode-sdk/geode
This commit is contained in:
commit
887f448627
7 changed files with 79 additions and 41 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
@ -145,7 +145,7 @@ jobs:
|
|||
dest: geode-nightly-win.zip
|
||||
|
||||
- name: Update release
|
||||
uses: IsaacShelton/update-existing-release@v1.3.1
|
||||
uses: IsaacShelton/update-existing-release@v1.3.2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: ./geode-nightly-mac.zip ./geode-nightly-win.zip
|
||||
|
|
|
@ -122,6 +122,10 @@ file(GLOB CODEGEN_DEPENDS CONFIGURE_DEPENDS
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/codegen/src/*.hpp
|
||||
)
|
||||
|
||||
if (NOT GEODE_BINDINGS_PATH)
|
||||
set(GEODE_BINDINGS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bindings)
|
||||
endif()
|
||||
|
||||
file(GLOB CODEGEN_OUTPUTS CONFIGURE_DEPENDS
|
||||
${GEODE_CODEGEN_PATH}/Geode/binding/*.hpp
|
||||
)
|
||||
|
@ -129,7 +133,7 @@ file(GLOB CODEGEN_OUTPUTS CONFIGURE_DEPENDS
|
|||
add_custom_command(
|
||||
DEPENDS ${CODEGEN_DEPENDS}
|
||||
DEPENDS CodegenProject
|
||||
COMMAND ${GEODE_CODEGEN_BINARY_OUT}/Codegen ${GEODE_TARGET_PLATFORM} bindings ${GEODE_CODEGEN_PATH}
|
||||
COMMAND ${GEODE_CODEGEN_BINARY_OUT}/Codegen ${GEODE_TARGET_PLATFORM} ${GEODE_BINDINGS_PATH} ${GEODE_CODEGEN_PATH}
|
||||
COMMAND echo codegen > ${GEODE_CODEGEN_PATH}/.stamp
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "Run Codegen"
|
||||
|
|
|
@ -2256,7 +2256,7 @@ class GJGameLevel : cocos2d::CCNode {
|
|||
void getNormalPercent() = mac 0x2b8b20;
|
||||
void levelWasAltered() = mac 0x2db530, win 0xbd550;
|
||||
void savePercentage(int, bool, int, int, bool) = mac 0x2db700;
|
||||
void dataLoaded(DS_Dictionary* dict) = mac 0x2922f0, win 0xbded0, ios 0x6fca4;
|
||||
void dataLoaded(DS_Dictionary* dict) = mac 0x2dc0e0, win 0xbded0, ios 0x6fca4;
|
||||
GJDifficulty getAverageDifficulty() = win 0xbd9b0;
|
||||
gd::string getUnpackedLevelDescription() = win 0xbf890;
|
||||
gd::string lengthKeyToString(int key) = win 0xbd910;
|
||||
|
@ -2310,7 +2310,7 @@ class GJGameLevel : cocos2d::CCNode {
|
|||
int m_chk;
|
||||
bool m_isChkValid;
|
||||
bool m_isCompletionLegitimate;
|
||||
geode::SeedValueVSR m_normalPercent;
|
||||
geode::SeedValueVRS m_normalPercent;
|
||||
geode::SeedValueRSV m_orbCompletion;
|
||||
geode::SeedValueRSV m_newNormalPercent2;
|
||||
int m_practicePercent;
|
||||
|
@ -2576,8 +2576,8 @@ class GJSearchObject : cocos2d::CCNode {
|
|||
return m_searchType;
|
||||
}
|
||||
|
||||
static GJSearchObject* create(SearchType nID) = win 0xc2b90;
|
||||
static GJSearchObject* create(SearchType nID, gd::string str) = win 0xc2c80;
|
||||
static GJSearchObject* create(SearchType nID) = win 0xc2b90, mac 0x2df120;
|
||||
static GJSearchObject* create(SearchType nID, gd::string str) = win 0xc2c80, mac 0x2df310;
|
||||
|
||||
SearchType m_searchType;
|
||||
gd::string m_searchQuery;
|
||||
|
@ -3670,13 +3670,13 @@ class LevelBrowserLayer : cocos2d::CCLayer {
|
|||
void updateLevelsLabel() = win 0x15c350;
|
||||
static LevelBrowserLayer* create(GJSearchObject* search) = mac 0x251210, win 0x159fa0, ios 0x2d0a00;
|
||||
|
||||
PAD = win 0x18;
|
||||
PAD = win 0x18, mac 0x30;
|
||||
GJListLayer* m_list;
|
||||
CCMenuItemSpriteExtra* m_leftArrow;
|
||||
CCMenuItemSpriteExtra* m_rightArrow;
|
||||
PAD = win 0x10;
|
||||
PAD = win 0x10, mac 0x20;
|
||||
GJSearchObject* m_searchObject;
|
||||
PAD = win 0x14;
|
||||
PAD = win 0x14, mac 0x28;
|
||||
int m_itemCount;
|
||||
int m_pageStartIdx;
|
||||
int m_pageEndIdx;
|
||||
|
@ -3923,14 +3923,14 @@ class LevelInfoLayer : cocos2d::CCLayer, LevelDownloadDelegate, LevelUpdateDeleg
|
|||
void setupProgressBars() = win 0x177fc0;
|
||||
void downloadLevel() = win 0x177d90;
|
||||
|
||||
PAD = win 0x4;
|
||||
PAD = win 0x4, mac 0x8;
|
||||
cocos2d::CCMenu* m_playBtnMenu;
|
||||
GJGameLevel* m_level;
|
||||
cocos2d::CCArray* m_unknown;
|
||||
CCMenuItemSpriteExtra* m_likeBtn;
|
||||
CCMenuItemSpriteExtra* m_starRateBtn;
|
||||
CCMenuItemSpriteExtra* m_demonRateBtn;
|
||||
PAD = win 0x4;
|
||||
PAD = win 0x4, mac 0x8;
|
||||
CCMenuItemToggler* m_toggler;
|
||||
cocos2d::CCLabelBMFont* m_label0;
|
||||
cocos2d::CCLabelBMFont* m_label1;
|
||||
|
@ -3939,7 +3939,7 @@ class LevelInfoLayer : cocos2d::CCLayer, LevelDownloadDelegate, LevelUpdateDeleg
|
|||
cocos2d::CCLabelBMFont* m_label4;
|
||||
cocos2d::CCLabelBMFont* m_label5;
|
||||
CCMenuItemSpriteExtra* m_cloneBtn;
|
||||
PAD = win 0x4;
|
||||
PAD = win 0x4, mac 0x8;
|
||||
}
|
||||
|
||||
class LevelLeaderboard : FLAlertLayer {
|
||||
|
@ -4148,7 +4148,7 @@ class LocalLevelManager : GManager {
|
|||
|
||||
cocos2d::CCDictionary* getAllLevelsInDict() = mac 0x35e3d0, win 0x18d7c0;
|
||||
|
||||
PAD = mac 0x10, win 0x1C;
|
||||
PAD = mac 0x4, win 0x1C;
|
||||
cocos2d::CCDictionary* m_loadData;
|
||||
cocos2d::CCDictionary* m_levelData;
|
||||
cocos2d::CCArray* m_localLevels;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
[project]
|
||||
name = "Geode"
|
||||
version = "v1.0.0-beta"
|
||||
version = "v1.0.0"
|
||||
repository = "https://github.com/geode-sdk/geode"
|
||||
tree = "https://github.com/geode-sdk/geode/tree/main"
|
||||
icon = "loader/resources/logos/geode-circle.png"
|
||||
|
@ -60,4 +60,4 @@ build-args = [
|
|||
]
|
||||
|
||||
# The file we use to get all the include paths and such
|
||||
infer-args-from = "loader/src/main.cpp"
|
||||
infer-args-from = "loader/src/load.cpp"
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace geode {
|
|||
template<class T, class N>
|
||||
concept InheritsEnterLayer = std::is_base_of_v<EnterLayerEvent<N>, T>;
|
||||
|
||||
template<class N, InheritsEnterLayer<N> T>
|
||||
template<class N, InheritsEnterLayer<N> T = EnterLayerEvent<N>>
|
||||
class EnterLayerFilter : public EventFilter<EnterLayerEvent<N>> {
|
||||
public:
|
||||
using Callback = void(T*);
|
||||
|
|
|
@ -75,25 +75,14 @@ void utils::web::openLinkInBrowser(std::string const& url) {
|
|||
|
||||
@implementation FileDialog
|
||||
+(Result<std::vector<ghc::filesystem::path>>) filePickerWithMode:(file::PickMode)mode options:(file::FilePickOptions const&)options multiple:(bool)mult {
|
||||
NSOpenPanel* panel = [NSOpenPanel openPanel];
|
||||
NSSavePanel* panel;
|
||||
if (mode == file::PickMode::SaveFile)
|
||||
panel = [NSSavePanel savePanel];
|
||||
else
|
||||
panel = [NSOpenPanel openPanel];
|
||||
|
||||
// allowed files
|
||||
NSMutableArray* allowed = [NSMutableArray array];
|
||||
[panel setCanCreateDirectories: TRUE];
|
||||
|
||||
for (auto& f : options.filters) {
|
||||
for (auto& i : f.files) {
|
||||
auto nsstr = [NSString stringWithUTF8String: i.c_str()];
|
||||
|
||||
if (![allowed containsObject: nsstr])
|
||||
[allowed addObject: nsstr];
|
||||
}
|
||||
}
|
||||
|
||||
if (options.filters.size())
|
||||
[panel setAllowedFileTypes: allowed];
|
||||
|
||||
// multiple
|
||||
[panel setAllowsMultipleSelection: mult];
|
||||
|
||||
// default path
|
||||
if (options.defaultPath) {
|
||||
|
@ -102,8 +91,36 @@ void utils::web::openLinkInBrowser(std::string const& url) {
|
|||
}
|
||||
|
||||
// other
|
||||
[panel setCanChooseDirectories: NO];
|
||||
[panel setCanChooseFiles: YES];
|
||||
if (mode != file::PickMode::SaveFile) {
|
||||
auto openPanel = (NSOpenPanel*)panel;
|
||||
|
||||
if (mode == file::PickMode::OpenFile){
|
||||
[openPanel setCanChooseDirectories: NO];
|
||||
[openPanel setCanChooseFiles: YES];
|
||||
}
|
||||
else {
|
||||
[openPanel setCanChooseDirectories: YES];
|
||||
[openPanel setCanChooseFiles: NO];
|
||||
}
|
||||
|
||||
[openPanel setAllowsMultipleSelection: mult];
|
||||
|
||||
// allowed files
|
||||
// TODO: allowed files using the NSOpenSavePanelDelegate xd
|
||||
// NSMutableArray* allowed = [NSMutableArray array];
|
||||
|
||||
// for (auto& f : options.filters) {
|
||||
// for (auto& i : f.files) {
|
||||
// auto nsstr = [NSString stringWithUTF8String: i.c_str()];
|
||||
|
||||
// if (![allowed containsObject: nsstr])
|
||||
// [allowed addObject: nsstr];
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (options.filters.size())
|
||||
// [panel setAllowedFileTypes: allowed];
|
||||
}
|
||||
|
||||
// run thing
|
||||
|
||||
|
@ -111,11 +128,16 @@ void utils::web::openLinkInBrowser(std::string const& url) {
|
|||
|
||||
if (result == NSModalResponseOK) {
|
||||
std::vector<ghc::filesystem::path> fileURLs;
|
||||
|
||||
for (NSURL* i in panel.URLs) {
|
||||
fileURLs.push_back(std::string(i.path.UTF8String));
|
||||
if (mode == file::PickMode::SaveFile) {
|
||||
fileURLs.push_back(std::string([[[panel URL] path] UTF8String]));
|
||||
}
|
||||
else {
|
||||
auto openPanel = (NSOpenPanel*)panel;
|
||||
|
||||
for (NSURL* i in openPanel.URLs) {
|
||||
fileURLs.push_back(std::string(i.path.UTF8String));
|
||||
}
|
||||
}
|
||||
return Ok(fileURLs);
|
||||
} else {
|
||||
return Err("File picker cancelled");
|
||||
|
@ -143,10 +165,11 @@ Result<std::vector<ghc::filesystem::path>> utils::file::pickFiles(
|
|||
}
|
||||
|
||||
CCPoint cocos::getMousePos() {
|
||||
auto frame = NSApp.mainWindow.frame;
|
||||
auto scaleFactor = CCPoint(CCDirector::get()->getWinSize()) / ccp(frame.size.width, frame.size.height);
|
||||
auto windowFrame = NSApp.mainWindow.frame;
|
||||
auto viewFrame = NSApp.mainWindow.contentView.frame;
|
||||
auto scaleFactor = CCPoint(CCDirector::get()->getWinSize()) / ccp(viewFrame.size.width, viewFrame.size.height);
|
||||
auto mouse = [NSEvent mouseLocation];
|
||||
return ccp(mouse.x - frame.origin.x, mouse.y - frame.origin.y) * scaleFactor;
|
||||
return ccp(mouse.x - windowFrame.origin.x, mouse.y - windowFrame.origin.y) * scaleFactor;
|
||||
}
|
||||
|
||||
ghc::filesystem::path dirs::getGameDir() {
|
||||
|
|
|
@ -64,4 +64,15 @@ GEODE_MEMBER_CHECK(SetupPulsePopup, m_pulseMode, 0x38c);
|
|||
// ColorSelectPopup
|
||||
GEODE_MEMBER_CHECK(ColorSelectPopup, m_copyColor, 0x372);
|
||||
|
||||
// LevelInfoLayer
|
||||
GEODE_MEMBER_CHECK(LevelInfoLayer, m_level, 0x1c0);
|
||||
|
||||
// LevelBrowserLayer
|
||||
GEODE_MEMBER_CHECK(LevelBrowserLayer, m_leftArrow, 0x1a8);
|
||||
GEODE_MEMBER_CHECK(LevelBrowserLayer, m_searchObject, 0x1d8);
|
||||
GEODE_MEMBER_CHECK(LevelBrowserLayer, m_itemCount, 0x208);
|
||||
|
||||
// LocalLevelManager
|
||||
GEODE_MEMBER_CHECK(LocalLevelManager, m_localLevels, 0x140);
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue