Skip to content

Commit

Permalink
Merge pull request #23 from eviltwo/0.7.1-dev
Browse files Browse the repository at this point in the history
0.7.1
  • Loading branch information
eviltwo committed Jul 6, 2024
2 parents 13046cd + f94dff2 commit 7c27731
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 19 deletions.
6 changes: 6 additions & 0 deletions InputGlyphs/Assets/InputGlyphs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [0.7.1] - 2024-07-06
### Added
- Added text tag hint.
### Changed
- Remove prefix input_ from text tag. input_Move -> Move

## [0.7.0] - 2024-07-06
### Added
- Added duo player sample scene.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Player 1 moves with <sprite name=input_Move> and attacks with <sprite name=input_Attack>
m_text: Player 1 moves with <sprite name=Move> and attacks with <sprite name=Attack>
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
Expand Down Expand Up @@ -2434,7 +2434,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Player 2 moves with <sprite name=input_Move> and attacks with <sprite name=input_Attack>
m_text: Player 2 moves with <sprite name=Move> and attacks with <sprite name=Attack>
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Player 1 moves with <sprite name=input_Move> and attacks with <sprite name=input_Attack>
m_text: Player 1 moves with <sprite name=Move> and attacks with <sprite name=Attack>
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Player 1 moves with <sprite name=input_Move> and attacks with <sprite name=input_Attack>
m_text: Player 1 moves with <sprite name=Move> and attacks with <sprite name=Attack>
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#if ENABLE_INPUT_SYSTEM && SUPPORT_TMPRO
using System.Text;
using UnityEditor;
using UnityEngine;

namespace InputGlyphs.Display.Editor
{
[CustomEditor(typeof(InputGlyphText))]
public class InputGlyphTextEditor : UnityEditor.Editor
{
private StringBuilder _stringBuilder = new StringBuilder();

public override void OnInspectorGUI()
{
base.OnInspectorGUI();

var glyphText = (InputGlyphText)target;

EditorGUILayout.Space();
EditorGUILayout.LabelField("Enter the following tag into the text:");
using (new EditorGUI.IndentLevelScope())
{
for (int i = 0; i < glyphText.InputActionReferences.Length; i++)
{
if (glyphText.InputActionReferences[i] == null)
{
continue;
}
using (new EditorGUILayout.HorizontalScope())
{
_stringBuilder.Clear();
_stringBuilder.Append("<sprite name=");
_stringBuilder.Append(glyphText.InputActionReferences[i].action.name);
_stringBuilder.Append(">");
EditorGUILayout.LabelField(_stringBuilder.ToString());
if (GUILayout.Button("Copy"))
{
EditorGUIUtility.systemCopyBuffer = _stringBuilder.ToString();
}
}
}
}
}
}
}

#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "InputGlyphs.Display.TextMeshPro.Editor",
"rootNamespace": "",
"references": [
"GUID:75469ad4d38634e559750d17036d5f7c",
"GUID:1f6dfe89326c1df4db8a18418293db90"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": false,
"defineConstraints": [],
"versionDefines": [
{
"name": "com.unity.textmeshpro",
"expression": "",
"define": "SUPPORT_TMPRO"
}
],
"noEngineReferences": false
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private void SetGlyphsToSpriteAsset(IReadOnlyList<Texture2D> actionTextures, IRe

// Create character
var glyphCharacter = new TMP_SpriteCharacter(0, spriteGlyph);
glyphCharacter.name = $"input_{actionTextureIndex.Item1}";
glyphCharacter.name = actionTextureIndex.Item1;
_sharedSpriteAsset.spriteCharacterTable.Add(glyphCharacter);
}
_sharedSpriteAsset.UpdateLookupTables();
Expand Down
2 changes: 1 addition & 1 deletion InputGlyphs/Assets/InputGlyphs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.eviltwo.input-glyphs",
"displayName": "Input Glyphs",
"version": "0.7.0",
"version": "0.7.1",
"unity": "2022.3",
"description": "Displays glyphs (icons) of keyboard & mouse or controller buttons recognized by Unity's InputSystem.",
"author": {
Expand Down
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ Easy to use and extensible. Glyph images are taken from [Xelu's FREE Controller

![duo](https://github.com/eviltwo/InputGlyphs/assets/7721151/93cadf60-385d-44ea-86b5-50b2e4ba28f6)

|Feature|Status|
|Supported deveices|
|---|
|Keyboard & Mouse|
|Xbox controller|
|Playstation controller|
|Switch pro controller|

|Glyph display modules|
|---|
|Text Mesh Pro|
|UI Image|
|Sprite Renderer|


|Other contents|Status|
|---|:---:|
|Keyboard&Mouse||
|Xbox controller||
|PS controller||
|Switch pro controller||
|Steam input glyph API||
|||
|Sprite icon in text (TMPro)||
|UI Image||
|Sprite renderer||
|Multiple key||
|||
|Samples||
|Sample scenes||
|Useage document|writing|

# Required packages
Expand Down

0 comments on commit 7c27731

Please sign in to comment.