mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
Compare commits
4 commits
71f56ef49e
...
01807fedc9
Author | SHA1 | Date | |
---|---|---|---|
|
01807fedc9 | ||
|
22a11b96e2 | ||
|
6679a690a2 | ||
|
ebd4c920f5 |
4 changed files with 16 additions and 12 deletions
|
@ -10,8 +10,7 @@
|
||||||
* Rewritten matjson library
|
* Rewritten matjson library
|
||||||
* Settings V2 completely removed, use V3 now
|
* Settings V2 completely removed, use V3 now
|
||||||
* `JsonChecker` removed
|
* `JsonChecker` removed
|
||||||
* Add new system for ordered hook priority (673317d, 6db3084)
|
* Add new system for ordered hook priority, [see docs](https://docs.geode-sdk.org/tutorials/hookpriority) (673317d, 6db3084)
|
||||||
* See docs: LINK HERE!!
|
|
||||||
* C++20 coroutine support for `geode::Task`, [see docs](https://docs.geode-sdk.org/tutorials/tasks#coroutines) (e61b2c0, ab196b9)
|
* C++20 coroutine support for `geode::Task`, [see docs](https://docs.geode-sdk.org/tutorials/tasks#coroutines) (e61b2c0, ab196b9)
|
||||||
* Add `Task::chain`, [see docs](https://docs.geode-sdk.org/tutorials/tasks#chaining-tasks) (3248831)
|
* Add `Task::chain`, [see docs](https://docs.geode-sdk.org/tutorials/tasks#chaining-tasks) (3248831)
|
||||||
* Single page local mods list (efb1fbf)
|
* Single page local mods list (efb1fbf)
|
||||||
|
|
|
@ -817,7 +817,7 @@ namespace geode {
|
||||||
// make the second event listener that waits for the mapper's task
|
// make the second event listener that waits for the mapper's task
|
||||||
// and just forwards everything through
|
// and just forwards everything through
|
||||||
static_cast<void*>(new EventListener<NewTask>(
|
static_cast<void*>(new EventListener<NewTask>(
|
||||||
[handle](Event* event) mutable {
|
[handle](typename NewTask::Event* event) mutable {
|
||||||
if (auto v = event->getValue()) {
|
if (auto v = event->getValue()) {
|
||||||
NewTask::finish(handle.lock(), std::move(*v));
|
NewTask::finish(handle.lock(), std::move(*v));
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,9 +330,10 @@ void ModItem::updateState() {
|
||||||
auto wantsRestart = m_source.wantsRestart();
|
auto wantsRestart = m_source.wantsRestart();
|
||||||
|
|
||||||
auto download = server::ModDownloadManager::get()->getDownload(m_source.getID());
|
auto download = server::ModDownloadManager::get()->getDownload(m_source.getID());
|
||||||
|
bool isDownloading = download && download->isActive();
|
||||||
|
|
||||||
// If there is an active download ongoing, show that in place of developer name
|
// If there is an active download ongoing, show that in place of developer name
|
||||||
if (download && download->isActive()) {
|
if (isDownloading) {
|
||||||
m_updateBtn->setVisible(false);
|
m_updateBtn->setVisible(false);
|
||||||
m_restartRequiredLabel->setVisible(false);
|
m_restartRequiredLabel->setVisible(false);
|
||||||
m_developers->setVisible(false);
|
m_developers->setVisible(false);
|
||||||
|
@ -431,7 +432,7 @@ void ModItem::updateState() {
|
||||||
m_bg->setColor("mod-list-errors-found"_cc3b);
|
m_bg->setColor("mod-list-errors-found"_cc3b);
|
||||||
m_bg->setOpacity(isGeodeTheme() ? 25 : 90);
|
m_bg->setOpacity(isGeodeTheme() ? 25 : 90);
|
||||||
}
|
}
|
||||||
if (!wantsRestart && targetsOutdated) {
|
if (!wantsRestart && targetsOutdated && !isDownloading) {
|
||||||
LoadProblem problem = targetsOutdated.value();
|
LoadProblem problem = targetsOutdated.value();
|
||||||
m_bg->setColor("mod-list-outdated-label"_cc3b);
|
m_bg->setColor("mod-list-outdated-label"_cc3b);
|
||||||
m_bg->setOpacity(isGeodeTheme() ? 25 : 90);
|
m_bg->setOpacity(isGeodeTheme() ? 25 : 90);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <Geode/ui/GeodeUI.hpp>
|
#include <Geode/ui/GeodeUI.hpp>
|
||||||
#include <server/DownloadManager.hpp>
|
#include <server/DownloadManager.hpp>
|
||||||
#include <Geode/binding/GameObject.hpp>
|
#include <Geode/binding/GameObject.hpp>
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
LoadModSuggestionTask loadModSuggestion(LoadProblem const& problem) {
|
LoadModSuggestionTask loadModSuggestion(LoadProblem const& problem) {
|
||||||
// Recommended / suggested are essentially the same thing for the purposes of this
|
// Recommended / suggested are essentially the same thing for the purposes of this
|
||||||
|
@ -183,19 +184,22 @@ server::ServerRequest<std::unordered_set<std::string>> ModSource::fetchValidTags
|
||||||
return std::visit(makeVisitor {
|
return std::visit(makeVisitor {
|
||||||
[](Mod* mod) {
|
[](Mod* mod) {
|
||||||
return server::getTags().map(
|
return server::getTags().map(
|
||||||
[mod](auto* result) -> Result<std::unordered_set<std::string>, server::ServerError> {
|
[mod](Result<std::unordered_set<std::string>, server::ServerError>* result)
|
||||||
|
-> Result<std::unordered_set<std::string>, server::ServerError> {
|
||||||
|
std::unordered_set<std::string> finalTags;
|
||||||
|
auto modTags = mod->getMetadata().getTags();
|
||||||
|
|
||||||
if (result->isOk()) {
|
if (result->isOk()) {
|
||||||
|
std::unordered_set<std::string> fetched = result->unwrap();
|
||||||
// Filter out invalid tags
|
// Filter out invalid tags
|
||||||
auto modTags = mod->getMetadata().getTags();
|
for (std::string const& tag : modTags) {
|
||||||
auto finalTags = std::unordered_set<std::string>();
|
if (fetched.contains(tag)) {
|
||||||
for (auto& tag : modTags) {
|
|
||||||
if (result->unwrap().contains(tag)) {
|
|
||||||
finalTags.insert(tag);
|
finalTags.insert(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Ok(finalTags);
|
|
||||||
}
|
}
|
||||||
return Ok(result->unwrap());
|
|
||||||
|
return Ok(finalTags);
|
||||||
},
|
},
|
||||||
[](server::ServerProgress* progress) {
|
[](server::ServerProgress* progress) {
|
||||||
return *progress;
|
return *progress;
|
||||||
|
|
Loading…
Reference in a new issue