Skip to content

Commit 319c5de

Browse files
committed
add support for dashed lines to all line type we touch, and set to my normal defaults in mod.json
1 parent 756810c commit 319c5de

File tree

3 files changed

+34
-12
lines changed

3 files changed

+34
-12
lines changed

BTMLColorLOSMod/LineSetting.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public float[][] colors
1515
Colors.Clear();
1616
foreach (var colorValues in value)
1717
{
18-
Colors.Add(SettingsColorHelper.ColorFromValues(
19-
colorValues[0], colorValues[1], colorValues[2], colorValues[3]));
18+
Colors.Add(SettingsColorHelper.ColorFromValues(colorValues[0], colorValues[1], colorValues[2], colorValues[3]));
2019
}
2120
}
2221
}

BTMLColorLOSMod/WeaponRangeIndicators_DrawLine_Patch.cs

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,25 @@ static bool Prefix(
156156
"GetShotQuality", new object[] { selectedActor, position, rotation, target });
157157
line.material.color = Color.white;
158158
line.endColor = line.startColor = Color.Lerp(Color.clear, ModSettings.Direct.Color, shotQuality);
159+
// PoC follows for a very high contrast line to help color blind players
160+
// line.endColor = line.startColor = Color.black;
161+
// LineRenderer line8080 =
162+
// (LineRenderer)ReflectionHelper.InvokePrivateMethode(__instance, "getLine",
163+
// new object[] { });
164+
// line8080.positionCount = 2;
165+
// line8080.SetPosition(0, vector);
166+
// line8080.material = __instance.MaterialOutOfRange;
167+
// line8080.endColor = line8080.startColor = Color.white;
168+
// line8080.material.color = Color.white;
169+
// line8080.startWidth = line8080.endWidth = ModSettings.Direct.Thickness * 1.5f;
170+
// line8080.SetPosition(1, vector2);
171+
if (ModSettings.Direct.Dashed)
172+
{
173+
line.material = __instance.MaterialOutOfRange;
174+
line.material.color = line.endColor;
175+
}
159176
}
160-
161-
line.startWidth = __instance.LOSWidthBegin;
162-
line.endWidth = __instance.LOSWidthEnd;
177+
line.startWidth = line.endWidth = ModSettings.Direct.Thickness;
163178
}
164179

165180
line.SetPosition(1, vector2);
@@ -188,6 +203,11 @@ static bool Prefix(
188203
line.material.color = Color.white;
189204
line.startColor = line.endColor = ModSettings.ObstructedAttackerSide.Color;
190205
line.startWidth = line.endWidth = ModSettings.ObstructedAttackerSide.Thickness;
206+
if (ModSettings.ObstructedAttackerSide.Dashed)
207+
{
208+
line.material = __instance.MaterialOutOfRange;
209+
line.material.color = line.endColor;
210+
}
191211
}
192212

193213
LineRenderer line2 =
@@ -202,6 +222,11 @@ static bool Prefix(
202222
line2.material.color = Color.white;
203223
line2.startColor = line2.endColor = ModSettings.ObstructedTargetSide.Color;
204224
line2.startWidth = line2.endWidth = ModSettings.ObstructedTargetSide.Thickness;
225+
if (ModSettings.ObstructedTargetSide.Dashed)
226+
{
227+
line2.material = __instance.MaterialOutOfRange;
228+
line2.material.color = line2.endColor;
229+
}
205230
}
206231
else
207232
{

BTMLColorLOSMod/mod.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
"ConflictsWith": [],
1414

1515
"Settings": {
16-
"debug": true,
17-
1816
"nextColorKeyBinding": {
1917
"active": true,
2018
"keys": ["shift", "i"]
2119
},
22-
20+
2321
"direct": {
2422
"active": true,
2523
"colors": [
@@ -28,7 +26,7 @@
2826
[ 0, 0, 255, 255],
2927
[ 0, 0, 0, 255]
3028
],
31-
"dashed": true,
29+
"dashed": false,
3230
"thickness": 1
3331
},
3432
"indirect": {
@@ -43,14 +41,14 @@
4341
"thickness": 1.75
4442
},
4543
"obstructedAttackerSide": {
46-
"active": true,
44+
"active": false,
4745
"colors": [
4846
[ 0, 64, 255, 255],
4947
[ 0, 0, 255, 255],
5048
[ 0, 255, 0, 255],
5149
[255, 0, 0, 255]
5250
],
53-
"dashed": true,
51+
"dashed": false,
5452
"thickness": 1
5553
},
5654
"obstructedTargetSide": {
@@ -61,7 +59,7 @@
6159
[ 0, 0, 255, 255],
6260
[ 0, 255, 0, 255]
6361
],
64-
"dashed": true,
62+
"dashed": false,
6563
"thickness": 1.25
6664
}
6765
}

0 commit comments

Comments
 (0)