-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* FEATURE - Added TMP_Overflow and TMP_Alignment resize commands
- Loading branch information
randoman
committed
Sep 10, 2021
1 parent
adbef16
commit d9b60cb
Showing
18 changed files
with
181 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -673,6 +673,10 @@ The following types of commands exists: | |
* `UGUI_HorizontalOverflow(string mode)` - possible values: [wrap, overflow] | ||
* Commands that control vertical overflow (UGUI only): | ||
* `UGUI_VerticalOverflow(string mode)` - possible values: [truncate, overflow] | ||
* Commands to control overflow (TMP only): | ||
* `TMP_Overflow(string mode)` - [possible values](https://docs.unity3d.com/Packages/[email protected]/api/TMPro.TextOverflowModes.html) | ||
* Commands to control text alignment (TMP only): | ||
* `TMP_Alignment(string mode)` - [possible values](https://docs.unity3d.com/Packages/[email protected]/api/TMPro.TextAlignmentOptions.html) | ||
|
||
But stop you say! How would I determine the path to use? This plugin provides no way to easily determine this, but there are other plugins that will allow you to do this. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ public override string Version | |
{ | ||
get | ||
{ | ||
return "4.19.0"; | ||
return "4.20.0"; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/XUnity.AutoTranslator.Plugin.Core/UIResize/ITMP_Alignment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace XUnity.AutoTranslator.Plugin.Core.UIResize | ||
{ | ||
interface ITMP_Alignment | ||
{ | ||
int? GetMode(); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/XUnity.AutoTranslator.Plugin.Core/UIResize/ITMP_OverflowMode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace XUnity.AutoTranslator.Plugin.Core.UIResize | ||
{ | ||
interface ITMP_OverflowMode | ||
{ | ||
int? GetMode(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/XUnity.AutoTranslator.Plugin.Core/UIResize/TMP_Alignment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using XUnity.AutoTranslator.Plugin.Core.Utilities; | ||
using XUnity.Common.Constants; | ||
|
||
namespace XUnity.AutoTranslator.Plugin.Core.UIResize | ||
{ | ||
class TMP_Alignment : ITMP_Alignment | ||
{ | ||
private int? _mode; | ||
|
||
public TMP_Alignment( string[] args ) | ||
{ | ||
if( args.Length != 1 ) throw new ArgumentException( "TMP_Alignment requires one argument." ); | ||
|
||
_mode = (int)EnumHelper.GetValues( ClrTypes.TextAlignmentOptions, args[ 0 ] ); | ||
} | ||
|
||
public int? GetMode() | ||
{ | ||
return _mode; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/XUnity.AutoTranslator.Plugin.Core/UIResize/TMP_Overflow.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using XUnity.AutoTranslator.Plugin.Core.Utilities; | ||
using XUnity.Common.Constants; | ||
|
||
namespace XUnity.AutoTranslator.Plugin.Core.UIResize | ||
{ | ||
class TMP_Overflow : ITMP_OverflowMode | ||
{ | ||
private int? _mode; | ||
|
||
public TMP_Overflow( string[] args ) | ||
{ | ||
if( args.Length != 1 ) throw new ArgumentException( "TMP_Overflow requires one argument." ); | ||
|
||
_mode = (int)EnumHelper.GetValues( ClrTypes.TextOverflowModes, args[ 0 ] ); | ||
} | ||
|
||
public int? GetMode() | ||
{ | ||
return _mode; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters