mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-22 15:37:53 -05:00
more compile time optimizations
This commit is contained in:
parent
1cfc793f7c
commit
cce4daf501
60 changed files with 563 additions and 524 deletions
|
@ -9,7 +9,8 @@
|
|||
There's nothing worse than having to read thousands of words just to see what some library's code actually looks like, so instead, here's a **Hello World** in Geode right off the bat:
|
||||
|
||||
```cpp
|
||||
#include <Geode/Geode.hpp>
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <codegenned/modify/MenuLayer.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
|
|
@ -92,8 +92,8 @@ class AudioEffectsLayer {
|
|||
}
|
||||
|
||||
class BoomListView : cocos2d::CCLayer, TableViewDelegate, TableViewDataSource {
|
||||
inline BoomListView() {}
|
||||
inline ~BoomListView() {
|
||||
BoomListView() {}
|
||||
~BoomListView() {
|
||||
CC_SAFE_RELEASE(m_entries);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,9 @@ namespace { namespace format_strings {
|
|||
char const* class_includes = R"GEN(#pragma once
|
||||
#include <Geode/c++stl/gdstdlib.hpp>
|
||||
#include <cocos2d.h>
|
||||
#include <cocos-ext.h>
|
||||
#include <codegenned/GeneratedPredeclare.hpp>
|
||||
#include <Geode/Enums.hpp>
|
||||
|
||||
)GEN";
|
||||
|
||||
|
@ -75,7 +77,7 @@ std::string generateBindingHeader(Root& root, ghc::filesystem::path const& singl
|
|||
std::string single_output;
|
||||
single_output += format_strings::class_includes;
|
||||
|
||||
for (auto dep : cls.superclasses) {
|
||||
for (auto dep : cls.depends) {
|
||||
if (can_find(dep, "cocos2d::")) continue;
|
||||
|
||||
std::string depfilename = (codegen::getUnqualifiedClassName(dep) + ".hpp");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// included by default in every geode project
|
||||
|
||||
#include <Geode/Geode.hpp>
|
||||
#include <Geode/Loader.hpp>
|
||||
|
||||
GEODE_API bool GEODE_CALL geode_implicit_load(geode::Mod* m) {
|
||||
geode::Mod::setSharedMod(m);
|
||||
|
|
|
@ -117,10 +117,10 @@ target_link_libraries(${PROJECT_NAME} z lilac_hook geode-sdk)
|
|||
set_source_files_properties(${OBJC_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
||||
target_precompile_headers(${PROJECT_NAME} PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/Geode/DefaultInclude.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/Geode/Utils.hpp"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/include/Geode/Utils.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/Geode/Loader.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/Geode/UI.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/Geode/Bindings.hpp"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/include/Geode/Bindings.hpp"
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/include/Geode/Modify.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/Geode/cocos/cocos2dx/include/cocos2d.h"
|
||||
)
|
||||
|
|
|
@ -15,340 +15,10 @@
|
|||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <Geode/utils/addresser.hpp>
|
||||
#include "Enums.hpp"
|
||||
|
||||
namespace geode::core::meta {}
|
||||
|
||||
template<auto F>
|
||||
struct address_of_t {
|
||||
static inline auto value = geode::base::get();
|
||||
};
|
||||
|
||||
template<auto F>
|
||||
inline auto address_of = address_of_t<F>::value;
|
||||
|
||||
//thanks pie
|
||||
enum class SearchType {
|
||||
Search = 0,
|
||||
Downloaded = 1,
|
||||
MostLiked = 2,
|
||||
Trending = 3,
|
||||
Recent = 4,
|
||||
UsersLevels = 5,
|
||||
Featured = 6,
|
||||
Magic = 7,
|
||||
Sends = 8,
|
||||
MapPack = 9,
|
||||
MapPackOnClick = 10,
|
||||
Awarded = 11,
|
||||
Followed = 12,
|
||||
Friends = 13,
|
||||
Users = 14,
|
||||
LikedGDW = 15,
|
||||
HallOfFame = 16,
|
||||
FeaturedGDW = 17,
|
||||
Similar = 18,
|
||||
MyLevels = 98,
|
||||
SavedLevels = 99,
|
||||
FavouriteLevels = 100
|
||||
};
|
||||
|
||||
// jesus fucking christ (painfully written by @hjfod)
|
||||
enum class GameObjectType {
|
||||
Solid = 0,
|
||||
Hazard = 2,
|
||||
InverseGravityPortal = 3,
|
||||
NormalGravityPortal = 4,
|
||||
ShipPortal = 5,
|
||||
CubePortal = 6,
|
||||
Decoration = 7,
|
||||
YellowJumpPad = 8,
|
||||
PinkJumpPad = 9,
|
||||
GravityPad = 10,
|
||||
YellowJumpRing = 11,
|
||||
PinkJumpRing = 12,
|
||||
GravityRing = 13,
|
||||
InverseMirrorPortal = 14,
|
||||
NormalMirrorPortal = 15,
|
||||
BallPortal = 16,
|
||||
RegularSizePortal = 17,
|
||||
MiniSizePortal = 18,
|
||||
UfoPortal = 19,
|
||||
Modifier = 20,
|
||||
SecretCoin = 22,
|
||||
DualPortal = 23,
|
||||
SoloPortal = 24,
|
||||
Slope = 25,
|
||||
WavePortal = 26,
|
||||
RobotPortal = 27,
|
||||
TeleportPortal = 28,
|
||||
GreenRing = 29,
|
||||
Collectible = 30,
|
||||
UserCoin = 31,
|
||||
DropRing = 32,
|
||||
SpiderPortal = 33,
|
||||
RedJumpPad = 34,
|
||||
RedJumpRing = 35,
|
||||
CustomRing = 36,
|
||||
DashRing = 37,
|
||||
GravityDashRing = 38,
|
||||
CollisionObject = 39,
|
||||
Special = 40,
|
||||
};
|
||||
|
||||
enum class PulseEffectType {};
|
||||
enum class TouchTriggerType {};
|
||||
enum class PlayerButton {};
|
||||
enum class GhostType {};
|
||||
enum class TableViewCellEditingStyle {};
|
||||
enum class UserListType {};
|
||||
enum class GJErrorCode {};
|
||||
enum class AccountError {};
|
||||
enum class GJSongError {};
|
||||
enum class LikeItemType {
|
||||
Unknown = 0,
|
||||
Level = 1,
|
||||
Comment = 2,
|
||||
AccountComment = 3
|
||||
};
|
||||
|
||||
enum class GJStoreItem {};
|
||||
enum class CommentError {};
|
||||
enum class BackupAccountError {};
|
||||
|
||||
enum class BoomListType {
|
||||
Default = 0x0,
|
||||
User = 0x2,
|
||||
Stats = 0x3,
|
||||
Achievement = 0x4,
|
||||
Level = 0x5,
|
||||
Level2 = 0x6,
|
||||
Comment = 0x7,
|
||||
Comment2 = 0x8,
|
||||
Song = 0xb,
|
||||
Score = 0xc,
|
||||
MapPack = 0xd,
|
||||
CustomSong = 0xe,
|
||||
Comment3 = 0xf,
|
||||
User2 = 0x10,
|
||||
Request = 0x11,
|
||||
Message = 0x12,
|
||||
LevelScore = 0x13,
|
||||
Artist = 0x14,
|
||||
};
|
||||
|
||||
enum class MenuAnimationType {
|
||||
Scale = 0,
|
||||
Move = 1,
|
||||
};
|
||||
|
||||
enum class ShopType {
|
||||
Normal,
|
||||
Secret,
|
||||
Community
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class ZLayer {
|
||||
B4 = -3,
|
||||
B3 = -1,
|
||||
B2 = 1,
|
||||
B1 = 3,
|
||||
Default = 0,
|
||||
T1 = 5,
|
||||
T2 = 7,
|
||||
T3 = 9,
|
||||
};
|
||||
|
||||
enum class UpdateResponse {
|
||||
Unknown,
|
||||
UpToDate,
|
||||
GameVerOutOfDate,
|
||||
UpdateSuccess,
|
||||
};
|
||||
|
||||
enum class UnlockType {
|
||||
Cube = 0x1,
|
||||
Col1 = 0x2,
|
||||
Col2 = 0x3,
|
||||
Ship = 0x4,
|
||||
Ball = 0x5,
|
||||
Bird = 0x6,
|
||||
Dart = 0x7,
|
||||
Robot = 0x8,
|
||||
Spider = 0x9,
|
||||
Streak = 0xA,
|
||||
Death = 0xB,
|
||||
GJItem = 0xC,
|
||||
};
|
||||
|
||||
enum class SpecialRewardItem {
|
||||
FireShard = 0x1,
|
||||
IceShard = 0x2,
|
||||
PoisonShard = 0x3,
|
||||
ShadowShard = 0x4,
|
||||
LavaShard = 0x5,
|
||||
BonusKey = 0x6,
|
||||
Orbs = 0x7,
|
||||
Diamonds = 0x8,
|
||||
CustomItem = 0x9,
|
||||
};
|
||||
|
||||
enum class EditCommand {
|
||||
SmallLeft = 1,
|
||||
SmallRight = 2,
|
||||
SmallUp = 3,
|
||||
SmallDown = 4,
|
||||
|
||||
Left = 5,
|
||||
Right = 6,
|
||||
Up = 7,
|
||||
Down = 8,
|
||||
|
||||
BigLeft = 9,
|
||||
BigRight = 10,
|
||||
BigUp = 11,
|
||||
BigDown = 12,
|
||||
|
||||
TinyLeft = 13,
|
||||
TinyRight = 14,
|
||||
TinyUp = 15,
|
||||
TinyDown = 16,
|
||||
|
||||
FlipX = 17,
|
||||
FlipY = 18,
|
||||
RotateCW = 19,
|
||||
RotateCCW = 20,
|
||||
RotateCW45 = 21,
|
||||
RotateCCW45 = 22,
|
||||
RotateFree = 23,
|
||||
RotateSnap = 24,
|
||||
|
||||
Scale = 25,
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class PlaybackMode {
|
||||
Not = 0,
|
||||
Playing = 1,
|
||||
Paused = 2,
|
||||
};
|
||||
|
||||
enum class SelectArtType {
|
||||
Background = 0,
|
||||
Ground = 1,
|
||||
};
|
||||
|
||||
enum class UndoCommand {
|
||||
Delete = 1,
|
||||
New = 2,
|
||||
Paste = 3,
|
||||
DeleteMulti = 4,
|
||||
Transform = 5,
|
||||
Select = 6,
|
||||
};
|
||||
|
||||
enum class EasingType {
|
||||
None = 0,
|
||||
EaseInOut = 1,
|
||||
EaseIn = 2,
|
||||
EaseOut = 3,
|
||||
ElasticInOut = 4,
|
||||
ElasticIn = 5,
|
||||
ElasticOut = 6,
|
||||
BounceInOut = 7,
|
||||
BounceIn = 8,
|
||||
BounceOut = 9,
|
||||
ExponentialInOut = 10,
|
||||
ExponentialIn = 11,
|
||||
ExponentialOut = 12,
|
||||
SineInOut = 13,
|
||||
SineIn = 14,
|
||||
SineOut = 15,
|
||||
BackInOut = 16,
|
||||
BackIn = 17,
|
||||
BackOut = 18,
|
||||
};
|
||||
|
||||
enum class GJDifficulty {
|
||||
Auto = 0,
|
||||
Easy = 1,
|
||||
Normal = 2,
|
||||
Hard = 3,
|
||||
Harder = 4,
|
||||
Insane = 5,
|
||||
Demon = 6,
|
||||
DemonEasy = 7,
|
||||
DemonMedium = 8,
|
||||
DemonInsane = 9,
|
||||
DemonExtreme = 10
|
||||
};
|
||||
|
||||
enum class GJLevelType {
|
||||
Local = 1,
|
||||
Editor = 2,
|
||||
Saved = 3
|
||||
};
|
||||
|
||||
enum class IconType {
|
||||
Cube = 0,
|
||||
Ship = 1,
|
||||
Ball = 2,
|
||||
Ufo = 3,
|
||||
Wave = 4,
|
||||
Robot = 5,
|
||||
Spider = 6,
|
||||
DeathEffect = 98,
|
||||
Special = 99,
|
||||
};
|
||||
|
||||
enum class GJChallengeType {
|
||||
Unknown = 0,
|
||||
Orbs = 1,
|
||||
UserCoins = 2,
|
||||
Stars = 3
|
||||
};
|
||||
|
||||
enum class GJScoreType {
|
||||
Unknown = 0,
|
||||
Creator = 1
|
||||
};
|
||||
|
||||
enum class LevelLeaderboardType {
|
||||
Friends = 0,
|
||||
Global = 1,
|
||||
Weekly = 2
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class ComparisonType {
|
||||
Equals = 0,
|
||||
Larger = 1,
|
||||
Smaller = 2,
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class MoveTargetType {
|
||||
Both = 0,
|
||||
XOnly = 1,
|
||||
YOnly = 2,
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class TouchToggleMode {
|
||||
Normal = 0,
|
||||
ToggleOn = 1,
|
||||
ToggleOff = 2,
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class LeaderboardState {
|
||||
Default = 0,
|
||||
Top100 = 1,
|
||||
Global = 2,
|
||||
Creator = 3,
|
||||
Friends = 4,
|
||||
};
|
||||
|
||||
#define CLASSPARAM(...)
|
||||
#define STRUCTPARAM(...)
|
||||
|
||||
|
|
|
@ -103,82 +103,82 @@ _61,_62,_63,N,...) N
|
|||
9, 8, 7, 6, 5, 4, 3, 2, 1, 0
|
||||
|
||||
|
||||
#define GEODE_NEST1(macro, begin) \
|
||||
macro(GEODE_CONCAT(begin, 0)), \
|
||||
macro(GEODE_CONCAT(begin, 1)), \
|
||||
macro(GEODE_CONCAT(begin, 2)), \
|
||||
macro(GEODE_CONCAT(begin, 3)), \
|
||||
macro(GEODE_CONCAT(begin, 4)), \
|
||||
macro(GEODE_CONCAT(begin, 5)), \
|
||||
macro(GEODE_CONCAT(begin, 6)), \
|
||||
macro(GEODE_CONCAT(begin, 7)), \
|
||||
macro(GEODE_CONCAT(begin, 8)), \
|
||||
macro(GEODE_CONCAT(begin, 9)), \
|
||||
macro(GEODE_CONCAT(begin, a)), \
|
||||
macro(GEODE_CONCAT(begin, b)), \
|
||||
macro(GEODE_CONCAT(begin, c)), \
|
||||
macro(GEODE_CONCAT(begin, d)), \
|
||||
macro(GEODE_CONCAT(begin, e)), \
|
||||
macro(GEODE_CONCAT(begin, f))
|
||||
// #define GEODE_NEST1(macro, begin) \
|
||||
// macro(GEODE_CONCAT(begin, 0)), \
|
||||
// macro(GEODE_CONCAT(begin, 1)), \
|
||||
// macro(GEODE_CONCAT(begin, 2)), \
|
||||
// macro(GEODE_CONCAT(begin, 3)), \
|
||||
// macro(GEODE_CONCAT(begin, 4)), \
|
||||
// macro(GEODE_CONCAT(begin, 5)), \
|
||||
// macro(GEODE_CONCAT(begin, 6)), \
|
||||
// macro(GEODE_CONCAT(begin, 7)), \
|
||||
// macro(GEODE_CONCAT(begin, 8)), \
|
||||
// macro(GEODE_CONCAT(begin, 9)), \
|
||||
// macro(GEODE_CONCAT(begin, a)), \
|
||||
// macro(GEODE_CONCAT(begin, b)), \
|
||||
// macro(GEODE_CONCAT(begin, c)), \
|
||||
// macro(GEODE_CONCAT(begin, d)), \
|
||||
// macro(GEODE_CONCAT(begin, e)), \
|
||||
// macro(GEODE_CONCAT(begin, f))
|
||||
|
||||
#define GEODE_NEST2(macro, begin) \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, 0)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, 1)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, 2)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, 3)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, 4)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, 5)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, 6)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, 7)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, 8)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, 9)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, a)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, b)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, c)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, d)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, e)), \
|
||||
GEODE_NEST1(macro, GEODE_CONCAT(begin, f))
|
||||
// #define GEODE_NEST2(macro, begin) \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, 0)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, 1)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, 2)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, 3)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, 4)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, 5)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, 6)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, 7)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, 8)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, 9)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, a)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, b)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, c)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, d)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, e)), \
|
||||
// GEODE_NEST1(macro, GEODE_CONCAT(begin, f))
|
||||
|
||||
#define GEODE_NEST3(macro, begin) \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, 0)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, 1)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, 2)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, 3)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, 4)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, 5)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, 6)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, 7)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, 8)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, 9)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, a)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, b)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, c)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, d)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, e)), \
|
||||
GEODE_NEST2(macro, GEODE_CONCAT(begin, f))
|
||||
// #define GEODE_NEST3(macro, begin) \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, 0)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, 1)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, 2)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, 3)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, 4)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, 5)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, 6)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, 7)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, 8)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, 9)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, a)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, b)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, c)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, d)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, e)), \
|
||||
// GEODE_NEST2(macro, GEODE_CONCAT(begin, f))
|
||||
|
||||
#define GEODE_NEST4(macro, begin) \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, 0)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, 1)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, 2)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, 3)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, 4)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, 5)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, 6)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, 7)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, 8)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, 9)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, a)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, b)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, c)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, d)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, e)), \
|
||||
GEODE_NEST3(macro, GEODE_CONCAT(begin, f))
|
||||
// #define GEODE_NEST4(macro, begin) \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, 0)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, 1)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, 2)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, 3)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, 4)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, 5)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, 6)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, 7)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, 8)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, 9)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, a)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, b)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, c)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, d)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, e)), \
|
||||
// GEODE_NEST3(macro, GEODE_CONCAT(begin, f))
|
||||
|
||||
|
||||
#define GEODE_ENUM_OFFSETS_DEFINE(hex) GEODE_CONCAT($, hex)
|
||||
#define GEODE_ENUM_OFFSETS_SET() GEODE_NEST4(GEODE_ENUM_OFFSETS_DEFINE, 0x)
|
||||
// #define GEODE_ENUM_OFFSETS_DEFINE(hex) GEODE_CONCAT($, hex)
|
||||
// #define GEODE_ENUM_OFFSETS_SET() GEODE_NEST4(GEODE_ENUM_OFFSETS_DEFINE, 0x)
|
||||
|
||||
enum class PrinterOffsets {
|
||||
GEODE_ENUM_OFFSETS_SET()
|
||||
};
|
||||
// enum class PrinterOffsets {
|
||||
// GEODE_ENUM_OFFSETS_SET()
|
||||
// };
|
||||
|
|
324
loader/include/Geode/Enums.hpp
Normal file
324
loader/include/Geode/Enums.hpp
Normal file
|
@ -0,0 +1,324 @@
|
|||
#pragma once
|
||||
|
||||
//thanks pie
|
||||
enum class SearchType {
|
||||
Search = 0,
|
||||
Downloaded = 1,
|
||||
MostLiked = 2,
|
||||
Trending = 3,
|
||||
Recent = 4,
|
||||
UsersLevels = 5,
|
||||
Featured = 6,
|
||||
Magic = 7,
|
||||
Sends = 8,
|
||||
MapPack = 9,
|
||||
MapPackOnClick = 10,
|
||||
Awarded = 11,
|
||||
Followed = 12,
|
||||
Friends = 13,
|
||||
Users = 14,
|
||||
LikedGDW = 15,
|
||||
HallOfFame = 16,
|
||||
FeaturedGDW = 17,
|
||||
Similar = 18,
|
||||
MyLevels = 98,
|
||||
SavedLevels = 99,
|
||||
FavouriteLevels = 100
|
||||
};
|
||||
|
||||
// jesus fucking christ (painfully written by @hjfod)
|
||||
enum class GameObjectType {
|
||||
Solid = 0,
|
||||
Hazard = 2,
|
||||
InverseGravityPortal = 3,
|
||||
NormalGravityPortal = 4,
|
||||
ShipPortal = 5,
|
||||
CubePortal = 6,
|
||||
Decoration = 7,
|
||||
YellowJumpPad = 8,
|
||||
PinkJumpPad = 9,
|
||||
GravityPad = 10,
|
||||
YellowJumpRing = 11,
|
||||
PinkJumpRing = 12,
|
||||
GravityRing = 13,
|
||||
InverseMirrorPortal = 14,
|
||||
NormalMirrorPortal = 15,
|
||||
BallPortal = 16,
|
||||
RegularSizePortal = 17,
|
||||
MiniSizePortal = 18,
|
||||
UfoPortal = 19,
|
||||
Modifier = 20,
|
||||
SecretCoin = 22,
|
||||
DualPortal = 23,
|
||||
SoloPortal = 24,
|
||||
Slope = 25,
|
||||
WavePortal = 26,
|
||||
RobotPortal = 27,
|
||||
TeleportPortal = 28,
|
||||
GreenRing = 29,
|
||||
Collectible = 30,
|
||||
UserCoin = 31,
|
||||
DropRing = 32,
|
||||
SpiderPortal = 33,
|
||||
RedJumpPad = 34,
|
||||
RedJumpRing = 35,
|
||||
CustomRing = 36,
|
||||
DashRing = 37,
|
||||
GravityDashRing = 38,
|
||||
CollisionObject = 39,
|
||||
Special = 40,
|
||||
};
|
||||
|
||||
enum class PulseEffectType {};
|
||||
enum class TouchTriggerType {};
|
||||
enum class PlayerButton {};
|
||||
enum class GhostType {};
|
||||
enum class TableViewCellEditingStyle {};
|
||||
enum class UserListType {};
|
||||
enum class GJErrorCode {};
|
||||
enum class AccountError {};
|
||||
enum class GJSongError {};
|
||||
enum class LikeItemType {
|
||||
Unknown = 0,
|
||||
Level = 1,
|
||||
Comment = 2,
|
||||
AccountComment = 3
|
||||
};
|
||||
|
||||
enum class GJStoreItem {};
|
||||
enum class CommentError {};
|
||||
enum class BackupAccountError {};
|
||||
|
||||
enum class BoomListType {
|
||||
Default = 0x0,
|
||||
User = 0x2,
|
||||
Stats = 0x3,
|
||||
Achievement = 0x4,
|
||||
Level = 0x5,
|
||||
Level2 = 0x6,
|
||||
Comment = 0x7,
|
||||
Comment2 = 0x8,
|
||||
Song = 0xb,
|
||||
Score = 0xc,
|
||||
MapPack = 0xd,
|
||||
CustomSong = 0xe,
|
||||
Comment3 = 0xf,
|
||||
User2 = 0x10,
|
||||
Request = 0x11,
|
||||
Message = 0x12,
|
||||
LevelScore = 0x13,
|
||||
Artist = 0x14,
|
||||
};
|
||||
|
||||
enum class MenuAnimationType {
|
||||
Scale = 0,
|
||||
Move = 1,
|
||||
};
|
||||
|
||||
enum class ShopType {
|
||||
Normal,
|
||||
Secret,
|
||||
Community
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class ZLayer {
|
||||
B4 = -3,
|
||||
B3 = -1,
|
||||
B2 = 1,
|
||||
B1 = 3,
|
||||
Default = 0,
|
||||
T1 = 5,
|
||||
T2 = 7,
|
||||
T3 = 9,
|
||||
};
|
||||
|
||||
enum class UpdateResponse {
|
||||
Unknown,
|
||||
UpToDate,
|
||||
GameVerOutOfDate,
|
||||
UpdateSuccess,
|
||||
};
|
||||
|
||||
enum class UnlockType {
|
||||
Cube = 0x1,
|
||||
Col1 = 0x2,
|
||||
Col2 = 0x3,
|
||||
Ship = 0x4,
|
||||
Ball = 0x5,
|
||||
Bird = 0x6,
|
||||
Dart = 0x7,
|
||||
Robot = 0x8,
|
||||
Spider = 0x9,
|
||||
Streak = 0xA,
|
||||
Death = 0xB,
|
||||
GJItem = 0xC,
|
||||
};
|
||||
|
||||
enum class SpecialRewardItem {
|
||||
FireShard = 0x1,
|
||||
IceShard = 0x2,
|
||||
PoisonShard = 0x3,
|
||||
ShadowShard = 0x4,
|
||||
LavaShard = 0x5,
|
||||
BonusKey = 0x6,
|
||||
Orbs = 0x7,
|
||||
Diamonds = 0x8,
|
||||
CustomItem = 0x9,
|
||||
};
|
||||
|
||||
enum class EditCommand {
|
||||
SmallLeft = 1,
|
||||
SmallRight = 2,
|
||||
SmallUp = 3,
|
||||
SmallDown = 4,
|
||||
|
||||
Left = 5,
|
||||
Right = 6,
|
||||
Up = 7,
|
||||
Down = 8,
|
||||
|
||||
BigLeft = 9,
|
||||
BigRight = 10,
|
||||
BigUp = 11,
|
||||
BigDown = 12,
|
||||
|
||||
TinyLeft = 13,
|
||||
TinyRight = 14,
|
||||
TinyUp = 15,
|
||||
TinyDown = 16,
|
||||
|
||||
FlipX = 17,
|
||||
FlipY = 18,
|
||||
RotateCW = 19,
|
||||
RotateCCW = 20,
|
||||
RotateCW45 = 21,
|
||||
RotateCCW45 = 22,
|
||||
RotateFree = 23,
|
||||
RotateSnap = 24,
|
||||
|
||||
Scale = 25,
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class PlaybackMode {
|
||||
Not = 0,
|
||||
Playing = 1,
|
||||
Paused = 2,
|
||||
};
|
||||
|
||||
enum class SelectArtType {
|
||||
Background = 0,
|
||||
Ground = 1,
|
||||
};
|
||||
|
||||
enum class UndoCommand {
|
||||
Delete = 1,
|
||||
New = 2,
|
||||
Paste = 3,
|
||||
DeleteMulti = 4,
|
||||
Transform = 5,
|
||||
Select = 6,
|
||||
};
|
||||
|
||||
enum class EasingType {
|
||||
None = 0,
|
||||
EaseInOut = 1,
|
||||
EaseIn = 2,
|
||||
EaseOut = 3,
|
||||
ElasticInOut = 4,
|
||||
ElasticIn = 5,
|
||||
ElasticOut = 6,
|
||||
BounceInOut = 7,
|
||||
BounceIn = 8,
|
||||
BounceOut = 9,
|
||||
ExponentialInOut = 10,
|
||||
ExponentialIn = 11,
|
||||
ExponentialOut = 12,
|
||||
SineInOut = 13,
|
||||
SineIn = 14,
|
||||
SineOut = 15,
|
||||
BackInOut = 16,
|
||||
BackIn = 17,
|
||||
BackOut = 18,
|
||||
};
|
||||
|
||||
enum class GJDifficulty {
|
||||
Auto = 0,
|
||||
Easy = 1,
|
||||
Normal = 2,
|
||||
Hard = 3,
|
||||
Harder = 4,
|
||||
Insane = 5,
|
||||
Demon = 6,
|
||||
DemonEasy = 7,
|
||||
DemonMedium = 8,
|
||||
DemonInsane = 9,
|
||||
DemonExtreme = 10
|
||||
};
|
||||
|
||||
enum class GJLevelType {
|
||||
Local = 1,
|
||||
Editor = 2,
|
||||
Saved = 3
|
||||
};
|
||||
|
||||
enum class IconType {
|
||||
Cube = 0,
|
||||
Ship = 1,
|
||||
Ball = 2,
|
||||
Ufo = 3,
|
||||
Wave = 4,
|
||||
Robot = 5,
|
||||
Spider = 6,
|
||||
DeathEffect = 98,
|
||||
Special = 99,
|
||||
};
|
||||
|
||||
enum class GJChallengeType {
|
||||
Unknown = 0,
|
||||
Orbs = 1,
|
||||
UserCoins = 2,
|
||||
Stars = 3
|
||||
};
|
||||
|
||||
enum class GJScoreType {
|
||||
Unknown = 0,
|
||||
Creator = 1
|
||||
};
|
||||
|
||||
enum class LevelLeaderboardType {
|
||||
Friends = 0,
|
||||
Global = 1,
|
||||
Weekly = 2
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class ComparisonType {
|
||||
Equals = 0,
|
||||
Larger = 1,
|
||||
Smaller = 2,
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class MoveTargetType {
|
||||
Both = 0,
|
||||
XOnly = 1,
|
||||
YOnly = 2,
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class TouchToggleMode {
|
||||
Normal = 0,
|
||||
ToggleOn = 1,
|
||||
ToggleOff = 2,
|
||||
};
|
||||
|
||||
// Geode Addition
|
||||
enum class LeaderboardState {
|
||||
Default = 0,
|
||||
Top100 = 1,
|
||||
Global = 2,
|
||||
Creator = 3,
|
||||
Friends = 4,
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <Event.hpp>
|
||||
#include "Event.hpp"
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <functional>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <Geode/utils/types.hpp>
|
||||
#include <string_view>
|
||||
|
||||
#include "../hook-core/Hook.hpp"
|
||||
#include <Geode/hook-core/Hook.hpp>
|
||||
|
||||
namespace geode {
|
||||
class Mod;
|
||||
|
|
|
@ -10,9 +10,7 @@
|
|||
#include <functional>
|
||||
#include <unordered_set>
|
||||
#include <fs/filesystem.hpp>
|
||||
#include <Geode/utils/json.hpp>
|
||||
#include "Log.hpp"
|
||||
#include <Geode/utils/VersionInfo.hpp>
|
||||
|
||||
namespace geode {
|
||||
#pragma warning(disable: 4251)
|
||||
|
@ -27,6 +25,7 @@ namespace geode {
|
|||
class Mod;
|
||||
class Hook;
|
||||
struct ModInfo;
|
||||
class VersionInfo;
|
||||
|
||||
namespace modifier {
|
||||
template<class, class, class>
|
||||
|
|
|
@ -3,15 +3,14 @@
|
|||
#include <Geode/DefaultInclude.hpp>
|
||||
#include "Types.hpp"
|
||||
#include "Hook.hpp"
|
||||
#include "../utils/types.hpp"
|
||||
#include "../utils/Result.hpp"
|
||||
#include "../utils/VersionInfo.hpp"
|
||||
#include <Geode/utils/types.hpp>
|
||||
#include <Geode/utils/Result.hpp>
|
||||
#include <Geode/utils/VersionInfo.hpp>
|
||||
#include <Geode/utils/json.hpp>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include <type_traits>
|
||||
#include <cocos2d.h>
|
||||
#include "Setting.hpp"
|
||||
#include <optional>
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
#include <Geode/DefaultInclude.hpp>
|
||||
#include <optional>
|
||||
#include <unordered_set>
|
||||
#include "../utils/container.hpp"
|
||||
#include "../utils/json.hpp"
|
||||
#include "../utils/Result.hpp"
|
||||
#include "../utils/JsonValidation.hpp"
|
||||
#include "../utils/convert.hpp"
|
||||
#include "../utils/platform.hpp"
|
||||
#include <Geode/utils/container.hpp>
|
||||
#include <Geode/utils/json.hpp>
|
||||
#include <Geode/utils/Result.hpp>
|
||||
#include <Geode/utils/JsonValidation.hpp>
|
||||
#include <Geode/utils/convert.hpp>
|
||||
#include <Geode/utils/platform.hpp>
|
||||
#include <regex>
|
||||
|
||||
#pragma warning(push)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "Setting.hpp"
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <cocos2d.h>
|
||||
|
||||
namespace geode {
|
||||
class SettingNode;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include "Traits.hpp"
|
||||
#include <Geode/loader/Loader.hpp>
|
||||
#include <vector>
|
||||
|
||||
namespace cocos2d {
|
||||
class CCNode;
|
||||
}
|
||||
|
||||
namespace geode::modifier {
|
||||
class FieldContainer {
|
||||
private:
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "BasedButtonSprite.hpp"
|
||||
#include <codegenned/binding/CCMenuItemToggler.hpp>
|
||||
|
||||
#pragma warning(disable : 4275)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <cocos2d.h>
|
||||
|
||||
namespace geode {
|
||||
enum class CircleBaseSize {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "Popup.hpp"
|
||||
#include "InputNode.hpp"
|
||||
|
||||
#include <codegenned/binding/TextInputDelegate.hpp>
|
||||
|
||||
namespace geode {
|
||||
class ColorPickPopupDelegate {
|
||||
public:
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <cocos2d.h>
|
||||
|
||||
namespace cocos2d::extension {
|
||||
class CCScale9Sprite;
|
||||
}
|
||||
|
||||
namespace geode {
|
||||
class GEODE_DLL IconButtonSprite :
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <cocos2d.h>
|
||||
|
||||
namespace geode {
|
||||
class GEODE_DLL InputNode : public cocos2d::CCMenuItem {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <codegenned/binding/TableViewCell.hpp>
|
||||
#include <codegenned/binding/CustomListView.hpp>
|
||||
|
||||
namespace geode {
|
||||
class GEODE_DLL GenericListCell : public TableViewCell {
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <codegenned/binding/FLAlertLayerProtocol.hpp>
|
||||
#include "TextRenderer.hpp"
|
||||
#include "ScrollLayer.hpp"
|
||||
|
||||
struct MDParser;
|
||||
class CCScrollLayerExt;
|
||||
|
||||
namespace geode {
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <cocos2d.h>
|
||||
#include "SceneManager.hpp"
|
||||
#include <chrono>
|
||||
#include "../utils/Ref.hpp"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <codegenned/binding/FLAlertLayer.hpp>
|
||||
#include <codegenned/binding/CCMenuItemSpriteExtra.hpp>
|
||||
|
||||
namespace geode {
|
||||
template<typename... InitArgs>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
namespace cocos2d {
|
||||
class CCArray;
|
||||
class CCNode;
|
||||
}
|
||||
|
||||
namespace geode {
|
||||
class GEODE_DLL SceneManager {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <codegenned/binding/CCContentLayer.hpp>
|
||||
#include <codegenned/binding/CCScrollLayerExt.hpp>
|
||||
|
||||
namespace geode {
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <cocos2d.h>
|
||||
|
||||
namespace geode {
|
||||
class GEODE_DLL Scrollbar : public cocos2d::CCLayer {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <codegenned/binding/CCMenuItemSpriteExtra.hpp>
|
||||
|
||||
namespace geode {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <cocos2d.h>
|
||||
|
||||
namespace geode {
|
||||
enum class TextAlignment {
|
||||
|
|
|
@ -247,14 +247,20 @@ namespace geode::cocos {
|
|||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace std {
|
||||
template <typename T>
|
||||
struct std::iterator_traits<CCArrayIterator<T>> {
|
||||
struct iterator_traits<geode::cocos::CCArrayIterator<T>> {
|
||||
using difference_type = ptrdiff_t;
|
||||
using value_type = T;
|
||||
using pointer = T*;
|
||||
using reference = T&;
|
||||
using iterator_category = std::random_access_iterator_tag; // its random access but im too lazy to implement it
|
||||
};
|
||||
}
|
||||
|
||||
namespace geode::cocos {
|
||||
|
||||
struct GEODE_DLL CCArrayInserter {
|
||||
public:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Geode.hpp>
|
||||
#include <cocos2d.h>
|
||||
|
||||
namespace geode {
|
||||
static cocos2d::CCPoint& operator*=(cocos2d::CCPoint & pos, float mul) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <Geode/Bindings.hpp>
|
||||
#include <cocos2d.h>
|
||||
#include <Geode/utils/Ref.hpp>
|
||||
#include <Geode/utils/WackyGeodeMacros.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
#include <Geode/modify/Field.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
@ -83,7 +83,7 @@ void CCNode::setID(std::string const& id) {
|
|||
}
|
||||
|
||||
CCNode* CCNode::getChildByID(std::string const& id) {
|
||||
CCARRAY_FOREACH_B_TYPE(m_pChildren, child, CCNode) {
|
||||
for (auto child : CCArrayExt<CCNode>(m_pChildren)) {
|
||||
if (child->getID() == id) {
|
||||
return child;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ CCNode* CCNode::getChildByIDRecursive(std::string const& id) {
|
|||
if (auto child = this->getChildByID(id)) {
|
||||
return child;
|
||||
}
|
||||
CCARRAY_FOREACH_B_TYPE(m_pChildren, child, CCNode) {
|
||||
for (auto child : CCArrayExt<CCNode>(m_pChildren)) {
|
||||
if ((child = child->getChildByIDRecursive(id))) {
|
||||
return child;
|
||||
}
|
||||
|
|
|
@ -228,7 +228,7 @@ class $modify(CustomMenuLayer, MenuLayer) {
|
|||
|
||||
bottomMenu->alignItemsHorizontallyWithPadding(3.f);
|
||||
|
||||
CCARRAY_FOREACH_B_TYPE(bottomMenu->getChildren(), node, CCNode) {
|
||||
for (auto node : CCArrayExt<CCNode>(bottomMenu->getChildren())) {
|
||||
node->setPositionY(y);
|
||||
}
|
||||
if (chest) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// #include <Geode/Geode.hpp>
|
||||
// // this is the fix for the dynamic_cast problems
|
||||
|
||||
// USE_GEODE_NAMESPACE();
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
#include <Geode/utils/json.hpp>
|
||||
#include <Geode/utils/JsonValidation.hpp>
|
||||
#include <Geode/utils/fetch.hpp>
|
||||
#include <Geode/utils/file.hpp>
|
||||
#include <Geode/utils/string.hpp>
|
||||
#include <Geode/utils/vector.hpp>
|
||||
|
||||
#define GITHUB_DONT_RATE_LIMIT_ME_PLS 0
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <Geode/Geode.hpp>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
#include <Geode/utils/json.hpp>
|
||||
#include <hash.hpp>
|
||||
#include <Geode/utils/fetch.hpp>
|
||||
#include <Geode/utils/file.hpp>
|
||||
#include <Geode/utils/string.hpp>
|
||||
|
||||
void InstallTicket::postProgress(
|
||||
UpdateStatus status,
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "InternalMod.hpp"
|
||||
#include <Geode/loader/Log.hpp>
|
||||
#include <Geode/loader/Loader.hpp>
|
||||
#include <Geode/Geode.hpp>
|
||||
#include <Geode/utils/fetch.hpp>
|
||||
#include <thread>
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
#ifdef GEODE_IS_WINDOWS
|
||||
|
||||
#include <Geode/Geode.hpp>
|
||||
|
||||
#include "../crashlog.hpp"
|
||||
#include <Windows.h>
|
||||
#include <fstream>
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <Geode/utils/map.hpp>
|
||||
#include <Geode/utils/types.hpp>
|
||||
#include <mutex>
|
||||
#include <Geode/Geode.hpp>
|
||||
#include <about.hpp>
|
||||
#include <crashlog.hpp>
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include <Geode/Geode.hpp>
|
||||
#include <Geode/loader/Log.hpp>
|
||||
#include <Geode/loader/Mod.hpp>
|
||||
#include <Geode/loader/Loader.hpp>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#ifdef GEODE_IS_IOS
|
||||
|
||||
#include <Geode/Geode.hpp>
|
||||
#include <Geode/loader/Mod.hpp>
|
||||
#include <dlfcn.h>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#ifdef GEODE_IS_WINDOWS
|
||||
|
||||
#include <Geode/Geode.hpp>
|
||||
#include <Geode/loader/Mod.hpp>
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
template<typename T>
|
||||
|
|
|
@ -384,7 +384,7 @@ ModCell* ModCell::create(ModListView* list, bool expanded, const char* key, CCSi
|
|||
|
||||
|
||||
void ModListView::updateAllStates(ModCell* toggled) {
|
||||
CCARRAY_FOREACH_B_TYPE(m_tableView->m_cellArray, cell, ModCell) {
|
||||
for (auto cell : CCArrayExt<ModCell>(m_tableView->m_cellArray)) {
|
||||
cell->updateState(toggled == cell);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#include "GeodeSettingNode.hpp"
|
||||
#include <Geode/utils/platform.hpp>
|
||||
#include <codegenned/binding/ColorChannelSprite.hpp>
|
||||
#include <codegenned/binding/ButtonSprite.hpp>
|
||||
#include <codegenned/binding/CCTextInputNode.hpp>
|
||||
#include <codegenned/binding/Slider.hpp>
|
||||
|
||||
// BoolSettingNode
|
||||
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
#include <Geode/loader/Setting.hpp>
|
||||
#include <Geode/loader/SettingNode.hpp>
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <codegenned/binding/CCMenuItemSpriteExtra.hpp>
|
||||
#include <codegenned/binding/CCTextInputNode.hpp>
|
||||
#include <codegenned/binding/Slider.hpp>
|
||||
#include <codegenned/binding/SliderThumb.hpp>
|
||||
#include <Geode/ui/InputNode.hpp>
|
||||
#include <Geode/ui/BasedButtonSprite.hpp>
|
||||
#include <Geode/utils/convert.hpp>
|
||||
|
@ -297,7 +300,7 @@ namespace {
|
|||
decArrowSpr->setScale(.3f);
|
||||
|
||||
m_decArrow = CCMenuItemSpriteExtra::create(
|
||||
decArrowSpr, self(), menu_selector(ImplArrows::onDecrement)
|
||||
decArrowSpr, self(), menu_selector(ImplArrows::Callbacks::onDecrement)
|
||||
);
|
||||
m_decArrow->setPosition(-width / 2 + 80.f, yPos);
|
||||
self()->m_menu->addChild(m_decArrow);
|
||||
|
@ -306,7 +309,7 @@ namespace {
|
|||
incArrowSpr->setScale(.3f);
|
||||
|
||||
m_incArrow = CCMenuItemSpriteExtra::create(
|
||||
incArrowSpr, self(), menu_selector(ImplArrows::onIncrement)
|
||||
incArrowSpr, self(), menu_selector(ImplArrows::Callbacks::onIncrement)
|
||||
);
|
||||
m_incArrow->setPosition(-10.f, yPos);
|
||||
self()->m_menu->addChild(m_incArrow);
|
||||
|
@ -318,7 +321,7 @@ namespace {
|
|||
decArrowSpr->setScale(.3f);
|
||||
|
||||
m_bigDecArrow = CCMenuItemSpriteExtra::create(
|
||||
decArrowSpr, self(), menu_selector(ImplArrows::onBigDecrement)
|
||||
decArrowSpr, self(), menu_selector(ImplArrows::Callbacks::onBigDecrement)
|
||||
);
|
||||
m_bigDecArrow->setPosition(-width / 2 + 65.f, yPos);
|
||||
self()->m_menu->addChild(m_bigDecArrow);
|
||||
|
@ -327,50 +330,46 @@ namespace {
|
|||
incArrowSpr->setScale(.3f);
|
||||
|
||||
m_bigIncArrow = CCMenuItemSpriteExtra::create(
|
||||
incArrowSpr, self(), menu_selector(ImplArrows::onBigIncrement)
|
||||
incArrowSpr, self(), menu_selector(ImplArrows::Callbacks::onBigIncrement)
|
||||
);
|
||||
m_bigIncArrow->setPosition(5.f, yPos);
|
||||
self()->m_menu->addChild(m_bigIncArrow);
|
||||
}
|
||||
}
|
||||
|
||||
void onIncrement(CCObject*) {
|
||||
// intentionally refcast to prevent warnings on clang and
|
||||
// not to offset this as it has already been offset to the
|
||||
// correct vtable when it's passed to CCMenuItemSpriteExtra
|
||||
auto self = reference_cast<C*>(this);
|
||||
self->m_uncommittedValue += std::static_pointer_cast<T>(
|
||||
self->m_setting
|
||||
)->getArrowStepSize();
|
||||
self->valueChanged(true);
|
||||
}
|
||||
// intentionally a subclass to make it relatively safe to
|
||||
// use as callbacks for the child class, since we give the
|
||||
// child class as the target to CCMenuItemSpriteExtra
|
||||
struct Callbacks : public C {
|
||||
void onIncrement(CCObject*) {
|
||||
this->m_uncommittedValue += std::static_pointer_cast<T>(
|
||||
this->m_setting
|
||||
)->getArrowStepSize();
|
||||
this->valueChanged(true);
|
||||
}
|
||||
|
||||
void onDecrement(CCObject*) {
|
||||
// intentional, see ImplArrows::onIncrement
|
||||
auto self = reference_cast<C*>(this);
|
||||
self->m_uncommittedValue -= std::static_pointer_cast<T>(
|
||||
self->m_setting
|
||||
)->getArrowStepSize();
|
||||
self->valueChanged(true);
|
||||
}
|
||||
void onDecrement(CCObject*) {
|
||||
this->m_uncommittedValue -= std::static_pointer_cast<T>(
|
||||
this->m_setting
|
||||
)->getArrowStepSize();
|
||||
this->valueChanged(true);
|
||||
}
|
||||
|
||||
void onBigIncrement(CCObject*) {
|
||||
// intentional, see ImplArrows::onIncrement
|
||||
auto self = reference_cast<C*>(this);
|
||||
self->m_uncommittedValue += std::static_pointer_cast<T>(
|
||||
self->m_setting
|
||||
)->getBigArrowStepSize();
|
||||
self->valueChanged(true);
|
||||
}
|
||||
void onBigIncrement(CCObject*) {
|
||||
this->m_uncommittedValue += std::static_pointer_cast<T>(
|
||||
this->m_setting
|
||||
)->getBigArrowStepSize();
|
||||
this->valueChanged(true);
|
||||
}
|
||||
|
||||
void onBigDecrement(CCObject*) {
|
||||
this->m_uncommittedValue -= std::static_pointer_cast<T>(
|
||||
this->m_setting
|
||||
)->getBigArrowStepSize();
|
||||
this->valueChanged(true);
|
||||
}
|
||||
};
|
||||
|
||||
void onBigDecrement(CCObject*) {
|
||||
// intentional, see ImplArrows::onIncrement
|
||||
auto self = reference_cast<C*>(this);
|
||||
self->m_uncommittedValue -= std::static_pointer_cast<T>(
|
||||
self->m_setting
|
||||
)->getBigArrowStepSize();
|
||||
self->valueChanged(true);
|
||||
}
|
||||
};
|
||||
|
||||
template<class C, class T>
|
||||
|
@ -413,7 +412,7 @@ namespace {
|
|||
void setupSlider(std::shared_ptr<T> setting, float width) {
|
||||
if (setting->hasSlider()) {
|
||||
m_slider = Slider::create(
|
||||
self(), menu_selector(ImplSlider::onSlider), .5f
|
||||
self(), menu_selector(ImplSlider::Callbacks::onSlider), .5f
|
||||
);
|
||||
m_slider->setPosition(-50.f, -15.f);
|
||||
self()->m_menu->addChild(m_slider);
|
||||
|
@ -432,17 +431,21 @@ namespace {
|
|||
}
|
||||
}
|
||||
|
||||
void onSlider(CCObject* slider) {
|
||||
// intentional, see ImplArrows::onIncrement
|
||||
auto self = reference_cast<C*>(this);
|
||||
auto setting = std::static_pointer_cast<T>(self->m_setting);
|
||||
// intentionally a subclass to make it relatively safe to
|
||||
// use as callbacks for the child class, since we give the
|
||||
// child class as the target to CCMenuItemSpriteExtra
|
||||
struct Callbacks : public C {
|
||||
void onSlider(CCObject* slider) {
|
||||
auto setting = std::static_pointer_cast<T>(this->m_setting);
|
||||
|
||||
self->m_uncommittedValue = valueFromSlider(
|
||||
setting,
|
||||
static_cast<SliderThumb*>(slider)->getValue()
|
||||
);
|
||||
self->valueChanged(true);
|
||||
}
|
||||
this->m_uncommittedValue = valueFromSlider(
|
||||
setting,
|
||||
static_cast<SliderThumb*>(slider)->getValue()
|
||||
);
|
||||
this->valueChanged(true);
|
||||
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <Geode/loader/Setting.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
#include <Geode/utils/convert.hpp>
|
||||
#include <codegenned/binding/ButtonSprite.hpp>
|
||||
|
||||
bool ModSettingsPopup::setup(Mod* mod) {
|
||||
m_noElasticity = true;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
#include <Geode/ui/ColorPickPopup.hpp>
|
||||
#include <Geode/utils/operators.hpp>
|
||||
#include <codegenned/binding/ButtonSprite.hpp>
|
||||
#include <codegenned/binding/CCTextInputNode.hpp>
|
||||
#include <codegenned/binding/Slider.hpp>
|
||||
#include <codegenned/binding/SliderThumb.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <Geode/ui/IconButtonSprite.hpp>
|
||||
#include <Geode/Utils.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <Geode/ui/InputNode.hpp>
|
||||
#include <codegenned/binding/CCTextInputNode.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#include <Geode/ui/ListView.hpp>
|
||||
#include <Geode/Utils.hpp>
|
||||
#include <codegenned/binding/StatsCell.hpp>
|
||||
#include <codegenned/binding/TableView.hpp>
|
||||
#include <Geode/utils/casts.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <Geode/ui/MDPopup.hpp>
|
||||
#include <Geode/utils/string.hpp>
|
||||
#include <codegenned/binding/ButtonSprite.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
#include <Geode/ui/MDTextArea.hpp>
|
||||
#include <Geode/utils/WackyGeodeMacros.hpp>
|
||||
#include <md4c.h>
|
||||
#include <Geode/Utils.hpp>
|
||||
#include <codegenned/binding/ProfilePage.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
#include <Geode/utils/string.hpp>
|
||||
#include <Geode/utils/casts.hpp>
|
||||
#include <Geode/utils/vector.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
@ -53,7 +56,7 @@ public:
|
|||
// so that's why based MDContentLayer expects itself
|
||||
// to have a CCMenu :-)
|
||||
if (m_content) {
|
||||
CCARRAY_FOREACH_B_TYPE(m_content->getChildren(), child, CCNode) {
|
||||
for (auto child : CCArrayExt<CCNode>(m_content->getChildren())) {
|
||||
auto y = this->getPositionY() + child->getPositionY();
|
||||
child->setVisible(!(
|
||||
(m_content->getContentSize().height < y) ||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include <Geode/ui/Notification.hpp>
|
||||
#include <Geode/ui/TextRenderer.hpp>
|
||||
#include <Geode/utils/WackyGeodeMacros.hpp>
|
||||
#include <Geode/Utils.hpp>
|
||||
#include <codegenned/binding/GameSoundManager.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
#include <Geode/utils/vector.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
@ -220,7 +221,7 @@ bool Notification::init(
|
|||
m_obContentSize.width += iconSpace;
|
||||
m_icon->setPositionX(m_icon->getPositionX() - iconSpace / 2);
|
||||
m_title->setPositionX(m_title->getPositionX() - iconSpace / 2);
|
||||
CCARRAY_FOREACH_B_TYPE(m_labels, label, CCNode) {
|
||||
for (auto label : CCArrayExt<CCNode>(m_labels)) {
|
||||
label->setPosition(
|
||||
label->getPositionX() + iconSpace - m_obContentSize.width / 2,
|
||||
label->getPositionY() - m_obContentSize.height / 2 + 2.f
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <Geode/ui/SceneManager.hpp>
|
||||
#include <Geode/utils/WackyGeodeMacros.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
@ -31,7 +31,7 @@ void SceneManager::forget(CCNode* node) {
|
|||
}
|
||||
|
||||
void SceneManager::willSwitchToScene(CCScene* scene) {
|
||||
CCARRAY_FOREACH_B_TYPE(m_persistedNodes, node, CCNode) {
|
||||
for (auto node : CCArrayExt<CCNode>(m_persistedNodes)) {
|
||||
// no cleanup in order to keep actions running
|
||||
node->removeFromParentAndCleanup(false);
|
||||
scene->addChild(node);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <Geode/ui/ScrollLayer.hpp>
|
||||
#include <Geode/utils/WackyGeodeMacros.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
@ -18,7 +18,7 @@ void GenericContentLayer::setPosition(CCPoint const& pos) {
|
|||
// all be TableViewCells
|
||||
CCLayerColor::setPosition(pos);
|
||||
|
||||
CCARRAY_FOREACH_B_TYPE(m_pChildren, child, CCNode) {
|
||||
for (auto child : CCArrayExt<CCNode>(m_pChildren)) {
|
||||
auto y = this->getPositionY() + child->getPositionY();
|
||||
child->setVisible(!(
|
||||
(m_obContentSize.height < y) ||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <Geode/ui/Scrollbar.hpp>
|
||||
#include <Geode/Utils.hpp>
|
||||
#include <Geode/utils/operators.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
|
||||
// TODO: die
|
||||
#undef min
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include <Geode/ui/TextRenderer.hpp>
|
||||
#include <Geode/utils/WackyGeodeMacros.hpp>
|
||||
#include <Geode/Utils.hpp>
|
||||
#include <Geode/utils/operators.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
#include <Geode/utils/string.hpp>
|
||||
#include <Geode/utils/casts.hpp>
|
||||
#undef max
|
||||
#undef min
|
||||
|
||||
|
@ -279,7 +281,7 @@ CCNode* TextRenderer::end(
|
|||
padY = std::max(m_size.height - renderedHeight, 0.f); break;
|
||||
}
|
||||
// adjust child positions
|
||||
CCARRAY_FOREACH_B_TYPE(m_target->getChildren(), child, CCNode) {
|
||||
for (auto child : CCArrayExt<CCNode>(m_target->getChildren())) {
|
||||
child->setPosition(
|
||||
child->getPositionX() + padX,
|
||||
child->getPositionY() +
|
||||
|
|
|
@ -27,7 +27,7 @@ CCRect geode::cocos::calculateNodeCoverage(std::vector<CCNode*> const& nodes) {
|
|||
|
||||
CCRect geode::cocos::calculateNodeCoverage(CCArray* nodes) {
|
||||
CCRect coverage;
|
||||
CCARRAY_FOREACH_B_TYPE(nodes, child, CCNode) {
|
||||
for (auto child : CCArrayExt<CCNode>(nodes)) {
|
||||
auto pos = child->getPosition() - child->getScaledContentSize() * child->getAnchorPoint();
|
||||
auto csize = child->getPosition() + child->getScaledContentSize() * (CCPoint { 1.f, 1.f } - child->getAnchorPoint());
|
||||
if (pos.x < coverage.origin.x) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include <Geode/utils/file.hpp>
|
||||
#include <Geode/utils/string.hpp>
|
||||
#include <fstream>
|
||||
#include <Geode/Bindings.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
|
|
Loading…
Reference in a new issue