Compare commits

...

7 commits

Author SHA1 Message Date
Justin
3ddfdd0d69
Merge 4a40835f71 into 01807fedc9 2024-11-13 16:24:19 -05:00
Fleeym
01807fedc9 fix(ModSource): fix bad unwrap in fetchValidTags
Some checks are pending
Build Binaries / Build Windows (push) Waiting to run
Build Binaries / Build macOS (push) Waiting to run
Build Binaries / Build Android (64-bit) (push) Waiting to run
Build Binaries / Build Android (32-bit) (push) Waiting to run
Build Binaries / Publish (push) Blocked by required conditions
Check CHANGELOG.md / Check CHANGELOG.md (push) Waiting to run
2024-11-13 23:19:07 +02:00
matcool
22a11b96e2 fix wrong type in Task::chain impl 2024-11-13 16:20:50 -03:00
Fleeym
6679a690a2 fix(ModItem): hide outdated label when updating 2024-11-13 19:48:47 +02:00
mat
ebd4c920f5
add placeholder link for new hook priority system
lets not forget to write docs for this..
2024-11-13 13:38:10 -03:00
Justin
4a40835f71
Change approach 2024-11-08 12:23:18 -05:00
Justin
74d0924bcb
Part 2: Geode SDK 2024-11-08 10:20:30 -05:00
5 changed files with 37 additions and 13 deletions

View file

@ -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)

View file

@ -164,7 +164,27 @@ function(setup_geode_mod proname)
set(HAS_HEADERS Off) set(HAS_HEADERS Off)
endif() endif()
if (HAS_HEADERS AND WIN32) if (GEODE_BUNDLE_PDB AND WIN32 AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
if (HAS_HEADERS)
add_custom_target(${proname}_PACKAGE ALL
DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json
COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR}
--binary $<TARGET_FILE:${proname}> $<TARGET_LINKER_FILE:${proname}> $<TARGET_PDB_FILE:${proname}>
--output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode
${INSTALL_ARG} ${PDB_ARG}
VERBATIM USES_TERMINAL
)
else()
add_custom_target(${proname}_PACKAGE ALL
DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json
COMMAND ${GEODE_CLI} package new ${CMAKE_CURRENT_SOURCE_DIR}
--binary $<TARGET_FILE:${proname}> $<TARGET_PDB_FILE:${proname}>
--output ${CMAKE_CURRENT_BINARY_DIR}/${MOD_ID}.geode
${INSTALL_ARG} ${PDB_ARG}
VERBATIM USES_TERMINAL
)
endif()
elseif (HAS_HEADERS AND WIN32)
# this adds the .lib file on windows, which is needed for linking with the headers # this adds the .lib file on windows, which is needed for linking with the headers
add_custom_target(${proname}_PACKAGE ALL add_custom_target(${proname}_PACKAGE ALL
DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json DEPENDS ${proname} ${CMAKE_CURRENT_SOURCE_DIR}/mod.json

View file

@ -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));
} }

View file

@ -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);

View file

@ -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;