コード例 #1
0
ファイル: ArmyOrderWorker.cs プロジェクト: SwimUp/moreevents
 protected virtual bool GiveWorkerTo(FactionArmy army, War war)
 {
     return(true);
 }
コード例 #2
0
 public virtual void Initialize(War war)
 {
     this.war = war;
 }
コード例 #3
0
ファイル: ArmyOrderWorker.cs プロジェクト: SwimUp/moreevents
 protected virtual bool CanGiveSubTo(FactionArmy army, War war)
 {
     return(true);
 }
コード例 #4
0
 public virtual void Notify_WarIsOver(War war)
 {
 }
コード例 #5
0
 public virtual void Notify_WarIsStarted(War war)
 {
 }
コード例 #6
0
        private void DrawWarMode(Rect inRect)
        {
            Text.Anchor = TextAnchor.MiddleCenter;

            float y         = inRect.y;
            Rect  titleRect = new Rect(inRect.x, y, inRect.width, 25);

            Widgets.Label(titleRect, "MakeWarWindow_DrawWarModeTitle".Translate(interactFaction.Faction.Name));

            y += 30;
            Rect selectWarGoalRect = new Rect(inRect.x, y, inRect.width, 25);

            if (GUIUtils.DrawCustomButton(selectWarGoalRect, "MakeWarWindow_DrawWarMode_SelectWarGoal".Translate(warGoalDef.LabelCap), Color.white))
            {
                List <FloatMenuOption> options = new List <FloatMenuOption>();
                foreach (var goal in DefDatabase <WarGoalDef> .AllDefs)
                {
                    options.Add(new FloatMenuOption(goal.LabelCap, delegate
                    {
                        warGoalDef = goal;
                    }));
                }

                Find.WindowStack.Add(new FloatMenu(options));
            }

            y += 28;

            Text.Anchor = TextAnchor.UpperLeft;

            float height       = inRect.height - y - 80;
            Rect  fullInfoRect = new Rect(inRect.x, y, inRect.width, height);

            Widgets.Label(fullInfoRect, warGoalDef.description);

            y += height;

            Text.Anchor = TextAnchor.MiddleCenter;
            Rect warNameRect = new Rect(inRect.x, y, inRect.width, 25);

            Widgets.Label(warNameRect, "MakeWarWindow_WarNameLabel".Translate());
            y             += 22;
            warNameRect.y += 22;
            editBufferName = Widgets.TextField(warNameRect, editBufferName);

            y += 30;

            Rect createWarButtonRect = new Rect(inRect.x, y, inRect.width, 25);

            if (GUIUtils.DrawCustomButton(createWarButtonRect, "MakeWarWindow_DrawWarMode_MakeWar".Translate(interactFaction.Faction.Name), Color.white))
            {
                if (string.IsNullOrEmpty(editBufferName))
                {
                    Messages.Message("MakeWarWindow_EmptyName".Translate(), MessageTypeDefOf.NeutralEvent);
                }
                else
                {
                    War war = WarMaker.MakeWar(editBufferName, warGoalDef, QuestsManager.Communications.FactionManager.GetInteraction(speaker.Faction), interactFaction);

                    QuestsManager.Communications.FactionManager.AddWar(war);

                    war.StartWar();

                    Close();
                }
            }

            Text.Anchor = TextAnchor.UpperLeft;
        }
コード例 #7
0
ファイル: WarGoalWorker.cs プロジェクト: SwimUp/moreevents
 public virtual void StartWar(War war)
 {
     this.war = war;
 }