component NotificationWindowController { NotificationWindowModel m_Model; public NotificationWindowController () { m_Model = system.Layer_GetComponentByName("notification_window_with_image"); Player SelfPlayer = hsPlayerGet(); string SelfUserCode = SelfPlayer.GetCustomState("UserCode"); string SelfUserType = SelfPlayer.GetCustomState("UserType"); //Memo 初回ログイン(ゲスト)の入室ボタンが押されていない場合は、通知を入室後に設定する。 if(SelfUserType == "login" && !SelfUserCode.IsEmpty()){ FetchNotification(); }else{ // Cookie FirstInputUserName設定取得 string IsSpaceChatValid = hel_get_cookie_onEmptyStr("FirstInputUserName"); if(IsSpaceChatValid == "1"){ FetchNotification(); } } } public void FetchNotification(){ m_Model.FetchNotification(); } public void OnClickedButton(string LayerName, string ButtonName) { if(LayerName == "notification_window_with_image" || LayerName == "notification_window_with_no_image") { LayerBundle layer = hsLayerGet(LayerName); if(layer === null) return; if(ButtonName == "common_btn_close" || ButtonName == "common_btn_txt_close" || ButtonName == "common_dialog_base_common_bg") { layer.CallComponentMethod("NotificationWindowViewModel", "OnClickedCloseDialog", "notification_window_with_image"); layer.CallComponentMethod("NotificationWindowViewModel", "OnClickedCloseDialog", "notification_window_with_image_description"); layer.CallComponentMethod("NotificationWindowViewModel", "OnClickedCloseDialog", "notification_window_with_no_image"); layer.CallComponentMethod("NotificationWindowViewModel", "OnClickedCloseDialog", "notification_window_with_no_image_description"); //memo 通知モーダルを閉じた際に移動できるようにする。 Player player = hsPlayerGet(); player.SetControlEnabled(true); // 次のお知らせ取得API実行処理 // ※ない場合は何もしない m_Model.NextNotification(); hsCanvasResetToggleDefault("Toggle_Notification_Window_Checkbox"); } else if (ButtonName == "notification_checkbox_off") { layer.CallComponentMethod("NotificationWindowViewModel", "OnClickedCheckbox", ""); m_Model.AddHideNotification(); } else if (ButtonName == "notification_checkbox_on") { layer.CallComponentMethod("NotificationWindowViewModel", "OnClickedCheckbox", ""); m_Model.RemoveHideNotification(); } } } }