void SetOverlaysVisibleImpl(bool state) { string screenName = FixActiveScreenName(ActiveScreenName); foreach (var overlayPair in m_Overlays) { GuiOverlay overlay = overlayPair.Value; if (overlay == null) { continue; } if (state == true) { overlay.ShowView(this); overlay.EnableView(); overlay.SetActiveScreen(screenName); } else { overlay.SetActiveScreen(null); overlay.DisableView(); overlay.HideView(this); } } }
private MapOverlay OverlayTitlebarMenuTutorial() { if (API.State.WindowMode != WindowMode.Overlay) { return(this.NormalOverlayModeTutorial()); } var items = new GuiOverlay(); items.MapItems.Add(this.GetTutorialStamp(500, 200)); int center = API.UiElements.TileDisplay.Width / 2; var tex = new MapTexture { Texture = API.Content.Textures.ArrowUp, PositionAlignment = MapItemAlignment.Top | MapItemAlignment.Center, Size = new Vector2(128, 128), Position = new PositionDefinition { Type = DrawMode.ViewPort, X = center, Y = 0 }, }; items.MapItems.Add(tex); var txts = new MapTextBuilder(FontType.GuiNormal, Color.White, Color.Black, true, MapItemAlignment.Top | MapItemAlignment.Left); txts.Text("Tutorial: Overlay Menu", textColor: Color.Red, font: FontType.GuiXLarge).Break(); txts.Text("The Overlay Menu provides quick access to many useful controls. You may access it by right-clicking the title bar.", 400).Break(); txts.Break(); txts.Text("Please open the Overlay Menu now.", textColor: Color.Green).Break(); items.MapItems.AddRange(txts.ToMapItem(DrawMode.ViewPort, (int)(this.TutorialFramePosition.X - items.MapItems.First().Size.X / 2.5), this.TutorialFramePosition.Y)); return(items); }
public IEnumerable <MapOverlay> GetCustomOverlay() { if (Properties.GeneralSettings.Default.DisableTutorials) { return(null); } var stage = CurrentStage; if (this.setupStage != stage) { this.CleanupStage(this.setupStage); this.SetupStage(stage); } MapOverlay overlay = null; switch (CurrentStage) { case TutorialStage.ZoomIn: overlay = this.NormalZoomInTutorial(); break; case TutorialStage.ZoomOut: overlay = this.NormalZoomOutTutorial(); break; case TutorialStage.OverlayMode: overlay = this.NormalOverlayModeTutorial(); break; case TutorialStage.OverlayTitlebarMenuOpen: overlay = this.OverlayTitlebarMenuTutorial(); break; case TutorialStage.OverlayTitlebarMenuClose: overlay = new GuiOverlay(); break; case TutorialStage.OverlayResizeWindow: overlay = this.NormalResizeTutorial(); break; case TutorialStage.OverlayExit: overlay = this.OverlayExitTutorial(); break; case TutorialStage.Magnification: overlay = this.NormalMagnificationTutorial(); break; } if (overlay != null) { return(overlay.AsArray); } // We've finished the tutorials. Unload! API.PluginManager.UnloadPlugin <TutorialPlugin>(); return(null); }
void RegisterOverlay(GuiOverlay overlay) { string name = GetScreenName(overlay); if (m_Overlays.ContainsKey(name) == true) { return; } m_Overlays[name] = overlay; }
private MapOverlay NormalResizeTutorial() { var items = new GuiOverlay(); items.MapItems.Add(this.GetTutorialStamp(500, 200)); var txts = new MapTextBuilder(FontType.GuiNormal, Color.White, Color.Black, true, MapItemAlignment.Top | MapItemAlignment.Left); txts.Text("Tutorial: Window Size", textColor: Color.Red, font: FontType.GuiXLarge).Break(); txts.Text("You may resize the window by dragging the window border using the mouse.", 400).Break(); txts.Break(); txts.Text("Please resize the window now.", textColor: Color.Green).Break(); items.MapItems.AddRange(txts.ToMapItem(DrawMode.ViewPort, (int)(this.TutorialFramePosition.X - items.MapItems.First().Size.X / 2.5), this.TutorialFramePosition.Y)); return(items); }
private MapOverlay NormalOverlayModeTutorial() { var items = new GuiOverlay(); items.MapItems.Add(this.GetTutorialStamp(500, 200)); var txts = new MapTextBuilder(FontType.GuiNormal, Color.White, Color.Black, true, MapItemAlignment.Top | MapItemAlignment.Left); txts.Text("Tutorial: Overlay Mode", textColor: Color.Red, font: FontType.GuiXLarge).Break(); txts.Text("Overlay Mode maximizes the visible map area and keeps PMV on top of other windows, such as Anarchy Online.", 390).Break(); txts.Text("You may enter Overlay Mode by going to the top menu and clicking view->Overlay Mode, or by pressing [F12].", 390).Break(); txts.Break(); txts.Text("Please enter Overlay Mode now.", textColor: Color.Green).Break(); items.MapItems.AddRange(txts.ToMapItem(DrawMode.ViewPort, (int)(this.TutorialFramePosition.X - items.MapItems.First().Size.X / 2.5), this.TutorialFramePosition.Y)); return(items); }
bool OnProcessInput(ref IInputEvent evt) { foreach (var overlayPair in m_Overlays) { GuiOverlay overlay = overlayPair.Value; if (overlay == null) { continue; } if (overlay.ProcessInput(ref evt) == true) { return(true); } } GuiScreen screen = activeScreen; if (screen != null) { if (screen.ProcessInput(ref evt) == true) { return(true); } if (evt.Kind == E_EventKind.Key) { KeyEvent key = (KeyEvent)evt; if (key.Code == KeyCode.Escape) { if (key.State == E_KeyState.Released) { if (m_AllowEmptyStack == true || ScreenStackDepth > 1) { Back(); return(true); } } } } } return(ProcessMenuInput(ref evt)); }
private MapOverlay NormalMagnificationTutorial() { var items = new GuiOverlay(); items.MapItems.Add(this.GetTutorialStamp(500, 230)); var txts = new MapTextBuilder(FontType.GuiNormal, Color.White, Color.Black, true, MapItemAlignment.Top | MapItemAlignment.Left); txts.Text("Tutorial: Magnification", textColor: Color.Red, font: FontType.GuiXLarge).Break(); txts.Text("Magnification lets you shrink or enlarge the size of the underlying planet map. ", 400).Break(); txts.Break(); txts.Text("You may alter magnification by the following means:", 400).Break(); txts.Text("- Manipulating the magnification slider in the main UI, right pane", 400).Break(); txts.Text("- Pressing [Ctrl] while scrolling the mouse wheel", 400).Break(); txts.Break(); txts.Text("Please use the magnifying feature now.", textColor: Color.Green).Break(); items.MapItems.AddRange(txts.ToMapItem(DrawMode.ViewPort, (int)(this.TutorialFramePosition.X - items.MapItems.First().Size.X / 2.5), this.TutorialFramePosition.Y)); return(items); }
private MapOverlay OverlayExitTutorial() { if (API.State.WindowMode != WindowMode.Overlay) { return(this.NormalOverlayModeTutorial()); } var items = new GuiOverlay(); items.MapItems.Add(this.GetTutorialStamp(500, 200)); var txts = new MapTextBuilder(FontType.GuiNormal, Color.White, Color.Black, true, MapItemAlignment.Top | MapItemAlignment.Left); txts.Text("Tutorial: Exiting Overlay Mode", textColor: Color.Red, font: FontType.GuiXLarge).Break(); txts.Text("You may exit overlay mode by pressing the close window button at top right, by opening the Overlay Menu and selecting 'Exit Overlay Mode', or pressing [F12]", 400).Break(); txts.Break(); txts.Text("Please exit overlay mode now.", textColor: Color.Green).Break(); items.MapItems.AddRange(txts.ToMapItem(DrawMode.ViewPort, (int)(this.TutorialFramePosition.X - items.MapItems.First().Size.X / 2.5), this.TutorialFramePosition.Y)); return(items); }
private MapOverlay NormalZoomInTutorial() { var items = new GuiOverlay(); items.MapItems.Add(this.GetTutorialStamp(500, 200)); var txts = new MapTextBuilder(FontType.GuiNormal, Color.White, Color.Black, true, MapItemAlignment.Top | MapItemAlignment.Left); txts.Text("Tutorial: Zooming in", textColor: Color.Red, font: FontType.GuiXLarge).Break(); txts.Text("You may zoom in on the map by the following means:").Break(); txts.Text("- Double left-click anywhere on the map").Break(); txts.Text("- Pressing the 'Zoom In' button to the right").Break(); txts.Text("- Pressing the + key on your keyboard").Break(); txts.Text("- Using your keyboards zoom button, if it has one").Break(); txts.Break(); txts.Text("Please zoom in now.", textColor: Color.Green).Break(); items.MapItems.AddRange(txts.ToMapItem(DrawMode.ViewPort, (int)(this.TutorialFramePosition.X - items.MapItems.First().Size.X / 2.5), this.TutorialFramePosition.Y)); return(items); }
void SetOverlaysEnabledImpl(bool state) { string screenName = FixActiveScreenName(ActiveScreenName); foreach (var overlayPair in m_Overlays) { GuiOverlay overlay = overlayPair.Value; if (overlay == null) { continue; } if (state == true && m_OverlaysCustomEnabled == true) { overlay.EnableView(); } else { overlay.DisableView(); } overlay.SetActiveScreen(screenName); } }
void LateInit() { GuiScreen[] screens = GetComponentsInChildren <GuiScreen>(); foreach (var screen in screens) { RegisterScreen(screen); } GuiOverlay[] overlays = GetComponentsInChildren <GuiOverlay>(); foreach (var overlay in overlays) { RegisterOverlay(overlay); } OnMenuInit(); foreach (var overlayPair in m_Overlays) { GuiOverlay overlay = overlayPair.Value; if (overlay == null) { continue; } overlay.InitView(); } _InitScreens(); if (Player.LocalInstance != null && Player.LocalInstance.Controls != null) { Player.LocalInstance.Controls.LockCursor(false); } SetMenuState(E_MenuState.Idle); }