Make chatroom icon go to profile

This commit is contained in:
2025-09-09 23:17:22 -07:00
parent 79e37ac98b
commit 2c49d6078a
2 changed files with 181 additions and 128 deletions

View File

@@ -914,6 +914,7 @@ GameObject:
- component: {fileID: 97705055}
- component: {fileID: 97705057}
- component: {fileID: 97705056}
- component: {fileID: 97705058}
m_Layer: 5
m_Name: PlayerIcon
m_TagString: Untagged
@@ -961,7 +962,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 6534417478244952628, guid: dbf71fe5f2caad1409da64bdbb781eb5, type: 3}
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
@@ -979,6 +980,50 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 97705054}
m_CullTransparentMesh: 1
--- !u!114 &97705058
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 97705054}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Button
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 97705056}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &108104528
GameObject:
m_ObjectHideFlags: 0
@@ -3351,6 +3396,47 @@ MonoBehaviour:
invert: 1
addMore: {r: 0, g: 0, b: 0, a: 0}
reverseAdd: 0
--- !u!21 &327946746
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI/RoundedCorners/RoundedCorners
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ColorMask: 15
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UseUIAlphaClip: 0
m_Colors:
- _OuterUV: {r: 0, g: 0, b: 1, a: 1}
- _WidthHeightRadius: {r: 1180, g: 75, b: 20, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!1 &347285537
GameObject:
m_ObjectHideFlags: 0
@@ -4305,6 +4391,7 @@ MonoBehaviour:
content: {fileID: 1822440541}
sampleObject: {fileID: 432996040}
downButton: {fileID: 1187894098}
profilePrefab: {fileID: 3162524169402907368, guid: ed502784d1f0b48ee8e614eb6d09f2fb, type: 3}
optionsPanel: {fileID: 438920397}
optionsPanelExitButton: {fileID: 1818490499}
optionsPanelDeleteButton: {fileID: 354765674}
@@ -5789,6 +5876,47 @@ MonoBehaviour:
invert: 0
addMore: {r: 0, g: 0, b: 0, a: 0}
reverseAdd: 0
--- !u!21 &700485377
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI/RoundedCorners/RoundedCorners
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ColorMask: 15
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UseUIAlphaClip: 0
m_Colors:
- _OuterUV: {r: 0, g: 0, b: 1, a: 1}
- _WidthHeightRadius: {r: 1180, g: 75, b: 20, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!1 &720440146
GameObject:
m_ObjectHideFlags: 0
@@ -6630,7 +6758,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
m_Material: {fileID: 1795208740}
m_Material: {fileID: 1650439183}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
@@ -6949,7 +7077,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
m_Material: {fileID: 1790352887}
m_Material: {fileID: 327946746}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
@@ -7159,47 +7287,6 @@ MonoBehaviour:
invert: 0
addMore: {r: 0, g: 0, b: 0, a: 0}
reverseAdd: 0
--- !u!21 &1038294227
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI/RoundedCorners/RoundedCorners
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ColorMask: 15
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UseUIAlphaClip: 0
m_Colors:
- _OuterUV: {r: 0, g: 0, b: 1, a: 1}
- _WidthHeightRadius: {r: 1180, g: 75, b: 20, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!1 &1057045262
GameObject:
m_ObjectHideFlags: 0
@@ -7774,7 +7861,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
m_Material: {fileID: 1038294227}
m_Material: {fileID: 700485377}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
@@ -9696,6 +9783,47 @@ MonoBehaviour:
invert: 1
addMore: {r: 0, g: 0, b: 0, a: 0}
reverseAdd: 0
--- !u!21 &1650439183
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI/RoundedCorners/RoundedCorners
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ColorMask: 15
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UseUIAlphaClip: 0
m_Colors:
- _OuterUV: {r: 0, g: 0, b: 1, a: 1}
- _WidthHeightRadius: {r: 1180, g: 75, b: 20, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!1 &1664916833
GameObject:
m_ObjectHideFlags: 0
@@ -10338,88 +10466,6 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!21 &1790352887
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI/RoundedCorners/RoundedCorners
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ColorMask: 15
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UseUIAlphaClip: 0
m_Colors:
- _OuterUV: {r: 0, g: 0, b: 1, a: 1}
- _WidthHeightRadius: {r: 1180, g: 75, b: 20, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!21 &1795208740
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI/RoundedCorners/RoundedCorners
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ColorMask: 15
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UseUIAlphaClip: 0
m_Colors:
- _OuterUV: {r: 0, g: 0, b: 1, a: 1}
- _WidthHeightRadius: {r: 1180, g: 75, b: 20, a: 0}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!1 &1808945141
GameObject:
m_ObjectHideFlags: 0

View File

@@ -9,7 +9,6 @@ using Newtonsoft.Json.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class ChatroomMenu : MonoBehaviour
@@ -28,6 +27,7 @@ public class ChatroomMenu : MonoBehaviour
private bool shouldScrollToBottom = true;
public Button downButton;
private bool isPaused;
public ProfileMenu profilePrefab;
public GameObject optionsPanel;
public Button optionsPanelExitButton;
@@ -418,6 +418,7 @@ public class ChatroomMenu : MonoBehaviour
var bgImg = rowInfo.transform.GetChild(0).GetComponent<Image>();
var usernameText = rowInfo.transform.GetChild(1).GetComponent<TMP_Text>();
var playerIcon = rowInfo.transform.GetChild(2).GetComponent<Image>();
var playerIconButton = rowInfo.transform.GetChild(2).GetComponent<Button>();
var playerOverlayIcon = playerIcon.transform.GetChild(0).GetComponent<Image>();
var messageText = rowInfo.transform.GetChild(3).GetComponent<TMP_Text>();
var optionsButton = rowInfo.transform.GetChild(4).GetComponent<Button>();
@@ -464,6 +465,12 @@ public class ChatroomMenu : MonoBehaviour
Tools.RenderFromBase64(customIcons[message.CustomIcon], playerIcon);
playerOverlayIcon.gameObject.SetActive(false);
}
playerIconButton.onClick.AddListener(async () =>
{
var clone = Instantiate(profilePrefab.gameObject, profilePrefab.gameObject.transform.parent);
clone.SetActive(true);
await clone.GetComponent<ProfileMenu>().Init(message.UserID);
});
optionsButton.onClick.AddListener(() => OptionsButtonClick(message, localUserId ?? 0));
rowInfo.name = "ChatroomRow_" + message.ID;
var entryComponet = rowInfo.AddComponent<ChatroomMenuEntry>();