public void SetScenario(GameScenario scen) { foreach (GameObjects.TroopDetail.CombatMethod m in scen.GameCommonData.AllCombatMethods.CombatMethods.Values) { if (!this.help.TextTree.HasItem("TroopCombatMethod_" + m.ID)) { GameObjectTextBranch branch = new GameObjectTextBranch(); branch.AddLeaf("战法", this.help.RichText.DefaultColor.PackedValue); branch.AddLeaf(m.Name, this.help.RichText.TitleColor.PackedValue); branch.AddLeaf("\\n", this.help.RichText.DefaultColor.PackedValue); branch.AddLeaf("\\n", this.help.RichText.DefaultColor.PackedValue); foreach (GameObjects.Influences.Influence i in m.Influences.Influences.Values) { branch.AddLeaf(i.Description, this.help.RichText.SubTitleColor.PackedValue); branch.AddLeaf("\\n", this.help.RichText.DefaultColor.PackedValue); } this.help.TextTree.AddItem("TroopCombatMethod_" + m.ID, branch); } } foreach (GameObjects.TroopDetail.Stratagem m in scen.GameCommonData.AllStratagems.Stratagems.Values) { if (!this.help.TextTree.HasItem("TroopStratagem_" + m.ID)) { GameObjectTextBranch branch = new GameObjectTextBranch(); branch.AddLeaf("计略", this.help.RichText.DefaultColor.PackedValue); branch.AddLeaf(m.Name, this.help.RichText.TitleColor.PackedValue); branch.AddLeaf("\\n", this.help.RichText.DefaultColor.PackedValue); branch.AddLeaf("\\n", this.help.RichText.DefaultColor.PackedValue); foreach (GameObjects.Influences.Influence i in m.Influences.Influences.Values) { branch.AddLeaf(i.Description, this.help.RichText.SubTitleColor.PackedValue); branch.AddLeaf("\\n", this.help.RichText.DefaultColor.PackedValue); } this.help.TextTree.AddItem("TroopStratagem_" + m.ID, branch); } } foreach (GameObjects.PersonDetail.Stunt m in scen.GameCommonData.AllStunts.Stunts.Values) { if (!this.help.TextTree.HasItem("TroopStunt_" + m.ID)) { GameObjectTextBranch branch = new GameObjectTextBranch(); branch.AddLeaf("特技", this.help.RichText.DefaultColor.PackedValue); branch.AddLeaf(m.Name, this.help.RichText.TitleColor.PackedValue); branch.AddLeaf("\\n", this.help.RichText.DefaultColor.PackedValue); branch.AddLeaf("\\n", this.help.RichText.DefaultColor.PackedValue); foreach (GameObjects.Influences.Influence i in m.Influences.Influences.Values) { branch.AddLeaf(i.Description, this.help.RichText.SubTitleColor.PackedValue); branch.AddLeaf("\\n", this.help.RichText.DefaultColor.PackedValue); } this.help.TextTree.AddItem("TroopStunt_" + m.ID, branch); } } }
internal void SetGameObjectBranch(GameObject gongfang, GameObject gameObject, string branchName) { this.BuildingRichText.Clear(); if (gameObject != null) { GameObjectTextBranch a = this.TextTree.GetBranch(branchName); if (a != null) { this.BuildingRichText.AddGameObjectTextBranch(gameObject, a); } else { this.BuildingRichText.AddText(branchName); } } else { GameObjectTextBranch a = this.TextTree.GetBranch(branchName); if (a != null) { this.BuildingRichText.AddGameObjectTextBranch(gongfang, a); } else { this.BuildingRichText.AddText(branchName); } } if (this.HasConfirmationDialog) { this.DisplayQueue.Enqueue(new GameObjectAndBranchName(gongfang, this.BuildingRichText.Texts, branchName, this.iConfirmationDialog, this.YesFunction, this.NoFunction)); this.YesFunction = null; this.NoFunction = null; } else { this.DisplayQueue.Enqueue(new GameObjectAndBranchName(gongfang, this.BuildingRichText.Texts, branchName, null, null, null)); } this.HasConfirmationDialog = false; }
internal void AddPerson(Person person, Point p, string branchName) { if (Session.MainGame.mainGameScreen.TileInScreen(p)) { Point pointByPosition = Session.MainGame.mainGameScreen.GetPointByPosition(p); Bubble item = new Bubble { SpeakingPerson = person, Position = new Point(pointByPosition.X, pointByPosition.Y + (this.PositionCount(person) * this.BackgroundSize.Y)) }; GameObjectTextBranch branch = this.TextTree.GetBranch(branchName); if (branch != null) { item.LastingTime = branch.Time; item.RichText = new FreeRichText(); // this.TextBuilder); item.RichText.DefaultColor = this.DefaultTextColor; item.RichText.ClientWidth = this.TextClientWidth; item.RichText.ClientHeight = this.TextClientHeight; item.RichText.RowMargin = this.TextRowMargin; item.RichText.DisplayOffset = this.RichTextDisplayOffset(item.Position); item.RichText.SetGameObjectTextBranch(person, branch); } this.Bubbles.Add(item); } }