Skip to content

Commit

Permalink
Merge branch 'main' into 1.4.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Oct 15, 2023
2 parents 3247397 + 5819a13 commit 6574b22
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 49 deletions.
11 changes: 5 additions & 6 deletions .github/ISSUE_TEMPLATE/crash-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ name: Crash Report
description: Report a Geode bug (not mods themselves) that crashes the game or prevents startup caused by Geode Loader (not mods created by others).
labels: [ "unverified", "crash" ]
body:
- type: input
id: geode-confirmation
- type: checkboxes
attributes:
label: Geode Issue
description: |
The Geode repository is for issues of *Geode Loader*, not individual mods created by other developers.
When submitting a crash report, please make sure that the crash is *actually* related to ***Geode Loader itself*** and not to a mod or mod combination, after you do that type in "confirm" in the input field above.
When submitting a crash report, please make sure that the crash is *actually* related to ***Geode Loader itself*** and not to a mod or mod combination.
Failing to do this will get your issue *closed without explanation*.
placeholder: "Please, read the text below."
validations:
required: true
options:
- label: I confirm that this crash is NOT related to a mod but directly to Geode Loader itself.
required: true
- type: dropdown
id: platform
attributes:
Expand Down
5 changes: 5 additions & 0 deletions bindings/Cocos2d.bro
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ class cocos2d::CCCallFuncO {
static auto create(cocos2d::CCObject*, cocos2d::SEL_CallFuncO, cocos2d::CCObject*) = mac 0x455940;
}

[[link(win)]]
class cocos2d::CCCallFuncND {
static auto create(cocos2d::CCObject*, cocos2d::SEL_CallFuncND, void*) = mac 0x455470;
}

[[link(win)]]
class cocos2d::CCClippingNode {
CCClippingNode() {
Expand Down
120 changes: 88 additions & 32 deletions bindings/GeometryDash.bro

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cmake/GeodeFile.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(GEODE_CLI_MINIMUM_VERSION 1.0.5)

# Find Geode CLI
if (NOT DEFINED GEODE_CLI)
if (NOT DEFINED GEODE_CLI OR GEODE_CLI STREQUAL "GEODE_CLI-NOTFOUND")
find_program(GEODE_CLI NAMES geode.exe geode-cli.exe geode geode-cli PATHS ${CLI_PATH})
endif()

Expand Down Expand Up @@ -59,7 +59,7 @@ function(setup_geode_mod proname)
if(GEODE_CLI STREQUAL "GEODE_CLI-NOTFOUND")
message(FATAL_ERROR
"setup_geode_mod called, but Geode CLI was not found - "
"Please install CLI: https://docs.geode-sdk.org/info/installcli/"
"Please install CLI: https://docs.geode-sdk.org/"
)
return()
endif()
Expand Down
7 changes: 5 additions & 2 deletions loader/include/Geode/c++stl/gnustl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,11 @@ namespace gd {
}

~vector() {
for (auto i = m_start; i != m_finish; ++i) {
delete i;
if (m_start) {
for (auto& x : *this) {
x.~T();
}
delete m_start;
}
}

Expand Down
1 change: 1 addition & 0 deletions loader/include/Geode/ui/SceneManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace geode {
class GEODE_DLL SceneManager {
protected:
cocos2d::CCArray* m_persistedNodes;
cocos2d::CCScene* m_lastScene = nullptr;

bool setup();

Expand Down
15 changes: 9 additions & 6 deletions loader/src/loader/Index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class Index::Impl final {
friend class Index;

void cleanupItems();
void downloadIndex();
void downloadIndex(std::string commitHash = "");
void checkForUpdates();
void updateFromLocalTree();
void installNext(size_t index, IndexInstallList const& list);
Expand Down Expand Up @@ -296,7 +296,7 @@ bool Index::hasTriedToUpdate() const {
return m_impl->m_triedToUpdate;
}

void Index::Impl::downloadIndex() {
void Index::Impl::downloadIndex(std::string commitHash) {
log::debug("Downloading index");

IndexUpdateEvent(UpdateProgress(0, "Beginning download")).post();
Expand All @@ -307,7 +307,7 @@ void Index::Impl::downloadIndex() {
.join("index-download")
.fetch("https://github.com/geode-sdk/mods/zipball/main")
.into(targetFile)
.then([this, targetFile](auto) {
.then([this, targetFile, commitHash](auto) {
auto targetDir = dirs::getIndexDir() / "v0";
// delete old unzipped index
try {
Expand All @@ -333,6 +333,10 @@ void Index::Impl::downloadIndex() {

// remove the directory github adds to the root of the zip
(void)flattenGithubRepo(targetDir);
if (!commitHash.empty()) {
auto const checksumPath = dirs::getIndexDir() / ".checksum";
(void)file::writeString(checksumPath, commitHash);
}

Loader::get()->queueInMainThread([this] {
// update index
Expand Down Expand Up @@ -387,8 +391,7 @@ void Index::Impl::checkForUpdates() {
}
// otherwise save hash and download source
else {
(void)file::writeString(checksum, newSHA);
this->downloadIndex();
this->downloadIndex(newSHA);
}
})
.expect([](std::string const& err) {
Expand Down Expand Up @@ -591,7 +594,7 @@ bool Index::isUpdateAvailable(IndexItemHandle item) const {
bool Index::areUpdatesAvailable() const {
for (auto& mod : Loader::get()->getAllMods()) {
auto item = this->getMajorItem(mod->getID());
if (item && item->getMetadata().getVersion() > mod->getVersion()) {
if (item && item->getMetadata().getVersion() > mod->getVersion() && mod->isEnabled()) {
return true;
}
}
Expand Down
1 change: 0 additions & 1 deletion loader/src/ui/nodes/Notification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ void Notification::show() {
auto winSize = CCDirector::get()->getWinSize();
this->setPosition(winSize.width / 2, winSize.height / 4);
this->setZOrder(CCScene::get()->getHighestChildZ() + 100);
CCScene::get()->addChild(this);
}
SceneManager::get()->keepAcrossScenes(this);
m_showing = true;
Expand Down
5 changes: 5 additions & 0 deletions loader/src/ui/nodes/SceneManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ SceneManager::~SceneManager() {
}

void SceneManager::keepAcrossScenes(CCNode* node) {
if (m_lastScene) {
node->removeFromParentAndCleanup(false);
m_lastScene->addChild(node);
}
m_persistedNodes->addObject(node);
}

Expand All @@ -36,4 +40,5 @@ void SceneManager::willSwitchToScene(CCScene* scene) {
node->removeFromParentAndCleanup(false);
scene->addChild(node);
}
m_lastScene = scene;
}

0 comments on commit 6574b22

Please sign in to comment.