Skip to content

Commit

Permalink
UI Fixes, Undo Fix, & Layer Add
Browse files Browse the repository at this point in the history
* Tweaked the UI of Actor to Rail Link and Local Links window
* Fixed selecting Tile Units, Rails, and Global Links via the UI windows
* Fixed batch undo when deleting multiple objects
* (Experimental WIP) Added button to add new layers
  • Loading branch information
DonavinDraws committed Feb 16, 2024
1 parent 7538146 commit 17ac2ae
Show file tree
Hide file tree
Showing 6 changed files with 254 additions and 153 deletions.
2 changes: 1 addition & 1 deletion Fushigi/course/Course.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void Save()

foreach (CourseArea area in mAreas)
{
refArr.AddNodeToArray(BymlUtil.CreateNode<string>("", $"Work/Stage/StageParam/{area.GetName()}.game__stage__StageParam.gyml"));
refArr.AddNodeToArray(BymlUtil.CreateNode($"Work/Stage/StageParam/{area.GetName()}.game__stage__StageParam.gyml"));
}

stageParamRoot.AddNode(BymlNodeId.Array, refArr, "RefStages");
Expand Down
12 changes: 6 additions & 6 deletions Fushigi/course/CourseRail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,17 @@ public BymlHashTable BuildNode()
if (mIsCurve)
{
BymlArrayNode controlNode = new(3);
controlNode.AddNodeToArray(BymlUtil.CreateNode<float>("X", mControl.mTranslate.X));
controlNode.AddNodeToArray(BymlUtil.CreateNode<float>("Y", mControl.mTranslate.Y));
controlNode.AddNodeToArray(BymlUtil.CreateNode<float>("Z", mControl.mTranslate.Z));
controlNode.AddNodeToArray(BymlUtil.CreateNode(mControl.mTranslate.X));
controlNode.AddNodeToArray(BymlUtil.CreateNode( mControl.mTranslate.Y));
controlNode.AddNodeToArray(BymlUtil.CreateNode(mControl.mTranslate.Z));

tbl.AddNode(BymlNodeId.Array, controlNode, "Control1");
}

BymlArrayNode translateNode = new(3);
translateNode.AddNodeToArray(BymlUtil.CreateNode<float>("X", mTranslate.X));
translateNode.AddNodeToArray(BymlUtil.CreateNode<float>("Y", mTranslate.Y));
translateNode.AddNodeToArray(BymlUtil.CreateNode<float>("Z", mTranslate.Z));
translateNode.AddNodeToArray(BymlUtil.CreateNode(mTranslate.X));
translateNode.AddNodeToArray(BymlUtil.CreateNode(mTranslate.Y));
translateNode.AddNodeToArray(BymlUtil.CreateNode(mTranslate.Z));

tbl.AddNode(BymlNodeId.Array, translateNode, "Translate");

Expand Down
10 changes: 6 additions & 4 deletions Fushigi/course/distance_view/DistantViewManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public class DistantViewManager
{
private Dictionary<string, Matrix4x4> LayerMatrices = new Dictionary<string, Matrix4x4>();

private DVLayerParamTable ParamTable = new DVLayerParamTable();
private DVLayerParamTable LvlParamTable = new DVLayerParamTable();
public static DVLayerParamTable ParamTable = new DVLayerParamTable();

private CourseActor DVLocator;

Expand All @@ -28,6 +29,7 @@ public DistantViewManager(CourseArea area)
public void PrepareDVLocator(CourseArea area)
{
ParamTable.LoadDefault();
LvlParamTable = ParamTable;

foreach (var actor in area.GetActors())
{
Expand All @@ -43,13 +45,13 @@ public void PrepareDVLocator(CourseArea area)
{
string layer_param = (string)DVLocator.mActorParameters["DVLayerParamName"];
if (!string.IsNullOrEmpty(layer_param))
ParamTable.Load(layer_param);
LvlParamTable.Load(layer_param);
}
}
}

LayerMatrices.Clear();
foreach (var layer in this.ParamTable.Layers)
foreach (var layer in this.LvlParamTable.Layers)
LayerMatrices.Add(layer.Key, Matrix4x4.Identity);
}

Expand All @@ -61,7 +63,7 @@ public void UpdateMatrix(string layer, ref Matrix4x4 matrix)

public void Calc(Vector3 camera_pos)
{
foreach (var layer in this.ParamTable.Layers.Keys)
foreach (var layer in this.LvlParamTable.Layers.Keys)
{
var scroll_config = ParamTable.Layers[layer];
var locator_pos = DVLocator != null ? DVLocator.mTranslation : Vector3.Zero;
Expand Down
2 changes: 1 addition & 1 deletion Fushigi/ui/EditContextBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void Commit(string name)

public ICommittable BeginBatchAction()
{
mCurrentActionBatch = [];
mCurrentActionBatch ??= [];
var batchAction = new BatchAction(this);
mNestedBatchActions.Push(batchAction);
return batchAction;
Expand Down
Loading

0 comments on commit 17ac2ae

Please sign in to comment.