mirror of
https://github.com/TobyAdd/GDH.git
synced 2025-09-06 21:11:41 +00:00
Compare commits
4 Commits
1d5d513a3d
...
617a493d46
Author | SHA1 | Date | |
---|---|---|---|
![]() |
617a493d46 | ||
![]() |
bd862d987a | ||
![]() |
4ee1bee05c | ||
![]() |
d3b6acce4d |
35
changelog.md
35
changelog.md
@@ -1,3 +1,38 @@
|
||||
# v5.0.0-beta.4
|
||||
UI Changes:
|
||||
- Seach box will be cleared when the menu is closed
|
||||
- Mobile button now using layouts (Node ID dependency)
|
||||
|
||||
Hacks changes:
|
||||
- Added Process priority
|
||||
- Added Resume Timer (fixes lag when respawning while TPS Bypass is enabled, adjustable in the Framerate window)
|
||||
- Fast Complete (Faster animation)
|
||||
- Fixed Fast Chest open
|
||||
- Added Auto Deafen
|
||||
- Added Cheat Indicator
|
||||
- Fixed "Main Levels Bypass" hack for "The Tower" levels
|
||||
- Fixed Startpos Swither when you in Practice Mode
|
||||
|
||||
Labels changes:
|
||||
- Added text coloring (CPS Counter, Death Counter will now be colored)
|
||||
- Added Replay Engine State
|
||||
- Added FPS Counter
|
||||
- Added Cheat Indicator
|
||||
- Added Testmode label
|
||||
- Fixed Noclip Accuracy deaths
|
||||
- Fixed Session Time
|
||||
- "Progress" label have now a more customizable floating point
|
||||
|
||||
**Note:** labels may have an old formatting mapping, so they should be re-added
|
||||
|
||||
Replay Engine/Recorder changes:
|
||||
- Fixed Accuracy Fix for 2P
|
||||
- Audio Sync Recording now works perfectly with Music/SFX triggers
|
||||
- Overlay Mode for Recorder (capturing overlays like reshade)
|
||||
- Added option to change the volume percentage when recording audio for the showcase
|
||||
- Practice Fix is back and reworked
|
||||
- Audio now has better quality when merged with "Merge" tab
|
||||
|
||||
# v5.0.0-beta.3
|
||||
- armeabi-v7a support (no recorder yet)
|
||||
- startpos switcher keybinds fix (thanks ery)
|
||||
|
120
src/labels.cpp
120
src/labels.cpp
@@ -174,53 +174,48 @@ void Labels::load() {
|
||||
|
||||
void Labels::setStringColored(cocos2d::CCLabelBMFont* label, std::string format_text) {
|
||||
if (!label) return;
|
||||
|
||||
auto label_children = label->getChildren();
|
||||
std::vector<cocos2d::ccColor3B> colors(label_children->count(), {255, 255, 255});
|
||||
|
||||
std::string parsed_text;
|
||||
cocos2d::ccColor3B currentColor = {255, 255, 255};
|
||||
const cocos2d::ccColor3B defaultColor = {255, 255, 255};
|
||||
cocos2d::ccColor3B currentColor = defaultColor;
|
||||
size_t index = 0;
|
||||
|
||||
// shitcoded, will optimize later
|
||||
|
||||
const std::unordered_map<std::string, cocos2d::ccColor3B> tagColors = {
|
||||
{"cr", {255, 0, 128}},
|
||||
{"cg", {0, 255, 0}},
|
||||
{"co", {255, 106, 0}},
|
||||
{"cy", {255, 242, 0}}
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < format_text.size(); i++) {
|
||||
if (format_text.compare(i, 4, "<cr>") == 0) {
|
||||
currentColor = {255, 0, 128};
|
||||
i += 3;
|
||||
}
|
||||
else if (format_text.compare(i, 5, "<cr/>") == 0) {
|
||||
currentColor = {255, 255, 255};
|
||||
i += 4;
|
||||
}
|
||||
else if (format_text.compare(i, 4, "<cg>") == 0) {
|
||||
currentColor = {0, 255, 0};
|
||||
i += 3;
|
||||
}
|
||||
else if (format_text.compare(i, 5, "<cg/>") == 0) {
|
||||
currentColor = {255, 255, 255};
|
||||
i += 4;
|
||||
}
|
||||
else if (format_text.compare(i, 4, "<co>") == 0) {
|
||||
currentColor = {255, 106, 0};
|
||||
i += 3;
|
||||
}
|
||||
else if (format_text.compare(i, 5, "<co/>") == 0) {
|
||||
currentColor = {255, 255, 255};
|
||||
i += 4;
|
||||
}
|
||||
else if (format_text.compare(i, 4, "<cy>") == 0) {
|
||||
currentColor = {255, 242, 0};
|
||||
i += 3;
|
||||
}
|
||||
else if (format_text.compare(i, 5, "<cy/>") == 0) {
|
||||
currentColor = {255, 255, 255};
|
||||
i += 4;
|
||||
}
|
||||
else if (format_text[i] == '\n') {
|
||||
parsed_text += format_text[i];
|
||||
continue;
|
||||
if (format_text[i] == '<' && i + 2 < format_text.size()) {
|
||||
std::string potentialTag = format_text.substr(i + 1, 2);
|
||||
|
||||
bool isClosingTag = false;
|
||||
if (i + 4 < format_text.size() && format_text[i + 3] == '/' && format_text[i + 4] == '>') {
|
||||
isClosingTag = true;
|
||||
}
|
||||
|
||||
bool isOpeningTag = !isClosingTag && i + 3 < format_text.size() && format_text[i + 3] == '>';
|
||||
|
||||
auto tagIt = tagColors.find(potentialTag);
|
||||
if (tagIt != tagColors.end()) {
|
||||
if (isOpeningTag) {
|
||||
currentColor = tagIt->second;
|
||||
i += 3;
|
||||
continue;
|
||||
} else if (isClosingTag) {
|
||||
currentColor = defaultColor;
|
||||
i += 4;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (format_text[i] == '\n') {
|
||||
parsed_text += '\n';
|
||||
} else {
|
||||
parsed_text += format_text[i];
|
||||
if (index < colors.size()) {
|
||||
colors[index] = currentColor;
|
||||
@@ -228,10 +223,9 @@ void Labels::setStringColored(cocos2d::CCLabelBMFont* label, std::string format_
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
label->removeAllChildren();
|
||||
label->setCString(parsed_text.c_str());
|
||||
|
||||
for (size_t i = 0; i < colors.size(); i++) {
|
||||
auto child = label_children->objectAtIndex(i);
|
||||
if (auto bmFont = geode::prelude::typeinfo_cast<cocos2d::CCSprite*>(child)) {
|
||||
@@ -241,24 +235,32 @@ void Labels::setStringColored(cocos2d::CCLabelBMFont* label, std::string format_
|
||||
}
|
||||
|
||||
std::string Labels::processSpecialText(std::string text) {
|
||||
size_t start, end;
|
||||
|
||||
if ((start = text.find("ColoredCPS(")) != std::string::npos) {
|
||||
start += 11;
|
||||
end = text.rfind(')');
|
||||
if (end != std::string::npos && end > start)
|
||||
text.replace(text.find("ColoredCPS("), end + 1 - text.find("ColoredCPS("),
|
||||
fmt::format("{}{}{}", push ? "<cg>" : "", text.substr(start, end - start), push ? "<cg/>" : ""));
|
||||
const std::string cpsTag = "ColoredCPS(";
|
||||
size_t start = text.find(cpsTag);
|
||||
if (start != std::string::npos) {
|
||||
size_t contentStart = start + cpsTag.length();
|
||||
size_t end = text.find(')', contentStart);
|
||||
|
||||
if (end != std::string::npos) {
|
||||
std::string content = text.substr(contentStart, end - contentStart);
|
||||
std::string replacement = push ? "<cg>" + content + "<cg/>" : content;
|
||||
text.replace(start, end - start + 1, replacement);
|
||||
}
|
||||
}
|
||||
|
||||
if ((start = text.find("ColoredDeath(")) != std::string::npos) {
|
||||
start += 13;
|
||||
end = text.rfind(')');
|
||||
if (end != std::string::npos && end > start)
|
||||
text.replace(text.find("ColoredDeath("), end + 1 - text.find("ColoredDeath("),
|
||||
fmt::format("{}{}{}", NoclipAccuracy::get().prevDied ? "<cr>" : "", text.substr(start, end - start), NoclipAccuracy::get().prevDied ? "<cr/>" : ""));
|
||||
|
||||
const std::string deathTag = "ColoredDeath(";
|
||||
start = text.find(deathTag);
|
||||
if (start != std::string::npos) {
|
||||
size_t contentStart = start + deathTag.length();
|
||||
size_t end = text.find(')', contentStart);
|
||||
|
||||
if (end != std::string::npos) {
|
||||
std::string content = text.substr(contentStart, end - contentStart);
|
||||
std::string replacement = NoclipAccuracy::get().prevDied ? "<cr>" + content + "<cr/>" : content;
|
||||
text.replace(start, end - start + 1, replacement);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
@@ -20,7 +20,8 @@ class $modify(PlayLayer) {
|
||||
auto& config = Config::get();
|
||||
auto& engine = ReplayEngine::get();
|
||||
|
||||
if (config.get<bool>("practice_fix", false) || engine.mode == state::record) {
|
||||
bool practiceFixEnabled = config.get<bool>("practice_fix", false) || engine.mode == state::record;
|
||||
if (practiceFixEnabled) {
|
||||
auto fields = m_fields.self();
|
||||
if (fields->checkpoints.contains(checkpoint)) {
|
||||
PlayLayer::loadFromCheckpoint(checkpoint);
|
||||
@@ -42,8 +43,9 @@ class $modify(PlayLayer) {
|
||||
auto& engine = ReplayEngine::get();
|
||||
|
||||
auto checkpoint = PlayLayer::createCheckpoint();
|
||||
if (!checkpoint || (!config.get<bool>("practice_fix", false) || engine.mode == state::record))
|
||||
return checkpoint;
|
||||
bool practiceFixEnabled = config.get<bool>("practice_fix", false) || engine.mode == state::record;
|
||||
if (!checkpoint || !practiceFixEnabled)
|
||||
return checkpoint;
|
||||
|
||||
if (m_gameState.m_currentProgress > 0) {
|
||||
checkpoint_data checkpoint_p1(m_player1);
|
||||
|
@@ -241,8 +241,8 @@ public:
|
||||
m_maybeStateForce2 = player->m_maybeStateForce2;
|
||||
m_stateScale = player->m_stateScale;
|
||||
m_platformerXVelocity = player->m_platformerXVelocity;
|
||||
m_holdingRight = player->m_holdingRight;
|
||||
m_holdingLeft = player->m_holdingLeft;
|
||||
// m_holdingRight = player->m_holdingRight;
|
||||
// m_holdingLeft = player->m_holdingLeft;
|
||||
m_leftPressedFirst = player->m_leftPressedFirst;
|
||||
m_scaleXRelated = player->m_scaleXRelated;
|
||||
m_maybeHasStopped = player->m_maybeHasStopped;
|
||||
@@ -549,8 +549,8 @@ public:
|
||||
player->m_maybeStateForce2 = m_maybeStateForce2;
|
||||
player->m_stateScale = m_stateScale;
|
||||
player->m_platformerXVelocity = m_platformerXVelocity;
|
||||
player->m_holdingRight = m_holdingRight;
|
||||
player->m_holdingLeft = m_holdingLeft;
|
||||
// player->m_holdingRight = m_holdingRight;
|
||||
// player->m_holdingLeft = m_holdingLeft;
|
||||
player->m_leftPressedFirst = m_leftPressedFirst;
|
||||
player->m_scaleXRelated = m_scaleXRelated;
|
||||
player->m_maybeHasStopped = m_maybeHasStopped;
|
||||
@@ -858,8 +858,8 @@ private:
|
||||
int m_maybeStateForce2;
|
||||
int m_stateScale;
|
||||
double m_platformerXVelocity;
|
||||
bool m_holdingRight;
|
||||
bool m_holdingLeft;
|
||||
// bool m_holdingRight;
|
||||
// bool m_holdingLeft;
|
||||
bool m_leftPressedFirst;
|
||||
double m_scaleXRelated;
|
||||
bool m_maybeHasStopped;
|
||||
|
Reference in New Issue
Block a user