Skip to content
This repository was archived by the owner on Feb 11, 2024. It is now read-only.

Commit 860af28

Browse files
committed
Add project files.
1 parent 8bd65db commit 860af28

23 files changed

Lines changed: 2134 additions & 0 deletions
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{1D7832E3-8127-4A4C-AB02-CB1485630156}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>COM3D2.GUIAPI</RootNamespace>
11+
<AssemblyName>COM3D2.GUIAPI</AssemblyName>
12+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="0Harmony">
35+
<HintPath>..\..\..\..\Desktop\Meido Assemblies\COM Assemblies\BepinEx\0Harmony.dll</HintPath>
36+
</Reference>
37+
<Reference Include="Assembly-CSharp">
38+
<HintPath>..\..\..\..\Desktop\Meido Assemblies\COM Assemblies\GameOriginal 1.55.4\publicized_assemblies\Assembly-CSharp.dll</HintPath>
39+
</Reference>
40+
<Reference Include="BepInEx">
41+
<HintPath>..\..\..\..\Desktop\Meido Assemblies\COM Assemblies\BepinEx\BepInEx.dll</HintPath>
42+
</Reference>
43+
<Reference Include="ConfigurationManager">
44+
<HintPath>..\..\..\..\Desktop\Meido Assemblies\COM Assemblies\Resources\ConfigurationManager.dll</HintPath>
45+
</Reference>
46+
<Reference Include="System" />
47+
<Reference Include="System.Core" />
48+
<Reference Include="System.Xml.Linq" />
49+
<Reference Include="System.Data.DataSetExtensions" />
50+
<Reference Include="System.Data" />
51+
<Reference Include="System.Xml" />
52+
<Reference Include="UnityEngine">
53+
<HintPath>..\..\..\..\Desktop\Meido Assemblies\COM Assemblies\GameOriginal 1.55.4\UnityEngine.dll</HintPath>
54+
</Reference>
55+
</ItemGroup>
56+
<ItemGroup>
57+
<Compile Include="Handlers\ButtonHandler.cs" />
58+
<Compile Include="ConfigControlDropDown.cs" />
59+
<Compile Include="ConfigControlInputField.cs" />
60+
<Compile Include="ConfigTabButton.cs" />
61+
<Compile Include="ConfigControlSlider.cs" />
62+
<Compile Include="ConfigControlSwitch.cs" />
63+
<Compile Include="ConfigMenu.cs" />
64+
<Compile Include="ConfigSection.cs" />
65+
<Compile Include="ElementStoreHouse.cs" />
66+
<Compile Include="ConfigControl.cs" />
67+
<Compile Include="Helper\UIHelperFuncs.cs" />
68+
<Compile Include="Main.cs" />
69+
<Compile Include="Handlers\MenuHandler.cs" />
70+
<Compile Include="Properties\AssemblyInfo.cs" />
71+
<Compile Include="UIPopupListFixed.cs" />
72+
</ItemGroup>
73+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
74+
<PropertyGroup>
75+
<PostBuildEvent>del "G:\KISS\COM3D2Test\BepinEx\plugins\$(TargetFileName)"
76+
copy "$(TargetPath)" "G:\KISS\COM3D2Test\BepinEx\plugins"
77+
powershell start-process "G:\KISS\COM3D2Test\COM3D2x64.exe"</PostBuildEvent>
78+
</PropertyGroup>
79+
</Project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using UnityEngine;
6+
7+
namespace COM3D2.GUIAPI
8+
{
9+
public abstract class ConfigControl
10+
{
11+
internal string Name { get; set; }
12+
internal GameObject MainObject { get; set; }
13+
internal ConfigSection Parent { get; set; }
14+
internal bool DoneCreating { get; set; }
15+
16+
internal abstract void CreateControl();
17+
18+
internal abstract void DeleteControl();
19+
}
20+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using UnityEngine;
6+
7+
namespace COM3D2.GUIAPI
8+
{
9+
public class ConfigControlDropDown : ConfigControl
10+
{
11+
private List<string> ListOfItems = new List<string>();
12+
private readonly string StartVal;
13+
public EventHandler ValueChanged;
14+
private UIPopupList DropDown;
15+
public UIPopupList.Position Position
16+
{
17+
get => DropDown.position;
18+
set => DropDown.position = value;
19+
}
20+
public string Value
21+
{
22+
get
23+
{
24+
if (DropDown)
25+
{
26+
return DropDown.mSelectedItem;
27+
}
28+
29+
return StartVal;
30+
}
31+
set
32+
{
33+
DropDown.mSelectedItem = Value;
34+
}
35+
}
36+
internal ConfigControlDropDown(ConfigSection section, string name, List<string> listOfItems, string startVal)
37+
{
38+
base.Parent = section;
39+
base.Name = name;
40+
StartVal = startVal;
41+
42+
ListOfItems = listOfItems;
43+
}
44+
45+
internal override void CreateControl()
46+
{
47+
base.MainObject = ElementStoreHouse.BuildConfigControlDropDown(base.Parent.Table);
48+
MainObject.name = Name;
49+
50+
var label = base.MainObject.GetComponentsInChildren<UILabel>(true).First(go => go.name.Equals("Title"));
51+
label.text = base.Name;
52+
53+
DropDown = base.MainObject.GetComponentsInChildren<UIPopupListFixed>(true).First();
54+
DropDown.items = ListOfItems;
55+
DropDown.mSelectedItem = StartVal;
56+
57+
DropDown.onChange.Add(new EventDelegate(() => {
58+
try
59+
{
60+
ValueChanged.Invoke(this, null);
61+
}
62+
catch { }
63+
}));
64+
65+
DropDown.Start();
66+
DropDown.openOn = UIPopupList.OpenOn.ClickOrTap;
67+
68+
base.DoneCreating = true;
69+
}
70+
71+
internal override void DeleteControl()
72+
{
73+
UnityEngine.Object.Destroy(base.MainObject);
74+
DropDown = null;
75+
ListOfItems = null;
76+
ValueChanged = null;
77+
}
78+
}
79+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace COM3D2.GUIAPI
7+
{
8+
public class ConfigControlInputField : ConfigControl
9+
{
10+
private readonly string StartVal;
11+
private UIInput InputField;
12+
public string Value
13+
{
14+
get
15+
{
16+
17+
if (InputField)
18+
{
19+
return InputField.value;
20+
}
21+
22+
return StartVal;
23+
24+
}
25+
set
26+
{
27+
28+
if (base.MainObject)
29+
{
30+
InputField.value = value;
31+
}
32+
}
33+
34+
35+
}
36+
public EventHandler ValueChanged;
37+
38+
internal ConfigControlInputField(ConfigSection section, string name, string startval)
39+
{
40+
base.Name = name;
41+
StartVal = startval;
42+
base.Parent = section;
43+
}
44+
45+
internal override void CreateControl()
46+
{
47+
base.MainObject = ElementStoreHouse.BuildConfigControlInputField(base.Parent.Table);
48+
MainObject.name = Name;
49+
50+
MainObject.GetComponentsInChildren<UILabel>(true).First(go => go.name.Equals("TitleLabel")).text = base.Name;
51+
52+
53+
InputField = MainObject.GetComponentsInChildren<UIInput>()[0];
54+
InputField.value = StartVal;
55+
56+
InputField.onSubmit.Add(new EventDelegate(() =>
57+
{
58+
try
59+
{
60+
ValueChanged.Invoke(this, null);
61+
}
62+
catch
63+
{
64+
65+
}
66+
}));
67+
68+
base.DoneCreating = true;
69+
}
70+
71+
internal override void DeleteControl()
72+
{
73+
UnityEngine.Object.Destroy(base.MainObject);
74+
InputField = null;
75+
ValueChanged = null;
76+
}
77+
}
78+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using UnityEngine;
6+
7+
namespace COM3D2.GUIAPI
8+
{
9+
public class ConfigControlSlider : ConfigControl
10+
{
11+
private UISlider Slider;
12+
public EventHandler ValueChanged;
13+
private readonly float StartVal;
14+
public float Value
15+
{
16+
get
17+
{
18+
if (Slider)
19+
{
20+
return Slider.value;
21+
}
22+
23+
return StartVal;
24+
}
25+
set
26+
{
27+
Slider.value = value;
28+
}
29+
}
30+
31+
internal ConfigControlSlider(ConfigSection section, string name, float startVal)
32+
{
33+
base.Name = name;
34+
this.StartVal = startVal;
35+
base.Parent = section;
36+
}
37+
internal override void CreateControl()
38+
{
39+
base.MainObject = ElementStoreHouse.BuildConfigControlSlider(base.Parent.Table);
40+
base.MainObject.name = Name;
41+
42+
MainObject.GetComponentsInChildren<UILabel>()[0].text = base.Name;
43+
44+
Slider = MainObject.GetComponentsInChildren<UISlider>()[0];
45+
Slider.onDragFinished = () =>
46+
{
47+
//Main.logger.LogDebug($"Drag finished at a value of {Value}");
48+
try
49+
{
50+
ValueChanged.Invoke(this, null);
51+
}
52+
catch { }
53+
};
54+
55+
Slider.value = StartVal;
56+
57+
base.DoneCreating = true;
58+
}
59+
internal override void DeleteControl()
60+
{
61+
UnityEngine.Object.Destroy(base.MainObject);
62+
Slider = null;
63+
ValueChanged = null;
64+
}
65+
}
66+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using UnityEngine;
6+
7+
namespace COM3D2.GUIAPI
8+
{
9+
public class ConfigControlSwitch : ConfigControl
10+
{
11+
public bool Value { get; set; }
12+
public EventHandler ValueChanged;
13+
14+
internal ConfigControlSwitch(ConfigSection section, string name, bool startval)
15+
{
16+
base.Name = name;
17+
Value = startval;
18+
base.Parent = section;
19+
}
20+
21+
internal override void CreateControl()
22+
{
23+
base.MainObject = ElementStoreHouse.BuildConfigControlSwitch(base.Parent.Table);
24+
base.MainObject.name = Name;
25+
var label = MainObject.GetComponentsInChildren<UILabel>()[0].text = base.Name;
26+
27+
var buttonFunc = MainObject.GetComponentsInChildren<ConfigSelectButton>()[0];
28+
buttonFunc.onGetValue = null;
29+
buttonFunc.onSetValue = null;
30+
31+
buttonFunc.onSetValue = (newVal) =>
32+
{
33+
Value = newVal;
34+
try
35+
{
36+
ValueChanged.Invoke(this, null);
37+
}
38+
catch
39+
{
40+
41+
}
42+
};
43+
buttonFunc.onGetValue = () =>
44+
{
45+
return Value;
46+
};
47+
48+
buttonFunc.UpdateButton();
49+
50+
base.DoneCreating = true;
51+
}
52+
internal override void DeleteControl()
53+
{
54+
UnityEngine.Object.Destroy(base.MainObject);
55+
ValueChanged = null;
56+
}
57+
}
58+
}

0 commit comments

Comments
 (0)