1
0
mirror of synced 2024-11-14 11:07:39 +01:00

Fix visibilty anim groups for layout animations

This commit is contained in:
KillzXGaming 2019-10-20 15:26:25 -04:00
parent 999a0c76ae
commit 2205174ffe
5 changed files with 84 additions and 23 deletions

View File

@ -96,17 +96,17 @@ namespace LayoutBXLYT
if (Runtime.LayoutEditor.AnimationEditMode) if (Runtime.LayoutEditor.AnimationEditMode)
{ {
//Change any UI that can be keyed or is keyed //Change any UI that can be keyed or is keyed
tranXUD.ReloadTheme(); tranXUD.SetUnkeyedTheme();
tranYUD.ReloadTheme(); tranYUD.SetUnkeyedTheme();
tranZUD.ReloadTheme(); tranZUD.SetUnkeyedTheme();
rotXUD.ReloadTheme(); rotXUD.SetUnkeyedTheme();
rotYUD.ReloadTheme(); rotYUD.SetUnkeyedTheme();
rotZUD.ReloadTheme(); rotZUD.SetUnkeyedTheme();
scaleXUD.ReloadTheme(); scaleXUD.SetUnkeyedTheme();
scaleYUD.ReloadTheme(); scaleYUD.SetUnkeyedTheme();
sizeXUD.ReloadTheme(); sizeXUD.SetUnkeyedTheme();
sizeYUD.ReloadTheme(); sizeYUD.SetUnkeyedTheme();
alphaUD.ReloadTheme(); alphaUD.SetUnkeyedTheme();
if (ActivePane.animController.PaneSRT.ContainsKey(LPATarget.TranslateX)) if (ActivePane.animController.PaneSRT.ContainsKey(LPATarget.TranslateX))
tranXUD.SetKeyedTheme(); tranXUD.SetKeyedTheme();
@ -121,9 +121,16 @@ namespace LayoutBXLYT
rotYUD.SetKeyedTheme(); rotYUD.SetKeyedTheme();
if (ActivePane.animController.PaneSRT.ContainsKey(LPATarget.RotateZ)) if (ActivePane.animController.PaneSRT.ContainsKey(LPATarget.RotateZ))
rotZUD.SetKeyedTheme(); rotZUD.SetKeyedTheme();
paneVisibleChk.ShowBorder = true;
paneVisibleChk.BorderColor = Color.Red;
paneVisibleChk.Refresh();
} }
else else
{ {
paneVisibleChk.ShowBorder = false;
paneVisibleChk.Refresh();
//Set UI to default theme colors //Set UI to default theme colors
tranXUD.ReloadTheme(); tranXUD.ReloadTheme();
tranYUD.ReloadTheme(); tranYUD.ReloadTheme();

View File

@ -285,6 +285,9 @@ namespace LayoutBXLYT
if (e is TreeViewEventArgs) { if (e is TreeViewEventArgs) {
var node = ((TreeViewEventArgs)e).Node; var node = ((TreeViewEventArgs)e).Node;
if (Runtime.LayoutEditor.AnimationEditMode)
OnSelectedAnimationMode();
if (!isSelectedInViewer) if (!isSelectedInViewer)
ActiveViewport?.SelectedPanes.Clear(); ActiveViewport?.SelectedPanes.Clear();
@ -315,6 +318,13 @@ namespace LayoutBXLYT
} }
} }
private void OnSelectedAnimationMode()
{
if (AnimationPanel == null) return;
}
public void UpdateViewport() { public void UpdateViewport() {
ActiveViewport?.UpdateViewport(); ActiveViewport?.UpdateViewport();
} }
@ -1123,7 +1133,9 @@ namespace LayoutBXLYT
{ {
Runtime.LayoutEditor.AnimationEditMode = editorModeCB.SelectedIndex == 1; Runtime.LayoutEditor.AnimationEditMode = editorModeCB.SelectedIndex == 1;
if (Runtime.LayoutEditor.AnimationEditMode) if (Runtime.LayoutEditor.AnimationEditMode)
{
chkAutoKey.Enabled = true; chkAutoKey.Enabled = true;
}
else else
chkAutoKey.Enabled = false; chkAutoKey.Enabled = false;

View File

@ -411,7 +411,7 @@ namespace LayoutBXLYT
private void RenderPanes(BxlytShader shader, BasePane pane, bool isRoot, byte parentAlpha, bool parentAlphaInfluence, BasePane partPane = null, int stage = 0) private void RenderPanes(BxlytShader shader, BasePane pane, bool isRoot, byte parentAlpha, bool parentAlphaInfluence, BasePane partPane = null, int stage = 0)
{ {
if (!pane.DisplayInEditor || !pane.animController.Visibile) if (!pane.DisplayInEditor)
return; return;
GL.PushMatrix(); GL.PushMatrix();
@ -472,7 +472,7 @@ namespace LayoutBXLYT
{ {
bool isSelected = SelectedPanes.Contains(pane); bool isSelected = SelectedPanes.Contains(pane);
if (!pane.Visible) if (!pane.Visible && !pane.animController.Visibile)
DrawDefaultPane(shader, pane, isSelected); DrawDefaultPane(shader, pane, isSelected);
else if (pane is IPicturePane) else if (pane is IPicturePane)
BxlytToGL.DrawPictureBox(pane, GameWindow, effectiveAlpha, Textures, isSelected); BxlytToGL.DrawPictureBox(pane, GameWindow, effectiveAlpha, Textures, isSelected);
@ -1234,6 +1234,12 @@ namespace LayoutBXLYT
posY = pane.Translate.Y - pickMouse.Y; posY = pane.Translate.Y - pickMouse.Y;
} }
if (Runtime.LayoutEditor.AnimationEditMode)
{
}
else
{
if (!Runtime.LayoutEditor.TransformChidlren) if (!Runtime.LayoutEditor.TransformChidlren)
pane.KeepChildrenTransform(posX, posY); pane.KeepChildrenTransform(posX, posY);
@ -1253,6 +1259,7 @@ namespace LayoutBXLYT
} }
} }
} }
}
else if (!showSelectionBox) else if (!showSelectionBox)
{ {
var selectionBox = GetSelectedPanesBounding(SelectedPanes); var selectionBox = GetSelectedPanesBounding(SelectedPanes);

View File

@ -1251,6 +1251,15 @@ namespace BarSlider
Controls.Add(textBox); Controls.Add(textBox);
} }
private bool ShowUnkeyedBorder = false;
public void SetUnkeyedTheme()
{
ReloadTheme();
ShowUnkeyedBorder = true;
}
public void SetKeyedTheme() public void SetKeyedTheme()
{ {
BackColor = FormThemes.BaseTheme.KeyFrameColor; BackColor = FormThemes.BaseTheme.KeyFrameColor;
@ -1266,6 +1275,8 @@ namespace BarSlider
public void ReloadTheme() public void ReloadTheme()
{ {
ShowUnkeyedBorder = false;
BackColor = FormThemes.BaseTheme.ValueBarSliderElapseBottmColor; BackColor = FormThemes.BaseTheme.ValueBarSliderElapseBottmColor;
ThumbPenColor = FormThemes.BaseTheme.ValueBarSliderElapseBottmColor; ThumbPenColor = FormThemes.BaseTheme.ValueBarSliderElapseBottmColor;
@ -1347,6 +1358,15 @@ namespace BarSlider
_elapsedInnerColor); _elapsedInnerColor);
} }
} }
if (ShowUnkeyedBorder)
{
e.Graphics.DrawRectangle(new Pen(Color.Red), new Rectangle(
ClientRectangle.Location.X,
ClientRectangle.Location.Y,
ClientRectangle.Width - 1,
ClientRectangle.Height- 1));
}
} }
/// <summary> /// <summary>

View File

@ -21,6 +21,12 @@ namespace Toolbox.Library.Forms
/// </summary> /// </summary>
private Image TickTock => Properties.Resources.CheckMark; private Image TickTock => Properties.Resources.CheckMark;
public Color BorderColor = Color.Black;
public int BorderSize = 1;
public bool ShowBorder = false;
public STCheckBox() public STCheckBox()
{ {
SetColor(); SetColor();
@ -59,6 +65,15 @@ namespace Toolbox.Library.Forms
{ {
e.Graphics.DrawImage(this.TickTock, 2, 2, 12, 12); e.Graphics.DrawImage(this.TickTock, 2, 2, 12, 12);
} }
if (ShowBorder)
{
e.Graphics.DrawRectangle(new Pen(BorderColor), new Rectangle(
ClientRectangle.Location.X,
ClientRectangle.Location.Y,
ClientRectangle.Width - BorderSize,
ClientRectangle.Height - BorderSize));
}
} }
/// <summary> /// <summary>
/// Sets the size of the layout to 16x;16x /// Sets the size of the layout to 16x;16x