Skip to content

Commit

Permalink
Made a number of fixes to support old FRB projects (pre GLUX version 8).
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Nov 26, 2023
1 parent 3f5ed58 commit b9b77b9
Show file tree
Hide file tree
Showing 61 changed files with 2,885 additions and 1,151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,26 @@ public Microsoft.Xna.Framework.Color Color

ShapeCollection ICollidable.Collision => this.mShapes;

#if ICollidableHasItemsCollidedAgainst


HashSet<string> ICollidable.ItemsCollidedAgainst => this.mShapes.ItemsCollidedAgainst;

HashSet<string> ICollidable.LastFrameItemsCollidedAgainst => this.mShapes.LastFrameItemsCollidedAgainst;

#endif

#if ICollidableHasObjectsCollidedAgainst

HashSet<object> ICollidable.ObjectsCollidedAgainst => this.mShapes.ObjectsCollidedAgainst;

HashSet<object> ICollidable.LastFrameObjectsCollidedAgainst => this.mShapes.LastFrameObjectsCollidedAgainst;

#endif

public RepositionUpdateStyle RepositionUpdateStyle { get; set; } = RepositionUpdateStyle.Outward;


#endregion
#endregion

public TileShapeCollection()
{
Expand Down
11 changes: 11 additions & 0 deletions FRBDK/Glue/Glue/SaveClasses/GlueProjectSave.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ public enum GluxVersions
// file version for supporting named subcollisions.
ScreensHaveActivityEditMode = 8,
SupportsNamedSubcollisions = 8,

// This was added 5/5/2021,
TimeManagerHasDelaySeconds = 8,

// Added 8/24/2021
GumTextHasIsBold = 8,

GlueSavedToJson = 9,
IEntityInFrb = 10,
SeparateJsonFilesForElements = 11,
Expand Down Expand Up @@ -100,6 +107,10 @@ public enum GluxVersions
GeneratedCameraSetupFile = 26,
ShapeCollectionHasMaxAxisAlignedRectanglesRadiusX = 27,
AutoNameCollisionListsAsSingle = 28,

// Added retroactively to address problem with project template:
GumHasIgnoredByParentSize = 29,

GumTextObjectsUpdateTextWith0ChildDepth = 29,
HasFrameworkElementManager = 30,
HasGumSkiaElements = 31,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ public void GenerateAdditionalMethods(StandardElementSave standardElementSave, I
GenerateSetTextureCoordinatesFrom(classBodyBlock);
GenerateSourceFileNameProperty(classBodyBlock);
GenerateCurrentChainNameProperty(classBodyBlock);
GeneratePlayAnimationsAsync(classBodyBlock);

if(GlueState.Self.CurrentGlueProject.FileVersion >= (int)GluxVersions.TimeManagerHasDelaySeconds)
{
GeneratePlayAnimationsAsync(classBodyBlock);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,24 @@ public void RefreshVariableNamesToSkipBasedOnGlueVersion()
Skip("LineHeightMultiplier");
}

if ( version >= (int) GluxVersions.GumHasIgnoredByParentSize)
{
Skip("IgnoredByParentSize");
}
else
{
Skip("IgnoredByParentSize");
}

if( version >= (int) GluxVersions.GumTextHasIsBold)
{
Skip("IsBold");
}
else
{
Skip("IsBold");
}

return;

void Include(string variable)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"Name (System.String, required)",MaxSpeedX (System.Single),AccelerationTimeX (System.Single),DecelerationTimeX (System.Single),Gravity (System.Single),MaxFallSpeed (System.Single),JumpVelocity (System.Single),JumpApplyLength (System.Single),JumpApplyByButtonHold (System.Boolean),UsesAcceleration (System.Boolean),CanFallThroughCloudPlatforms (System.Boolean),CloudFallThroughDistance (System.Single),IsUsingCustomDeceleration (System.Boolean),CustomDecelerationValue (System.Single),MoveSameSpeedOnSlopes (System.Boolean),UphillFullSpeedSlope (System.Decimal),UphillStopSpeedSlope (System.Decimal),DownhillFullSpeedSlope (System.Decimal),DownhillMaxSpeedSlope (System.Decimal),DownhillMaxSpeedBoostPercentage (System.Decimal)
Ground,100,0.25,0.15,900,500,230,0.2,True,True,True,16,False,0,True,0,60,0,60,50
Air,100,0.7,0.7,900,260,0,0,False,True,True,16,False,0,True,0,0,0,0,0
Running,150,0.3,0.2,900,500,250,0.25,True,True,True,16,False,0,True,0,0,0,0,0
RunningAir,150,0.7,0.7,900,260,0,0,False,True,True,16,False,0,True,0,0,0,0,0
Ducking,0,0,0,900,500,230,0.2,True,True,True,16,True,200,True,0,0,0,0,0
"Name (System.String, required)",MaxSpeedX (System.Single),AccelerationTimeX (System.Single),DecelerationTimeX (System.Single),Gravity (System.Single),MaxFallSpeed (System.Single),JumpVelocity (System.Single),JumpApplyLength (System.Single),JumpApplyByButtonHold (System.Boolean),UsesAcceleration (System.Boolean),CanFallThroughCloudPlatforms (System.Boolean),CloudFallThroughDistance (System.Single),IsUsingCustomDeceleration (System.Boolean),CustomDecelerationValue (System.Single),MoveSameSpeedOnSlopes (System.Boolean),UphillFullSpeedSlope (System.Decimal),UphillStopSpeedSlope (System.Decimal),DownhillFullSpeedSlope (System.Decimal),DownhillMaxSpeedSlope (System.Decimal),DownhillMaxSpeedBoostPercentage (System.Decimal),CanClimb (System.Boolean),MaxClimbingSpeed (System.Single),InheritOrOverwriteAsInt (System.Int32)
Ground,100,0.25,0.15,900,500,230,0.2,True,True,True,16,False,0,True,0,60,0,60,50,False,0,0
Air,100,0.7,0.7,900,260,0,0,False,True,True,16,False,0,True,0,0,0,0,0,False,0,0
Running,150,0.3,0.2,900,500,250,0.25,True,True,True,16,False,0,True,0,0,0,0,0,False,0,0
RunningAir,150,0.7,0.7,900,260,0,0,False,True,True,16,False,0,True,0,0,0,0,0,False,0,0
Ducking,0,0,0,900,500,230,0.2,True,True,True,16,True,200,True,0,0,0,0,0,False,0,0
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
</State>
<Category>
<Name>ButtonCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>Enabled</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
</State>
<Category>
<Name>CheckBoxCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>EnabledOn</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<SetsValue>true</SetsValue>
</Variable>
<Variable>
<Type>ColorCategoryState</Type>
<Type>ColorCategory</Type>
<Name>ColorCategoryState</Name>
<SetsValue>false</SetsValue>
</Variable>
Expand Down Expand Up @@ -213,6 +213,7 @@
</State>
<Category>
<Name>ColorCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>Gray</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
</State>
<Category>
<Name>ComboBoxCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>Enabled</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<State>
<Name>Default</Name>
<Variable>
<Type>CursorMoveCategoryState</Type>
<Type>CursorMoveCategory</Type>
<Name>CursorMoveCategoryState</Name>
<SetsValue>false</SetsValue>
</Variable>
Expand Down Expand Up @@ -3832,6 +3832,7 @@
</State>
<Category>
<Name>CursorMoveCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>LeftRightMoveSupported</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
</State>
<Category>
<Name>ButtonCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>Enabled</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
<SetsValue>false</SetsValue>
</Variable>
<Variable>
<Type>ScrollBarVisibilityState</Type>
<Type>ScrollBarVisibility</Type>
<Name>ScrollBarVisibilityState</Name>
<SetsValue>false</SetsValue>
</Variable>
Expand Down Expand Up @@ -357,6 +357,7 @@
</State>
<Category>
<Name>ListBoxCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>Enabled</Name>
<Variable>
Expand Down Expand Up @@ -425,6 +426,7 @@
</Category>
<Category>
<Name>ScrollBarVisibility</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>NoScrollBar</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
</State>
<Category>
<Name>ListBoxItemCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>Enabled</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
</State>
<Category>
<Name>PasswordBoxCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>Enabled</Name>
</State>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@
</State>
<Category>
<Name>RadioButtonCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>EnabledOn</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@
</State>
<Category>
<Name>ScrollBarCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
</Category>
<Instance>
<Name>BackgroundInstance</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
</State>
<Category>
<Name>ButtonCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>Enabled</Name>
</State>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
<SetsValue>true</SetsValue>
</Variable>
<Variable>
<Type>ScrollBarVisibilityState</Type>
<Type>ScrollBarVisibility</Type>
<Name>ScrollBarVisibilityState</Name>
<SetsValue>false</SetsValue>
</Variable>
Expand Down Expand Up @@ -263,6 +263,7 @@
</State>
<Category>
<Name>ScrollBarVisibility</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>NoScrollBar</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
</State>
<Category>
<Name>SliderCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
</Category>
<Instance>
<Name>LineInstance</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
</State>
<Category>
<Name>TextBoxCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>Enabled</Name>
</State>
Expand All @@ -289,6 +290,7 @@
</Category>
<Category>
<Name>LineModeCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>Single</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@
</State>
<Category>
<Name>ToggleCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>EnabledOn</Name>
<Variable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
</State>
<Category>
<Name>ToggleCategory</Name>
<IsSetRecursively>false</IsSetRecursively>
<State>
<Name>EnabledOn</Name>
<Variable>
Expand Down
Loading

0 comments on commit b9b77b9

Please sign in to comment.