From fc107a689dc01737fd381293340e52e516eed1be Mon Sep 17 00:00:00 2001 From: jdflyer Date: Sat, 26 Sep 2026 15:59:52 -0600 Subject: [PATCH] Bump version, fix build workflow, update example mod --- .github/workflows/build.yml | 4 +++- CMakeLists.txt | 7 +++++-- src/mod.cpp | 9 ++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98eff67..c7ede35 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: pull_request: env: - SYMGEN_VERSION: v1.2.4 + SYMGEN_VERSION: v1.3.6 jobs: build: @@ -96,6 +96,8 @@ jobs: name: Combine bundles needs: build runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v7 diff --git a/CMakeLists.txt b/CMakeLists.txt index e9eef49..af369a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,7 @@ cmake_minimum_required(VERSION 3.26) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) if (NOT DEFINED CMAKE_BUILD_TYPE AND NOT DEFINED ENV{CMAKE_BUILD_TYPE}) set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Build type") @@ -8,7 +11,7 @@ project(my_mod VERSION 1.0.0 LANGUAGES CXX) # The Dusklight version to build against: a release tag (e.g. "v2.0.0") or a commit SHA. if (NOT DUSKLIGHT_VERSION) - set(DUSKLIGHT_VERSION "v2.0.0") + set(DUSKLIGHT_VERSION "v2.0.2") endif () # Fetches the Dusklight sources into ./dusklight and provides DUSKLIGHT_DIR. # Use -DDUSKLIGHT_DIR= to point at an existing Dusklight checkout. @@ -18,7 +21,7 @@ add_subdirectory("${DUSKLIGHT_DIR}/sdk" dusklight-sdk EXCLUDE_FROM_ALL) configure_file(mod.json.in "${CMAKE_CURRENT_BINARY_DIR}/mod.json" @ONLY NEWLINE_STYLE LF) add_mod(my_mod - FEATURES game # remove for service/asset-only mods; add webgpu for GfxService + FEATURES game fmt # remove for service/asset-only mods; add webgpu for GfxService SOURCES src/mod.cpp MOD_JSON "${CMAKE_CURRENT_BINARY_DIR}/mod.json" RES_DIR res # mod resources, including icon.png and banner.png diff --git a/src/mod.cpp b/src/mod.cpp index 1ec64b6..eede735 100644 --- a/src/mod.cpp +++ b/src/mod.cpp @@ -1,7 +1,6 @@ -#include "mods/svc/hook.hpp" #include "mods/service.hpp" -#include "mods/svc/hook.h" -#include "mods/svc/log.h" +#include "mods/svc/hook.hpp" +#include "mods/svc/log.hpp" // Game includes #include "d/d_item_data.h" @@ -28,11 +27,11 @@ MOD_EXPORT ModResult mod_initialize(ModError*) { // Installs a pre hook on fopAcM_createItem. ModResult result = mods::hook::add_pre(on_create_item_pre); if (result != MOD_OK) { - svc_log->error(mod_ctx, "failed to install on_create_item_pre"); + mods::log::error("failed to install pre_hook on_create_item_pre"); return result; } - svc_log->info(mod_ctx, "my_mod initialized"); + mods::log::info("my_mod initialized"); return MOD_OK; }