private static void ShowNewPanel() { if (CurrentPanel != null) { CurrentPanel.CloseOrSetInactive(); } if (Application.isPlaying && !EditorApplication.isPaused && MonKeyInternalSettings.Instance.PauseGameOnConsoleOpen) { pausedByMonkey = true; EditorApplication.isPaused = true; } var monkeyPanel = GetWindow <CommandConsoleWindow>(); monkeyPanel.wantsMouseMove = true; monkeyPanel.Show(); monkeyPanel.titleContent = new GUIContent(" MonKey", MonkeyStyle.Instance.MonkeyHead, "Uuuh! Uuuh!"); monkeyPanel.maxSize = new Vector2(WindowMaxWidth, WindowMaxHeight); monkeyPanel.minSize = new Vector2(WindowMinWidth, WindowMinHeight); CurrentPanel = monkeyPanel; SetFirstHistoryCommandSelected(); if (CurrentPanel != null) { CurrentPanel.isActiveMode = true; CurrentPanel.JustOpenedActiveMode = true; GetIsDockedInfo(); } }
private static void ActivatePanel() { if (Application.isPlaying && !EditorApplication.isPaused && MonKeyInternalSettings.Instance.PauseGameOnConsoleOpen) { pausedByMonkey = true; EditorApplication.isPaused = true; } CurrentPanel.isActiveMode = !CurrentPanel.isActiveMode; if (CurrentPanel.isActiveMode) { CurrentPanel.JustOpenedActiveMode = true; } ResetSearchTerms(); CurrentPanel.ScrollIndex = Vector2.zero; CurrentPanel.IsParametricMethodCompletion = false; CurrentPanel.DisplayNoResult = false; CurrentPanel.Focus(); CurrentPanel.Repaint(); if (CommandManager.Instance.CommandsByName.Count == 0) { CommandManager.Instance.OnEnable(); } }
public IEnumerator RespawnTimer() { while (timer > 0) { timer -= Time.deltaTime; if (team == PhotonTeams.Team.Red) { _redRespawnText.text = string.Format("{0:0}", timer); _redLoadingBar.fillAmount = timer / _respawnTimer; } else if (team == PhotonTeams.Team.Blue) { _blueRespawnText.text = string.Format("{0:0}", timer); _blueLoadingBar.fillAmount = timer / _respawnTimer; } yield return(null); } if (timer < 0) { _mainCamera.cullingMask = -1; RespawnStatus(false); currentPanel = CurrentPanel.GamePanel; ChangePanel(); timer = _respawnTimer; } }
private void OnRefreshPageCommand() { if (CurrentPanel != null) { CurrentPanel.InvalidateMeasure(); } }
public void ReloadEditor(bool DoUnload = false, bool SetType = false) { if (MainSplitContainer.Panel2.Controls[0] is CameraPanelBase CurrentPanel) { if (DoUnload) { CurrentPanel.UnLoadCamera(Cameras[PrevListID]); } else if (SetType) { Cameras[PrevListID].Type = CurrentPanel.CurrentCameraType; } string PanelKey = GetPanelKey(Cameras[PrevListID].Type); if (PanelKey.Equals(CurrentPanel.CameraType)) { CurrentPanel.LoadCamera(Cameras[PrevListID]); } else { MainSplitContainer.Panel2.Controls.Clear(); MainSplitContainer.Panel2.Controls.Add(PreBufferedPanels[PanelKey]); ((CameraPanelBase)MainSplitContainer.Panel2.Controls[0]).LoadCamera(Cameras[PrevListID]); } } }
public void RespawnPanelOn() { respawn = true; currentPanel = CurrentPanel.MenuPanel; ChangePanel(); RespawnStatus(true); _timerCoroutine = StartCoroutine(RespawnTimer()); }
void Start() { currentPanel = CurrentPanel.HOME; homeUnderline.SetActive(true); playingUnderline.SetActive(false); songsUnderline.SetActive(false); artistUnderline.SetActive(false); playlistUnderline.SetActive(false); }
public void HomeButton() { if (currentPanel == CurrentPanel.PLAYING) { playingAnimator.Play("MP Panel Fade-out"); homeAnimator.Play("MP Panel Fade-in"); if (isControlsMinimized == false) { controlsAnimator.Play("Music Controls Minimize"); isControlsMinimized = true; } } else if (currentPanel == CurrentPanel.SONGS) { songsAnimator.Play("MP Panel Fade-out"); homeAnimator.Play("MP Panel Fade-in"); if (isControlsMinimized == false) { controlsAnimator.Play("Music Controls Minimize"); isControlsMinimized = true; } } else if (currentPanel == CurrentPanel.ARTIST) { artistAnimator.Play("MP Panel Fade-out"); homeAnimator.Play("MP Panel Fade-in"); if (isControlsMinimized == false) { controlsAnimator.Play("Music Controls Minimize"); isControlsMinimized = true; } } else if (currentPanel == CurrentPanel.PLAYLIST) { playlistAnimator.Play("MP Panel Fade-out"); homeAnimator.Play("MP Panel Fade-in"); if (isControlsMinimized == false) { controlsAnimator.Play("Music Controls Minimize"); isControlsMinimized = true; } } currentPanel = CurrentPanel.HOME; homeUnderline.SetActive(true); playingUnderline.SetActive(false); songsUnderline.SetActive(false); artistUnderline.SetActive(false); playlistUnderline.SetActive(false); }
private void ShowViewSpotDetailCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e) { ViewSpot param = e.Parameter as ViewSpot; ViewDetail.DetailShowItem = param; ViewDetail.ImageUrls[0] = ViewDetail.DetailShowItem.photourl1 ?? string.Empty; ViewDetail.ImageUrls[1] = ViewDetail.DetailShowItem.photourl2 ?? string.Empty; ViewDetail.ImageUrls[2] = ViewDetail.DetailShowItem.photourl3 ?? string.Empty; ViewDetail.CurrentImageUrl = ViewDetail.ImageUrls[ViewDetail.CurrentImageIndex]; CurrentGrid = CurrentPanel.Detail; }
public void ClosePanel() { if (CurrentPanel == null) { return; } CurrentPanel.Close(0.5f); CurrentPanel = null; EscapeHandler.Instance.EscapeHandling -= ClosePanel; GameController.Instance.ResumeGame(); }
public void Draw(SpriteBatch spriteBatch) { if (!_isTransitioning) { CurrentPanel.Draw(spriteBatch); } else { spriteBatch.End(); RenderTarget2D renderTarget = (RenderTarget2D)spriteBatch.GraphicsDevice.GetRenderTargets()[0].RenderTarget; RenderTarget2D oldRoomTarget = new RenderTarget2D(spriteBatch.GraphicsDevice, 160, 128); spriteBatch.GraphicsDevice.SetRenderTarget(oldRoomTarget); spriteBatch.Begin(); CurrentPanel.Draw(spriteBatch); spriteBatch.End(); RenderTarget2D newRoomTarget = new RenderTarget2D(spriteBatch.GraphicsDevice, 160, 128); spriteBatch.GraphicsDevice.SetRenderTarget(newRoomTarget); spriteBatch.Begin(); NewPanel.Draw(spriteBatch); spriteBatch.End(); spriteBatch.GraphicsDevice.SetRenderTarget(renderTarget); spriteBatch.Begin(); switch (_transitionDirection) { case Direction.Up: spriteBatch.Draw(oldRoomTarget, new Vector2(0, _transitionLine), Color.White); spriteBatch.Draw(newRoomTarget, new Vector2(0, _transitionLine - 128), Color.White); break; case Direction.Down: spriteBatch.Draw(oldRoomTarget, new Vector2(0, -_transitionLine), Color.White); spriteBatch.Draw(newRoomTarget, new Vector2(0, 128 - _transitionLine), Color.White); break; case Direction.Left: spriteBatch.Draw(oldRoomTarget, new Vector2(_transitionLine, 0), Color.White); spriteBatch.Draw(newRoomTarget, new Vector2(_transitionLine - 160, 0), Color.White); break; case Direction.Right: spriteBatch.Draw(oldRoomTarget, new Vector2(-_transitionLine, 0), Color.White); spriteBatch.Draw(newRoomTarget, new Vector2(160 - _transitionLine, 0), Color.White); break; } } }
private async void ShowDiscussCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e) { ViewSpot param = e.Parameter as ViewSpot; ViewComment.DetailShowItem = param; CurrentGrid = CurrentPanel.Comment; ViewMaster.DataItemListView.SelectedIndex = -1; if (ViewComment.DetailShowItem == null) { return; } string requestString = AppSettings["WEB_API_GET_COMMENT_INFO_BY_VIEW"] + "?viewid=" + ViewComment.DetailShowItem.id; //API返回内容 string jsonString = string.Empty; try { jsonString = (await WebServiceHelper.GetHttpResponseAsync(requestString, string.Empty, RestSharp.Method.GET)).Content; if (jsonString == "") { throw new Exception(""); } JObject jobject = (JObject)JsonConvert.DeserializeObject(jsonString); string content_string = jobject["CommentInfo"].ToString(); using (var ms = new MemoryStream(Encoding.Unicode.GetBytes(content_string))) { DataContractJsonSerializer deseralizer = new DataContractJsonSerializer(typeof(ObservableCollection <CommentInfo>)); ViewComment.CommentList = (ObservableCollection <CommentInfo>)deseralizer.ReadObject(ms); } } catch (Exception ex) { Console.WriteLine(ex.Message); MessageboxMaster.Show(LanguageDictionaryHelper.GetString("Server_Connect_Error"), LanguageDictionaryHelper.GetString("MessageBox_Error_Title")); return; } //检查数据 for (int i = 0; i < ViewComment.CommentList.Count; i++) { ViewComment.CommentList[i].Spot = ViewComment.DetailShowItem; ViewComment.CommentList[i].CheckData(); } }
public void CustomizeClick() { if (currentPanel == CurrentPanel.PLAY) { playPanel.Play("Panel Close"); customizePanel.Play("Panel Open"); playButton.Play("TP Close"); customizeButton.Play("TP Open"); } else if (currentPanel == CurrentPanel.REWARDS) { rewardsPanel.Play("Panel Close"); customizePanel.Play("Panel Open"); rewardsButton.Play("TP Close"); customizeButton.Play("TP Open"); } else if (currentPanel == CurrentPanel.CAREER) { careerPanel.Play("Panel Close"); customizePanel.Play("Panel Open"); careerButton.Play("TP Close"); customizeButton.Play("TP Open"); } else if (currentPanel == CurrentPanel.LEADER) { leaderPanel.Play("Panel Close"); customizePanel.Play("Panel Open"); leaderButton.Play("TP Close"); customizeButton.Play("TP Open"); } else if (currentPanel == CurrentPanel.REPLAYS) { replaysPanel.Play("Panel Close"); customizePanel.Play("Panel Open"); replaysButton.Play("TP Close"); customizeButton.Play("TP Open"); } currentPanel = CurrentPanel.CUSTOMIZE; particles.SetActive(true); }
public static void TogglePanelCustom() { if (MonkeyStyle.Instance.IsFakeTextureInUse) { MonkeyStyle.Instance.PostInstanceCreation(); } if (CommandManager.Instance.CommandCount == 0) { CommandManager.Instance.OnEnable(); } if (!CurrentPanel) { ShowNewPanel(); } else { if (CurrentPanel.isDockedInfo == null) { GetIsDockedInfo(); } if (CurrentPanel.IsDocked) { if (CurrentPanel.isActiveMode) { if (!CurrentPanel.Focused) { CurrentPanel.Focus(); CurrentPanel.Focused = true; } else { ResetSearchTerms(); CurrentPanel.CloseOrSetInactive(); } } else { ActivatePanel(); } } else { CurrentPanel.CloseOrSetInactive(); } } }
public void SwitchPanel() { switch (currentPanel) { case CurrentPanel.MAIN: currentPanel = CurrentPanel.CREDITS; state = State.MOVE_LEFT; break; case CurrentPanel.CREDITS: currentPanel = CurrentPanel.MAIN; state = State.MOVE_RIGHT; break; default: throw new ArgumentOutOfRangeException(); } }
public void Update(double gameTime) { if (!_isTransitioning) { CurrentPanel.Update(gameTime); } else { _transitionLine += (int)(0.5 * gameTime * 1000); if (((_transitionDirection == Direction.Left || _transitionDirection == Direction.Right) && _transitionLine > 160) || ((_transitionDirection == Direction.Up || _transitionDirection == Direction.Down) && _transitionLine > 128)) { _isTransitioning = false; x = newX; y = newY; } } }
private static void ResetWindow() { EditorWindow window = focusedWindow; try { CurrentPanel = FindObjectOfType <CommandConsoleWindow>(); if (CurrentPanel) { ShowNewPanel(); CurrentPanel.CloseOrSetInactive(); } /* if (window) * window.Focus();*/ } catch (NullReferenceException) { //ignore, due to change of version } }
/// <summary> /// 构造函数 /// </summary> public SpotRecommend() { InitializeComponent(); CurrentGrid = CurrentPanel.List; }
/// <summary> /// 构造函数 /// </summary> public SpotQuery() { InitializeComponent(); StartPointAddress.Focus(); CurrentGrid = CurrentPanel.List; }
public virtual void GetFeedback() => CurrentPanel.SetChildPanelsRead(true);
public virtual void SetCompleted() { CurrentPanel.SetChildPanelsRead(true); IsCompleted = true; Completed?.Invoke(); }
/// <summary> /// 查询按钮响应函数 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void SpotSearchBtn_ClickAsync(object sender, RoutedEventArgs e) { int selectedIndex = ModeCombox.SelectedIndex; string requestString = null; string AscOrDescString = Desc.IsChecked == true ? "desc" : "asc"; if (selectedIndex == 0) { requestString = AppSettings["WEB_API_GET_VIEW_INFO_BY_RATING"] + "?limit=100&ascordesc=" + AscOrDescString; } else if (selectedIndex == 1) { requestString = AppSettings["WEB_API_GET_VIEW_INFO_BY_COST"] + "?limit=100&ascordesc=" + AscOrDescString; } else { MessageboxMaster.Show(LanguageDictionaryHelper.GetString("Input_Empty"), LanguageDictionaryHelper.GetString("MessageBox_Warning_Title")); return; } //API返回内容 string jsonString = string.Empty; List <ViewSpot> viewSpotList = new List <ViewSpot>(100); try { jsonString = (await WebServiceHelper.GetHttpResponseAsync(requestString, string.Empty, RestSharp.Method.GET)).Content; if (jsonString == "") { throw new Exception(""); } JObject jobject = (JObject)JsonConvert.DeserializeObject(jsonString); string content_string = jobject["ViewInfo"].ToString(); using (var ms = new MemoryStream(Encoding.Unicode.GetBytes(content_string))) { DataContractJsonSerializer deseralizer = new DataContractJsonSerializer(typeof(List <ViewSpot>)); viewSpotList = (List <ViewSpot>)deseralizer.ReadObject(ms); } } catch (Exception ex) { Console.WriteLine(ex.Message); MessageboxMaster.Show(LanguageDictionaryHelper.GetString("Server_Connect_Error"), LanguageDictionaryHelper.GetString("MessageBox_Error_Title")); return; } //检查数据 for (int i = 0; i < viewSpotList.Count; i++) { viewSpotList[i].CheckData(); } //设置显示数据 ViewMaster.ViewSpotList = new ObservableCollection <ViewSpot>(viewSpotList); //定义当前显示的面板 CurrentGrid = CurrentPanel.List; //设置面板可见 PanelVisibility = Visibility.Visible; //清除点图层要素 ArcGISMapCommands.ClearFeatures.Execute(2, this); //绘制要素 foreach (ViewSpot viewSpot in viewSpotList) { MapPoint gcjpoint = new MapPoint(viewSpot.lng, viewSpot.lat); MapPoint wgspoint = WGSGCJLatLonHelper.GCJ02ToWGS84(gcjpoint); viewSpot.lng = wgspoint.X; viewSpot.lat = wgspoint.Y; Dictionary <string, object> commandParams = new Dictionary <string, object>(8) { { "Lng", viewSpot.lng }, { "Lat", viewSpot.lat }, { "IconUri", IconDictionaryHelper.IconDictionary[IconDictionaryHelper.Icons.pin_blue] }, { "Width", 16.0 }, { "Height", 24.0 }, { "OffsetX", 0.0 }, { "OffsetY", 9.5 }, { "Data", viewSpot } }; ArcGISMapCommands.ShowFeatureOnMap.Execute(commandParams, this); } }
/// <summary> /// 查询按钮响应函数 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void SpotSearchBtn_ClickAsync(object sender, RoutedEventArgs e) { if (StartPointAddress.Text == null || StartPointAddress.Text == string.Empty) { MessageboxMaster.Show(LanguageDictionaryHelper.GetString("Input_Empty"), LanguageDictionaryHelper.GetString("MessageBox_Warning_Title")); return; } //用户输入的内容 string input_spot_name = StartPointAddress.Text; //逐一分词之后的内容 char[] input_spot_name_spited = input_spot_name.ToCharArray(); //模糊查询中的内容 string sql_regexp = "%"; { foreach (char siglechar in input_spot_name_spited) { sql_regexp += siglechar + "%"; } } //API返回内容 string jsonString = string.Empty; //景点数量 int viewCount = -1; try { jsonString = (await WebServiceHelper.GetHttpResponseAsync(AppSettings["WEB_API_GET_VIEW_COUNT_BY_NAME"] + "?name=" + sql_regexp, string.Empty, RestSharp.Method.GET)).Content; if (jsonString == "") { throw new Exception(""); } JObject jobject = (JObject)JsonConvert.DeserializeObject(jsonString); JToken jtoken = jobject["ViewCount"][0]; viewCount = (int)jtoken["COUNT(*)"]; } catch { MessageboxMaster.Show(LanguageDictionaryHelper.GetString("Server_Connect_Error"), LanguageDictionaryHelper.GetString("MessageBox_Error_Title")); return; } if (viewCount <= 0) { MessageboxMaster.Show(LanguageDictionaryHelper.GetString("SpotSearch_Null"), LanguageDictionaryHelper.GetString("MessageBox_Tip_Title")); return; } List <ViewSpot> viewSpotList = new List <ViewSpot>(viewCount); try { jsonString = (await WebServiceHelper.GetHttpResponseAsync(AppSettings["WEB_API_GET_VIEW_INFO_BY_NAME"] + "?name=" + sql_regexp, string.Empty, RestSharp.Method.GET)).Content; if (jsonString == "") { throw new Exception(""); } JObject jobject = (JObject)JsonConvert.DeserializeObject(jsonString); string content_string = jobject["ViewInfo"].ToString(); using (var ms = new MemoryStream(Encoding.Unicode.GetBytes(content_string))) { DataContractJsonSerializer deseralizer = new DataContractJsonSerializer(typeof(List <ViewSpot>)); viewSpotList = (List <ViewSpot>)deseralizer.ReadObject(ms); } } catch (Exception ex) { Console.WriteLine(ex.Message); MessageboxMaster.Show(LanguageDictionaryHelper.GetString("Server_Connect_Error"), LanguageDictionaryHelper.GetString("MessageBox_Error_Title")); return; } //检查数据 for (int i = 0; i < viewSpotList.Count; i++) { viewSpotList[i].CheckData(); } //设置显示数据 ViewMaster.ViewSpotList = new ObservableCollection <ViewSpot>(viewSpotList); //定义当前显示的面板 CurrentGrid = CurrentPanel.List; //设置面板可见 PanelVisibility = Visibility.Visible; //清除点图层要素 ArcGISMapCommands.ClearFeatures.Execute(2, this); //绘制要素 foreach (ViewSpot viewSpot in viewSpotList) { MapPoint gcjpoint = new MapPoint(viewSpot.lng, viewSpot.lat); MapPoint wgspoint = WGSGCJLatLonHelper.GCJ02ToWGS84(gcjpoint); viewSpot.lng = wgspoint.X; viewSpot.lat = wgspoint.Y; Dictionary <string, object> commandParams = new Dictionary <string, object>(8) { { "Lng", viewSpot.lng }, { "Lat", viewSpot.lat }, { "IconUri", IconDictionaryHelper.IconDictionary[IconDictionaryHelper.Icons.pin_blue] }, { "Width", 16.0 }, { "Height", 24.0 }, { "OffsetX", 0.0 }, { "OffsetY", 9.5 }, { "Data", viewSpot } }; ArcGISMapCommands.ShowFeatureOnMap.Execute(commandParams, this); } }
private void BackToMasterCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e) { CurrentGrid = CurrentPanel.List; ViewMaster.DataItemListView.SelectedIndex = -1; ArcGISMapCommands.ClearCallout.Execute(null, Application.Current.MainWindow); }