Skip to content

Commit

Permalink
Fix textwindow margins not being applied via mod functions
Browse files Browse the repository at this point in the history
  • Loading branch information
drojf committed Feb 5, 2024
1 parent 562cca0 commit 248f603
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Assets.Scripts.Core.Buriko/BurikoScriptFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2515,9 +2515,7 @@ private BurikoVariable OperationSetWindowMargins()
int num2 = ReadVariable().IntValue();
int num3 = ReadVariable().IntValue();
int num4 = ReadVariable().IntValue();
gameSystem.TextController.WindowMargins = new Vector4(num, num2, num3, num4);
gameSystem.TextController.WindowMarginsJp = new Vector4(num, num2, num3, num4);
gameSystem.TextController.RefreshMargins();
gameSystem.MainUIController.SetWindowMargins(num, num2, num3, num4);
return BurikoVariable.Null;
}

Expand Down
5 changes: 4 additions & 1 deletion Assets.Scripts.UI/MainUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ public void SetWindowSize(int x, int y)

public void SetWindowMargins(int left, int top, int right, int bottom)
{
TextWindow.margin = new Vector4(left, top, right, bottom);
Vector4 newMargin = new Vector4(left, top, right, bottom);
gameSystem.TextController.WindowMargins = newMargin;
gameSystem.TextController.WindowMarginsJp = newMargin;
gameSystem.TextController.RefreshMargins();
}

public TMP_FontAsset GetEnglishFont()
Expand Down

0 comments on commit 248f603

Please sign in to comment.