mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-22 23:48:08 -05:00
add bindings and ids for CustomSongWidget
This commit is contained in:
parent
ed8d230733
commit
530551ec95
2 changed files with 41 additions and 0 deletions
|
@ -939,6 +939,7 @@ class CustomSongLayer : FLAlertLayer, FLAlertLayerProtocol, TextInputDelegate, G
|
||||||
}
|
}
|
||||||
|
|
||||||
class CustomSongWidget : cocos2d::CCNode, MusicDownloadDelegate, FLAlertLayerProtocol {
|
class CustomSongWidget : cocos2d::CCNode, MusicDownloadDelegate, FLAlertLayerProtocol {
|
||||||
|
bool init(SongInfoObject*, LevelSettingsObject*, bool, bool, bool, bool, bool hideBackground) = mac 0x37be20, win 0x685b0;
|
||||||
void FLAlert_Clicked(FLAlertLayer*, bool) {}
|
void FLAlert_Clicked(FLAlertLayer*, bool) {}
|
||||||
void loadSongInfoFinished(SongInfoObject*) {}
|
void loadSongInfoFinished(SongInfoObject*) {}
|
||||||
|
|
||||||
|
|
40
loader/src/ids/CustomSongWidget.cpp
Normal file
40
loader/src/ids/CustomSongWidget.cpp
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
#include "AddIDs.hpp"
|
||||||
|
|
||||||
|
#include <Geode/Bindings.hpp>
|
||||||
|
#include <Geode/modify/CustomSongWidget.hpp>
|
||||||
|
#include <Geode/utils/cocos.hpp>
|
||||||
|
|
||||||
|
using namespace geode::prelude;
|
||||||
|
|
||||||
|
$register_ids(CustomSongWidget) {
|
||||||
|
setIDSafe<CCScale9Sprite>(this, 0, "bg");
|
||||||
|
setIDSafe<CCSprite>(this, 0, "loading-bar");
|
||||||
|
setIDSafe<CCLabelBMFont>(this, 0, "song-name-label");
|
||||||
|
setIDSafe<CCLabelBMFont>(this, 1, "author-name-label");
|
||||||
|
setIDSafe<CCLabelBMFont>(this, 2, "id-and-size-label");
|
||||||
|
setIDSafe<CCLabelBMFont>(this, 3, "error-label");
|
||||||
|
setIDSafe<CCMenu>(this, 0, "buttons-menu");
|
||||||
|
auto customSongWidgetMenu = this->getChildByID("buttons-menu");
|
||||||
|
setIDSafe<CCMenuItemSpriteExtra>(customSongWidgetMenu, 0, "download-button");
|
||||||
|
setIDSafe<CCMenuItemSpriteExtra>(customSongWidgetMenu, 1, "cancel-button");
|
||||||
|
setIDSafe<CCMenuItemSpriteExtra>(customSongWidgetMenu, 2, "use-button");
|
||||||
|
setIDSafe<CCMenuItemSpriteExtra>(customSongWidgetMenu, 3, "refresh-button");
|
||||||
|
setIDSafe<CCMenuItemSpriteExtra>(customSongWidgetMenu, 4, "play-song-button");
|
||||||
|
setIDSafe<CCMenuItemSpriteExtra>(customSongWidgetMenu, 5, "more-button");
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CustomSongWidgetIDs : Modify<CustomSongWidgetIDs, CustomSongWidget> {
|
||||||
|
static void onModify(auto& self) {
|
||||||
|
if (!self.setHookPriority("CustomSongWidget::init", GEODE_ID_PRIORITY)) {
|
||||||
|
log::warn("Failed to set CustomSongWidget::init hook priority, node IDs may not work properly");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool init(SongInfoObject* s, LevelSettingsObject* l, bool b1, bool b2, bool b3, bool b4, bool hideBackground) {
|
||||||
|
if (!CustomSongWidget::init(s, l, b1, b2, b3, b4, hideBackground)) return false;
|
||||||
|
|
||||||
|
NodeIDs::get()->provide(this);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue