Exemplo n.º 1
0
		private void WriteBattleLog()
		{

			if (!Utility.Configuration.Config.Log.SaveBattleLog)
				return;

			try
			{
				string parent = BattleLogPath;

				if (!Directory.Exists(parent))
					Directory.CreateDirectory(parent);

				string info;
				if (IsPractice)
					info = "practice";
				else
					info = $"{Compass.MapAreaID}-{Compass.MapInfoID}-{Compass.Destination}";

				string path = $"{parent}\\{DateTimeHelper.GetTimeStamp()}@{info}.txt";

				using (var sw = new StreamWriter(path, false, Utility.Configuration.Config.Log.FileEncoding))
				{
					sw.Write(BattleDetailDescriptor.GetBattleDetail(this));
				}

			}
			catch (Exception ex)
			{

				Utility.ErrorReporter.SendErrorReport(ex, "戦闘ログの出力に失敗しました。");
			}
		}
        private void WriteBattleLog()
        {
            if (!Utility.Configuration.Config.Log.SaveBattleLog)
            {
                return;
            }

            try {
                string parent = BattleLogPath;

                if (!Directory.Exists(parent))
                {
                    Directory.CreateDirectory(parent);
                }

                string info;
                if (IsPractice)
                {
                    info = "practice";
                }
                else
                {
                    info = string.Format("{0}-{1}-{2}", Compass.MapAreaID, Compass.MapInfoID, Compass.Destination);
                }

                string path = string.Format("{0}\\{1}@{2}.txt", parent, DateTimeHelper.GetTimeStamp(), info);

                using (var sw = new StreamWriter(path, false, Utility.Configuration.Config.Log.FileEncoding)) {
                    sw.Write(BattleDetailDescriptor.GetBattleDetail(this));
                }
            } catch (Exception ex) {
                Utility.ErrorReporter.SendErrorReport(ex, "戦闘ログの出力に失敗しました。");
            }
        }
Exemplo n.º 3
0
		private void RightClickMenu_ShowBattleDetail_Click(object sender, EventArgs e)
		{
			var bm = KCDatabase.Instance.Battle;

			if (bm == null || bm.BattleMode == BattleManager.BattleModes.Undefined)
				return;

			var dialog = new Dialog.DialogBattleDetail
			{
				BattleDetailText = BattleDetailDescriptor.GetBattleDetail(bm),
				Location = RightClickMenu.Location
			};
			dialog.Show(this);

		}