fix AEnterLayerEvent + resources not being loaded properly

This commit is contained in:
HJfod 2023-01-24 00:13:20 +02:00
parent db32b910ea
commit e4706c9aca
6 changed files with 10 additions and 7 deletions

View file

@ -1,5 +1,9 @@
# Geode Changelog
## v1.0.0-alpha
- Major rework of the entire framework; most notable changes include switching to a whole new hooking framework (TulipHook), simplifying many parts of the framework, and making it production-ready.
## v0.7.0
- Jesus H. Christmas Kallen there's like 300 new commits since v0.6.1 I don't think there's a point in listing them all, we basically redesigned the whole framework

View file

@ -23,13 +23,13 @@ namespace geode {
class GEODE_DLL AEnterLayerFilter : public EventFilter<AEnterLayerEvent> {
public:
using Callback = std::function<void(AEnterLayerEvent*)>;
using Callback = void(AEnterLayerEvent*);
protected:
std::optional<std::string> m_targetID;
public:
ListenerResult handle(Callback fn, AEnterLayerEvent* event);
ListenerResult handle(std::function<Callback> fn, AEnterLayerEvent* event);
AEnterLayerFilter(
std::optional<std::string> const& id

View file

@ -17,8 +17,10 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
Loader::get()->waitForModsToBeLoaded();
}
if (!LoadingLayer::init(fromReload)) return false;
CCFileUtils::get()->updatePaths();
if (!LoadingLayer::init(fromReload)) return false;
if (!fromReload) {
auto winSize = CCDirector::sharedDirector()->getWinSize();

View file

@ -45,8 +45,6 @@ struct CustomMenuLayer : Modify<CustomMenuLayer, MenuLayer> {
CCSprite* m_geodeButton;
bool init() {
log::debug("this: {}", this);
if (!MenuLayer::init()) return false;
// make sure to add the string IDs for nodes (Geode has no manual

View file

@ -9,7 +9,6 @@ struct ResourcesUpdate : Modify<ResourcesUpdate, LoadingLayer> {
LoadingLayer::loadAssets();
// this is in case the user refreshes texture quality at runtime
if (m_loadStep == 10) {
CCFileUtils::get()->updatePaths();
Loader::get()->updateResources();
}
}

View file

@ -8,7 +8,7 @@ AEnterLayerEvent::AEnterLayerEvent(
) : layerID(layerID),
layer(layer) {}
ListenerResult AEnterLayerFilter::handle(Callback fn, AEnterLayerEvent* event) {
ListenerResult AEnterLayerFilter::handle(std::function<Callback> fn, AEnterLayerEvent* event) {
if (m_targetID == event->layerID) {
fn(event);
}