Upload from upload_mods.ps1

This commit is contained in:
Nathaniel Cosford
2025-06-04 16:16:45 +09:30
commit 59641de2d7
8 changed files with 235 additions and 0 deletions

80
.gitignore vendored Normal file
View File

@@ -0,0 +1,80 @@
# Build and Object Folders
bin/
obj/
# Nuget packages directory
packages/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.log
*.vspscc
*.vssscc
.builds
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help
UpgradeLog*.XML
# Lightswitch
_Pvt_Extensions
GeneratedArtifacts
*.xap
ModelManifest.xml
#Backup file
*.bak
#zzzili
v15/

67
CustomMuzzleFlash.csproj Normal file
View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6B763422-D3CD-4136-9C64-E3D34B7A1FA8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CustomMuzzleFlash</RootNamespace>
<AssemblyName>CustomMuzzleFlash</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>.\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>.\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
</PropertyGroup>
<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\0_TFP_Harmony\0Harmony.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\7DaysToDie_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="LogLibrary">
<HintPath>..\..\7DaysToDie_Data\Managed\LogLibrary.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>..\..\7DaysToDie_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Harmony\Patches.cs" />
<Compile Include="Harmony\Init.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

BIN
CustomMuzzleFlash.dll Normal file

Binary file not shown.

BIN
CustomMuzzleFlash.pdb Normal file

Binary file not shown.

16
Harmony/Init.cs Normal file
View File

@@ -0,0 +1,16 @@
using System.Reflection;
public class CustomMuzzleFlashInit : IModApi
{
private static bool inited = false;
public void InitMod(Mod _modInstance)
{
if (inited)
return;
inited = true;
Log.Out(" Loading Patch: " + GetType());
var harmony = new HarmonyLib.Harmony(GetType().ToString());
harmony.PatchAll(Assembly.GetExecutingAssembly());
}
}

27
Harmony/Patches.cs Normal file
View File

@@ -0,0 +1,27 @@
using HarmonyLib;
[HarmonyPatch]
class MuzzlePatch
{
[HarmonyPatch(typeof(ItemActionAttack), nameof(ItemActionAttack.ReadFrom))]
[HarmonyPostfix]
private static void Postfix_ReadFrom_ItemActionAttack(DynamicProperties _props)
{
if (_props.Values.ContainsKey("Particles_muzzle_fire") && !ParticleEffect.IsAvailable(_props.Values["Particles_muzzle_fire"]))
{
ParticleEffect.LoadAsset(_props.Values["Particles_muzzle_fire"]);
}
if (_props.Values.ContainsKey("Particles_muzzle_fire_fpv") && !ParticleEffect.IsAvailable(_props.Values["Particles_muzzle_fire_fpv"]))
{
ParticleEffect.LoadAsset(_props.Values["Particles_muzzle_fire_fpv"]);
}
if (_props.Values.ContainsKey("Particles_muzzle_smoke") && !ParticleEffect.IsAvailable(_props.Values["Particles_muzzle_smoke"]))
{
ParticleEffect.LoadAsset(_props.Values["Particles_muzzle_smoke"]);
}
if (_props.Values.ContainsKey("Particles_muzzle_smoke_fpv") && !ParticleEffect.IsAvailable(_props.Values["Particles_muzzle_smoke_fpv"]))
{
ParticleEffect.LoadAsset(_props.Values["Particles_muzzle_smoke_fpv"]);
}
}
}

9
ModInfo.xml Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xml>
<Name value="CustomMuzzleFlash" />
<DisplayName value="Custom Muzzle Flash" />
<Description value="Register custom muzzle flash and smoke properties." />
<Author value="closer_ex" />
<Version value="1.0.3" />
</xml>

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("CustomMuzzleFlash")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomMuzzleFlash")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("6b763422-d3cd-4136-9c64-e3d34b7a1fa8")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]