mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 01:45:35 -05:00
Compare commits
7 commits
461a135b82
...
ba584726b8
Author | SHA1 | Date | |
---|---|---|---|
|
ba584726b8 | ||
|
6e11d0a6b0 | ||
|
c94a533d1c | ||
|
b9fb2f6778 | ||
|
3fa91241aa | ||
|
302eea1f47 | ||
|
06eb32310c |
7 changed files with 91 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
|||
!insertmacro LANGFILE_EXT PortuguesePT
|
||||
!insertmacro LANGFILE_EXT Portuguese
|
||||
|
||||
!pragma warning disable 6030
|
||||
${LangFileString} MUI_TEXT_WELCOME_INFO_TEXT "O instalador irá guiá-lo através da instalação de $(^NameDA).$\r$\n$\r$\nAntes de iniciar a instalação, certifique-se de que o Geometry Dash não está aberto.$\r$\n$\r$\n$_CLICK"
|
|
@ -59,7 +59,7 @@
|
|||
!insertmacro GEODE_LANGUAGE "Polish"
|
||||
!insertmacro GEODE_LANGUAGE "Russian"
|
||||
!insertmacro GEODE_LANGUAGE "PortugueseBR"
|
||||
!insertmacro GEODE_LANGUAGE "PortuguesePT"
|
||||
!insertmacro GEODE_LANGUAGE "Portuguese"
|
||||
!insertmacro GEODE_LANGUAGE "Ukrainian"
|
||||
!insertmacro GEODE_LANGUAGE "Czech"
|
||||
!insertmacro GEODE_LANGUAGE "Turkish"
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#include "../../include/cocos2d.h"
|
||||
#include "../ExtensionMacros.h"
|
||||
|
||||
enum class GJHttpType;
|
||||
|
||||
NS_CC_EXT_BEGIN
|
||||
|
||||
class CC_DLL CCHttpClient;
|
||||
|
@ -216,6 +218,50 @@ public:
|
|||
return _headers;
|
||||
}
|
||||
|
||||
inline int getType() {
|
||||
return _type;
|
||||
}
|
||||
|
||||
inline void setType(int type) {
|
||||
_type = type;
|
||||
}
|
||||
|
||||
// @note Geode addition
|
||||
inline void setType(GJHttpType type) {
|
||||
_type = static_cast<int>(type);
|
||||
}
|
||||
|
||||
inline bool getShouldCancel() {
|
||||
return _shouldCancel;
|
||||
}
|
||||
|
||||
inline void setShouldCancel(bool shouldCancel) {
|
||||
_shouldCancel = shouldCancel;
|
||||
}
|
||||
|
||||
inline int getDownloadProgress() {
|
||||
return _downloadProgress;
|
||||
}
|
||||
|
||||
inline void setDownloadProgress(int downloadProgress) {
|
||||
_downloadProgress = downloadProgress;
|
||||
}
|
||||
|
||||
inline int getReadTimeout() {
|
||||
return _readTimeout;
|
||||
}
|
||||
|
||||
inline void setReadTimeout(int readTimeout) {
|
||||
_readTimeout = readTimeout;
|
||||
}
|
||||
|
||||
inline int getConnectTimeout() {
|
||||
return _connectTimeout;
|
||||
}
|
||||
|
||||
inline void setConnectTimeout(int connectTimeout) {
|
||||
_connectTimeout = connectTimeout;
|
||||
}
|
||||
|
||||
protected:
|
||||
// properties
|
||||
|
@ -229,13 +275,15 @@ protected:
|
|||
gd::vector<gd::string> _headers; /// custom http headers
|
||||
|
||||
// @note RobTop Addition
|
||||
int _requestTypeGJ;
|
||||
int _type;
|
||||
// @note RobTop Addition
|
||||
bool _shouldCancel;
|
||||
// @note RobTop Addition
|
||||
int _downloadProgress;
|
||||
// @note RobTop Addition
|
||||
int _readTimeout;
|
||||
// @note RobTop Addition
|
||||
int _connectTimeout;
|
||||
};
|
||||
|
||||
NS_CC_EXT_END
|
||||
|
|
|
@ -1331,15 +1331,13 @@ namespace geode::cocos {
|
|||
class CallFuncExtImpl : public cocos2d::CCActionInstant {
|
||||
public:
|
||||
static CallFuncExtImpl* create(const F& func) {
|
||||
auto ret = new CallFuncExtImpl;
|
||||
ret->m_func = func;
|
||||
auto ret = new CallFuncExtImpl(func);
|
||||
ret->autorelease();
|
||||
return ret;
|
||||
}
|
||||
|
||||
static CallFuncExtImpl* create(F&& func) {
|
||||
auto ret = new CallFuncExtImpl;
|
||||
ret->m_func = std::move(func);
|
||||
auto ret = new CallFuncExtImpl(std::move(func));
|
||||
ret->autorelease();
|
||||
return ret;
|
||||
}
|
||||
|
@ -1347,8 +1345,17 @@ namespace geode::cocos {
|
|||
private:
|
||||
F m_func;
|
||||
|
||||
// F may not be default-constructible
|
||||
CallFuncExtImpl(F&& func) : m_func(std::move(func)) {}
|
||||
CallFuncExtImpl(F const& func) : m_func(func) {}
|
||||
|
||||
void update(float) override {
|
||||
if (m_func) this->m_func();
|
||||
// Make sure any `std::function`s are valid
|
||||
if constexpr (requires { static_cast<bool>(m_func); }) {
|
||||
if (m_func) m_func();
|
||||
} else {
|
||||
m_func();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
DownloadStatus m_status;
|
||||
EventListener<ServerRequest<ServerModVersion>> m_infoListener;
|
||||
EventListener<web::WebTask> m_downloadListener;
|
||||
unsigned int m_scheduledEventForFrame = 0;
|
||||
|
||||
Impl(
|
||||
std::string const& id,
|
||||
|
@ -83,7 +84,14 @@ public:
|
|||
}
|
||||
|
||||
if (!ModDownloadManager::get()->checkAutoConfirm()) {
|
||||
ModDownloadEvent(m_id).post();
|
||||
// Throttle events to only once per frame to not cause a
|
||||
// billion UI updates at once
|
||||
if (m_scheduledEventForFrame != CCDirector::get()->getTotalFrames()) {
|
||||
m_scheduledEventForFrame = CCDirector::get()->getTotalFrames();
|
||||
Loader::get()->queueInMainThread([id = m_id]() {
|
||||
ModDownloadEvent(id).post();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
auto fetchVersion = version.has_value() ? ModVersion(*version) : ModVersion(ModVersionLatest());
|
||||
|
@ -157,7 +165,14 @@ public:
|
|||
else if (event->isCancelled()) {
|
||||
m_status = DownloadStatusCancelled();
|
||||
}
|
||||
ModDownloadEvent(m_id).post();
|
||||
// Throttle events to only once per frame to not cause a
|
||||
// billion UI updates at once
|
||||
if (m_scheduledEventForFrame != CCDirector::get()->getTotalFrames()) {
|
||||
m_scheduledEventForFrame = CCDirector::get()->getTotalFrames();
|
||||
Loader::get()->queueInMainThread([id = m_id]() {
|
||||
ModDownloadEvent(id).post();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
auto req = web::WebRequest();
|
||||
|
|
|
@ -466,8 +466,12 @@ void ModItem::updateState() {
|
|||
if (m_enableToggle && m_source.asMod()) {
|
||||
m_enableToggle->toggle(m_source.asMod()->isOrWillBeEnabled());
|
||||
|
||||
// Disable the toggle if the mod has been uninstalled
|
||||
if (modRequestedActionIsUninstall(m_source.asMod()->getRequestedAction())) {
|
||||
// Disable the toggle if the mod has been uninstalled or if the mod is
|
||||
// outdated
|
||||
if (
|
||||
modRequestedActionIsUninstall(m_source.asMod()->getRequestedAction()) ||
|
||||
m_source.asMod()->targetsOutdatedVersion()
|
||||
) {
|
||||
m_enableToggle->setEnabled(false);
|
||||
auto off = typeinfo_cast<CCRGBAProtocol*>(m_enableToggle->m_offButton->getNormalImage());
|
||||
auto on = typeinfo_cast<CCRGBAProtocol*>(m_enableToggle->m_onButton->getNormalImage());
|
||||
|
|
|
@ -672,7 +672,11 @@ void ModPopup::updateState() {
|
|||
m_cancelBtn->setVisible(false);
|
||||
|
||||
m_enableBtn->toggle(asMod && asMod->isOrWillBeEnabled());
|
||||
m_enableBtn->setVisible(asMod && asMod->getRequestedAction() == ModRequestedAction::None);
|
||||
m_enableBtn->setVisible(
|
||||
asMod &&
|
||||
asMod->getRequestedAction() == ModRequestedAction::None &&
|
||||
!asMod->targetsOutdatedVersion()
|
||||
);
|
||||
|
||||
m_reenableBtn->toggle(m_enableBtn->isToggled());
|
||||
m_reenableBtn->setVisible(asMod && modRequestedActionIsToggle(asMod->getRequestedAction()));
|
||||
|
|
Loading…
Reference in a new issue