-
Notifications
You must be signed in to change notification settings - Fork 2
Use new api, add automatic copy to steam folder #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
joukepouke
wants to merge
8
commits into
PolyModdingTeam:main
Choose a base branch
from
joukepouke:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
db36b65
automatically generate a .polymod on build
joukepouke 97b5e60
use new api
joukepouke 200be89
Merge branch 'config-api' into merge
joukepouke a8ae63e
move to steam directory automatically
joukepouke ee25fc8
fix bug
joukepouke cd19128
fix
joukepouke 99f026a
fix
joukepouke 1ba0e6f
Update PolyScriptTemplate.csproj
joukepouke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,14 @@ | ||
| using BepInEx.Logging; | ||
| using PolyMod; | ||
|
|
||
| namespace PolyScriptTemplate; | ||
| public static class Main | ||
| public class Main : PolyScriptMod | ||
| { | ||
| public static void Load(ManualLogSource logger) | ||
| public override void Load() | ||
| { | ||
| this.Logger.LogMessage("Here we go!"); | ||
| } | ||
| public override void UnLoad() | ||
| { | ||
| logger.LogMessage("Here we go!"); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,41 @@ | |
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="PolyMod" Version="*" /> | ||
| <PackageReference Include="PolyMod" Version="*" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="MSBuildTasks" Version="1.5.0.235"> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
| <Target Name="PostBuild" AfterTargets="PostBuildEvent"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistent indent plz |
||
| <PropertyGroup> | ||
| <ModFilesDir>$(ProjectDir)..\modFiles\</ModFilesDir> | ||
| <ZipFile>$(ProjectDir)..\template.polymod</ZipFile> | ||
|
|
||
| <SteamDir Condition="'$(SteamDir)' != ''">$(SteamDir)</SteamDir> | ||
| <SteamDir Condition="'$(SteamDir)' == '' AND '$(OS)' == 'Windows_NT'">C:\Program Files (x86)\Steam</SteamDir> | ||
| <SteamDir Condition="'$(SteamDir)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(HOME)/.steam/steam')">$(HOME)/.steam/steam</SteamDir> | ||
| <SteamDir Condition="'$(SteamDir)' == '' AND '$(OS)' != 'Windows_NT' AND Exists('$(HOME)/Library/Application Support/Steam')">$(HOME)/Library/Application Support/Steam</SteamDir> | ||
|
|
||
| <PolytopiaModsDir>$(SteamDir)/steamapps/common/The Battle of Polytopia/Mods</PolytopiaModsDir> | ||
| </PropertyGroup> | ||
|
|
||
| <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(ModFilesDir)" /> | ||
|
|
||
| <ItemGroup> | ||
| <FilesToZip Include="$(ModFilesDir)**\*" /> | ||
| </ItemGroup> | ||
|
|
||
| <ZipDirectory SourceDirectory="$(ModFilesDir)" DestinationFile="$(ZipFile)" Overwrite="true" /> | ||
|
|
||
| <Error Condition="!Exists('$(PolytopiaModsDir)')" | ||
| Text="Polytopia Mods folder not found at '$(PolytopiaModsDir)'. Please set SteamDir manually (e.g. dotnet build -p:SteamDir=/path/to/steam)." /> | ||
|
|
||
| <Message Text="Deploying $(ZipFile) to $(PolytopiaModsDir)" Importance="high" /> | ||
|
|
||
| <Copy SourceFiles="$(ZipFile)" DestinationFolder="$(PolytopiaModsDir)"/> | ||
| </Target> | ||
| </Project> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "id": "template", | ||
| "version": "1.0.0", | ||
| "authors": ["your_name_here"] | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is everything in this line absolutely correct?