Merge branch 'main' into settings

This commit is contained in:
HJfod 2024-08-19 19:19:48 +03:00
commit 90ed885d89
5 changed files with 87 additions and 1 deletions

View file

@ -213,7 +213,7 @@ if (ANDROID)
endif() endif()
set(MAT_JSON_AS_INTERFACE ON) set(MAT_JSON_AS_INTERFACE ON)
CPMAddPackage("gh:geode-sdk/json#3a79c51") CPMAddPackage("gh:geode-sdk/json#cda9807")
CPMAddPackage("gh:fmtlib/fmt#10.2.1") CPMAddPackage("gh:fmtlib/fmt#10.2.1")
target_compile_definitions(${PROJECT_NAME} INTERFACE MAT_JSON_DYNAMIC=1) target_compile_definitions(${PROJECT_NAME} INTERFACE MAT_JSON_DYNAMIC=1)

View file

@ -325,6 +325,8 @@ THE SOFTWARE.
#include "../robtop/scene_nodes/CCSceneTransitionDelegate.h" #include "../robtop/scene_nodes/CCSceneTransitionDelegate.h"
#include "../robtop/special_nodes/CCLightning.h"
#include "../robtop/xml/DS_Dictionary.h" #include "../robtop/xml/DS_Dictionary.h"
#include "../robtop/xml/ObjectDecoder.h" #include "../robtop/xml/ObjectDecoder.h"

View file

@ -0,0 +1,70 @@
#ifndef __CCLIGHTNING_H__
#define __CCLIGHTNING_H__
#include "../../include/ccMacros.h"
#include "../../base_nodes/CCNode.h"
NS_CC_BEGIN
// @note RobTop Addition
class CCLightning : public CCNode, public CCRGBAProtocol {
public:
CCLightning();
virtual ~CCLightning();
static CCLightning* lightningWithStrikePoint(CCPoint strikePoint, CCPoint strikePoint2, float duration);
static CCLightning* lightningWithStrikePoint(CCPoint strikePoint);
bool initWithStrikePoint(CCPoint strikePoint, CCPoint strikePoint2, float duration);
bool initWithStrikePoint(CCPoint strikePoint);
void strike();
void strikeFinished();
void strikeRandom();
void strikeWithSeed(uint64_t seed);
void draw();
// cocos2d::CCRGBAProtocol
bool isOpacityModifyRGB();
void setOpacityModifyRGB(bool);
unsigned char getOpacity();
unsigned char getDisplayedOpacity();
void setOpacity(unsigned char);
void updateDisplayedOpacity(unsigned char);
bool isCascadeColorEnabled();
void setCascadeOpacityEnabled(bool);
ccColor3B const& getColor();
ccColor3B const& getDisplayedColor();
void setColor(ccColor3B const&);
void updateDisplayedColor(ccColor3B const&);
bool isCascadeOpacityEnabled();
void setCascadeColorEnabled(bool);
protected:
CCPoint m_strikePoint;
CCPoint m_strikePoint2;
bool m_split;
int m_displacement;
int m_minDisplacement;
uint64_t m_seed;
float m_lineWidth;
bool m_unkBool;
bool m_removeAfterFinished;
float m_duration;
float m_opacityModify;
std::array<CCPoint, 200>* m_lightningPoints;
uint32_t m_numPoints;
uint8_t m_displayedOpacity;
uint8_t m_opacity;
ccColor3B m_displayedColor;
ccColor3B m_color;
bool m_cascadeColorEnabled;
bool m_cascadeOpacityEnabled;
bool m_opacityModifyEnabled;
};
NS_CC_END
#endif //__CCLIGHTNING_H__

View file

@ -93,5 +93,11 @@ namespace geode {
* to prematurily hide the notification * to prematurily hide the notification
*/ */
void hide(); void hide();
/**
* Cancels the showing of the notification if it's in the queue.
* Otherwise, it hides the notification if it's currently showing.
*/
void cancel();
}; };
} }

View file

@ -211,3 +211,11 @@ void Notification::hide() {
nullptr nullptr
)); ));
} }
void Notification::cancel() {
if(m_pParent) return this->hide();
if (s_queue->containsObject(this)) {
s_queue->removeObject(this);
}
}