diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml index 173ac7e..b24a538 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/draft-release.yml @@ -8,12 +8,13 @@ env: CARGO_TERM_COLOR: always jobs: - release: + parser: runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v2 + - name: Use Rust stable uses: actions-rs/toolchain@v1 with: @@ -25,74 +26,96 @@ jobs: working-directory: ./settings-parser - name: Zip parser - uses: thedoctor0/zip-release@main + uses: thedoctor0/zip-release@0.7.5 with: type: 'zip' filename: "TW3_MSF_Parser.zip" path: "./settings-parser/target/x86_64-pc-windows-msvc/release/settings_parser.exe" + + - uses: actions/upload-artifact@v4 + with: + name: parser + path: "TW3_MSF_Parser.zip" + + + scripts: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Remove manifests locally to not include them in released packages + run: find . -type f -name "witcherscript.toml" -delete + - name: Zip modSettingsFramework - uses: thedoctor0/zip-release@main + uses: thedoctor0/zip-release@0.7.5 with: type: 'zip' filename: "TW3_MSF_modSettingsFramework.zip" path: "./modSettingsFramework" - recursive_exclusions: "*/witcherscript.toml" - name: Zip v1.32 hooks - uses: thedoctor0/zip-release@main + uses: thedoctor0/zip-release@0.7.5 with: type: 'zip' filename: "TW3_MSF_Hooks_1.32.zip" path: "./hooks/v1.32/modSettingsFrameworkHooks" - recursive_exclusions: "*/witcherscript.toml" - name: Zip v4.00 hooks - uses: thedoctor0/zip-release@main + uses: thedoctor0/zip-release@0.7.5 with: type: 'zip' filename: "TW3_MSF_Hooks_4.00.zip" path: "./hooks/v4.00/modSettingsFrameworkHooks" - recursive_exclusions: "*/witcherscript.toml" - name: Zip v4.03 hooks - uses: thedoctor0/zip-release@main + uses: thedoctor0/zip-release@0.7.5 with: type: 'zip' filename: "TW3_MSF_Hooks_4.03.zip" path: "./hooks/v4.03/modSettingsFrameworkHooks" - recursive_exclusions: "*/witcherscript.toml" - name: Zip v4.04 hooks - uses: thedoctor0/zip-release@main + uses: thedoctor0/zip-release@0.7.5 with: type: 'zip' filename: "TW3_MSF_Hooks_4.04.zip" path: "./hooks/v4.04/modSettingsFrameworkHooks" - recursive_exclusions: "*/witcherscript.toml" - - name: Zip v4.04a_REDkit hooks - uses: thedoctor0/zip-release@main + - name: Zip v4.04a_REDkit+ hooks + uses: thedoctor0/zip-release@0.7.5 with: type: 'zip' - filename: "TW3_MSF_Hooks_4.04a_REDkit.zip" - path: "./hooks/v4.04a_REDkit/modSettingsFrameworkHooks" - recursive_exclusions: "*/witcherscript.toml" + filename: "TW3_MSF_Hooks_4.04a_REDkit+.zip" + path: "./hooks/v4.04a_REDkit+/modSettingsFrameworkHooks" - name: Zip samples - uses: thedoctor0/zip-release@main + uses: thedoctor0/zip-release@0.7.5 with: type: 'zip' filename: "TW3_MSF_Samples.zip" path: "./samples" - recursive_exclusions: "*/witcherscript.toml" + + - uses: actions/upload-artifact@v4 + with: + name: scripts + path: "*.zip" + + release: + runs-on: ubuntu-latest + needs: [parser, scripts] + if: success() + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: "./artifacts" + merge-multiple: true - name: Create draft release uses: ncipollo/release-action@v1 with: - artifacts: > - TW3_MSF_modSettingsFramework.zip, - TW3_MSF_Parser.zip, - TW3_MSF_Samples.zip, - TW3_MSF_Hooks_1.32.zip, - TW3_MSF_Hooks_4.00.zip, - TW3_MSF_Hooks_4.03.zip, - TW3_MSF_Hooks_4.04.zip, - TW3_MSF_Hooks_4.04a_REDkit.zip + artifacts: "artifacts/*.zip" draft: true generateReleaseNotes: true \ No newline at end of file diff --git a/README.md b/README.md index 9ae1db4..73aaaf3 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,9 @@ Framework provides xml parser program. It generates WitcherScript code which mir 1. Go to the [releases page](https://github.com/SpontanCombust/tw3-settings-framework/releases) 2. Download `TW3_MSF_Hooks_vX.XX.zip` appropriate for you game version and copy to the `Mods` directory + +:information_source: *With the addition of code annotations introoduced in hotfix patch 4.04a_REDkit on 06.06.2024 all future game versions can use `v4.04a_REDkit+` hooks* + 3. Download `TW3_MSF_modSettingsFramework.zip` and copy to the `Mods` directory 4. Use Script Merger to solve any conflicts 5. (Optional) See [remarks](#remarks) diff --git a/doc/cli_specification.md b/doc/cli_specification.md index 72fba9c..c06df01 100644 --- a/doc/cli_specification.md +++ b/doc/cli_specification.md @@ -1,5 +1,5 @@ ``` -TW3 Settings Framework Parser 1.0.1 +TW3 Settings Framework Parser 1.0.2 Parses a mod menu XML file and outputs witcher script code representing settings of this menu USAGE: diff --git a/doc/mod-menu.ws b/doc/mod-menu.ws index ebef71b..9652a2a 100644 --- a/doc/mod-menu.ws +++ b/doc/mod-menu.ws @@ -1,4 +1,4 @@ -// Code generated using Mod Settings Framework v1.0.1 by SpontanCombust & Aeltoth +// Code generated using Mod Settings Framework v1.0.2 by SpontanCombust & Aeltoth class MyModSettings extends ISettingsMaster { diff --git a/hooks/v1.32/modSettingsFrameworkHooks/witcherscript.toml b/hooks/v1.32/modSettingsFrameworkHooks/witcherscript.toml index e477d95..da449fe 100644 --- a/hooks/v1.32/modSettingsFrameworkHooks/witcherscript.toml +++ b/hooks/v1.32/modSettingsFrameworkHooks/witcherscript.toml @@ -4,7 +4,7 @@ [content] name = "modSettingsFrameworkHooks" description = "Vanilla hooks for modSettingsFramework" -version = "1.0.1" +version = "1.0.2" authors = [] game_version = "1.32" scripts_root = "content/scripts" diff --git a/hooks/v4.00/modSettingsFrameworkHooks/witcherscript.toml b/hooks/v4.00/modSettingsFrameworkHooks/witcherscript.toml index 74ad325..b990822 100644 --- a/hooks/v4.00/modSettingsFrameworkHooks/witcherscript.toml +++ b/hooks/v4.00/modSettingsFrameworkHooks/witcherscript.toml @@ -4,7 +4,7 @@ [content] name = "modSettingsFrameworkHooks" description = "Vanilla hooks for modSettingsFramework" -version = "1.0.1" +version = "1.0.2" authors = [] game_version = "4.00" scripts_root = "content/scripts" diff --git a/hooks/v4.03/modSettingsFrameworkHooks/witcherscript.toml b/hooks/v4.03/modSettingsFrameworkHooks/witcherscript.toml index d83531e..3a99831 100644 --- a/hooks/v4.03/modSettingsFrameworkHooks/witcherscript.toml +++ b/hooks/v4.03/modSettingsFrameworkHooks/witcherscript.toml @@ -4,7 +4,7 @@ [content] name = "modSettingsFrameworkHooks" description = "Vanilla hooks for modSettingsFramework" -version = "1.0.1" +version = "1.0.2" authors = [] game_version = "4.03" scripts_root = "content/scripts" diff --git a/hooks/v4.04/modSettingsFrameworkHooks/witcherscript.toml b/hooks/v4.04/modSettingsFrameworkHooks/witcherscript.toml index 583a6e9..1b9bcc8 100644 --- a/hooks/v4.04/modSettingsFrameworkHooks/witcherscript.toml +++ b/hooks/v4.04/modSettingsFrameworkHooks/witcherscript.toml @@ -4,7 +4,7 @@ [content] name = "modSettingsFrameworkHooks" description = "Vanilla hooks for modSettingsFramework" -version = "1.0.1" +version = "1.0.2" authors = [] game_version = "4.04" scripts_root = "content/scripts" diff --git a/hooks/v4.04a_REDkit+/modSettingsFrameworkHooks/content/scripts/local/settings_framework_hooks.ws b/hooks/v4.04a_REDkit+/modSettingsFrameworkHooks/content/scripts/local/settings_framework_hooks.ws new file mode 100644 index 0000000..de5f52b --- /dev/null +++ b/hooks/v4.04a_REDkit+/modSettingsFrameworkHooks/content/scripts/local/settings_framework_hooks.ws @@ -0,0 +1,37 @@ +// +++ game/r4Game.ws +++ + +@addField(CR4Game) +public var m_settingsMasterRegistry : CSettingsMasterRegistry; + +// --- game/r4Game.ws --- + + +// +++ game/gui/commonMainMenuBase.ws +++ + +@wrapMethod(CR4CommonMainMenuBase) +function OnConfigUI() { + wrappedMethod(); + + GetSettingsMasterRegistry().ReadAllSettings(); +} + +// --- game/gui/commonMainMenuBase.ws --- + + +// +++ game/gui/main_menu/ingameMenu.ws +++ + +@wrapMethod(CR4IngameMenu) +function SaveChangedSettings() { + var shouldUpdate: bool; + + shouldUpdate = this.hasChangedOption; + + wrappedMethod(); + + if (shouldUpdate) { + LogChannel('ModSettingsFramework', "Detected some changes."); + GetSettingsMasterRegistry().ReadAllSettings(); + } +} + +// --- game/gui/main_menu/ingameMenu.ws --- \ No newline at end of file diff --git a/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/witcherscript.toml b/hooks/v4.04a_REDkit+/modSettingsFrameworkHooks/witcherscript.toml similarity index 91% rename from hooks/v4.04a_REDkit/modSettingsFrameworkHooks/witcherscript.toml rename to hooks/v4.04a_REDkit+/modSettingsFrameworkHooks/witcherscript.toml index 19d625a..2c5d6be 100644 --- a/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/witcherscript.toml +++ b/hooks/v4.04a_REDkit+/modSettingsFrameworkHooks/witcherscript.toml @@ -4,9 +4,9 @@ [content] name = "modSettingsFrameworkHooks" description = "Vanilla hooks for modSettingsFramework" -version = "1.0.1" +version = "1.0.2" authors = [] -game_version = "4.04a_REDkit" +game_version = "^4.04a_REDkit" scripts_root = "content/scripts" # Any dependencies that this project might need diff --git a/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/content/scripts/game/gui/commonMainMenuBase.ws b/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/content/scripts/game/gui/commonMainMenuBase.ws deleted file mode 100644 index 735bcab..0000000 Binary files a/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/content/scripts/game/gui/commonMainMenuBase.ws and /dev/null differ diff --git a/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/content/scripts/game/gui/main_menu/ingameMenu.ws b/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/content/scripts/game/gui/main_menu/ingameMenu.ws deleted file mode 100644 index d25168c..0000000 Binary files a/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/content/scripts/game/gui/main_menu/ingameMenu.ws and /dev/null differ diff --git a/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/content/scripts/game/r4Game.ws b/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/content/scripts/game/r4Game.ws deleted file mode 100644 index 01f6819..0000000 Binary files a/hooks/v4.04a_REDkit/modSettingsFrameworkHooks/content/scripts/game/r4Game.ws and /dev/null differ diff --git a/modSettingsFramework/content/scripts/local/settings_master_registry.ws b/modSettingsFramework/content/scripts/local/settings_master_registry.ws index 056d4c1..a04acbe 100644 --- a/modSettingsFramework/content/scripts/local/settings_master_registry.ws +++ b/modSettingsFramework/content/scripts/local/settings_master_registry.ws @@ -1,7 +1,7 @@ class CSettingsMasterRegistry { public const var FRAMEWORK_VERSION : name; - default FRAMEWORK_VERSION = '1.0.0'; + default FRAMEWORK_VERSION = '1.0.2'; private var m_settingsEntries : array; diff --git a/modSettingsFramework/witcherscript.toml b/modSettingsFramework/witcherscript.toml index ffbf0df..d053e43 100644 --- a/modSettingsFramework/witcherscript.toml +++ b/modSettingsFramework/witcherscript.toml @@ -7,7 +7,7 @@ description = """ Framework for modding Witcher 3 that simplifies the pipeline of using mod settings by generating code based directly on mod menu XML and providing extendible interface for reacting to changes of settings. """ -version = "1.0.1" +version = "1.0.2" authors = [] game_version = "4.04" scripts_root = "content/scripts" @@ -15,7 +15,7 @@ scripts_root = "content/scripts" # Any dependencies that this project might need [dependencies] content0 = true -modSettingsFrameworkHooks = { path = "../hooks/v4.04a_REDkit/modSettingsFrameworkHooks" } +modSettingsFrameworkHooks = { path = "../hooks/v4.04a_REDkit+/modSettingsFrameworkHooks" } # For details check the manual # https://spontancombust.github.io/witcherscript-ide/user-manual/project-system/#manifest-format diff --git a/samples/DifficultyMod/Mods/modSampleDifficultyMod/content/scripts/local/difficulty_mod_base.ws b/samples/DifficultyMod/Mods/modSampleDifficultyMod/content/scripts/local/difficulty_mod_base.ws index af2c7f2..86553c9 100644 --- a/samples/DifficultyMod/Mods/modSampleDifficultyMod/content/scripts/local/difficulty_mod_base.ws +++ b/samples/DifficultyMod/Mods/modSampleDifficultyMod/content/scripts/local/difficulty_mod_base.ws @@ -1,4 +1,4 @@ -// Code generated using Mod Settings Framework v1.0.1 by SpontanCombust & Aeltoth +// Code generated using Mod Settings Framework v1.0.2 by SpontanCombust & Aeltoth class ModDifficultySettingsBase extends ISettingsMaster { diff --git a/samples/DifficultyMod/Mods/modSampleDifficultyMod/witcherscript.toml b/samples/DifficultyMod/Mods/modSampleDifficultyMod/witcherscript.toml index 132398a..fcdd7c1 100644 --- a/samples/DifficultyMod/Mods/modSampleDifficultyMod/witcherscript.toml +++ b/samples/DifficultyMod/Mods/modSampleDifficultyMod/witcherscript.toml @@ -3,7 +3,7 @@ # Basic information about this project [content] name = "modSampleDifficultyMod" -version = "1.0.1" +version = "1.0.2" authors = [] game_version = "4.04" scripts_root = "content/scripts" diff --git a/samples/MonsterOfTheWeek/Mods/modSampleMonsterOfTheWeek/content/scripts/local/monster_of_the_week_settings.ws b/samples/MonsterOfTheWeek/Mods/modSampleMonsterOfTheWeek/content/scripts/local/monster_of_the_week_settings.ws index bae2299..ccf7d10 100644 --- a/samples/MonsterOfTheWeek/Mods/modSampleMonsterOfTheWeek/content/scripts/local/monster_of_the_week_settings.ws +++ b/samples/MonsterOfTheWeek/Mods/modSampleMonsterOfTheWeek/content/scripts/local/monster_of_the_week_settings.ws @@ -1,4 +1,4 @@ -// Code generated using Mod Settings Framework v1.0.1 by SpontanCombust & Aeltoth +// Code generated using Mod Settings Framework v1.0.2 by SpontanCombust & Aeltoth class MonsterOfTheWeekSettings extends ISettingsMaster { diff --git a/samples/MonsterOfTheWeek/Mods/modSampleMonsterOfTheWeek/witcherscript.toml b/samples/MonsterOfTheWeek/Mods/modSampleMonsterOfTheWeek/witcherscript.toml index 91a47b9..584ca9b 100644 --- a/samples/MonsterOfTheWeek/Mods/modSampleMonsterOfTheWeek/witcherscript.toml +++ b/samples/MonsterOfTheWeek/Mods/modSampleMonsterOfTheWeek/witcherscript.toml @@ -3,7 +3,7 @@ # Basic information about this project [content] name = "modSampleMonsterOfTheWeek" -version = "1.0.1" +version = "1.0.2" authors = [] game_version = "4.04" scripts_root = "content/scripts" diff --git a/settings-parser/Cargo.toml b/settings-parser/Cargo.toml index a37d6f3..d58bd18 100644 --- a/settings-parser/Cargo.toml +++ b/settings-parser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tw3-mod-settings-framework-parser" -version = "1.0.1" +version = "1.0.2" edition = "2021" [[bin]]