Skip to content

Commit

Permalink
Customization & Mag Fixes
Browse files Browse the repository at this point in the history
-tons of ugly code to recolor various parts of the M1911Tactical
-tons of ugly code to correct M1911Tactical & M1911Operator low cap mag position
  • Loading branch information
Maiq-The-Dude committed Dec 19, 2020
1 parent 73dfea3 commit 439695b
Show file tree
Hide file tree
Showing 16 changed files with 447 additions and 44 deletions.
2 changes: 1 addition & 1 deletion RemoveM1911TacRedDot.sln → Better1911.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30608.117
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemoveM1911TacRedDot", "RemoveSillyDot\RemoveM1911TacRedDot.csproj", "{686FBDC0-1DE3-4F58-82E1-915CD3AE3FF9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Better1911", "Better1911\Better1911.csproj", "{686FBDC0-1DE3-4F58-82E1-915CD3AE3FF9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions Better1911/Configs/Frame.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using BepInEx.Configuration;
using UnityEngine;

namespace Better1911.Configs
{
public class FrameConfig : SharedConfigs
{
public FrameConfig(string section, ConfigFile config)
{
Color c = new Color32(0xFF, 0xFF, 0xFF, 0xFF);
Recolor = config.Bind(section, nameof(Recolor), c, "Color of the frame");
Roughness = config.Bind(section, nameof(Roughness), 1f, "Roughness of the material. Decrease for a more mirrored finish.");
Metallic = config.Bind(section, nameof(Metallic), 1f, "Metallic value for the material. Decrease for a flatter more polymer look.");
NormalStrength = config.Bind(section, nameof(NormalStrength), 1f, "Strength of the normal maps. Increase this for a more rugged look or decrease for a smoother look.");
Specularity = config.Bind(section, nameof(Specularity), 0f, "Specularity for the material.");
RemoveTexture = config.Bind(section, nameof(RemoveTexture), false, "Enable to remove texture. This can allow cleaner finishes and better recoloring.");
}
}
}
21 changes: 21 additions & 0 deletions Better1911/Configs/GlowSights.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using BepInEx.Configuration;
using Color = UnityEngine.Color;

namespace Better1911.Configs
{
public class GlowSightsConfig
{
public ConfigEntry<bool> DisableGlowSights { get; }
public ConfigEntry<bool> CustomColor { get; }
public ConfigEntry<Color> RearColor { get; }
public ConfigEntry<Color> FrontColor { get; }

public GlowSightsConfig(string section, ConfigFile config)
{
DisableGlowSights = config.Bind(section, nameof(DisableGlowSights), false, "Hide the glow sights");
CustomColor = config.Bind(section, nameof(CustomColor), false, "Enable custom coloring of the glow sights");
RearColor = config.Bind(section, nameof(RearColor), Color.blue, "Color of the rear glow sights");
FrontColor = config.Bind(section, nameof(FrontColor), Color.yellow, "Color of the front glow sight");
}
}
}
18 changes: 18 additions & 0 deletions Better1911/Configs/Grips.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using BepInEx.Configuration;
using UnityEngine;

namespace Better1911.Configs
{
public class GripsConfig : SharedConfigs
{
public GripsConfig(string section, ConfigFile config)
{
Color c = new Color32(0x1C, 0x1C, 0x1C, 0xFF);
Recolor = config.Bind(section, nameof(Recolor), c, "Color of the grips");
Roughness = config.Bind(section, nameof(Roughness), 0.409f, "Roughness of the material. Decrease for a more mirrored finish.");
Metallic = config.Bind(section, nameof(Metallic), 0.489f, "Metallic value for the material. Decrease for a flatter more polymer look.");
NormalStrength = config.Bind(section, nameof(NormalStrength), 1f, "Strength of the normal maps. Increase this for a more rugged look or decrease for a smoother look.");
Specularity = config.Bind(section, nameof(Specularity), 0f, "Specularity for the material.");
}
}
}
22 changes: 22 additions & 0 deletions Better1911/Configs/GunCustomization.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using BepInEx.Configuration;

namespace Better1911.Configs
{
public class GunCustomizationConfig
{
public ConfigEntry<bool> CustomMaterials { get; }

public FrameConfig Frame { get; }
public SlideConfig Slide { get; }
public GripsConfig Grips { get; }

public GunCustomizationConfig(string section, ConfigFile config)
{
CustomMaterials = config.Bind(section, nameof(CustomMaterials), false, "Enable material editing");

Slide = new SlideConfig(nameof(Slide), config);
Frame = new FrameConfig(nameof(Frame), config);
Grips = new GripsConfig(nameof(Grips), config);
}
}
}
22 changes: 22 additions & 0 deletions Better1911/Configs/Magazine.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using BepInEx.Configuration;

namespace Better1911.Configs
{
public class MagazineConfig
{
public ConfigEntry<bool> FixMagPos { get; }
public ConfigEntry<MagazineMaterial> CustomMagazineMaterial { get; }
public MagazineConfig(string section, ConfigFile config)
{
FixMagPos = config.Bind(section, nameof(FixMagPos), true, "Attempts to fix the standard capacity magazine positions for M1911 Tactical & Operator");
CustomMagazineMaterial = config.Bind(section, nameof(CustomMagazineMaterial), MagazineMaterial.Default, "Select Slide or Frame if you want your magazine material to match");
}

public enum MagazineMaterial
{
Default,
Slide,
Frame
}
}
}
21 changes: 21 additions & 0 deletions Better1911/Configs/Root.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using BepInEx.Configuration;

namespace Better1911.Configs
{
public class RootConfig
{
public ConfigEntry<bool> DisableRedDot { get; }
public GlowSightsConfig GlowSights { get; }
public GunCustomizationConfig GunCustomization { get; }
public MagazineConfig Magazine { get; }

public RootConfig(ConfigFile config)
{
DisableRedDot = config.Bind("Red Dot", nameof(DisableRedDot), true, "Hide the red dot");

GlowSights = new GlowSightsConfig(nameof(GlowSights), config);
GunCustomization = new GunCustomizationConfig(nameof(GunCustomization), config);
Magazine = new MagazineConfig(nameof(Magazine), config);
}
}
}
21 changes: 21 additions & 0 deletions Better1911/Configs/Shared.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using BepInEx.Configuration;
using UnityEngine;

namespace Better1911.Configs
{
public class SharedConfigs : IConfig
{
public ConfigEntry<Color> Recolor { get; set; }
public ConfigEntry<float> Roughness { get; set; }
public ConfigEntry<float> Metallic { get; set; }
public ConfigEntry<float> NormalStrength { get; set; }
public ConfigEntry<float> Specularity { get; set; }
public ConfigEntry<bool> RemoveTexture { get; set; }

Color IConfig.Recolor => Recolor.Value;
float IConfig.Roughness => Roughness.Value;
float IConfig.Metallic => Metallic.Value;
float IConfig.NormalStrength => NormalStrength.Value;
float IConfig.Specularity => Specularity.Value;
}
}
19 changes: 19 additions & 0 deletions Better1911/Configs/Slide.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using BepInEx.Configuration;
using UnityEngine;

namespace Better1911.Configs
{
public class SlideConfig : SharedConfigs
{
public SlideConfig(string section, ConfigFile config)
{
Color c = new Color32(0xFF, 0xFF, 0xFF, 0xFF);
Recolor = config.Bind(section, nameof(Recolor), c, "Color of the slide");
Roughness = config.Bind(section, nameof(Roughness), 1f, "Roughness of the material. Decrease for a more mirrored finish.");
Metallic = config.Bind(section, nameof(Metallic), 1f, "Metallic value for the material. Decrease for a flatter more polymer look.");
NormalStrength = config.Bind(section, nameof(NormalStrength), 1f, "Strength of the normal maps. Increase this for a more rugged look or decrease for a smoother look.");
Specularity = config.Bind(section, nameof(Specularity), 1f, "Specularity for the material.");
RemoveTexture = config.Bind(section, nameof(RemoveTexture), false, "Enable to remove texture. This can allow cleaner finishes and better recoloring.");
}
}
}
13 changes: 13 additions & 0 deletions Better1911/IConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using UnityEngine;

namespace Better1911
{
public interface IConfig
{
float Metallic { get; }
float NormalStrength { get; }
float Roughness { get; }
Color Recolor { get; }
float Specularity { get; }
}
}
Loading

0 comments on commit 439695b

Please sign in to comment.