Skip to content

Commit

Permalink
fix fods settingv3 stuff for gdutils
Browse files Browse the repository at this point in the history
  • Loading branch information
FireMario211 committed Sep 15, 2024
1 parent b953991 commit 5462edd
Show file tree
Hide file tree
Showing 12 changed files with 288 additions and 829 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## <cj>v1.3.10</c> <cb>(2024-09-15)</c>
* <cy>Updated</c> settings to the new V3 ones for custom settings.

## <cj>v1.3.9</c> <cb>(2024-08-19)</c>
* <cg>Added</c> <cp>Ko-Fi Supporter</c> badge on profile + link to get it on the "gift button" ([or also here](https://ko-fi.com/gdutils))
* <cg>Added</c> GD moderators leaderboards
Expand Down
92 changes: 51 additions & 41 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"geode": "3.4.0",
"version": "v1.3.9",
"geode": "3.7.0",
"version": "v1.3.10",
"gd": {
"win": "2.206",
"mac": "2.206",
Expand All @@ -20,12 +20,12 @@
"dependencies": [
{
"id": "geode.node-ids",
"version": ">=v1.13.1",
"version": ">=v1.14.0",
"importance": "required"
},
{
"id": "jouca.badgesapi",
"version": ">=v1.0.7",
"version": ">=v1.1.0",
"importance": "required"
}
],
Expand All @@ -51,14 +51,11 @@
"notification-section": {
"name": "Notifications",
"description": "This category is for where it should <cy>show notifications</c>, and also <cy>what notifications</c> precisely.",
"type": "custom",
"scale": 300,
"posX": 65
"type": "title"
},
"test-notification": {
"name": "Test",
"description": "NONE",
"type": "custom"
"type": "custom:test-notification"
},
"everywhereElse": {
"name": "Everywhere Else",
Expand Down Expand Up @@ -147,21 +144,18 @@
"notification-placement-section": {
"name": "Notification Placement",
"description": "This category is for where to <cy>show the notification</c> in the screen on a specific corner.",
"type": "custom",
"scale": 300,
"posX": 100
"type": "title"
},
"notificationPlacement": {
"name": "Placement",
"description": "Where the notification should be placed.\n1 = <cy>Top Left</c> | 2 = <cy>Top Right</c>\n3 = <cy>Bottom Left</c> | 4 = <cy>Bottom Right</c>",
"type": "custom"
"descriptionold": "Where the notification should be placed.\n1 = <cy>Top Left</c> | 2 = <cy>Top Right</c>\n3 = <cy>Bottom Left</c> | 4 = <cy>Bottom Right</c>",
"type": "custom:notification-placement",
"default": 4
},
"notification-appearance-section": {
"name": "Notification Appearance",
"description": "This category is for <cy>setting notification boxes</c> for how it should appear.\nYou can also use <cb>decimals</c> in these options, such as <cy>0.5 size</c>, or <cy>3.5 seconds.</c>",
"type": "custom",
"scale": 350,
"posX": 105
"type": "title"
},
"size": {
"name": "Size",
Expand Down Expand Up @@ -189,34 +183,46 @@
"spotify-section": {
"name": "Spotify",
"description": "This category is for determining when <cg>Spotify</c> should toggle <cr>mute</c>.\nThis only works if you currently have the <cg>Spotify App</c> open.\n\n<cy>If your music volume is set to 0, </c><cg>Spotify</c><cy>\nwill not be affected.</c>",
"type": "custom",
"scale": 350,
"posX": 40
"type": "title",
"platforms": ["win","mac"]
},
"inEditorSpotify": {
"name": "In Editor",
"description": "Disabling this will not auto-mute Spotify when you are playing music in the Editor.",
"type": "bool",
"default": false
"default": false,
"platforms": ["win","mac"]
},
"inLevelsSpotify": {
"name": "In Levels",
"description": "Disabling this will not auto-mute Spotify when you are playing a level, and music is playing.",
"type": "bool",
"default": false
"default": false,
"platforms": ["win","mac"]
},
"spotifyApp": {
"name": "Application",
"description": "This will decide what application should be auto-muted.",
"type": "custom",
"default": "Spotify.exe"
"type": "file",
"default": {
"win": "Spotify.exe",
"mac": "Spotify.app"
},
"platforms": ["win","mac"],
"control": {
"dialog": "open",
"filters": [
{
"files": ["*.exe", "*.app", "*.*"],
"description": "Executable programs"
}
]
}
},
"misc-section": {
"name": "Miscellaneous",
"description": "This category is for any other feature for <cy>GDUtils</c>.\nYou can choose whether to <cy>enable</c> or <cy>disable</c> some options if you do not want them.",
"type": "custom",
"scale": 300,
"posX": 65
"type": "title"
},
"friendSearch": {
"name": "Search Friends",
Expand All @@ -233,7 +239,9 @@
"demonListSelection": {
"name": "Demon List Selection",
"description": "Whether or not to select between <cg>Pointercrate</c> or <cg>AreDL</c> for placements.",
"type": "custom"
"type": "string",
"default": "Pointercrate",
"one-of": ["Pointercrate", "AreDL"]
},
"levelsProtocol": {
"name": "Allow Levels Protocol",
Expand Down Expand Up @@ -268,9 +276,7 @@
"background-section": {
"name": "Backgrounds",
"description": "This category is for changing the <cy>background colors</c>.",
"type": "custom",
"scale": 350,
"posX": 60
"type": "title"
},
"activate-background": {
"name": "Activate Background",
Expand All @@ -282,31 +288,36 @@
"name": "Background",
"description": "Change the color of GD backgrounds.",
"type": "color",
"default": "#0066FF"
"default": "#0066FF",
"enable-if": "activate-background"
},
"child-background": {
"name": "Child Background",
"description": "Change the color of GD child backgrounds (associated with GD backgrounds).",
"type": "color",
"default": "#00388D"
"default": "#00388D",
"enable-if": "activate-background"
},
"syncBGcolor": {
"name": "Sync BG Color",
"description": "Allows you to <cg>synchronise the GD backgrounds</c> with child backgrounds.",
"type": "bool",
"default": true
"default": true,
"enable-if": "activate-background"
},
"addChildBDGradient": {
"name": "Add child BG Gradient",
"description": "Adds a gradient to child backgrounds (only for level browsing).",
"type": "bool",
"default": true
"default": true,
"enable-if": "activate-background"
},
"bgchild-transparency": {
"name": "BG Child Transparency",
"description": "Change the transparency of child backgrounds.",
"type": "bool",
"default": false
"default": false,
"enable-if": "activate-background"
},
"bgchild-transparency-scroll": {
"name": "Transparency Opacity",
Expand All @@ -317,18 +328,17 @@
"max": 255,
"control": {
"slider": true
}
},
"enable-if": "activate-background"
},
"credits-section": {
"name": "Credits",
"description": "Below are the credits for those that developed the mod, and beta-tested the mod!",
"type": "custom",
"scale": 300,
"posX": 40
"type": "title"
},
"credit-buttons": {
"name": "Credit Buttons",
"type": "custom"
"type": "custom:credit-buttons"
}
}
}
38 changes: 19 additions & 19 deletions src/Notifications/EventsPush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,12 @@ bool EventsPush::init(sio::message::ptr const& data) {

auto menu = CCMenu::create();

bool newRate = Mod::get()->getSettingValue<bool>("newRate");
bool daily = Mod::get()->getSettingValue<bool>("daily");
bool weekly = Mod::get()->getSettingValue<bool>("weekly");
bool smallChest = Mod::get()->getSettingValue<bool>("smallChest");
bool largeChest = Mod::get()->getSettingValue<bool>("largeChest");
bool list = Mod::get()->getSettingValue<bool>("newListRate");
bool newRate = Mod::get()->template getSettingValue<bool>("newRate");
bool daily = Mod::get()->template getSettingValue<bool>("daily");
bool weekly = Mod::get()->template getSettingValue<bool>("weekly");
bool smallChest = Mod::get()->template getSettingValue<bool>("smallChest");
bool largeChest = Mod::get()->template getSettingValue<bool>("largeChest");
bool list = Mod::get()->template getSettingValue<bool>("newListRate");
switch (type) {
case 0: // Rate
eventType = EventType::Rate;
Expand Down Expand Up @@ -471,7 +471,7 @@ bool EventsPush::init(sio::message::ptr const& data) {
auto winSize = director->getWinSize();
auto bg = cocos2d::extension::CCScale9Sprite::create(sprite_name.c_str(), { .0f, .0f, 80.0f, 80.0f, });
auto bg_click_spr = cocos2d::extension::CCScale9Sprite::create(sprite_name.c_str(), { .0f, .0f, 80.0f, 80.0f, });
float lrScale = (float)Mod::get()->getSettingValue<double>("size");
float lrScale = (float)Mod::get()->template getSettingValue<double>("size");
auto LrSize = CCSize{ 240, 70 }; // * lrScale for both
bg->setScale(lrScale);
this->setZOrder(zOrder);
Expand Down Expand Up @@ -560,7 +560,7 @@ bool EventsPush::init(sio::message::ptr const& data) {
bg->addChild(legendary);
bg->addChild(diffFace);

if (Mod::get()->getSettingValue<bool>("customDifficultyFaces")) {
if (Mod::get()->template getSettingValue<bool>("customDifficultyFaces")) {
CCSprite* legendaryFace = nullptr;
if (isDemon == 0) {
if (starsum >= 10) {
Expand Down Expand Up @@ -591,7 +591,7 @@ bool EventsPush::init(sio::message::ptr const& data) {
case 4: // Mythic
bg->addChild(mythic);

if (Mod::get()->getSettingValue<bool>("customDifficultyFaces")) {
if (Mod::get()->template getSettingValue<bool>("customDifficultyFaces")) {
CCSprite* mythicFace = nullptr;
if (isDemon == 0) {
if (starsum >= 10) {
Expand Down Expand Up @@ -830,24 +830,24 @@ bool EventsPush::init(sio::message::ptr const& data) {
// Move action
//CCDelayTime

float delayTime = (float)Mod::get()->getSettingValue<double>("time");
float delayTime = (float)Mod::get()->template getSettingValue<double>("time");

int cornerId = Mod::get()->getSettingValue<SettingPosStruct>("notificationPlacement").m_pos;//ConfigHandler::readConfigInt("notificationPlacement");
auto cornerId = Mod::get()->getSettingValue<SettingPosEnum>("notificationPlacement");
float moveX = .0F;
switch (cornerId) {
case 1: // top left
case SettingPosEnum::TopLeft: // top left
bg->setPosition((-(bg->getContentSize().width / 2)) * lrScale, ((winSize.height - (bg->getContentSize().height / 2)) - (20 * lrScale)));
moveX = (bg->getContentSize().width) * lrScale;
break;
case 2: // top right
case SettingPosEnum::TopRight: // top right
bg->setPosition(winSize.width + ((bg->getContentSize().width / 2) * lrScale), ((winSize.height - (bg->getContentSize().height / 2)) - (20 * lrScale)));
moveX = -(bg->getContentSize().width * lrScale);
break;
case 3: // bottom left
case SettingPosEnum::BottomLeft: // bottom left
bg->setPosition((-(bg->getContentSize().width / 2)) * lrScale, (bg->getContentSize().height / 2) * lrScale);
moveX = (bg->getContentSize().width) * lrScale;
break;
case 4: // bottom right
case SettingPosEnum::BottomRight: // bottom right
bg->setPosition({ winSize.width + ((bg->getContentSize().width / 2) * lrScale), (bg->getContentSize().height / 2) * lrScale});
moveX = -((bg->getContentSize().width) * lrScale);
break;
Expand All @@ -863,14 +863,14 @@ bool EventsPush::init(sio::message::ptr const& data) {
));

float volume = 0.0f;
if (Mod::get()->getSettingValue<bool>("sfx-link")) {
if (Mod::get()->template getSettingValue<bool>("sfx-link")) {
volume = GameManager::get()->m_sfxVolume;
} else {
volume = Mod::get()->getSettingValue<double>("sfx-volume");
volume = Mod::get()->template getSettingValue<double>("sfx-volume");
}

if (Mod::get()->getSettingValue<bool>("sfx") && type != 3 && type != 4) FMODAudioEngine::sharedEngine()->playEffect("crystal01.ogg", 1, 1, volume);
if (Mod::get()->getSettingValue<bool>("sfx") && (type == 3 || type == 4)) FMODAudioEngine::sharedEngine()->playEffect("reward01.ogg", 1, 1, volume);
if (Mod::get()->template getSettingValue<bool>("sfx") && type != 3 && type != 4) FMODAudioEngine::sharedEngine()->playEffect("crystal01.ogg", 1, 1, volume);
if (Mod::get()->template getSettingValue<bool>("sfx") && (type == 3 || type == 4)) FMODAudioEngine::sharedEngine()->playEffect("reward01.ogg", 1, 1, volume);

return true;
}
Expand Down
Loading

0 comments on commit 5462edd

Please sign in to comment.