ui has been added

things will probably work
master
EvilPunkin 2023-08-13 14:03:01 -07:00
parent 0884419509
commit 1501212daa
15 changed files with 263 additions and 100 deletions

8
Director.Build.targets Normal file
View File

@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<ReferencePath>
G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\
</ReferencePath>
<AssemblySearchPaths>$(AssemblySearchPaths);$(ReferencePath);</AssemblySearchPaths>
</PropertyGroup>
</Project>

View File

@ -1,22 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MOD_NAME", "MOD_NAME/MOD_NAME.csproj", "{35FB73C9-194D-4B06-8327-9200CAF9BF7D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{35FB73C9-194D-4B06-8327-9200CAF9BF7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35FB73C9-194D-4B06-8327-9200CAF9BF7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35FB73C9-194D-4B06-8327-9200CAF9BF7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35FB73C9-194D-4B06-8327-9200CAF9BF7D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View File

@ -1,40 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>MOD_NAME</AssemblyName>
<TargetFramework>net48</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors>
</PropertyGroup>
<!-- Derail Valley -->
<ItemGroup>
<Reference Include="Assembly-CSharp"/>
</ItemGroup>
<!-- Unity -->
<ItemGroup>
<Reference Include="UnityEngine"/>
<Reference Include="UnityEngine.CoreModule"/>
</ItemGroup>
<!-- Mod Loader -->
<ItemGroup>
<PackageReference Include="UnityModManager" Version="0.27.2"/>
</ItemGroup>
<!-- Null Checking -->
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0"/>
<PackageReference Include="Nullable" Version="1.3.1" PrivateAssets="all"/>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<!-- Copy to build folder -->
<Copy SourceFiles="$(TargetPath)" DestinationFolder="../build/"/>
<!-- Package after Release build -->
<Exec Condition="'$(ConfigurationName)' == 'Release' And '$(OS)' == 'Windows_NT'" Command="powershell -executionpolicy bypass -Command &quot;(../package.ps1)&quot;"/>
<Exec Condition="'$(ConfigurationName)' == 'Release' And '$(OS)' != 'Windows_NT'" Command="pwsh -Command &quot;(../package.ps1)&quot;"/>
</Target>
</Project>

View File

@ -1,31 +0,0 @@
using System;
using System.Reflection;
using HarmonyLib;
using UnityModManagerNet;
namespace MOD_NAME;
public static class Main
{
// Unity Mod Manage Wiki: https://wiki.nexusmods.com/index.php/Category:Unity_Mod_Manager
private static bool Load(UnityModManager.ModEntry modEntry)
{
Harmony? harmony = null;
try
{
harmony = new Harmony(modEntry.Info.Id);
harmony.PatchAll(Assembly.GetExecutingAssembly());
// Other plugin startup logic
}
catch (Exception ex)
{
modEntry.Logger.LogException($"Failed to load {modEntry.Info.DisplayName}:", ex);
harmony?.UnpatchAll(modEntry.Info.Id);
return false;
}
return true;
}
}

BIN
assets/AssetBundles Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
ManifestFileVersion: 0
CRC: 966447639
AssetBundleManifest:
AssetBundleInfos:
Info_0:
Name: models.fullcab
Dependencies: {}

BIN
assets/models.fullcab Normal file

Binary file not shown.

View File

@ -0,0 +1,29 @@
ManifestFileVersion: 0
CRC: 1261696359
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: 1858f3bb33448328d19383b4869ef0d7
TypeTreeHash:
serializedVersion: 2
Hash: ae2cf77de671e115b4e55d2b65767202
HashAppended: 0
ClassTypes:
- Class: 1
Script: {instanceID: 0}
- Class: 4
Script: {instanceID: 0}
- Class: 21
Script: {instanceID: 0}
- Class: 23
Script: {instanceID: 0}
- Class: 33
Script: {instanceID: 0}
- Class: 43
Script: {instanceID: 0}
- Class: 48
Script: {instanceID: 0}
SerializeReferenceClassIdentifiers: []
Assets:
- Assets/better282/fullcab.prefab
Dependencies: []

25
dumb282tweaks.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33627.172
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dumb282tweaks", "dumb282tweaks\dumb282tweaks.csproj", "{29798D2A-7139-4E0D-A6A3-3FFA9E7E5611}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{29798D2A-7139-4E0D-A6A3-3FFA9E7E5611}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29798D2A-7139-4E0D-A6A3-3FFA9E7E5611}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29798D2A-7139-4E0D-A6A3-3FFA9E7E5611}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29798D2A-7139-4E0D-A6A3-3FFA9E7E5611}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C1C9BDE2-F852-4FB2-9E3F-0745754DA0EC}
EndGlobalSection
EndGlobal

115
dumb282tweaks/Main.cs Normal file
View File

@ -0,0 +1,115 @@
using System;
using System.IO;
using System.Reflection;
using HarmonyLib;
using UnityModManagerNet;
using UnityEngine;
using System.Collections.Generic;
using DV;
using UnityEngine.UI;
using System.ComponentModel;
using static dumb282tweaks.Main;
namespace dumb282tweaks;
public static class Main {
// Variables
public static UnityModManager.ModEntry Instance { get; private set; }
public static dumb282tweaksSettings Settings { get; private set; }
private static readonly string[] cabTypeTexts = new[] {
"Default",
//"Soviet",
"German"
};
private static readonly string[] smokeDeflectorTypeTexts = new[] {
"Default",
"Soviet",
"German"
};
// Load
private static bool Load(UnityModManager.ModEntry modEntry) {
Harmony? harmony = null;
try {
Instance = modEntry;
Settings = UnityModManager.ModSettings.Load<dumb282tweaksSettings>(Instance);
Instance.OnGUI = OnGUI;
Instance.OnSaveGUI = OnSaveGUI;
harmony = new Harmony(Instance.Info.Id);
harmony.PatchAll(Assembly.GetExecutingAssembly());
//var assets = AssetBundle.LoadFromFile(Path.Combine(modEntry.Path, "model.fullcab"));
//var fullcab = assets.LoadAsset<GameObject>("fullcab");
} catch (Exception ex) {
Instance.Logger.LogException($"Failed to load {Instance.Info.DisplayName}:", ex);
harmony?.UnpatchAll(Instance.Info.Id);
return false;
}
return true;
}
// GUI Rendering
static void OnGUI(UnityModManager.ModEntry modEntry) {
GUILayout.BeginVertical();
Settings.toggleTweaks = GUILayout.Toggle(Settings.toggleTweaks, "Toggle Tweaks");
GUILayout.Label("Cab Type");
Settings.cabType = (CabType)GUILayout.SelectionGrid((int)Settings.cabType, cabTypeTexts, 1, "toggle");
GUILayout.Space(2);
GUILayout.Label("Smoke Deflector Type");
Settings.smokeDeflectorType = (SmokeDeflectorType) GUILayout.SelectionGrid((int) Settings.smokeDeflectorType, smokeDeflectorTypeTexts, 1, "toggle");
GUILayout.Space(2);
GUILayout.Label("Texture Utility");
GUILayout.EndVertical();
}
static void OnSaveGUI(UnityModManager.ModEntry modEntry) {
Settings.Save(modEntry);
}
// Logger Commands
public static void Log(string message) {
Instance.Logger.Log(message);
}
public static void Warning(string message) {
Instance.Logger.Warning(message);
}
public static void Error(string message) {
Instance.Logger.Error(message);
}
public enum CabType {
[Description("Default 282 Cab")]
Default,
[Description("German Type Cab")]
German
}
public enum SmokeDeflectorType {
[Description("No Smoke Deflectors")]
None,
[Description("Soviet Smoke Deflectors")]
Soviet,
[Description("German Smoke Deflectors")]
German,
}
public class dumb282tweaksSettings : UnityModManager.ModSettings {
public bool toggleTweaks = true;
public CabType cabType = CabType.German;
public SmokeDeflectorType smokeDeflectorType = SmokeDeflectorType.Soviet;
public override void Save(UnityModManager.ModEntry modEntry) {
Save(this, modEntry);
}
}
}

View File

@ -0,0 +1,62 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>dumb282tweaks</AssemblyName>
<TargetFramework>net48</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<WarningsAsErrors>CS8600;CS8602;CS8603</WarningsAsErrors>
</PropertyGroup>
<!-- Derail Valley -->
<!-- Unity -->
<!-- Mod Loader -->
<ItemGroup>
<PackageReference Include="UnityModManager" Version="0.27.2" />
</ItemGroup>
<!-- Null Checking -->
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Nullable" Version="1.3.1" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\UnityModManager\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AssetBundleModule">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityModManager">
<HintPath>G:\SteamLibrary\steamapps\common\Derail Valley\DerailValley_Data\Managed\UnityModManager\UnityModManager.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<!-- Copy to build folder -->
<Copy SourceFiles="$(TargetPath)" DestinationFolder="../build/" />
<!-- Package after Release build -->
<Exec Condition="'$(ConfigurationName)' == 'Release' And '$(OS)' == 'Windows_NT'" Command="powershell -executionpolicy bypass -Command &quot;(../package.ps1)&quot;" />
<Exec Condition="'$(ConfigurationName)' == 'Release' And '$(OS)' != 'Windows_NT'" Command="pwsh -Command &quot;(../package.ps1)&quot;" />
</Target>
</Project>

View File

@ -1,9 +1,9 @@
{
"Id": "MOD_NAME",
"Id": "dumb282tweaks",
"Version": "1.0.0",
"DisplayName": "MOD_NAME",
"Author": "MOD_AUTHOR",
"EntryMethod": "MOD_NAME.Main.Load",
"DisplayName": "Dumb S282 Tweaks",
"Author": "aeugh",
"EntryMethod": "dumb282tweaks.Main.Load",
"ManagerVersion": "0.27.3",
"Repository": "https://github.com/OWNER/REPOSITORY/blob/main/repository.json"
"Repository": "https://github.com/aeughsendhelp/dumb282tweaks/blob/main/repository.json"
}

View File

@ -1,9 +1,9 @@
{
"Releases": [
{
"Id": "MOD_NAME",
"Id": "dumb282tweaks",
"Version": "1.0.0",
"DownloadUrl": "https://github.com/OWNER/REPOSITORY/releases/download/TAG/FILE_NAME.zip"
"DownloadUrl": "https://github.com/aeughsendhelp/dumb282tweaks/releases/download/TAG/FILE_NAME.zip"
}
]
}

3
sendtomods.ps1 Normal file
View File

@ -0,0 +1,3 @@
powershell -executionpolicy bypass .\package.ps1 -NoArchive -OutputDirectory `'G:\SteamLibrary\steamapps\common\Derail Valley\Mods`'
# Start-Sleep -Seconds 1
# steam steam://rungameid/588030

7
zDerailValley.url Normal file
View File

@ -0,0 +1,7 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,0
[InternetShortcut]
IDList=
IconIndex=0
URL=steam://rungameid/588030
IconFile=C:\Program Files (x86)\Steam\steam\games\ce91a672ac33c3038e50fc02fffa67e7133d2bf1.ico