mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-24 05:14:40 -04:00
Geode android compiles gg girls and girls
This commit is contained in:
parent
6ce1838570
commit
5d07b2ab7d
19 changed files with 91 additions and 75 deletions
|
@ -135,7 +135,7 @@ if (NOT GEODE_BINDINGS_REPO_PATH)
|
|||
"contribute new bindings) then set GEODE_BINDINGS_REPO_PATH to where you have "
|
||||
"cloned the repository (system environment variables are supported)."
|
||||
)
|
||||
CPMAddPackage("gh:geode-sdk/bindings#2c4e7b9")
|
||||
CPMAddPackage("gh:geode-sdk/bindings#687394d")
|
||||
set(GEODE_BINDINGS_REPO_PATH ${GeodeBindings_SOURCE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace geode {
|
|||
*/
|
||||
class GEODE_DLL ListView : public CustomListView {
|
||||
protected:
|
||||
void setupList() override;
|
||||
void setupList(float) override;
|
||||
TableViewCell* getListCell(char const* key) override;
|
||||
void loadCell(TableViewCell* cell, int index) override;
|
||||
|
||||
|
|
|
@ -4,15 +4,17 @@
|
|||
|
||||
using namespace geode::prelude;
|
||||
|
||||
struct TextNodeFix : Modify<TextNodeFix, CCTextInputNode> {
|
||||
bool onTextFieldInsertText(cocos2d::CCTextFieldTTF* field, char const* text, int count) {
|
||||
auto change = count >= m_maxLabelLength ? 1 : 0;
|
||||
// TODO: commenting cause cctextinputnode is changed enough that i'm not sure how it works now
|
||||
|
||||
m_maxLabelLength += change;
|
||||
auto ret = CCTextInputNode::onTextFieldInsertText(field, text, count);
|
||||
m_maxLabelLength -= change;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
// struct TextNodeFix : Modify<TextNodeFix, CCTextInputNode> {
|
||||
// bool onTextFieldInsertText(cocos2d::CCTextFieldTTF* field, char const* text, int count) {
|
||||
// auto change = count >= m_maxLabelLength ? 1 : 0;
|
||||
|
||||
// m_maxLabelLength += change;
|
||||
// auto ret = CCTextInputNode::onTextFieldInsertText(field, text, count);
|
||||
// m_maxLabelLength -= change;
|
||||
// return ret;
|
||||
// }
|
||||
// };
|
||||
|
||||
#endif
|
|
@ -1,23 +1,25 @@
|
|||
using namespace geode::prelude;
|
||||
|
||||
#include <Geode/modify/CCTouchDispatcher.hpp>
|
||||
// TODO: 2.2 changes touch prio, we need to test how that affects things
|
||||
|
||||
struct ForcePrioRevert : Modify<ForcePrioRevert, CCTouchDispatcher> {
|
||||
void addTargetedDelegate(CCTouchDelegate* delegate, int priority, bool swallowsTouches) {
|
||||
m_bForcePrio = false;
|
||||
if (m_pTargetedHandlers->count() > 0) {
|
||||
auto handler = static_cast<CCTouchHandler*>(m_pTargetedHandlers->objectAtIndex(0));
|
||||
priority = handler->getPriority() - 2;
|
||||
}
|
||||
// #include <Geode/modify/CCTouchDispatcher.hpp>
|
||||
|
||||
CCTouchDispatcher::addTargetedDelegate(delegate, priority, swallowsTouches);
|
||||
}
|
||||
// struct ForcePrioRevert : Modify<ForcePrioRevert, CCTouchDispatcher> {
|
||||
// void addTargetedDelegate(CCTouchDelegate* delegate, int priority, bool swallowsTouches) {
|
||||
// m_bForcePrio = false;
|
||||
// if (m_pTargetedHandlers->count() > 0) {
|
||||
// auto handler = static_cast<CCTouchHandler*>(m_pTargetedHandlers->objectAtIndex(0));
|
||||
// priority = handler->getPriority() - 2;
|
||||
// }
|
||||
|
||||
void incrementForcePrio(int num) {
|
||||
m_bForcePrio = false;
|
||||
}
|
||||
// CCTouchDispatcher::addTargetedDelegate(delegate, priority, swallowsTouches);
|
||||
// }
|
||||
|
||||
void decrementForcePrio(int num) {
|
||||
m_bForcePrio = false;
|
||||
}
|
||||
};
|
||||
// void incrementForcePrio(int num) {
|
||||
// m_bForcePrio = false;
|
||||
// }
|
||||
|
||||
// void decrementForcePrio(int num) {
|
||||
// m_bForcePrio = false;
|
||||
// }
|
||||
// };
|
||||
|
|
|
@ -5,7 +5,7 @@ using namespace geode::prelude;
|
|||
#include <Geode/modify/AppDelegate.hpp>
|
||||
|
||||
struct SaveLoader : Modify<SaveLoader, AppDelegate> {
|
||||
void trySaveGame() {
|
||||
void trySaveGame(bool p0) {
|
||||
log::info("Saving mod data...");
|
||||
log::pushNest();
|
||||
|
||||
|
@ -19,6 +19,6 @@ struct SaveLoader : Modify<SaveLoader, AppDelegate> {
|
|||
|
||||
log::popNest();
|
||||
|
||||
return AppDelegate::trySaveGame();
|
||||
return AppDelegate::trySaveGame(p0);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -204,12 +204,13 @@ void geode::utils::game::launchLoaderUninstaller(bool deleteSaveData) {
|
|||
}
|
||||
|
||||
void geode::utils::game::exit() {
|
||||
if (CCApplication::sharedApplication() &&
|
||||
(GameManager::get()->m_playLayer || GameManager::get()->m_levelEditorLayer)) {
|
||||
log::error("Cannot exit in PlayLayer or LevelEditorLayer!");
|
||||
return;
|
||||
}
|
||||
AppDelegate::get()->trySaveGame();
|
||||
// TODO: yeah
|
||||
// if (CCApplication::sharedApplication() &&
|
||||
// (GameManager::get()->m_playLayer || GameManager::get()->m_levelEditorLayer)) {
|
||||
// log::error("Cannot exit in PlayLayer or LevelEditorLayer!");
|
||||
// return;
|
||||
// }
|
||||
AppDelegate::get()->trySaveGame(true);
|
||||
// AppDelegate::get()->showLoadingCircle(false, true);
|
||||
|
||||
CCDirector::get()->getActionManager()->addAction(CCSequence::create(
|
||||
|
@ -220,11 +221,11 @@ void geode::utils::game::exit() {
|
|||
}
|
||||
|
||||
void geode::utils::game::restart() {
|
||||
if (CCApplication::sharedApplication() &&
|
||||
(GameManager::get()->m_playLayer || GameManager::get()->m_levelEditorLayer)) {
|
||||
log::error("Cannot restart in PlayLayer or LevelEditorLayer!");
|
||||
return;
|
||||
}
|
||||
// if (CCApplication::sharedApplication() &&
|
||||
// (GameManager::get()->m_playLayer || GameManager::get()->m_levelEditorLayer)) {
|
||||
// log::error("Cannot restart in PlayLayer or LevelEditorLayer!");
|
||||
// return;
|
||||
// }
|
||||
|
||||
class Exit : public CCObject {
|
||||
public:
|
||||
|
@ -240,7 +241,7 @@ void geode::utils::game::restart() {
|
|||
// Not implemented
|
||||
// log::error("Restarting the game is not implemented on android");
|
||||
|
||||
AppDelegate::get()->trySaveGame();
|
||||
AppDelegate::get()->trySaveGame(true);
|
||||
// AppDelegate::get()->showLoadingCircle(false, true);
|
||||
|
||||
CCDirector::get()->getActionManager()->addAction(CCSequence::create(
|
||||
|
|
|
@ -97,7 +97,7 @@ HookCell* HookCell::create(char const* key, CCSize size) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void HookListView::setupList() {
|
||||
void HookListView::setupList(float) {
|
||||
m_itemSeparation = 30.0f;
|
||||
|
||||
if (!m_entries->count()) return;
|
||||
|
|
|
@ -37,7 +37,7 @@ class HookListView : public CustomListView {
|
|||
protected:
|
||||
Mod* m_mod;
|
||||
|
||||
void setupList() override;
|
||||
void setupList(float) override;
|
||||
TableViewCell* getListCell(char const* key) override;
|
||||
void loadCell(TableViewCell* cell, int index) override;
|
||||
|
||||
|
|
|
@ -459,8 +459,7 @@ void ModListLayer::reloadList(bool keepScroll, std::optional<ModListQuery> const
|
|||
// set search query
|
||||
m_query.keywords =
|
||||
m_searchInput &&
|
||||
m_searchInput->getString() &&
|
||||
strlen(m_searchInput->getString()) ?
|
||||
m_searchInput->getString().size() ?
|
||||
std::optional<std::string>(m_searchInput->getString()) :
|
||||
std::nullopt;
|
||||
|
||||
|
@ -523,7 +522,8 @@ void ModListLayer::reloadList(bool keepScroll, std::optional<ModListQuery> const
|
|||
}
|
||||
|
||||
// set list
|
||||
m_list = GJListLayer::create(list, nullptr, { 0, 0, 0, 180 }, 358.f, 220.f);
|
||||
// TODO: 6th param dont know
|
||||
m_list = GJListLayer::create(list, nullptr, { 0, 0, 0, 180 }, 358.f, 220.f, 0);
|
||||
m_list->setZOrder(2);
|
||||
m_list->setPosition(winSize / 2 - m_list->getScaledContentSize() / 2);
|
||||
this->addChild(m_list);
|
||||
|
@ -544,9 +544,7 @@ void ModListLayer::reloadList(bool keepScroll, std::optional<ModListQuery> const
|
|||
|
||||
// check if the user has searched something,
|
||||
// and show visual indicator if so
|
||||
auto hasQuery =
|
||||
(m_searchInput->getString() &&
|
||||
strlen(m_searchInput->getString()));
|
||||
auto hasQuery = m_searchInput->getString().size() > 0;
|
||||
m_searchBtn->setVisible(!hasQuery);
|
||||
m_searchClearBtn->setVisible(hasQuery);
|
||||
|
||||
|
|
|
@ -345,7 +345,7 @@ void FileSettingNode::updateLabel() {
|
|||
}
|
||||
|
||||
void FileSettingNode::textChanged(CCTextInputNode* input) {
|
||||
m_uncommittedValue = input->getString();
|
||||
m_uncommittedValue = input->getString().c_str();
|
||||
this->valueChanged(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ void ColorPickPopup::onReset(CCObject*) {
|
|||
}
|
||||
|
||||
void ColorPickPopup::textChanged(CCTextInputNode* input) {
|
||||
if (input->getString() && strlen(input->getString())) {
|
||||
if (input->getString().size()) {
|
||||
switch (input->getTag()) {
|
||||
case TAG_HEX_INPUT:
|
||||
{
|
||||
|
@ -218,13 +218,13 @@ void ColorPickPopup::textChanged(CCTextInputNode* input) {
|
|||
|
||||
case TAG_OPACITY_INPUT:
|
||||
{
|
||||
m_color.a = parseFloat(input->getString());
|
||||
m_color.a = parseFloat(input->getString().c_str());
|
||||
}
|
||||
break;
|
||||
|
||||
case TAG_R_INPUT: m_color.r = parseInt(input->getString()); break;
|
||||
case TAG_G_INPUT: m_color.g = parseInt(input->getString()); break;
|
||||
case TAG_B_INPUT: m_color.b = parseInt(input->getString()); break;
|
||||
case TAG_R_INPUT: m_color.r = parseInt(input->getString().c_str()); break;
|
||||
case TAG_G_INPUT: m_color.g = parseInt(input->getString().c_str()); break;
|
||||
case TAG_B_INPUT: m_color.b = parseInt(input->getString().c_str()); break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include <Geode/ui/Colors.hpp>
|
||||
#include <Geode/utils/ranges.hpp>
|
||||
#include <Geode/modify/LevelInfoLayer.hpp>
|
||||
|
||||
using namespace geode::prelude;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
using namespace geode::prelude;
|
||||
|
||||
char const* InputNode::getString() {
|
||||
return m_input->getString();
|
||||
return m_input->getString().c_str();
|
||||
}
|
||||
|
||||
void InputNode::setString(std::string const& str) {
|
||||
|
|
|
@ -29,7 +29,7 @@ void GenericListCell::updateBGColor(int index) {
|
|||
m_backgroundLayer->setOpacity(0xff);
|
||||
}
|
||||
|
||||
void ListView::setupList() {
|
||||
void ListView::setupList(float) {
|
||||
if (!m_entries->count()) return;
|
||||
m_tableView->reloadData();
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <Geode/binding/ProfilePage.hpp>
|
||||
// #include <Geode/binding/ProfilePage.hpp>
|
||||
#include <Geode/binding/CCContentLayer.hpp>
|
||||
#include <Geode/loader/Mod.hpp>
|
||||
#include <Geode/ui/MDTextArea.hpp>
|
||||
|
@ -181,7 +181,8 @@ void MDTextArea::onGDProfile(CCObject* pSender) {
|
|||
auto profile = std::string(href->getCString());
|
||||
profile = profile.substr(profile.find(":") + 1);
|
||||
try {
|
||||
ProfilePage::create(std::stoi(profile), false)->show();
|
||||
// TODO: im really lazy rn
|
||||
// ProfilePage::create(std::stoi(profile), false)->show();
|
||||
}
|
||||
catch (...) {
|
||||
FLAlertLayer::create(
|
||||
|
|
|
@ -30,7 +30,8 @@ public:
|
|||
auto inst = new QuickPopup;
|
||||
inst->m_selected = selected;
|
||||
inst->m_cancelledByEscape = cancelledByEscape;
|
||||
if (inst && inst->init(inst, title, content, btn1, btn2, width, false, .0f)) {
|
||||
// TODO: idk what 9th param is
|
||||
if (inst && inst->init(inst, title, content, btn1, btn2, width, false, .0f, .0f)) {
|
||||
inst->autorelease();
|
||||
return inst;
|
||||
}
|
||||
|
|
|
@ -407,7 +407,8 @@ struct LoadingFinished : Modify<LoadingFinished, LoadingLayer> {
|
|||
}
|
||||
auto scene = CCScene::create();
|
||||
scene->addChild(layer);
|
||||
AppDelegate::get()->m_runningScene = scene;
|
||||
// TODO: readd this
|
||||
// AppDelegate::get()->m_runningScene = scene;
|
||||
CCDirector::get()->replaceScene(scene);
|
||||
// Don't overwrite behaviour next time
|
||||
LOADING_FINISHED_SCENE = nullptr;
|
||||
|
|
|
@ -92,12 +92,12 @@ protected:
|
|||
} else {
|
||||
btnSpr->setColor({ 200, 200, 200 });
|
||||
}
|
||||
// auto btn = CCMenuItemSpriteExtra::create(
|
||||
// btnSpr, this, menu_selector(MySettingNode::onSelect)
|
||||
// );
|
||||
// btn->setTag(static_cast<int>(icon));
|
||||
// btn->setPosition(x, 0);
|
||||
// menu->addChild(btn);
|
||||
auto btn = CCMenuItemSpriteExtra::create(
|
||||
btnSpr, this, menu_selector(MySettingNode::onSelect)
|
||||
);
|
||||
btn->setTag(static_cast<int>(icon));
|
||||
btn->setPosition(x, 0);
|
||||
menu->addChild(btn);
|
||||
|
||||
x += 50.f;
|
||||
}
|
||||
|
@ -152,14 +152,14 @@ struct MyMenuLayer : Modify<MyMenuLayer, MenuLayer> {
|
|||
void onMoreGames(CCObject*) {
|
||||
TestEvent("Event system works!").post();
|
||||
if (Mod::get()->getSettingValue<bool>("its-raining-after-all")) {
|
||||
// FLAlertLayer::create("Damn", ":(", "OK")->show();
|
||||
FLAlertLayer::create("Damn", ":(", "OK")->show();
|
||||
}
|
||||
else {
|
||||
// FLAlertLayer::create(
|
||||
// "Yay",
|
||||
// "The weather report said it wouldn't rain today :)",
|
||||
// "OK"
|
||||
// )->show();
|
||||
FLAlertLayer::create(
|
||||
"Yay",
|
||||
"The weather report said it wouldn't rain today :)",
|
||||
"OK"
|
||||
)->show();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -22,6 +22,17 @@ GEODE_SIZE_CHECK(CCMenuItemSprite, 0x138);
|
|||
|
||||
GEODE_SIZE_CHECK(CCScale9Sprite, 0x1a4);
|
||||
|
||||
GEODE_SIZE_CHECK(FLAlertLayer, 0x1f0);
|
||||
GEODE_SIZE_CHECK(BoomListView, 0x164);
|
||||
GEODE_SIZE_CHECK(CustomListView, 0x168);
|
||||
GEODE_SIZE_CHECK(CCMenuItemSpriteExtra, 0x174);
|
||||
GEODE_SIZE_CHECK(LoadingLayer, 0x15c);
|
||||
GEODE_SIZE_CHECK(GJDropDownLayer, 0x1e4);
|
||||
// GEODE_SIZE_CHECK(TableViewCell, 0x19c);
|
||||
// GEODE_SIZE_CHECK(Slider, 0x158);
|
||||
GEODE_SIZE_CHECK(SliderTouchLogic, 0x174);
|
||||
GEODE_SIZE_CHECK(CCScrollLayerExt, 0x184);
|
||||
GEODE_SIZE_CHECK(TableView, 0x1dc);
|
||||
|
||||
// needed classes are ones in the ids folder and some generic ones (i think they are already done though so only ids)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue