Switch to VRExpansionPlugin Example 2

This commit is contained in:
Simeon "Waldo" Wallrath 2023-11-03 13:45:36 +01:00
parent 3e6ff514ff
commit 6c02da9299
837 changed files with 78100 additions and 0 deletions

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>

View file

@ -0,0 +1,104 @@
/*
*
* This is just a really quick mockup of a program to rename base path UE4 projects, nothing fancy and nothing all that well executed, I am very c# rusty.
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace UE4ProjectRenamer
{
class Program
{
static void Main(string[] args)
{
string FilePath = Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetEntryAssembly().CodeBase).LocalPath);
string [] FoundFiles = Directory.GetFiles(FilePath, "*.uproject", SearchOption.TopDirectoryOnly);
if (FoundFiles.Length < 1)
{
MessageBox.Show("Uproject not found in .exe directory, please move this .exe to the uproject directory prior to running");
return;
}
string TargetProject = FoundFiles[0];
if(MessageBox.Show("Found uproject by name of: " + Path.GetFileName(TargetProject) + " - Do you want to rename this project?", "Rename this project?", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
{
return;
}
string OldProjectName = Path.GetFileNameWithoutExtension(TargetProject);
string NewProjectName = Microsoft.VisualBasic.Interaction.InputBox("Enter the new project name for: " + OldProjectName, "EnterNewName", "Default", -1, -1);
if (NewProjectName == "Default" || NewProjectName.Length < 1)
return;
if (MessageBox.Show("Preparing to rename: " + OldProjectName + " to " + NewProjectName + ", Are you sure?", "Rename this project?", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
{
return;
}
// Remove old solution files
File.Delete(FilePath + "\\" + OldProjectName + ".sln");
File.Delete(FilePath + "\\" + OldProjectName + ".sdf");
File.Delete(FilePath + "\\" + OldProjectName + ".VC.db");
// Replace the .uproject
OpenAndRenameFile(TargetProject, OldProjectName, NewProjectName);
List<string> FileList = new List<string>();
GetFilesInDirectory(FilePath + "\\Source", ref FileList);
// Replace all interior source and .cs files
foreach(string file in FileList)
{
OpenAndRenameFile(file, OldProjectName, NewProjectName);
}
// Rename source folder
Directory.Move(FilePath + "\\Source\\" + OldProjectName, FilePath + "\\Source\\" + NewProjectName);
MessageBox.Show("Finished renaming all files in source directory, you will need to re-generate your project files now, rename the project folder, and change the name in defaultengine.ini");
}
static bool OpenAndRenameFile(string FileName, string OldProjectName, string NewProjectName)
{
try
{
string text = File.ReadAllText(FileName);
text = text.Replace(OldProjectName.ToUpper() + "_API", NewProjectName.ToUpper() + "_API");
text = text.Replace(OldProjectName, NewProjectName);
string newFileName = Path.GetDirectoryName(FileName) + "\\" + Path.GetFileName(FileName).Replace(OldProjectName, NewProjectName);
File.WriteAllText(newFileName, text);
if (FileName != newFileName && File.Exists(FileName))
{
File.Delete(FileName);
}
}
catch(Exception exp)
{
MessageBox.Show("Failed to open and modify " + Path.GetFileName(FileName) + "! " + exp.Message);
return false;
}
return true;
}
static bool GetFilesInDirectory(string nDirectory, ref List<string> StringList)
{
string[] FoundFiles = Directory.GetFiles(nDirectory, "*", SearchOption.AllDirectories);
StringList.AddRange(FoundFiles);
return true;
}
}
}

View file

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UE4ProjectRenamer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UE4ProjectRenamer")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f6f1963a-7658-45d2-baa2-c545902c8f61")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -0,0 +1,54 @@
<?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>{F6F1963A-7658-45D2-BAA2-C545902C8F61}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>UE4ProjectRenamer</RootNamespace>
<AssemblyName>UE4ProjectRenamer</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
<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" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>