private void GetUiRefs() { _uiInstance = UserInterfaceHandler.Instance; _healthRef = _uiInstance.healthBar; _staminaRef = _uiInstance.staminaBar; _titleRef = _uiInstance.titleField; _moneyRef = _uiInstance.moneyField; }
public CampaignHandler(XnaContentManager content, UserInterfaceHandler userInterface) { this.userInterface = userInterface; Campaign.Renderer = Game.Renderer; this.campaigns = new List <Campaign> { new RitesOfPassage.RitesOfPassage( new MonoGameAssetManager(content), this.userInterface.CurrentUi) }; this.CurrentCampaign = this.campaigns[0]; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { Util.Logger.Info("Initializing Hero6 game instance."); Window.Title = "Hero6"; this.SetScale(); this.spriteBatch = new SpriteBatch(GraphicsDevice); Renderer = new MonoGameRenderer(this.spriteBatch); this.ui = new UserInterfaceHandler(this.Content); this.campaign = new CampaignHandler(this.Content, this.ui); this.ui.Initialize(); this.campaign.Initialize(); Util.Logger.Info("Hero6 game instance initialized."); base.Initialize(); }
void InstallMsi(string path) { // Configure event handler for install messages UserInterfaceHandler ux = new UserInterfaceHandler(InstallLogMode.ACTIONDATA | InstallLogMode.ACTIONSTART | InstallLogMode.PROGRESS); ux.ActionData += OnActionData; ux.ActionStart += OnActionStart; ux.Progress += OnProgress; ProgressPhase = 0; Console.WriteLine(); ActionTop = Console.CursorTop; ProgressBarTop = ActionTop + 1; // Make sure we run quietly. Be careful, we won't be prompted to elevate. WindowsInstaller.SetInternalUI(InstallUILevel.None); uint error = WindowsInstaller.InstallProduct(path, "MSIFASTINSTALL=7 REBOOT=ReallySuppress"); Console.CursorTop = ProgressBarTop + 1; Console.CursorLeft = 0; Console.CursorTop = ActionTop; ClearLine(); Console.CursorTop = ProgressBarTop; ClearLine(); if ((error != Error.SUCCESS) && (error != Error.SUCCESS_REBOOT_INITIATED) && (error != Error.SUCCESS_REBOOT_REQUIRED)) { throw new WindowsInstallerException((int)error); } else { Console.WriteLine("Done!"); } }