Skip to content

Commit

Permalink
update!
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMario211 committed Nov 8, 2024
1 parent fd4916d commit f8aeaaf
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 30 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v1.9.2
- Updated to Geode 3.9.0
- Added Japanese Translations
- Fixed Noclip Flash
- Updated Turkish Translations
- Updated French Translations
- Updated Polish Translations
# v1.9.1
- Fixed bug with Noclip Accuracy continuing even after the level is completed
- Added more mac hacks
Expand Down
10 changes: 5 additions & 5 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "3.7.1",
"version": "v1.9.1",
"geode": "3.9.0",
"version": "v1.9.2",
"gd": {
"win": "2.206",
"mac": "2.206",
Expand Down Expand Up @@ -39,8 +39,8 @@
"PrismMenu": {
"path": "resources/PrismMenu.otf",
"size": 128,
"charset": "21-383,460-513,535-540,561-564,578-581,898-1500,7681-7930,26085,26412,35486",
"charsetjp": "21-383,460-513,535-540,561-564,578-581,898-1500,7681-7930,26085,26412,35486,12289,12290,12293,12300,12301,12354,12356,12358,12360,12362,12363,12364,12365,12367,12369,12371,12372,12373,12374,12375,12376,12377,12378,12379,12381,12383,12384,12385,12387,12388,12390,12391,12392,12393,12394,12395,12398,12399,12400,12405,12409,12411,12414,12415,12417,12418,12420,12424,12425,12426,12427,12428,12429,12431,12434,12435,12449,12450,12451,12452,12454,12455,12456,12457,12458,12459,12460,12461,12463,12464,12465,12466,12467,12470,12471,12472,12473,12474,12475,12479,12480,12481,12483,12484,12486,12487,12488,12489,12490,12491,12494,12495,12496,12497,12500,12501,12502,12503,12505,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12521,12522,12523,12524,12525,12527,12531,12539,12540,19968,19978,19979,19981,20001,20013,20037,20102,20107,20129,20154,20182,20197,20301,20307,20316,20351,20415,20491,20516,20803,20837,20840,20844,20877,20998,20999,21028,21029,21033,21046,21066,21069,21147,21177,21205,21270,21332,21336,21453,21487,21491,21512,22238,22258,22266,22580,22793,22806,22810,22823,22826,22909,23383,23433,23436,23450,23453,23475,23567,23627,24038,24230,24235,24335,24341,24375,24403,24418,24441,24460,24489,24517,24615,24656,24847,25104,25147,25171,25246,25407,25551,25563,25925,25968,25973,25991,26041,26082,26085,26126,26143,26178,26222,26354,26367,26377,26399,26410,26412,26689,27005,27490,27491,27497,27515,27573,27704,27880,28187,28288,28357,28857,28858,28961,29289,29305,29575,29992,30011,30171,30340,30636,30701,30906,31034,31186,31354,31435,31561,31684,32218,32232,32244,32302,32622,32722,32763,32884,33021,33258,33324,33394,33853,34892,34920,35201,35211,35222,35302,35328,35373,35379,35430,35486,35488,36092,36215,36578,36600,36802,36879,36884,36890,36895,36899,36914,36984,37096,37325,37329,38263,38281,38283,38291,38306,38450,38480,38500,38555,38556,38560,38598,38754,38899"
"charsetold": "21-383,460-513,535-540,561-564,578-581,898-1500,7681-7930,26085,26412,35486",
"charset": "21-383,460-513,535-540,561-564,578-581,898-1500,7681-7930,26085,26412,35486,12289,12290,12293,12300,12301,12354,12356,12358,12360,12362,12363,12364,12365,12367,12369,12371,12372,12373,12374,12375,12376,12377,12378,12379,12381,12383,12384,12385,12387,12388,12390,12391,12392,12393,12394,12395,12398,12399,12400,12405,12409,12411,12414,12415,12417,12418,12420,12424,12425,12426,12427,12428,12429,12431,12434,12435,12449,12450,12451,12452,12454,12455,12456,12457,12458,12459,12460,12461,12463,12464,12465,12466,12467,12470,12471,12472,12473,12474,12475,12479,12480,12481,12483,12484,12486,12487,12488,12489,12490,12491,12494,12495,12496,12497,12500,12501,12502,12503,12505,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12521,12522,12523,12524,12525,12527,12531,12539,12540,19968,19978,19979,19981,20001,20013,20037,20102,20107,20129,20154,20182,20197,20301,20307,20316,20351,20415,20491,20516,20803,20837,20840,20844,20877,20998,20999,21028,21029,21033,21046,21066,21069,21147,21177,21205,21270,21332,21336,21453,21487,21491,21512,22238,22258,22266,22580,22793,22806,22810,22823,22826,22909,23383,23433,23436,23450,23453,23475,23567,23627,24038,24230,24235,24335,24341,24375,24403,24418,24441,24460,24489,24517,24615,24656,24847,25104,25147,25171,25246,25407,25551,25563,25925,25968,25973,25991,26041,26082,26085,26126,26143,26178,26222,26354,26367,26377,26399,26410,26412,26689,27005,27490,27491,27497,27515,27573,27704,27880,28187,28288,28357,28857,28858,28961,29289,29305,29575,29992,30011,30171,30340,30636,30701,30906,31034,31186,31354,31435,31561,31684,32218,32232,32244,32302,32622,32722,32763,32884,33021,33258,33324,33394,33853,34892,34920,35201,35211,35222,35302,35328,35373,35379,35430,35486,35488,36092,36215,36578,36600,36802,36879,36884,36890,36895,36899,36914,36984,37096,37325,37329,38263,38281,38283,38291,38306,38450,38480,38500,38555,38556,38560,38598,38754,38899"
}
}
},
Expand All @@ -60,7 +60,7 @@
"values": {
"name": "Hack Values",
"description": "NONE",
"type": "custom"
"type": "custom:hack-values"
}
},
"incompatibilities": [
Expand Down
Binary file modified resources/PrismMenu.otf
Binary file not shown.
2 changes: 1 addition & 1 deletion resources/hacks/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"desc": "Sets the language for Prism Menu!",
"type": "dropdown",
"default": 0,
"values": ["English", "Français", "Português (Brasil)", "Deutsch", "Русский", "Čeština", "Indonesia", "Español", "Polski", "Melayu", "Türkçe", "Tieng Viet", "Українська","Italiano","Română"],
"values": ["English", "Français", "Português (Brasil)", "Deutsch", "Русский", "Čeština", "Indonesia", "Español", "Polski", "Melayu", "Türkçe", "Tieng Viet", "Українська","Italiano","Română","日本語"],
"todovalues": ["Ελληνική","日本語"]
},
{
Expand Down
5 changes: 3 additions & 2 deletions server/characterfix.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ const letters = japaneseText.split("").map((a) => {

console.log([...new Set(letters)])

require('fs').writeFileSync("./kata.txt", JSON.stringify([...new Set(letters)]), 'utf8');

//require('fs').writeFileSync("./kata.txt", JSON.stringify([...new Set(letters)]), 'utf8');
console.log("言".codePointAt(0))
console.log("".codePointAt(0))
26 changes: 26 additions & 0 deletions server/unicodeexist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import fontforge

# Open the font file
font = fontforge.open("../resources/PrismMenu.otf")

# List of Unicode code points in decimal
unicode_points = [12289,12290,12293,12300,12301,12354,12356,12358,12360,12362,12363,12364,12365,12367,12369,12371,12372,12373,12374,12375,12376,12377,12378,12379,12381,12383,12384,12385,12387,12388,12390,12391,12392,12393,12394,12395,12398,12399,12400,12405,12409,12411,12414,12415,12417,12418,12420,12424,12425,12426,12427,12428,12429,12431,12434,12435,12449,12450,12451,12452,12454,12455,12456,12457,12458,12459,12460,12461,12463,12464,12465,12466,12467,12470,12471,12472,12473,12474,12475,12479,12480,12481,12483,12484,12486,12487,12488,12489,12490,12491,12494,12495,12496,12497,12500,12501,12502,12503,12505,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12521,12522,12523,12524,12525,12527,12531,12539,12540,19968,19978,19979,19981,20001,20013,20037,20102,20107,20129,20154,20182,20197,20301,20307,20316,20351,20415,20491,20516,20803,20837,20840,20844,20877,20998,20999,21028,21029,21033,21046,21066,21069,21147,21177,21205,21270,21332,21336,21453,21487,21491,21512,22238,22258,22266,22580,22793,22806,22810,22823,22826,22909,23383,23433,23436,23450,23453,23475,23567,23627,24038,24230,24235,24335,24341,24375,24403,24418,24441,24460,24489,24517,24615,24656,24847,25104,25147,25171,25246,25407,25551,25563,25925,25968,25973,25991,26041,26082,26085,26126,26143,26178,26222,26354,26367,26377,26399,26410,26412,26689,27005,27490,27491,27497,27515,27573,27704,27880,28187,28288,28357,28857,28858,28961,29289,29305,29575,29992,30011,30171,30340,30636,30701,30906,31034,31186,31354,31435,31561,31684,32218,32232,32244,32302,32622,32722,32763,32884,33021,33258,33324,33394,33853,34892,34920,35201,35211,35222,35302,35328,35373,35379,35430,35486,35488,36092,36215,36578,36600,36802,36879,36884,36890,36895,36899,36914,36984,37096,37325,37329,38263,38281,38283,38291,38306,38450,38480,38500,38555,38556,38560,38598,38754,38899]

# Check for each Unicode point
for codepoint in unicode_points:
# Attempt to get the glyph using the codepoint
try:
glyph = font[codepoint]

# Check if the glyph is worth outputting
if glyph.isWorthOutputting():
hi = 1
#print(f"Glyph for {codepoint} (U+{codepoint:04X}) exists in the font.")
else:
print(f"Glyph for {codepoint} (U+{codepoint:04X}) does NOT exist in the font.")

except TypeError:
print(f"Glyph for {codepoint} (U+{codepoint:04X}) does NOT exist in the font (TypeError).")
except Exception as e:
print(f"An error occurred for {codepoint} (U+{codepoint:04X}): {str(e)}")

6 changes: 3 additions & 3 deletions src/CustomSettings.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "CustomSettings.hpp"
SettingNode* SettingHackValue::createNode(float width) {
return SettingHackNode::create(this, width);
}

SettingNodeV3* SettingHackValue::createNode(float width) {
return SettingHackNode::create(static_pointer_cast<SettingHackValue>(shared_from_this()), width);
}
47 changes: 46 additions & 1 deletion src/CustomSettings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,48 @@ struct matjson::Serialize<SettingHackStruct> {

class SettingHackValue;

class SettingHackValue : public SettingValue {
// im laughing, it wont compile if i put the struct SettingHackValue, but it will if i just do matjson::Array, hahahaHAHAHAHA
class SettingHackValue : public SettingBaseValueV3<matjson::Array> {
protected:
// unsure if this is necessary...
matjson::Array m_hackValues;
public:
static Result<std::shared_ptr<SettingHackValue>> parse(std::string const& key, std::string const& modID, matjson::Value const& json) {
auto res = std::make_shared<SettingHackValue>();
auto root = checkJson(json, "SettingHackValue");
res->parseBaseProperties(key, modID, root);
root.checkUnknownKeys();
return root.ok(res);
}
SettingNodeV3* createNode(float width) override;
};

template <>
struct geode::SettingTypeForValueType<SettingHackStruct> {
using SettingType = SettingHackValue;
};

class SettingHackNode : public SettingValueNodeV3<SettingHackValue> {
protected:
bool init(std::shared_ptr<SettingHackValue> setting, float width) {
if (!SettingValueNodeV3::init(setting, width))
return false;
return true;
}
public:
static SettingHackNode* create(std::shared_ptr<SettingHackValue> setting, float width) {
auto ret = new SettingHackNode();
if (ret && ret->init(setting, width)) {
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
return nullptr;
}
};

/*
class SettingHackValue : public SettingBaseValueV3<SettingHackStruct> {
protected:
matjson::Array m_hackValues;
public:
Expand All @@ -56,6 +97,8 @@ class SettingHackValue : public SettingValue {
}
};
template<>
struct SettingValueSetter<SettingHackStruct> {
static SettingHackStruct get(SettingValue* setting) {
Expand Down Expand Up @@ -107,4 +150,6 @@ class SettingHackNode : public SettingNode {
return nullptr;
}
};
*/
#endif
10 changes: 6 additions & 4 deletions src/ImGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,12 @@ class $modify(MenuLayer) {
FLAlertLayer::create("Error", "This option can only be used on <cy>Android</c>!", "OK")->show();
#endif
} else if (name == "Uncomplete Level") {
if (auto levelInfoLayer = getChildOfType<LevelInfoLayer>(CCScene::get(), 0)) {
Hacks::resetLevel(levelInfoLayer, levelInfoLayer->m_level);
} else {
FLAlertLayer::create("Error", "You are not <cy>currently in the level page</c>! Please enter in a level page in order to <cg>reset the stats</c>.", "OK")->show();
if (auto scene = CCScene::get()) {
if (auto levelInfoLayer = scene->getChildByType<LevelInfoLayer>(0)) {
Hacks::resetLevel(levelInfoLayer, levelInfoLayer->m_level);
} else {
FLAlertLayer::create("Error", "You are not <cy>currently in the level page</c>! Please enter in a level page in order to <cg>reset the stats</c>.", "OK")->show();
}
}
} else { // how will this happen
FLAlertLayer::create("unimplemented", "this button is not implemented", "okay")->show();
Expand Down
11 changes: 7 additions & 4 deletions src/Languages.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ class Lang {
case 14: // Romanian
file = Hacks::readFile("romanian.json");
break;
case 15: // Greek
file = Hacks::readFile("greek.json");
break;
case 16: // Japanese
case 15: // Japanese
file = Hacks::readFile("japanese.json");
break;
case 16: // Greek
file = Hacks::readFile("greek.json");
break;
default: // anything else should be discarded
langId = 0;
break;
Expand Down Expand Up @@ -93,4 +93,7 @@ class Lang {
if (obj == nullptr) return key;
return obj.get<std::string>("desc");
}
int getLangID() {
return langId;
}
};
19 changes: 14 additions & 5 deletions src/UI/Dropdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,25 @@ void Dropdown::onToggle(CCObject* sender) {
};
auto pMenu = prismUIButton->getMenu();
if (pHack->type == "bool") {
static_cast<CCMenuItemToggler*>(pMenu->getChildren()->objectAtIndex(1))->setEnabled(!expanded);
if (auto menuItem = pMenu->getChildByType<CCMenuItemToggler>(0)) {
menuItem->setEnabled(!expanded);
}
} else if (pHack->type == "button") {
static_cast<CCMenuItemSpriteExtra*>(pMenu->getChildren()->objectAtIndex(0))->setEnabled(!expanded);
if (auto menuItem = pMenu->getChildByType<CCMenuItemSpriteExtra>(0)) {
menuItem->setEnabled(!expanded);
}
} else if (pHack->type == "float" || pHack->name.starts_with("Button Pos")) {
prismUIButton->getInputNode()->setEnabled(!expanded);
prismUIButton->getSlider()->getThumb()->setEnabled(!expanded);
static_cast<CCMenuItemSpriteExtra*>(pMenu->getChildren()->objectAtIndex(0))->setEnabled(!expanded);
if (auto menuItem = pMenu->getChildByType<CCMenuItemSpriteExtra>(0)) {
menuItem->setEnabled(!expanded);
}
} else if (pHack->type == "dropdown") {
auto otherDDMenu = static_cast<CCMenu*>(pMenu->getChildren()->objectAtIndex(1));
static_cast<CCMenuItemSpriteExtra*>(otherDDMenu->getChildByID("flip-btn"))->setEnabled(!expanded);
if (auto otherDDMenu = pMenu->getChildByType<CCMenu>(0)) {
if (auto flipBtn = typeinfo_cast<CCMenuItemSpriteExtra*>(otherDDMenu->getChildByID("flip-btn"))) {
flipBtn->setEnabled(!expanded);
}
}
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/UI/PrismUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "../Utils.hpp"
#include "CreditsMenu.hpp"
#include "../Hacks/Quartz.hpp"
//#include "../Misc/Label.hpp"

int currentMenuIndexGD = 0;

Expand Down Expand Up @@ -118,6 +119,7 @@ bool PrismUIButton::init(HackItem* hack) {
//auto opcodes = obj.get<matjson::Array>("opcodes");
this->m_hack = hack;
auto label = CCLabelBMFont::create(currentLanguage->name(name).c_str(), "PrismMenu.fnt"_spr);
//auto label = Label::create(currentLanguage->name(name).c_str(), "NotoSansJP-Regular.ttf"_spr);
Themes::RGBAToCC(PrismUI::GetTheme()["Text"], label);
label->setAnchorPoint({0.0F, 0.5F});
label->limitLabelWidth(150, 0.5F, .2F);
Expand Down Expand Up @@ -437,8 +439,9 @@ void PrismUIButton::onBtn(CCObject* ret) {
auto settings = Mod::get()->getSavedValue<SettingHackStruct>("values");
std::string name = m_hack->name;

if (CCScene::get() == nullptr) return;
auto prismUI = static_cast<PrismUI*>(CCScene::get()->getChildByID("prism-menu"));
auto scene = CCScene::get();
if (!scene) return;
auto prismUI = static_cast<PrismUI*>(scene->getChildByID("prism-menu"));
if (name == "Restore Defaults") {
Mod::get()->setSettingValue("skip-intro", false);
Hacks::processJSON(true);
Expand Down Expand Up @@ -520,7 +523,7 @@ void PrismUIButton::onBtn(CCObject* ret) {
FLAlertLayer::create("Error", "This option can only be used on <cy>Android</c>!", "OK")->show();
#endif
} else if (name == "Uncomplete Level") {
if (auto levelInfoLayer = getChildOfType<LevelInfoLayer>(CCScene::get(), 0)) {
if (auto levelInfoLayer = scene->getChildByType<LevelInfoLayer>(0)) {
// i forgor why i didnt do this and did for loop
Hacks::resetLevel(levelInfoLayer, levelInfoLayer->m_level);
} else {
Expand Down
10 changes: 8 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ bool restoreOldFiles() {

// maybe this will fix the issue
$execute {
SettingHackStruct val { matjson::Array() };
Mod::get()->addCustomSetting<SettingHackValue>("values", val);
auto ret = Mod::get()->registerCustomSettingType("hack-values", &SettingHackValue::parse);
if (!ret) {
log::error("Unable to register setting type: {}", ret.unwrapErr());
}
}

$on_mod(Loaded) {
Expand Down Expand Up @@ -431,6 +433,10 @@ class $modify(PrismPlayLayer, PlayLayer) {
void resetLevel() {
m_fields->death = 0;
m_fields->hasCompletedLevel = false;
if (m_fields->accuracyLabel != nullptr && m_fields->flashNode != nullptr) {
m_fields->flashOpacity = 0.0F;
m_fields->flashNode->setOpacity(m_fields->flashOpacity);
}
PlayLayer::resetLevel();
}
void postUpdate(float p0) {
Expand Down

0 comments on commit f8aeaaf

Please sign in to comment.