private void AcceptCalibration(object sender, RoutedEventArgs e) { // Hide UI calibrationMenu.Visibility = Visibility.Collapsed; this.visualPoint.Visibility = Visibility.Collapsed; // Grab screenshot string savePath = GTPath.GetLocalApplicationDataPath() + Path.DirectorySeparatorChar + "Calibration" + Path.DirectorySeparatorChar + Tracker.Instance.Calibration.ID + Path.DirectorySeparatorChar + "calibrationScreen.png"; SaveImage(savePath, CanvasRoot.GetScreenShot(1)); // Dump Instance settings into the calibration folder FileInfo fileSettings = new FileInfo(Settings.Instance.FileSettings.SettingsDirectory + Settings.Instance.GetLatestConfigurationFile()); try { File.Copy(fileSettings.FullName, Tracker.Instance.Calibration.DataFolder + "\\" + fileSettings.Name); } catch (Exception ex) { Console.Out.WriteLine("Error dumping calibration data in CalibrationWindow.AcceptCalibration(), message: " + ex.Message); } // Trigger global calibration accept (will hide this) GTCommands.Instance.Calibration.Accept(); }
public void UpdateTextViews() { if (LeftTextView != null && RightTextView != null) { CanvasRoot.Invalidate(); } }
void OnSongenPointValueIsZero() { SongenPointValue = 0.0f; SongenBar.Value = 0; StateRoot.BroadcastMessage("OnEndGame"); CanvasRoot.BroadcastMessage("OnEndGame"); }
/// <summary> /// 创建界面 /// </summary> /// <param name="windowType"></param> /// <param name="canvas"></param> /// <returns></returns> public WindowBase CreateWindow(int windowType, Canvas canvas) { WindowCfg info; WindowDict.TryGetValue(windowType, out info); if (info != null) { //ResourceSystem.ResourceSystemFacade.Inst.LoadResource<GameObject>(info.PrefabName); GameObject go = Resources.Load <GameObject>("Prefab/" + info.PrefabName); if (go != null) { GameObject returnObj = CanvasRoot.Instantiate(go, canvas.transform); WindowBase win = returnObj.GetComponent <WindowBase>(); win.CurWindowInfo = info; win.WindowsId = instIndex++; return(win); } else { // DebugUtils.LogError("The Target not found"); } } return(null); }
public DiffMapScrollControl() { this.InitializeComponent(); CanvasRoot.SizeChanged += (s, e) => { CanvasRoot.Invalidate(); }; }
public void Init() { GameObject go = Resources.Load <GameObject>("UIRoot"); if (go != null) { GameObject instance = MonoBehaviour.Instantiate(go); canvasRoot = instance.GetComponent <CanvasRoot>(); } Dictionary <int, WindowCfg> info = CfgSvc.Instance.WindowCfgDic; foreach (var winDict in info) { WindowDict.Add(winDict.Key, winDict.Value); } }
private void InitInGame() { CurrentState = State.InGame; Debug.Log("Go to InGame."); BGM.Play(); AudioSource.PlayOneShot(AudioGameStart); StateRoot.BroadcastMessage("OnStartGame"); CanvasRoot.BroadcastMessage("OnStartGame"); SetMessageText("始め!"); SetMessageScale(1.0f); MessageText.StartAlphaUpdate(); }
public TextControl() { this.InitializeComponent(); _textFormat = new CanvasTextFormat { FontFamily = "Consolas", FontSize = 12, WordWrapping = CanvasWordWrapping.NoWrap }; CanvasRoot.CreateResources += (s, e) => { _defaultForegroundBrush = new CanvasSolidColorBrush(s, _defaultForegroundColor); _addedForegroundBrush = new CanvasSolidColorBrush(s, _addedForegroundColor); _removedForegroundBrush = new CanvasSolidColorBrush(s, _removedForegroundColor); var stops = new CanvasGradientStop[4] { new CanvasGradientStop { Color = _defaultBackgroundColor, Position = 0 }, new CanvasGradientStop { Color = _defaultBackgroundColor, Position = 0.5f }, new CanvasGradientStop { Color = _nullBackgroundColor, Position = 0.5f }, new CanvasGradientStop { Color = _nullBackgroundColor, Position = 1 } }; _nullBrush = new CanvasLinearGradientBrush(s, stops, CanvasEdgeBehavior.Mirror, CanvasAlphaMode.Premultiplied) { StartPoint = new System.Numerics.Vector2(0, 0), EndPoint = new System.Numerics.Vector2(4, 4) }; }; CanvasRoot.SizeChanged += (s, e) => { CanvasRoot.Invalidate(); }; }
internal void UpdateText() { if (Text == null) { return; } CanvasRoot.Height = Text.LineCount * LineHeight; CanvasRoot.Invalidate(); GutterRoot.Text = this.Text; GutterRoot.UpdateHeight(CanvasRoot.Height); if (DiffMap != null) { DiffMap.UpdateTextViews(); } Text.ScrollToLineRequested -= Text_ScrollToLineRequested; Text.ScrollToLineRequested += Text_ScrollToLineRequested; }
public GutterControl() { this.InitializeComponent(); _textFormat = new CanvasTextFormat { FontFamily = "Consolas", FontSize = 12, WordWrapping = CanvasWordWrapping.NoWrap, HorizontalAlignment = CanvasHorizontalAlignment.Right }; CanvasRoot.CreateResources += (s, e) => { _defaultForegroundBrush = new CanvasSolidColorBrush(s, _defaultForegroundColor); }; CanvasRoot.SizeChanged += (s, e) => { CanvasRoot.Invalidate(); }; }
private void ShareData(object sender, RoutedEventArgs e) { calibrationMenu.Visibility = Visibility.Collapsed; sharingUC.SendData(Tracker.Instance, CanvasRoot.GetScreenShot(1)); sharingUC.Visibility = Visibility.Visible; }
public void UpdateHeight(double height) { CanvasRoot.Height = height; CanvasRoot.Invalidate(); }
internal void UpdateText() { CanvasRoot.Invalidate(); }