public override void LoadContent(JContent contentManager) { font = contentManager.Load <SpriteFont>("MediumFont"); np = new NinePatch(contentManager.Load <Sprite>("TestNP"), new Rectangle(5, 5, 6, 6)); buttonNP = new NinePatch(contentManager.Load <Sprite>("ButtonNP"), new Rectangle(10, 10, 12, 12)); }
public override async Task <object> Show(object content, string identifier, DialogClosingEventHandler closingHandler, DialogOpenedEventHandler openingHandler) { if (_testInput != null && content is CommonDialog) { ((CommonDialogViewModel)((CommonDialog)content).DataContext).Content = _testInput; _testInput = null; } return(_testResult); }
public override void LoadContent(JContent contentManager) { TreeLines = contentManager.Load <Sprite>("NewTreeLines"); TreeColor = contentManager.Load <Sprite>("NewTreeColor"); NoiseTileSprite = contentManager.Load <Sprite>("TileNoise"); MissileSprite = contentManager.Load <Sprite>("Missile"); Character = contentManager.Load <Sprite>("Character"); IconWood = contentManager.Load <Sprite>("Wood Icon"); NoiseTileDef = new TileDef(1, "Test Tile"); NoiseTileDef.BaseSprite = NoiseTileSprite; TileDef.Register(NoiseTileDef); TileDef.Register(new TestLinkedTile()); TileDef.Register(new TreeTile()); TileDef.Register(new WindTurbineTileDef()); ItemDef.Register(new WoodItem()); }
public void LoadContent(JContent contentManager) { foreach (var scr in allScreens) { #if CATCH_EXCEPTIONS try { #endif scr.LoadContent(contentManager); #if CATCH_EXCEPTIONS } catch (Exception e) { Debug.Error($"Exception loading content of screen {scr.Name} ({scr.ID}).", e); } #endif } }
public override void LoadContent(JContent content) { MainPanel = new Panel(new Vector2(400, 320), PanelSkin.Simple, Anchor.BottomRight, new Vector2(10, 10)); MainPanel.Draggable = true; PanelTabs tabs = new PanelTabs(PanelSkin.None); MainPanel.AddChild(tabs); var threadTab = tabs.AddTab("Pathing"); threadTab.button.MaxSize = new Vector2(500, 32); var threadPanel = threadTab.panel; threadPanel.AddChild(new CheckBox("Draw Paths") { OnValueChange = (e) => { JEngine.Entities.DrawPathfindingDebug = (e as CheckBox).Checked; }, Checked = false }); threadPanel.AddChild(ThreadPendingLabel = new Label("Pending: 0")); threadPanel.AdjustHeightAutomatically = true; ThreadLabels = new Paragraph[JEngine.PathfindingThreadCount]; ThreadBars = new ProgressBar[JEngine.PathfindingThreadCount]; for (int i = 0; i < JEngine.PathfindingThreadCount; i++) { threadPanel.AddChild(ThreadLabels[i] = new Paragraph($"{i}: 0%, Avg: 0.0ms, Max: 0.0ms") { Padding = new Vector2(0, 0), Scale = 0.5f }); threadPanel.AddChild(ThreadBars[i] = new ProgressBar(0, 100) { Value = 40, Size = new Vector2(-1, 24), Padding = Vector2.Zero }); } UserInterface.Active.AddEntity(MainPanel); }
public virtual void Dispose() { TargetType = null; JContent = null; }
/// <summary> /// Called when the game is loading content. Use this to load any content that this screen /// or related components need. You should also build GeonBit UI here since it cannot be done in Init(). /// Only called if the screen is registered early in startup! /// Default implementation does nothing. /// </summary> /// <param name="content">The default content manager that you can load content with.</param> public virtual void LoadContent(JContent content) { }
public virtual void SetTestInput(JContent input) { Messenger.Default.Send <Exception>(new NotSupportedException("This method supported only in test mode!")); }
public override void SetTestInput(JContent input) { _testInput = input; }