Skip to content

Commit b8dd524

Browse files
committed
hey
1 parent d95fef2 commit b8dd524

19 files changed

Lines changed: 135 additions & 174 deletions

File tree

ReProcessor/Configuration/PluginConfig.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55

66
namespace ReProcessor.Configuration
77
{
8-
internal class PluginConfig
8+
public class PluginConfig
99
{
1010
public static PluginConfig Instance { get; set; }
1111

12-
/// A value for the config has to be virtual if you want BSIPA
13-
/// to detect a value change and save the config automatically
14-
// public virtual int MeaningofLife = 42 { get; set; }
12+
public virtual string Preset { get; internal set; } = "Default";
1513
}
1614
}

ReProcessor/Configuration/Types.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public CameraSetting(string propertyName, object value,Type valueType)
1919

2020
public class Defaults
2121
{
22-
public static Dictionary<string,CameraSetting> DefaultBloom()
22+
public static Dictionary<string,CameraSetting> Props()
2323
{
2424
Dictionary<string,CameraSetting> rtn = new();
2525
rtn.Add("Radius",new CameraSetting("_bloomRadius",5f,typeof(System.Single)));
@@ -32,12 +32,6 @@ public static Dictionary<string,CameraSetting> DefaultBloom()
3232
rtn.Add("Downsample Pass",new CameraSetting("_downsamplePass","Downsample13",typeof(PyramidBloomRendererSO.Pass)));
3333
rtn.Add("Upsample Pass",new CameraSetting("_upsamplePass","UpsampleTent",typeof(PyramidBloomRendererSO.Pass)));
3434
rtn.Add("Final Upsample Pass",new CameraSetting("_finalUpsamplePass","UpsampleTent",typeof(PyramidBloomRendererSO.Pass)));
35-
return rtn;
36-
}
37-
38-
public static Dictionary<string,CameraSetting> ColorBoost()
39-
{
40-
Dictionary<string,CameraSetting> rtn = new();
4135
rtn.Add("Base Color Boost",new CameraSetting("_baseColorBoost",1f,typeof(System.Single)));
4236
rtn.Add("Base Color Boost Threshold",new CameraSetting("_baseColorBoostThreshold",0.0f,typeof(System.Single)));
4337
return rtn;
@@ -47,14 +41,12 @@ public class Preset
4741
{
4842
public string Name;
4943

50-
public Dictionary<string,CameraSetting> Bloom;
51-
public Dictionary<string,CameraSetting> ColorBoost;
44+
public Dictionary<string,CameraSetting> Props;
5245

5346
public Preset(string name = "Default")
5447
{
5548
Name = name;
56-
Bloom = Defaults.DefaultBloom();
57-
ColorBoost = Defaults.ColorBoost();
49+
Props = Defaults.Props();
5850
}
5951
}
6052
}

ReProcessor/Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<!-- Manifest -->
55
<PropertyGroup>
66
<AssemblyName>ReProcessor</AssemblyName>
7-
<Authors>$ModAuthor$</Authors>
8-
<Version>1.0.0</Version>
9-
<GameVersion>1.16.4</GameVersion>
10-
<Description>$ModDesc$</Description>
7+
<Authors>headassbtw</Authors>
8+
<Version>2.0.0</Version>
9+
<GameVersion>1.19.0</GameVersion>
10+
<Description>bloom moment</Description>
1111
<ProjectHome></ProjectHome>
1212
<ProjectSource></ProjectSource>
1313
<Donate></Donate>

ReProcessor/Extensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ internal static void SetCameraSetting(this Camera cam, string fieldName, object
6666
//Plugin.Log.Notice($"Setting camera value as type \"{value.GetType()}\"");
6767
cam.MainEffectContainerSO().mainEffect.SetPrivateField(fieldName, value);
6868
}
69+
70+
internal static bool BloomOn()
71+
{
72+
var t = Camera.main.MainEffectContainerSO().mainEffect.GetType();
73+
return t == typeof(PyramidBloomMainEffectSO);
74+
}
6975
internal static void SetCameraSetting(this Camera cam, CameraSetting camSetting)
7076
{
7177
//_log.Notice($"Setting property \"{camSetting.Name}\" with type \"{camSetting.ValueType}\" and value \"{camSetting.Value}\"");

ReProcessor/Extensions/Camera.cs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,12 @@ namespace ReProcessor.Extensions
55
public static class Presets
66
{
77

8-
public static void ApplyBloom(this UnityEngine.Camera cam, Preset preset)
8+
public static void ApplyProps(this UnityEngine.Camera cam, Preset preset)
99
{
10-
foreach (var prop in preset.Bloom)
10+
foreach (var prop in preset.Props)
1111
{
1212
cam.SetCameraSetting(prop.Value);
1313
}
1414
}
15-
public static void ApplyColorBoost(this UnityEngine.Camera cam, Preset preset)
16-
{
17-
foreach (var prop in preset.ColorBoost)
18-
{
19-
cam.SetCameraSetting(prop.Value);
20-
}
21-
}
22-
public static void ApplyPreset(this UnityEngine.Camera cam, Preset preset)
23-
{
24-
25-
}
2615
}
2716
}

ReProcessor/Installers/ReProcessor2AppInstaller.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public AppInstaller(PluginConfig config)
1515

1616
public override void InstallBindings()
1717
{
18-
Container.BindInstance(_config);
18+
Container.BindInstance(_config).AsSingle();
1919

2020
Container.BindInterfacesAndSelfTo<ConfigManager>().AsSingle();
2121

ReProcessor/Installers/ReProcessor2MenuInstaller.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
using ReProcessor.Configuration;
22
using ReProcessor.Managers;
33
using ReProcessor.UI;
4+
using ReProcessor.UI.Views.NoBloomError;
45
using ReProcessor.UI.Views.TestView;
56
using Zenject;
67

78
namespace ReProcessor.Installers
89
{
910
internal class MenuInstaller : Installer
1011
{
11-
1212
public MenuInstaller()
1313
{
1414

1515
}
16-
1716
public override void InstallBindings()
1817
{
1918
Container.BindInterfacesAndSelfTo<CamManager>().AsSingle();
2019
Container.BindInterfacesAndSelfTo<LastResort>().FromNewComponentOnNewGameObject().AsSingle();
2120
Container.BindInterfacesAndSelfTo<ButtonManager>().AsSingle();
21+
Container.BindInterfacesAndSelfTo<NoBloomController>().FromNewComponentAsViewController().AsSingle();
2222
Container.BindInterfacesAndSelfTo<ColorBoostController>().FromNewComponentAsViewController().AsSingle();
23-
Container.BindInterfacesAndSelfTo<MainViewController>().FromNewComponentAsViewController().AsSingle();
2423
Container.BindInterfacesAndSelfTo<ConfigViewController>().FromNewComponentAsViewController().AsSingle();
2524
Container.Bind<rSettingsFlowCoordinator>().FromNewComponentOnNewGameObject().AsSingle();
2625
}

ReProcessor/Managers/Cam.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ public class CamManager : IInitializable, IDisposable
2828

2929
public void Reset()
3030
{
31-
32-
_mainCam.ApplySettings(Configuration.Defaults.DefaultBloom().Values.ToList());
33-
_mainCam.ApplySettings(Configuration.Defaults.ColorBoost().Values.ToList());
31+
Preset def = new Preset();
32+
ApplyAll(def);
3433
}
3534

3635
public void Apply(CameraSetting setting)
@@ -40,8 +39,7 @@ public void Apply(CameraSetting setting)
4039

4140
public void ApplyAll(Preset preset)
4241
{
43-
_mainCam.ApplyBloom(preset);
44-
_mainCam.ApplyColorBoost(preset);
42+
_mainCam.ApplyProps(preset);
4543
}
4644

4745
public void Initialize()

ReProcessor/Plugin.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using SiraUtil.Zenject;
66
using ReProcessor.Configuration;
77
using ReProcessor.Installers;
8+
using ReProcessor.Managers;
89
using SiraUtil.Logging;
910
using IPALogger = IPA.Logging.Logger;
1011

@@ -27,7 +28,7 @@ public void Init(Zenjector zenjector, IPALogger logger, Config config)
2728

2829
zenjector.UseLogger(logger);
2930
zenjector.UseMetadataBinder<Plugin>();
30-
31+
3132

3233
zenjector.Install<AppInstaller>(Location.App, config.Generated<PluginConfig>());
3334
zenjector.Install<MenuInstaller>(Location.Menu);

ReProcessor/ReProcessor.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
<None Remove="Resources\MenuButtonImages\untitled3.png" />
126126
<EmbeddedResource Include="Resources\MenuButtonImages\untitled3.png" />
127127
<None Remove="UI\Views\TestView\TestView.bsml" />
128-
<EmbeddedResource Include="UI\Views\MainView\View.bsml" />
129128
<None Remove="UI\Views\ColorBoostView\View.bsml" />
130129
<EmbeddedResource Include="UI\Views\ColorBoostView\View.bsml" />
131130
<None Remove="UI\Views\ConfigManager\View.bsml" />

0 commit comments

Comments
 (0)