fix emblem taking into account
This commit is contained in:
@@ -10,7 +10,7 @@ namespace UI
|
|||||||
private TMP_Text _traitName;
|
private TMP_Text _traitName;
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private TMP_Text _traitEmblemCount;
|
private TMP_InputField _traitEmblemCount;
|
||||||
|
|
||||||
public string DisplayName { get; }
|
public string DisplayName { get; }
|
||||||
|
|
||||||
@@ -25,10 +25,24 @@ namespace UI
|
|||||||
|
|
||||||
public int GetEmblemCount()
|
public int GetEmblemCount()
|
||||||
{
|
{
|
||||||
int count;
|
int count = 0;
|
||||||
int.TryParse(_traitEmblemCount.text, out count);
|
|
||||||
if(count != 0)
|
// Check if the text field has valid content
|
||||||
Debug.Log($"Trait {Trait} has count {count}");
|
if (!string.IsNullOrEmpty(_traitEmblemCount.text))
|
||||||
|
{
|
||||||
|
// Try to parse the text to an integer
|
||||||
|
if (int.TryParse(_traitEmblemCount.text, out count))
|
||||||
|
{
|
||||||
|
if (count != 0)
|
||||||
|
Debug.Log($"Trait {Trait} has count {count}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"Failed to parse emblem count text '{_traitEmblemCount.text}' for trait {Trait}");
|
||||||
|
count = 0; // Ensure count is 0 if parsing fails
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -418,14 +418,14 @@ MonoBehaviour:
|
|||||||
m_VerticalScrollbarEventHandler: {fileID: 0}
|
m_VerticalScrollbarEventHandler: {fileID: 0}
|
||||||
m_LayoutGroup: {fileID: 0}
|
m_LayoutGroup: {fileID: 0}
|
||||||
m_ScrollSensitivity: 1
|
m_ScrollSensitivity: 1
|
||||||
m_ContentType: 0
|
m_ContentType: 2
|
||||||
m_InputType: 0
|
m_InputType: 0
|
||||||
m_AsteriskChar: 42
|
m_AsteriskChar: 42
|
||||||
m_KeyboardType: 0
|
m_KeyboardType: 4
|
||||||
m_LineType: 0
|
m_LineType: 0
|
||||||
m_HideMobileInput: 0
|
m_HideMobileInput: 0
|
||||||
m_HideSoftKeyboard: 0
|
m_HideSoftKeyboard: 0
|
||||||
m_CharacterValidation: 0
|
m_CharacterValidation: 2
|
||||||
m_RegexValue:
|
m_RegexValue:
|
||||||
m_GlobalPointSize: 14
|
m_GlobalPointSize: 14
|
||||||
m_CharacterLimit: 0
|
m_CharacterLimit: 0
|
||||||
@@ -614,7 +614,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
_traitName: {fileID: 4029719132024568495}
|
_traitName: {fileID: 4029719132024568495}
|
||||||
_traitEmblemCount: {fileID: 6579458243723793249}
|
_traitEmblemCount: {fileID: 5836336683357219304}
|
||||||
--- !u!1 &6898134698727560530
|
--- !u!1 &6898134698727560530
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user