component TCController { public void OnClickedButton(string LayerName, string ButtonName) { if(LayerName == "textchat_common" || LayerName == "mainmenu_webxr") { LayerBundle layer = hsLayerGet("textchat_common"); if(layer === null) return; if(ButtonName == "common_btn_close") { layer.CallComponentMethod("TCViewModel", "CloseTextChat", ""); } else if(ButtonName == "chat_tab_txt_chat_off") { layer.CallComponentMethod("TCViewModel", "SwitchTextChat", CHAT_TYPE_PUBLIC); } else if(ButtonName == "chat_tab_system_off") { layer.CallComponentMethod("TCViewModel", "SwitchTextChat", CHAT_TYPE_SYSTEM); } else if(ButtonName == "chat_btn_send") { layer.CallComponentMethod("TCViewModel", "ClickSendButton", ""); } else if(ButtonName == "chat_tab_prv_txt_chat_off") { layer.CallComponentMethod("TCViewModel", "SwitchTextChat", CHAT_TYPE_PRIVATE); } else if(ButtonName == "chat_tab_pub_txt_chat_off") { layer.CallComponentMethod("TCViewModel", "SwitchTextChat", CHAT_TYPE_PUBLIC); } else if(ButtonName == "chat_prv_txt_chat_pulldown_open") { layer.CallComponentMethod("TCViewModel", "ShowPrvChatPulldown", "true"); } else if(ButtonName == "chat_prv_txt_chat_pulldown_opened") { layer.CallComponentMethod("TCViewModel", "ShowPrvChatPulldown", "false"); } else if(ButtonName.IndexOf("dynamic_prvchat_pulldown_list_") != -1) { list nameSplit = ButtonName.Split("dynamic_prvchat_pulldown_list_"); if(nameSplit.Count() == 2){ layer.CallComponentMethod("TCViewModel", "SelectPlayerIndividualChatPulldown", nameSplit[1]); } } } else if(LayerName == CHAT_TYPE_PUBLIC || LayerName == CHAT_TYPE_PRIVATE) { LayerBundle layer = hsLayerGet("textchat_common"); if(layer === null) return; list ParamText = ButtonName.Split(":"); if(ParamText.Count < 3) return; string UserCode = ParamText[1]; string UserType = ParamText[2]; if(ButtonName.IndexOf("AvatarIcon_button") != -1) { if(UserType == "login") { layer.CallComponentMethod("TCViewModel", "ClickLoginUserIcon", UserCode); } else { layer.CallComponentMethod("TCViewModel", "ClickGuestUserIcon", UserCode); } } } } }