Skip to content

Commit

Permalink
[HaRepacker] Use text editor for WzStringProperty ending with '.json'
Browse files Browse the repository at this point in the history
  • Loading branch information
LastBattle committed Dec 10, 2020
1 parent 445cd28 commit c90d2b1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion HaCreator/MapEditor/Board.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void RenderBoard(SpriteBatch sprite)
}
}

public void CreateLayers()
public void CreateMapLayers()
{
for (int i = 0; i <= MapConstants.MaxMapLayers; i++)
{
Expand Down
4 changes: 2 additions & 2 deletions HaCreator/MapEditor/MultiBoard.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public Board CreateBoard(Microsoft.Xna.Framework.Point mapSize, Point centerPoin
{
Board newBoard = new Board(mapSize, centerPoint, this, menu, ApplicationSettings.theoreticalVisibleTypes, ApplicationSettings.theoreticalEditedTypes);
boards.Add(newBoard);
newBoard.CreateLayers();
newBoard.CreateMapLayers();
return newBoard;
}
}
Expand All @@ -254,7 +254,7 @@ public Board CreateHiddenBoard(Point mapSize, Point centerPoint)
lock (this)
{
Board newBoard = new Board(mapSize, centerPoint, this, null, ItemTypes.None, ItemTypes.None);
newBoard.CreateLayers();
newBoard.CreateMapLayers();
return newBoard;
}
}
Expand Down
14 changes: 10 additions & 4 deletions HaRepacker/GUI/Panels/MainPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -814,16 +814,16 @@ private void TextEditor_SaveButtonClicked(object sender, EventArgs e)
}
else if (obj is WzStringProperty stringProp)
{
if (stringProp.IsSpineAtlasResources)
{
//if (stringProp.IsSpineAtlasResources)
// {
string setText = textEditor.textEditor.Text;

stringProp.Value = setText;
}
/* }
else
{
throw new NotSupportedException("Usage of TextEditor for non-spine WzStringProperty.");
}
}*/
}
}

Expand Down Expand Up @@ -1460,6 +1460,12 @@ private void ShowObjectValue(WzObject obj)
thread.Start();
thread.Join();
}
else if (stringObj.Name.EndsWith(".json")) // Map001.wz/Back/BM3_3.img/spine/skeleton.json
{
textEditor.Visibility = Visibility.Visible;
textEditor.SetHighlightingDefinitionIndex(20); // json
textEditor.textEditor.Text = obj.ToString();
}
else
{
// Value
Expand Down

0 comments on commit c90d2b1

Please sign in to comment.