1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
#define SIMPLE_KEYBOARD_LAYER
using SharpPluginLoader.Core.Configuration;
using SharpPluginLoader.Core.IO;
namespace MHWNewCamera
{
internal class Config : IConfig
{
public String Name => "MHWNewCamera";
public String Version => "4.0";
public struct Settings
{
public const float DEFAULT_SPEED = 5.35f;
public const float DEFAULT_SPEED_MODIFIER = 0.40f;
public const float DEFAULT_SENSITIVITY = 0.0425f;
public const float DEFAULT_ZOOM_SPEED = 0.02f;
public const float DEFAULT_PITCH_LIMIT = -1.0f;
public const float MAX_PITCH_LIMIT = 89.95f;
public const int DEFAULT_DEADZONE = 4750;
public const float DEFAULT_ALT_NEAR_CLIP = 0.3f;
public Settings()
{
Speed = DEFAULT_SPEED;
SpeedModifier = DEFAULT_SPEED_MODIFIER;
Sensitivity = DEFAULT_SENSITIVITY;
ZoomSpeed = DEFAULT_ZOOM_SPEED;
PitchLimit = DEFAULT_PITCH_LIMIT;
StickDeadzone = DEFAULT_DEADZONE;
AlternateNearClip = DEFAULT_ALT_NEAR_CLIP;
}
public float Speed { get; set; }
public float SpeedModifier { get; set; }
public float Sensitivity { get; set; }
public float ZoomSpeed { get; set; }
public float PitchLimit { get; set; }
public int StickDeadzone { get; set; }
public float AlternateNearClip { get; set; }
public struct Binds
{
public Binds()
{
EnableCombo = true;
FreeCameraCombo = "RStick,LT";
DisableComboButton1UnlessButton2Held = false;
#if SIMPLE_KEYBOARD_LAYER
EnableMouse = true;
MouseSensitivity = 0.0225f;
EnableKeyboard = true;
KeyboardLookSensitivity = 19750;
#endif
}
public bool EnableCombo { get; set; }
public String FreeCameraCombo { get; set; }
public bool DisableComboButton1UnlessButton2Held { get; set; }
#if SIMPLE_KEYBOARD_LAYER
public bool EnableMouse { get; set; }
public float MouseSensitivity { get; set; }
public bool EnableKeyboard { get; set; }
public int KeyboardLookSensitivity { get; set; }
#endif
}
}
public struct Preset
{
public float FieldOfView { get; set; }
public float Forward { get; set; }
public float Right { get; set; }
public float Up { get; set; }
public float Roll { get; set; }
public bool DisableFading { get; set; }
}
public struct GraphicalTweaks
{
public GraphicalTweaks()
{
TripleShadowResolution = false;
ShadowRangeOffset = 0.5f;
ApplyShadowRange = false;
ShadowRadiusOffset = -0.0001f;
ApplyShadowRadius = false;
HigherShadowDetailInHoarfrost = false;
EnableHQMode = false;
FullResolutionVolumeBlur = false;
HigherThanHighestVolumeRendering = false;
DisableLODLimits = false;
FoliageLODBias = 3.0f;
TerrainLODBias = 16.0f;
FoliageLODFactor = 0.0f;
TerrainLODFactor = 0.0f;
SnowLODBias = 32.0f;
ApplyLODFactors = false;
LargerFoliageSwayRange = false;
DisableReducedRateAnimations = false;
}
public bool TripleShadowResolution { get; set; }
public float ShadowRangeOffset { get; set; }
public bool ApplyShadowRange { get; set; }
public float ShadowRadiusOffset { get; set; }
public bool ApplyShadowRadius { get; set; }
public bool HigherShadowDetailInHoarfrost { get; set; }
public bool EnableHQMode { get; set; }
public bool FullResolutionVolumeBlur { get; set; }
public bool HigherThanHighestVolumeRendering { get; set; }
public bool DisableLODLimits { get; set; }
public float FoliageLODBias { get; set; }
public float TerrainLODBias { get; set; }
public float FoliageLODFactor { get; set; }
public float TerrainLODFactor { get; set; }
public float SnowLODBias { get; set; }
public bool ApplyLODFactors { get; set; }
public bool LargerFoliageSwayRange { get; set; }
public bool DisableReducedRateAnimations { get; set; }
}
public struct Position
{
public float FieldOfView { get; set; }
public float PosX { get; set; }
public float PosY { get; set; }
public float PosZ { get; set; }
public float TargetX { get; set; }
public float TargetY { get; set; }
public float TargetZ { get; set; }
public float Roll { get; set; }
}
private static Dictionary<string, Button> buttonMap = new Dictionary<string, Button>
{
{ "r1", Button.R1 }, { "rb", Button.R1 },
{ "r2", Button.R2 }, { "rt", Button.R2 },
{ "r3", Button.R3 }, { "rstick", Button.R3 },
{ "l1", Button.L1 }, { "lb", Button.L1 },
{ "l2", Button.L2 }, { "lt", Button.L2 },
{ "l3", Button.L3 }, { "lstick", Button.L3 },
{ "a", Button.Cross }, { "cross", Button.Cross },
{ "b", Button.Circle }, { "circle", Button.Circle },
{ "x", Button.Square }, { "square", Button.Square },
{ "y", Button.Triangle }, { "triangle", Button.Triangle },
{ "start", Button.Options }, { "options", Button.Options },
{ "select", Button.Share }, { "share", Button.Share },
{ "up", Button.Up },
{ "down", Button.Down },
{ "left", Button.Left },
{ "right", Button.Right }
};
public static Button[]? ParseCombo(String comboString)
{
string[] buttonStrings = comboString.Split(",");
if (buttonStrings.Length == 2)
{
string b1 = buttonStrings[0].ToLower();
string b2 = buttonStrings[1].ToLower();
if (buttonMap.ContainsKey(b1) && buttonMap.ContainsKey(b2))
{
return [ buttonMap[b1], buttonMap[b2] ];
}
}
return null;
}
public bool DisableMod { get; set; } = false;
public bool OverrideViewMode { get; set; } = false;
public Settings Camera { get; set; } = new Settings();
public Settings.Binds Binds { get; set; } = new Settings.Binds();
public bool PerspectiveCameraEnabled { get; set; } = false;
public Dictionary<String, Preset> Presets { get; set; } = new Dictionary<String, Preset>();
public String Selected { get; set; } = "";
public GraphicalTweaks Graphics { get; set; } = new GraphicalTweaks();
public Dictionary<String, Position> Positions { get; set; } = new Dictionary<String, Position>();
}
}
|