Skip to content

Commit

Permalink
added ShareCommentLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
NinSam committed Jan 13, 2025
1 parent 9c01de6 commit a25f204
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 11 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ add_library(${PROJECT_NAME} SHARED
src/SetTextPopup.cpp
src/GJPromoPopup.cpp
src/SetIDPopup.cpp
src/ShareCommentLayer.cpp
src/Utils.hpp
src/Utils.cpp
# Add any extra C++ source files here
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed a small gradient cutoff on the sunrise sprite
- You can now set the opacity for the Dark Overlay
- Added Dark Overlay to ShareCommentLayer

## v1.1.1

Expand Down
Binary file modified resources/sunrise.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 modified resources/sunset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/EditLevelLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class $modify(EditLevelLayer) {

sunrise->setZOrder(-3);
sunrise->setAnchorPoint({0, 0});
sunrise->setScaleX(11 * relativescale);
sunrise->setScaleX(15 * relativescale);
sunrise->setScaleY(1.6 * relativescale);
sunrise->setPosition({0, 0});
sunrise->setID("sunrise"_spr);
Expand Down Expand Up @@ -106,7 +106,7 @@ class $modify(EditLevelLayer) {

sunset->setZOrder(-3);
sunset->setAnchorPoint({0, 0});
sunset->setScaleX(11 * relativescale);
sunset->setScaleX(15 * relativescale);
sunset->setScaleY(1.6 * relativescale);
sunset->setPosition({0, 0});
sunset->setID("sunset"_spr);
Expand Down
4 changes: 2 additions & 2 deletions src/LevelAreaLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class $modify(LevelAreaLayer) {

sunrise->setZOrder(-3);
sunrise->setAnchorPoint({0, 0});
sunrise->setScaleX(11 * relativescale);
sunrise->setScaleX(15 * relativescale);
sunrise->setScaleY(1.6 * relativescale);
sunrise->setPosition({0, 0});
sunrise->setID("sunrise"_spr);
Expand Down Expand Up @@ -105,7 +105,7 @@ class $modify(LevelAreaLayer) {

sunset->setZOrder(-3);
sunset->setAnchorPoint({0, 0});
sunset->setScaleX(11 * relativescale);
sunset->setScaleX(15 * relativescale);
sunset->setScaleY(1.6 * relativescale);
sunset->setPosition({0, 0});
sunset->setID("sunset"_spr);
Expand Down
4 changes: 2 additions & 2 deletions src/LevelSearchLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class $modify(LevelSearchLayer) {

sunrise->setZOrder(-3);
sunrise->setAnchorPoint({0, 0});
sunrise->setScaleX(11 * relativescale);
sunrise->setScaleX(15 * relativescale);
sunrise->setScaleY(1.6 * relativescale);
sunrise->setPosition({0, 0});
sunrise->setID("sunrise"_spr);
Expand Down Expand Up @@ -127,7 +127,7 @@ class $modify(LevelSearchLayer) {

sunset->setZOrder(-3);
sunset->setAnchorPoint({0, 0});
sunset->setScaleX(11 * relativescale);
sunset->setScaleX(15 * relativescale);
sunset->setScaleY(1.6 * relativescale);
sunset->setPosition({0, 0});
sunset->setID("sunset"_spr);
Expand Down
20 changes: 20 additions & 0 deletions src/ShareCommentLayer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/ShareCommentLayer.hpp>
#include "Utils.hpp"

using namespace geode::prelude;

class $modify(ShareCommentLayer) {

bool init(gd::string title, int charLimit, CommentType type, int ID, gd::string desc) {
if (!ShareCommentLayer::init(title, charLimit, type, ID, desc))
return false;

auto DayAndNightSystemOverlay = DayAndNightSystemOverlay::create();
DayAndNightSystemOverlay->setZOrder(106);
DayAndNightSystemOverlay->setID("ScreenOverlay"_spr);
this->addChild(DayAndNightSystemOverlay);

return true;
}
};
7 changes: 2 additions & 5 deletions src/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ bool DayAndNightSystem::init(){
CCSprite* sunrise = CCSprite::create("sunrise.png"_spr);

sunrise->setAnchorPoint({0, 0});
sunrise->setScaleX(11 * relativescale);
sunrise->setScaleX(15 * relativescale);
sunrise->setScaleY(1.6 * relativescale);
sunrise->setPosition({0, 0});
sunrise->setID("sunrise"_spr);
Expand All @@ -71,7 +71,7 @@ bool DayAndNightSystem::init(){
CCSprite* sunset = CCSprite::create("sunset.png"_spr);

sunset->setAnchorPoint({0, 0});
sunset->setScaleX(11 * relativescale);
sunset->setScaleX(15 * relativescale);
sunset->setScaleY(1.6 * relativescale);
sunset->setPosition({0, 0});
sunset->setID("sunset"_spr);
Expand Down Expand Up @@ -100,7 +100,6 @@ bool DayAndNightSystem::init(){
else if ((hr > startdarkhr || (hr == startdarkhr && min >= startdarkmin)) && (hr < endhrbugfix || (hr == endhrbugfix && min < endminbugfix))){

if (Mod::get()->getSettingValue<bool>("enable-dark")){


float relativescale = CCDirector::sharedDirector()->getContentScaleFactor()/4;
CCSprite* stars = CCSprite::create("stars.png"_spr);
Expand All @@ -116,7 +115,6 @@ bool DayAndNightSystem::init(){
else if ((hr > starthrbugfix || (hr == starthrbugfix && min >= startminbugfix)) && (hr < enddarkhr || (hr == enddarkhr && min < enddarkmin))){

if (Mod::get()->getSettingValue<bool>("enable-dark")){


float relativescale = CCDirector::sharedDirector()->getContentScaleFactor()/4;
CCSprite* stars = CCSprite::create("stars.png"_spr);
Expand Down Expand Up @@ -198,7 +196,6 @@ bool DayAndNightSystemOverlay::init(){
darkoverlay->setID("darkoverlay"_spr);
this->addChild(darkoverlay);


}

}
Expand Down

0 comments on commit a25f204

Please sign in to comment.