-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89d3082
commit a65834e
Showing
7 changed files
with
74 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,17 @@ | ||
#ifndef GEODE_IS_ANDROID32 | ||
|
||
#include <Geode/Geode.hpp> | ||
#include <Geode/modify/GameObject.hpp> | ||
#include <Geode/modify/GJBaseGameLayer.hpp> | ||
#include <Geode/modify/PlayLayer.hpp> | ||
#include "../Client/Client.h" | ||
|
||
using namespace geode::prelude; | ||
|
||
Module* noGlow = nullptr; | ||
|
||
class $modify(GameObject) { | ||
|
||
void commonSetup() | ||
class $modify(PlayLayer) | ||
{ | ||
void addObject(GameObject* obj) | ||
{ | ||
GameObject::commonSetup(); | ||
obj->m_hasNoGlow = true; | ||
|
||
if (!noGlow) | ||
noGlow = Client::GetModule("no-glow"); | ||
|
||
if (PlayLayer::get()) | ||
{ | ||
if (noGlow->enabled) | ||
m_hasNoGlow = true; | ||
} | ||
PlayLayer::addObject(obj); | ||
} | ||
}; | ||
#endif | ||
|
||
QOLMOD_MOD_HOOK("no-glow", "PlayLayer::addObject") | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "BestRun.hpp" | ||
|
||
void BestPlayLayer::resetLevel() | ||
{ | ||
m_fields->toPercent = getCurrentPercent(); | ||
|
||
auto length = m_fields->toPercent - m_fields->fromPercent; | ||
|
||
if (length > m_fields->bestLength) | ||
{ | ||
m_fields->bestLength = length; | ||
m_fields->bestFrom = m_fields->fromPercent; | ||
m_fields->bestTo = m_fields->toPercent; | ||
} | ||
|
||
PlayLayer::resetLevel(); | ||
m_fields->fromPercent = getCurrentPercent(); | ||
} | ||
|
||
std::string BestPlayLayer::getRunString() | ||
{ | ||
if (m_fields->bestLength == 0) | ||
return "Best Run: None"; | ||
|
||
return fmt::format("Best Run: {} - {}%", as<int>(m_fields->bestFrom), as<int>(m_fields->bestTo)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
|
||
#include <Geode/Geode.hpp> | ||
#include <Geode/modify/PlayLayer.hpp> | ||
#include <Geode/modify/PlayerObject.hpp> | ||
#include "../Client/Client.h" | ||
|
||
using namespace geode::prelude; | ||
|
||
class $modify (BestPlayLayer, PlayLayer) | ||
{ | ||
struct Fields { | ||
float fromPercent; | ||
float toPercent; | ||
|
||
float bestFrom; | ||
float bestTo; | ||
float bestLength; | ||
}; | ||
|
||
void resetLevel(); | ||
std::string getRunString(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters