Skip to content

Commit a98b3bd

Browse files
Tweak cutscene animation effect to not trigger in instances.
1 parent 19ee063 commit a98b3bd

7 files changed

Lines changed: 37 additions & 5 deletions

File tree

Chromatics/Chromatics.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<TargetFramework>net8.0-windows7.0</TargetFramework>
66
<UseWindowsForms>true</UseWindowsForms>
77
<StartupObject>Chromatics.Program</StartupObject>
8-
<Version>3.0.8.2</Version>
8+
<Version>3.0.8.3</Version>
99
<Authors>Danielle Thompson</Authors>
1010
<ApplicationManifest>app.manifest</ApplicationManifest>
1111
<Copyright>Danielle Thompson 2024</Copyright>

Chromatics/Extensions/Sharlayan/CutsceneAnimationExtension.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class CutsceneAnimationExtension
2121
private static bool _siginit;
2222
private static bool _memoryready;
2323
private static bool _isPopped;
24+
private static byte _inInstance;
2425
private static bool _initialized;
2526
private static List<Signature> _sList;
2627
private static readonly object RefreshLock = new object();
@@ -77,6 +78,9 @@ public static void RefreshData(MemoryHandler memoryHandler)
7778
var address = _memoryHandler.Scanner.Locations[memoryName];
7879
var contentFinderState = _memoryHandler.GetByte(address.GetAddress(), 0x145);
7980
_isPopped = contentFinderState == 3; //ContentFinderState of 3 means DF pop but not entered yet
81+
_inInstance = contentFinderState;
82+
83+
8084

8185
_initialized = true;
8286
}
@@ -105,5 +109,15 @@ public static bool IsPopped()
105109

106110
return _isPopped;
107111
}
112+
113+
public static byte InInstance()
114+
{
115+
if (!_initialized)
116+
return 0;
117+
118+
CheckCache();
119+
120+
return _inInstance;
121+
}
108122
}
109123
}

Chromatics/Extensions/Sharlayan/DutyFinderBellExtension.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class DutyFinderBellExtension
2121
private static bool _siginit;
2222
private static bool _memoryready;
2323
private static bool _isPopped;
24+
private static bool _inInstance;
2425
private static bool _initialized;
2526
private static List<Signature> _sList;
2627
private static readonly object RefreshLock = new object();
@@ -77,6 +78,7 @@ public static void RefreshData(MemoryHandler memoryHandler)
7778
var address = _memoryHandler.Scanner.Locations[memoryName];
7879
var contentFinderState = _memoryHandler.GetByte(address.GetAddress(), 0x145);
7980
_isPopped = contentFinderState == 3; //ContentFinderState of 3 means DF pop but not entered yet
81+
_inInstance = contentFinderState > 3;
8082

8183
_initialized = true;
8284
}
@@ -105,5 +107,15 @@ public static bool IsPopped()
105107

106108
return _isPopped;
107109
}
110+
111+
public static bool InInstance()
112+
{
113+
if (!_initialized)
114+
return false;
115+
116+
CheckCache();
117+
118+
return _inInstance;
119+
}
108120
}
109121
}

Chromatics/Layers/BaseLayers/ReactiveWeather.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,5 +551,7 @@ public static Color GetWeatherColor(string weatherType, PaletteColorModel colorP
551551

552552
return ColorHelper.ColorToRGBColor(colorMapping.Color);
553553
}
554+
554555
}
556+
555557
}

Chromatics/Layers/EffectLayers/CutsceneAnimation.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,12 @@ public override void Process(IMappingLayer layer)
116116
var getCurrentPlayer = _memoryHandler.Reader.GetCurrentPlayer();
117117
if (getCurrentPlayer.Entity == null) return;
118118

119+
DutyFinderBellExtension.CheckCache();
119120

120-
if (model._inCutscene != getCurrentPlayer.Entity.InCutscene || model.wasDisabled || layer.requestUpdate)
121+
122+
if (model._inCutscene != getCurrentPlayer.Entity.InCutscene || model._inInstance != DutyFinderBellExtension.InInstance() || model.wasDisabled || layer.requestUpdate)
121123
{
122-
if (getCurrentPlayer.Entity.InCutscene)
124+
if (getCurrentPlayer.Entity.InCutscene && !DutyFinderBellExtension.InInstance())
123125
{
124126
if (runningEffects.Contains(layergroup))
125127
{
@@ -152,6 +154,7 @@ public override void Process(IMappingLayer layer)
152154
}
153155

154156
model._inCutscene = getCurrentPlayer.Entity.InCutscene;
157+
model._inInstance = DutyFinderBellExtension.InInstance();
155158
}
156159

157160
model.wasDisabled = false;
@@ -165,6 +168,7 @@ public override void Process(IMappingLayer layer)
165168
private class CutsceneAnimationEffectModel
166169
{
167170
public bool _inCutscene { get; set; }
171+
public bool _inInstance { get; set; }
168172
public bool wasDisabled { get; set; }
169173
public SolidColorBrush activeBrush { get; set;}
170174
public bool init { get; set; }

Chromatics/obj/Chromatics.csproj.nuget.dgspec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"projects": {
77
"D:\\Git Projects\\roxaskeyheart\\Chromatics Workbench\\Chromatics-3.x\\Chromatics\\Chromatics.csproj": {
8-
"version": "3.0.8.2",
8+
"version": "3.0.8.3",
99
"restore": {
1010
"projectUniqueName": "D:\\Git Projects\\roxaskeyheart\\Chromatics Workbench\\Chromatics-3.x\\Chromatics\\Chromatics.csproj",
1111
"projectName": "Chromatics",

Chromatics/obj/project.assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4439,7 +4439,7 @@
44394439
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
44404440
},
44414441
"project": {
4442-
"version": "3.0.8.2",
4442+
"version": "3.0.8.3",
44434443
"restore": {
44444444
"projectUniqueName": "D:\\Git Projects\\roxaskeyheart\\Chromatics Workbench\\Chromatics-3.x\\Chromatics\\Chromatics.csproj",
44454445
"projectName": "Chromatics",

0 commit comments

Comments
 (0)