Skip to content

Commit

Permalink
Fixed setting default not working on variables outside of categories.
Browse files Browse the repository at this point in the history
Added code to propagate variable changes to all states in a category when editing in the wireframe.
  • Loading branch information
vchelaru committed Jun 23, 2017
1 parent 5ee2b99 commit 02fd4e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Gum/Plugins/VariableGrid/PropertyGridManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ private void ResetVariableToDefault(StateReferencingInstanceMember srim)
if (SelectedState.Self.SelectedInstance != null)
{
affectsTreeView = variableName == "Parent";
variableName = SelectedState.Self.SelectedInstance.Name + "." + variableName;
//variableName = SelectedState.Self.SelectedInstance.Name + "." + variableName;

shouldReset = true;
}
Expand All @@ -724,7 +724,7 @@ private void ResetVariableToDefault(StateReferencingInstanceMember srim)
MessageBox.Show(message);
shouldReset = false;
}
};
}

if (shouldReset)
{
Expand Down
10 changes: 7 additions & 3 deletions Gum/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
// - Variables on states inside of categories cannot be made default anymore
// - Variables in states inidde of categories must be made default with an X button shown when selecting the category.
// - Added support for instance members to undo their Make Default command.
// -
[assembly: AssemblyVersion("0.8.6.0")]
[assembly: AssemblyFileVersion("0.8.6.0")]
// 0.8.6.1
// - Removed ability to rename/remove default state.
// - Fixed font rendering bug which would offset centered fonts on the Y axis.
// 0.8.6.2
// - Fixed variables not propagating to sibling states in a category when editing in the wireframe window.
[assembly: AssemblyVersion("0.8.6.2")]
[assembly: AssemblyFileVersion("0.8.6.2")]
5 changes: 5 additions & 0 deletions Gum/Wireframe/EditingManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Gum.RenderingLibrary;
using RenderingLibrary.Math;
using Microsoft.Xna.Framework;
using Gum.PropertyGridHelpers;

namespace Gum.Wireframe
{
Expand Down Expand Up @@ -1016,6 +1017,9 @@ private float ModifyVariable(string baseVariableName, float modificationAmount,

ipso.SetProperty(baseVariableName, newValue);

SetVariableLogic.Self.PropagateVariablesInCategory(nameWithInstance);


return newValue;
}
else
Expand Down Expand Up @@ -1044,6 +1048,7 @@ private float ModifyVariable(string baseVariableName, float modificationAmount,
var ipso = WireframeObjectManager.Self.GetRepresentation(elementSave);
ipso.SetProperty(baseVariableName, newValue);

SetVariableLogic.Self.PropagateVariablesInCategory(baseVariableName);

return newValue;
}
Expand Down

0 comments on commit 02fd4e3

Please sign in to comment.