Skip to content

Commit

Permalink
- Fixed bluff tokens having name fields - Fixed helper tokens drawing…
Browse files Browse the repository at this point in the history
… under role tokens
  • Loading branch information
ddbrown30 committed Jun 29, 2020
1 parent 017bc69 commit cd56a3a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 8 deletions.
46 changes: 41 additions & 5 deletions Assets/Scenes/GrimoireScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1927,8 +1927,8 @@ MonoBehaviour:
ContextMenuPrefab: {fileID: 11433316, guid: e3ac8d34da2d71c48bce3808dbb04409, type: 3}
RoleTokenAttach: {fileID: 763230963}
HelperTokenAttach: {fileID: 1970541123}
HelperTokenFreeTransform: {fileID: 1077086681}
BluffTokenAttach: {fileID: 1595591120}
AlignmentTokenAttach: {fileID: 0}
HoverImage: {fileID: 1147585650}
RoleScaleSlider: {fileID: 1966428203141695017}
HelperScaleSlider: {fileID: 1966428202172496131}
Expand Down Expand Up @@ -4187,7 +4187,7 @@ RectTransform:
m_Children:
- {fileID: 234409207}
m_Father: {fileID: 1740795181}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -10656,6 +10656,41 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1051836408}
m_CullTransparentMesh: 0
--- !u!1 &1077086681
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1077086682}
m_Layer: 5
m_Name: HelperTokenFreeTransform
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1077086682
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1077086681}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1740795181}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -0.000061035156, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1085039423
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -11102,7 +11137,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1740795181}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -15828,6 +15863,7 @@ RectTransform:
- {fileID: 763230964}
- {fileID: 1970541124}
- {fileID: 1595591121}
- {fileID: 1077086682}
- {fileID: 1957039011}
- {fileID: 1147585649}
- {fileID: 387258122}
Expand Down Expand Up @@ -16746,7 +16782,7 @@ RectTransform:
- {fileID: 740535600}
- {fileID: 1244910099}
m_Father: {fileID: 1740795181}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -17119,7 +17155,7 @@ RectTransform:
- {fileID: 880482579}
- {fileID: 1103299348}
m_Father: {fileID: 1740795181}
m_RootOrder: 9
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/GrimoireManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class GrimoireManager : MonoBehaviour, IPointerClickHandler

public GameObject RoleTokenAttach;
public GameObject HelperTokenAttach;
public GameObject HelperTokenFreeTransform;
public GameObject BluffTokenAttach;
public GameObject AlignmentTokenAttach;

public Image HoverImage;

Expand Down Expand Up @@ -326,7 +326,7 @@ public void SetPlayerNamesVisible(bool visible)
PlayerNamesVisible = visible;
foreach (var token in RoleTokens)
{
token.NameText.gameObject.SetActive(visible);
token.SetPlayerNameVisible(visible);
}
}

Expand Down
9 changes: 9 additions & 0 deletions Assets/Scripts/GrimoireToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ public void SetIsBluffToken()
{
IsBluffToken = true;
GetComponentInChildren<Button>().enabled = false;
NameText.gameObject.SetActive(false);
}

public void SetPlayerNameVisible(bool visible)
{
if (IsBluffToken)
return;

NameText.gameObject.SetActive(visible);
}

public void SetRoleTokenScale(float scaleNormalized)
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/HelperToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class HelperToken : MonoBehaviour, IDragHandler

public void OnDrag(PointerEventData eventData)
{
gameObject.transform.SetParent(GrimoireManager.Instance.transform);
gameObject.transform.SetParent(GrimoireManager.Instance.HelperTokenFreeTransform.transform);
gameObject.transform.transform.position = Input.mousePosition;
GetComponent<RectTransform>().SetAsLastSibling();

Expand Down

0 comments on commit cd56a3a

Please sign in to comment.