Skip to content

Commit

Permalink
Added custom legendary/mythic faces
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouca committed Jan 3, 2024
1 parent 32fa0b6 commit 889bae9
Show file tree
Hide file tree
Showing 22 changed files with 86 additions and 3 deletions.
28 changes: 27 additions & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,27 @@
"sprites": [
"resources/Screenshot_1.png",
"resources/tab-gradient.png",
"resources/tab-gradient-mask.png"
"resources/tab-gradient-mask.png",
"resources/difficulty_01_mythicIcon.png",
"resources/difficulty_02_mythicIcon.png",
"resources/difficulty_03_mythicIcon.png",
"resources/difficulty_04_mythicIcon.png",
"resources/difficulty_05_mythicIcon.png",
"resources/difficulty_06_mythicIcon.png",
"resources/difficulty_07_mythicIcon.png",
"resources/difficulty_08_mythicIcon.png",
"resources/difficulty_09_mythicIcon.png",
"resources/difficulty_10_mythicIcon.png",
"resources/difficulty_01_legendaryIcon.png",
"resources/difficulty_02_legendaryIcon.png",
"resources/difficulty_03_legendaryIcon.png",
"resources/difficulty_04_legendaryIcon.png",
"resources/difficulty_05_legendaryIcon.png",
"resources/difficulty_06_legendaryIcon.png",
"resources/difficulty_07_legendaryIcon.png",
"resources/difficulty_08_legendaryIcon.png",
"resources/difficulty_09_legendaryIcon.png",
"resources/difficulty_10_legendaryIcon.png"
]
},
"settings": {
Expand Down Expand Up @@ -68,6 +88,12 @@
"type": "bool",
"default": true
},
"customDifficultyFaces": {
"name": "Custom Difficulty Faces",
"description": "Enable custom difficulty faces for Legendary/Mythic",
"type": "bool",
"default": true
},
"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.",
Expand Down
Binary file added resources/difficulty_01_legendaryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_01_mythicIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_02_legendaryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_02_mythicIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_03_legendaryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_03_mythicIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_04_legendaryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_04_mythicIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_05_legendaryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_05_mythicIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_06_legendaryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_06_mythicIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_07_legendaryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_07_mythicIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_08_legendaryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_08_mythicIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_09_legendaryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_09_mythicIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_10_legendaryIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/difficulty_10_mythicIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 59 additions & 2 deletions src/EventsPush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,20 +445,77 @@ bool EventsPush::init(sio::message::ptr const& data) {
switch (rateType) {
case 1: // Featured
bg->addChild(featured);
bg->addChild(diffFace);
break;
case 2: // Epic
bg->addChild(epic);
bg->addChild(diffFace);
break;
case 3: // Legendary
bg->addChild(legendary);
bg->addChild(diffFace);

if (Mod::get()->getSettingValue<bool>("customDifficultyFaces")) {
CCSprite* legendaryFace = nullptr;
if (isDemon == 0) {
if (starsum >= 10) {
std::string diffStr = std::to_string(static_cast<int>(getDifficulty(starsum)));
auto name = "difficulty_0" + diffStr + "_legendaryIcon.png";
legendaryFace = CCSprite::create(Mod::get()->expandSpriteName(name.c_str()));
}
} else {
if (starsum < 6) {
std::string diffStr = std::to_string(static_cast<int>(getDemonDifficulty(starsum)));
auto name = "difficulty_0" + diffStr + "_legendaryIcon.png";
legendaryFace = CCSprite::create(Mod::get()->expandSpriteName(name.c_str()));
} else {
std::string diffStr = std::to_string(static_cast<int>(getDemonDifficulty(starsum)));
auto name = "difficulty_" + diffStr + "_legendaryIcon.png";
legendaryFace = CCSprite::create(Mod::get()->expandSpriteName(name.c_str()));
}
}

if (legendaryFace != nullptr) {
legendaryFace->setPosition({26.f, 48.f});
legendaryFace->setScale(.8F);
bg->addChild(legendaryFace);
}
}

break;
case 4: // Mythic
bg->addChild(mythic);

if (Mod::get()->getSettingValue<bool>("customDifficultyFaces")) {
CCSprite* mythicFace = nullptr;
if (isDemon == 0) {
if (starsum >= 10) {
std::string diffStr = std::to_string(static_cast<int>(getDifficulty(starsum)));
auto name = "difficulty_0" + diffStr + "_mythicIcon.png";
mythicFace = CCSprite::create(Mod::get()->expandSpriteName(name.c_str()));
}
} else {
if (starsum < 6) {
std::string diffStr = std::to_string(static_cast<int>(getDemonDifficulty(starsum)));
auto name = "difficulty_0" + diffStr + "_mythicIcon.png";
mythicFace = CCSprite::create(Mod::get()->expandSpriteName(name.c_str()));
} else {
std::string diffStr = std::to_string(static_cast<int>(getDemonDifficulty(starsum)));
auto name = "difficulty_" + diffStr + "_mythicIcon.png";
mythicFace = CCSprite::create(Mod::get()->expandSpriteName(name.c_str()));
}
}

if (mythicFace != nullptr) {
mythicFace->setPosition({26.f, 48.f});
mythicFace->setScale(.8F);
bg->addChild(mythicFace);
}
}

break;
}
}

if (rateType < 4) bg->addChild(diffFace);

auto node = CCNode::create();

Expand Down

0 comments on commit 889bae9

Please sign in to comment.