Skip to content

Commit 83143cc

Browse files
authored
Merge pull request #2189 from VladiStep/gameSpecificDataOptional
"GameSpecificData" folder related improvements.
2 parents 24b6012 + e9f40f7 commit 83143cc

File tree

7 files changed

+21
-40
lines changed

7 files changed

+21
-40
lines changed

.github/workflows/publish_cli.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
cp ./README.md ./CLI-${{ matrix.os }}/
4444
cp ./SCRIPTS.md ./CLI-${{ matrix.os }}/
4545
cp ./LICENSE.txt ./CLI-${{ matrix.os }}/
46-
cp -r ./UndertaleModLib/GameSpecificData/ ./CLI-${{ matrix.os }}/GameSpecificData/
4746
cp -r ./UndertaleModTool/Scripts/ ./CLI-${{ matrix.os }}/Scripts/
4847
- name: Upload ${{ matrix.os }} CLI
4948
uses: actions/upload-artifact@v4

.github/workflows/publish_gui.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
cp ./README.md ./${{ matrix.os }}
4242
cp ./SCRIPTS.md ./${{ matrix.os }}
4343
cp ./LICENSE.txt ./${{ matrix.os }}
44-
cp -r ./UndertaleModLib/GameSpecificData/ ./${{ matrix.os }}/GameSpecificData/
4544
- name: Upload ${{ matrix.os }} GUI
4645
uses: actions/upload-artifact@v4
4746
with:

.github/workflows/publish_gui_nightly.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
cp ./README.md ./${{ matrix.os }}
4646
cp ./SCRIPTS.md ./${{ matrix.os }}
4747
cp ./LICENSE.txt ./${{ matrix.os }}
48-
cp -r ./UndertaleModLib/GameSpecificData/ ./${{ matrix.os }}/GameSpecificData/
4948
- name: Create zip for nightly release Windows GUI
5049
run: |
5150
7z a -tzip GUI-${{ matrix.os }}-${{ matrix.configuration }}-isBundled-${{ matrix.bundled }}-isSingleFile-${{ matrix.singlefile }}.zip ./${{ matrix.os }}/* -mx0
@@ -92,7 +91,6 @@ jobs:
9291
cp ./README.md ./CLI-${{ matrix.os }}/
9392
cp ./SCRIPTS.md ./CLI-${{ matrix.os }}/
9493
cp ./LICENSE.txt ./CLI-${{ matrix.os }}/
95-
cp -r ./UndertaleModLib/GameSpecificData/ ./CLI-${{ matrix.os }}/GameSpecificData/
9694
cp -r ./UndertaleModTool/Scripts/ ./CLI-${{ matrix.os }}/Scripts/
9795
- name: Create zip for nightly release CLI
9896
run: |

.github/workflows/publish_gui_release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
cp ./README.md ./${{ matrix.os }}
4242
cp ./SCRIPTS.md ./${{ matrix.os }}
4343
cp ./LICENSE.txt ./${{ matrix.os }}
44-
cp -r ./UndertaleModLib/GameSpecificData/ ./${{ matrix.os }}/GameSpecificData/
4544
- name: Create zip for stable release Windows GUI
4645
run: |
4746
7z a -tzip GUI-${{ matrix.os }}-${{ matrix.configuration }}-isBundled-${{ matrix.bundled }}-isSingleFile-${{ matrix.singlefile }}.zip ./${{ matrix.os }}/* -mx0
@@ -88,7 +87,6 @@ jobs:
8887
cp ./README.md ./CLI-${{ matrix.os }}/
8988
cp ./SCRIPTS.md ./CLI-${{ matrix.os }}/
9089
cp ./LICENSE.txt ./CLI-${{ matrix.os }}/
91-
cp -r ./UndertaleModLib/GameSpecificData/ ./CLI-${{ matrix.os }}/GameSpecificData/
9290
cp -r ./UndertaleModTool/Scripts/ ./CLI-${{ matrix.os }}/Scripts/
9391
- name: Create zip for stable release CLI
9492
run: |

.github/workflows/publish_pr.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
cp ./README.md ./${{ matrix.os }}
4444
cp ./SCRIPTS.md ./${{ matrix.os }}
4545
cp ./LICENSE.txt ./${{ matrix.os }}
46-
cp -r ./UndertaleModLib/GameSpecificData/ ./${{ matrix.os }}/GameSpecificData/
4746
- name: Upload ${{ matrix.os }} GUI
4847
uses: actions/upload-artifact@v4
4948
with:
@@ -87,7 +86,6 @@ jobs:
8786
cp ./README.md ./CLI-${{ matrix.os }}/
8887
cp ./SCRIPTS.md ./${{ matrix.os }}
8988
cp ./LICENSE.txt ./CLI-${{ matrix.os }}/
90-
cp -r ./UndertaleModLib/GameSpecificData/ ./CLI-${{ matrix.os }}/GameSpecificData/
9189
cp -r ./UndertaleModTool/Scripts/ ./CLI-${{ matrix.os }}/Scripts/
9290
- name: Upload ${{ matrix.os }} CLI
9391
uses: actions/upload-artifact@v4

UndertaleModLib/GameSpecificData/README.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,16 @@
33
Games are defined in the "Definitions" sub-folder, where they are given conditions to match the game(s) they target. Any JSON files from this folder are loaded automatically, if available.
44

55
GML decompiler configs are contained within the "Underanalyzer" sub-folder, referenced from the original definition files. (These are loaded on-demand.)
6+
7+
If you want to load this data from another path (or you just don't need to work with GML code), then you can prevent automatic folder copying.
8+
For that, you can do one of the following:
9+
1) Edit the `CopyGameSpecificDataToOutDir` project property (change to "false").
10+
2) Override its value through "Directory.Build.props" file outside of the project (e.g. when you use "UndertaleModLib" as a git submodule).
11+
Create the file (if doesn't exists) in the solution root folder, and write the following:
12+
<Project>
13+
<PropertyGroup>
14+
<CopyGameSpecificDataToOutDir>false</CopyGameSpecificDataToOutDir>
15+
</PropertyGroup>
16+
</Project>
17+
18+
In order to change the "GameSpecificData" folder location, you should change the `GameSpecificResolver.BaseDirectory` property.

UndertaleModLib/UndertaleModLib.csproj

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
2424
<GenerateDocumentationFile>True</GenerateDocumentationFile>
2525
</PropertyGroup>
26+
<PropertyGroup>
27+
<!-- Allows disabling "GameSpecificData" folder copying to the output directory using "Directory.Build.props" outside of the project
28+
(e.g. when using this project as a git submodule) -->
29+
<CopyGameSpecificDataToOutDir Condition="$(CopyGameSpecificDataToOutDir) == ''">true</CopyGameSpecificDataToOutDir>
30+
</PropertyGroup>
2631
<ItemGroup>
2732
<PackageReference Include="Fody" Version="6.9.2">
2833
<PrivateAssets>all</PrivateAssets>
@@ -34,42 +39,13 @@
3439
<PackageReference Include="SharpZipLib" Version="1.4.2" />
3540
</ItemGroup>
3641
<ItemGroup>
37-
<None Remove="GameSpecificData\Definitions\deltarune.json" />
38-
<None Remove="GameSpecificData\Definitions\gamemaker.json" />
39-
<None Remove="GameSpecificData\Definitions\undertale.json" />
40-
<None Remove="GameSpecificData\deltarune.json" />
41-
<None Remove="GameSpecificData\empty.json" />
42-
<None Remove="GameSpecificData\gamemaker.json" />
43-
<None Remove="GameSpecificData\README.txt" />
44-
<None Remove="GameSpecificData\undertale.json" />
42+
<None Remove="GameSpecificData\**" />
4543
<None Remove="version.txt" />
4644
</ItemGroup>
4745
<ItemGroup>
4846
<None Remove="gitversion.txt" />
49-
<Content Include="GameSpecificData\README.txt">
50-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
51-
</Content>
52-
<Content Include="GameSpecificData\Underanalyzer\deltarune.json">
53-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
54-
</Content>
55-
<Content Include="GameSpecificData\Underanalyzer\template.json">
56-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
57-
</Content>
58-
<Content Include="GameSpecificData\Underanalyzer\gamemaker.json">
59-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
60-
</Content>
61-
<Content Include="GameSpecificData\Underanalyzer\undertale.json">
62-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
63-
</Content>
64-
<Content Include="GameSpecificData\Definitions\deltarune.json">
65-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
66-
</Content>
67-
<Content Include="GameSpecificData\Definitions\gamemaker.json">
68-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
69-
</Content>
70-
<Content Include="GameSpecificData\Definitions\undertale.json">
71-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
72-
</Content>
47+
<Content Include="GameSpecificData\**" Condition="$(CopyGameSpecificDataToOutDir)"
48+
CopyToOutputDirectory="PreserveNewest" />
7349
<EmbeddedResource Include="gitversion.txt" />
7450
</ItemGroup>
7551
<ItemGroup>

0 commit comments

Comments
 (0)