/// ---------------------------------------------------------------------------- /// <Summary> /// Display a message in the message control. /// </Summary> /// ---------------------------------------------------------------------------- public void SetMessage() { this.gotoButton.Enabled = false; StringBuilder title = new StringBuilder(); title.AppendFormat("Year {0} - ", turnYear); if (messages.Count != 0) { title.AppendFormat("Message {0} of {1}", currentMessage + 1, messages.Count); } else { title.AppendFormat("No Messages"); } this.messageForm.Text = title.ToString(); if (messages.Count > 0) { Nova.Common.Message thisMessage = new Nova.Common.Message(); thisMessage = messages[currentMessage]; messageBox.Text = thisMessage.Text; if (thisMessage.Event != null) { this.gotoButton.Enabled = true; } } }
/// ---------------------------------------------------------------------------- /// <Summary> /// Go to event button pressed. /// </Summary> /// <param name="sender">The source of the event.</param> /// <param name="e">A <see cref="EventArgs"/> that contains the event data.</param> /// ---------------------------------------------------------------------------- private void GotoButton_Click(object sender, EventArgs e) { Nova.Common.Message thisMessage = messages[currentMessage]; if (thisMessage.Event is BattleReport) { DoDialog(new BattleViewer(thisMessage.Event as BattleReport)); } }
/// <summary> /// Initialize the general game data for each player. E,g, picking a home. /// planet, allocating initial resources, etc. /// </summary> public void GeneratePlayerAssets() { foreach (EmpireData empire in serverState.AllEmpires.Values) { string player = empire.Race.Name; PrepareDesigns(empire, player); PrepareResources(); InitializeHomeStar(empire, player); } Nova.Common.Message welcome = new Nova.Common.Message(); welcome.Text = "Your race is ready to explore the universe."; welcome.Audience = Global.Everyone; serverState.AllMessages.Add(welcome); }