mirror of
https://github.com/maxnut/GDMegaOverlay.git
synced 2025-09-06 05:32:19 +00:00
bugfixing
This commit is contained in:
1
about.md
1
about.md
@@ -8,4 +8,5 @@ Open Source, feature-rich, gui-integrated Geometry Dash mod menu.
|
||||
* Startpos Switcher
|
||||
* Macro Bot
|
||||
* Internal Recorder
|
||||
* Layout Mode
|
||||
* and much more!
|
2
mod.json
2
mod.json
@@ -3,7 +3,7 @@
|
||||
"gd": {
|
||||
"win": "2.204"
|
||||
},
|
||||
"version": "v2.7.0",
|
||||
"version": "v2.7.1",
|
||||
"id": "maxnu.gd_mega_overlay",
|
||||
"name": "GD Mega Overlay",
|
||||
"developer": "maxnu & SpaghettDev",
|
||||
|
@@ -240,7 +240,7 @@ class $modify(PlayLayer)
|
||||
int cameraSection = MBO(int, this, 10676);
|
||||
int cameraSectionLast = MBO(int, this, 10680);
|
||||
|
||||
gd::vector<gd::vector<gd::vector<GameObject*>*>*> sections = MBO(std::vector<std::vector<std::vector<GameObject*>*>*>, this, 11336);
|
||||
gd::vector<gd::vector<gd::vector<GameObject*>*>*> sections = MBO(gd::vector<gd::vector<gd::vector<GameObject*>*>*>, this, 11336);
|
||||
|
||||
for(int i = cameraSection; i < cameraSectionLast; i++)
|
||||
{
|
||||
@@ -256,7 +256,10 @@ class $modify(PlayLayer)
|
||||
{
|
||||
auto obj = sections.at(i)->at(j)->at(k);
|
||||
for(auto &pair : Common::sectionLoopFunctions)
|
||||
pair.first(obj);
|
||||
{
|
||||
if(Settings::get<bool>(pair.second, false))
|
||||
pair.first(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -33,9 +33,6 @@ namespace GUI
|
||||
|
||||
inline std::function<void()> lateInit;
|
||||
|
||||
inline bool(__thiscall* menuLayerInit)(int* self);
|
||||
bool __fastcall menuLayerInitHook(int* self, void*);
|
||||
|
||||
ImVec2 getJsonPosition(const std::string&);
|
||||
void setJsonPosition(const std::string&, ImVec2);
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
#include "Settings.hpp"
|
||||
|
||||
#include <Geode/modify/PlayLayer.hpp>
|
||||
#include <Geode/modify/GameObject.hpp>
|
||||
|
||||
#include "../Common.h"
|
||||
|
||||
@@ -11,7 +12,6 @@ class $modify(PlayLayer)
|
||||
bool init(GJGameLevel* level, bool unk1, bool unk2)
|
||||
{
|
||||
bool res = PlayLayer::init(level, unk1, unk2);
|
||||
HitboxMultiplier::rectForObject.clear();
|
||||
HitboxMultiplier::memberRectForObject.clear();
|
||||
return res;
|
||||
}
|
||||
@@ -59,47 +59,50 @@ void HitboxMultiplier::scaleHazard(GameObject* hazard)
|
||||
MBO(cocos2d::CCRect, hazard, 728) = rect;
|
||||
}
|
||||
|
||||
cocos2d::CCRect* HitboxMultiplier::GameObjectGetObjectRect(GameObject* obj)
|
||||
class $modify(GameObject)
|
||||
{
|
||||
bool enabled = Settings::get<bool>("level/hitbox_multiplier", false);
|
||||
cocos2d::CCRect m_objectRect;
|
||||
|
||||
if(!enabled)
|
||||
return reinterpret_cast<cocos2d::CCRect*(__thiscall*)(GameObject*)>(base::get() + 0x13a570)(obj);
|
||||
|
||||
bool all = Settings::get<bool>("level/hitbox_multiplier/scale_all", false);
|
||||
|
||||
float x = 1, y = 1;
|
||||
|
||||
float scaleSlopes[2] = {Settings::get<float>("level/hitbox_multiplier/scale_slopes/x", 1.f), Settings::get<float>("level/hitbox_multiplier/scale_slopes/y", 1.f)};
|
||||
float scalePlayer[2] = {Settings::get<float>("level/hitbox_multiplier/scale_player/x", 1.f), Settings::get<float>("level/hitbox_multiplier/scale_player/y", 1.f)};
|
||||
|
||||
if(obj == GameManager::get()->getGameLayer()->m_player1 || obj == GameManager::get()->getGameLayer()->m_player2)
|
||||
CCRect const& getObjectRect()
|
||||
{
|
||||
x = scalePlayer[0];
|
||||
y = scalePlayer[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(obj->m_objectType)
|
||||
bool enabled = Settings::get<bool>("level/hitbox_multiplier", false);
|
||||
|
||||
if(!enabled)
|
||||
return reinterpret_cast<cocos2d::CCRect const& (__thiscall*)(GameObject*)>(base::get() + 0x13a570)(this);
|
||||
|
||||
bool all = Settings::get<bool>("level/hitbox_multiplier/scale_all", false);
|
||||
|
||||
float x = 1, y = 1;
|
||||
|
||||
float scaleSlopes[2] = {Settings::get<float>("level/hitbox_multiplier/scale_slopes/x", 1.f), Settings::get<float>("level/hitbox_multiplier/scale_slopes/y", 1.f)};
|
||||
float scalePlayer[2] = {Settings::get<float>("level/hitbox_multiplier/scale_player/x", 1.f), Settings::get<float>("level/hitbox_multiplier/scale_player/y", 1.f)};
|
||||
|
||||
if((PlayerObject*)this == GameManager::get()->getGameLayer()->m_player1 || (PlayerObject*)this == GameManager::get()->getGameLayer()->m_player2)
|
||||
{
|
||||
default:
|
||||
return reinterpret_cast<cocos2d::CCRect*(__thiscall*)(GameObject*)>(base::get() + 0x13a570)(obj);
|
||||
case GameObjectType::Slope:
|
||||
x = scaleSlopes[0];
|
||||
y = scaleSlopes[1];
|
||||
break;
|
||||
x = scalePlayer[0];
|
||||
y = scalePlayer[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(this->m_objectType)
|
||||
{
|
||||
default:
|
||||
return reinterpret_cast<cocos2d::CCRect const& (__thiscall*)(GameObject*)>(base::get() + 0x13a570)(this);
|
||||
case GameObjectType::Slope:
|
||||
x = scaleSlopes[0];
|
||||
y = scaleSlopes[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cocos2d::CCRect rect = *reinterpret_cast<cocos2d::CCRect*(__thiscall*)(GameObject*)>(base::get() + 0x13a570)(obj);
|
||||
scaleRect(&rect, x, y);
|
||||
rectForObject[obj] = rect;
|
||||
return &rectForObject[obj];
|
||||
}
|
||||
cocos2d::CCRect rect = *reinterpret_cast<cocos2d::CCRect*(__thiscall*)(GameObject*)>(base::get() + 0x13a570)(this);
|
||||
scaleRect(&rect, x, y);
|
||||
m_fields->m_objectRect = rect;
|
||||
return m_fields->m_objectRect;
|
||||
}
|
||||
};
|
||||
|
||||
$execute
|
||||
{
|
||||
Mod::get()->hook(reinterpret_cast<void *>(base::get() + 0x13a570), &HitboxMultiplier::GameObjectGetObjectRect, "GameObject::getObjectRect", tulip::hook::TulipConvention::Thiscall);
|
||||
|
||||
Common::sectionLoopFunctions.push_back({HitboxMultiplier::scaleHazard, "level/hitbox_multiplier"});
|
||||
Common::sectionLoopFunctions.push_back({HitboxMultiplier::scaleHazard, "level/hitbox_multiplier"});
|
||||
}
|
@@ -6,11 +6,7 @@ using namespace geode::prelude;
|
||||
|
||||
namespace HitboxMultiplier
|
||||
{
|
||||
//TODO: replace this with a custom rect field in m_fields when geode fixes getobjectrect return type
|
||||
std::unordered_map<GameObject*, cocos2d::CCRect> rectForObject;
|
||||
std::unordered_map<GameObject*, cocos2d::CCRect> memberRectForObject;
|
||||
|
||||
cocos2d::CCRect* GameObjectGetObjectRect(GameObject* obj);
|
||||
|
||||
void scaleHazard(GameObject* hazard);
|
||||
};
|
@@ -145,7 +145,7 @@ void GJBaseGameLayerProcessCommands(GJBaseGameLayer* self)
|
||||
|
||||
$execute
|
||||
{
|
||||
Mod::get()->hook(reinterpret_cast<void *>(base::get() + 0x23f720), &LevelEditorLayerUpdateEditor, "LevelEditorLayer::UpdateEditor", tulip::hook::TulipConvention::Thiscall);
|
||||
Mod::get()->hook(reinterpret_cast<void *>(base::get() + 0x23f720), &LevelEditorLayerUpdateEditor, "LevelEditorLayer::updateEditor", tulip::hook::TulipConvention::Thiscall);
|
||||
Mod::get()->hook(reinterpret_cast<void *>(base::get() + 0x1BD240), &GJBaseGameLayerProcessCommands, "GJBaseGameLayer::processCommands", tulip::hook::TulipConvention::Thiscall);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user