Enhanced after version 14 (#30)

* Add log tab
* Merge control mesg & duty log
* Fix ping (calc loss)
* Add current connection in ping tab. Able to copy by double clicking item
* Log font has moved to config
* Add debug enable on config + save
* Display ping failed reason (debug enable)
* Handled copy exception
* New content list in duty tab
* Show loss rate option in ping tab
* Rename Chinese packet info file (No data)
* Bigger UI font
This commit is contained in:
ksh 2021-08-14 23:35:53 +09:00 committed by GitHub
parent 7ece3cf30f
commit cbfa535d20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 3560 additions and 1142 deletions

View file

@ -6,8 +6,8 @@ LANG=日本語
2=FFXIV プラグインが見つからないんです!
3=FFXIV プラグインを見つかりました!
4=FFXIV ドユーティー・コンテンツ: {0}
5=ACT 情報: {0} ({1})
6=FFXIV プラグイン情報: {0} ({1})
5=ACT 情報: {0}
6=FFXIV プラグイン情報: {0}
7=データが壊れました: {0}
8=分析できません!
9=アンノウン・コンテンツ: {0}
@ -16,7 +16,7 @@ LANG=日本語
12=アンノウン・フェイト: {0}
13=データが読めないんです!
14=データ・ファイルが見つからないんです! {0}
20=ドユーティー・コンテンツ情報: {1}({0}) / A:{2} / R:{3} / I:{4} / F:{5} ({6})
20=ドユーティー・コンテンツ情報: {1}({0}) / A:{2} / R:{3} / I:{4} / F:{5}
21=ルーレット
22=インスタンス
23=フェイト
@ -25,13 +25,18 @@ LANG=日本語
26=基本
27=なし
28=パケット・データが見つからないんです! {0}
29=パケット情報: {0} "{1}" ({2})
29=パケット情報: {0} "{1}"
30=Webサービスにエラーが発生しました。
31=コンテンツ・データのアップデートが失敗しました。
32=パケット・データのアップデートが失敗しまし。
33=パケット・アップデート: {0} "{1}"
35=クリップボードエラーです!
36=ウィンドウ制御エラーです!
37=デバッグ
38=マッチング
39=待機
99=Duty Content プラグイン {0}
99=DutyContent プラグイン {0}
101=WAVEファイルを選んでください
102=WAVファイル (*.wav)|*.wav|全て (*.*)|*.*
@ -54,13 +59,13 @@ LANG=日本語
213=使用する
214=使用しない
215=※プラグイン再起動が必要です
216=ログフォント
300=コンテンツ
301=コンテンツ
302=設定
303=パゲット
304=データ
305=ログフォント
306=オーバレイ・オン
307=透明度
308=サウンド・オン
@ -82,15 +87,6 @@ LANG=日本語
324=状態
325=人数
326=進行度
327=ピン
328=ピン使用
329=速度色
330=ナイス
331=いい
332=ふつう
333=わるい
334=グラフ
335=クライアントの接触がない場合のDC選択
336=パケット
337=カストム・パケット
338=Discordのウェブフックお知らせ
@ -98,7 +94,26 @@ LANG=日本語
340=テスト&& お知らせ保存
341=TTS使用
342=正しいDiscordのウェブフックURLを入力してください
343=現在アドレス
400=ピン
401=ピン使用
402=速度色
403=ナイス
404=いい
405=ふつう
406=わるい
407=グラフ
408=クライアントの接触がない場合のDC選択
409=現在アドレス
410=グラフタイプ
411=線形
412=湾曲
413=損失率を示す
500=ログ
501=コピー
502=全て消す
503=自動的にスクロール
10001="{0}" 発生!
10002=待機: {0}

View file

@ -6,8 +6,8 @@ LANG=한국어(액토즈)
2=FFXIV 플러그인이 없어요!
3=FFXIV 플러그인을 찾았어요!
4=FFXIV 듀티 콘텐츠: {0}
5=ACT 정보: {0} ({1})
6=FFXIV 플러그인 정보: {0} ({1})
5=ACT 정보: {0}
6=FFXIV 플러그인 정보: {0}
7=잘못된 데이터: {0}
8=분석할 수 없어요
9=알수없는 임무: {0}
@ -16,7 +16,7 @@ LANG=한국어(액토즈)
12=알수없는 돌발: {0}
13=데이터를 읽을 수가 없어요!
14=데이터 파일이 없어요! {0}
20=듀티 콘텐츠 정보: {1}({0}) / A:{2} / R:{3} / I:{4} / F:{5} ({6})
20=듀티 콘텐츠 정보: {1}({0}) / A:{2} / R:{3} / I:{4} / F:{5}
21=무작위 임무
22=인스턴스
23=돌발
@ -25,11 +25,16 @@ LANG=한국어(액토즈)
26=기본
27=없음
28=패킷 파일이 없어요! {0}
29=패킷 정보: {0} "{1}" ({2})
29=패킷 정보: {0} "{1}"
30=웹 요청중 에러 발생
31=임무 데이터 업데이트중 에러 발생
32=패킷 데이터 업데이트중 에러 발생
33=패킷을 업데이트 했습니다: {0} "{1}"
35=클립보드를 사용할 수 없습니다!
36=윈도우 컨트롤에 오류가 있습니다!
37=디버그
38=매칭
39=찾습니다
99=듀티 콘텐츠 플러그인 {0}
@ -54,13 +59,13 @@ LANG=한국어(액토즈)
213=사용함
214=사용안함
215=※플러그인 재기동이 필요합니다
216=로그 글꼴
300=임무
301=콘텐츠
302=설정
303=패킷
304=데이터셋
305=로그 글꼴
306=오버레이 보기
307=투명도
308=소리 듣기
@ -82,15 +87,6 @@ LANG=한국어(액토즈)
324=상태
325=사람수
326=진행도
327=핑
328=핑 사용
329=속도별 색깔
330=매우 좋음
331=좋음
332=보통
333=나쁨
334=그래프 보기
335=클라이언트의 접속이 없을때 사용할 DC 선택
336=패킷
337=커스텀 패킷
338=디스코드 웹훅 알림
@ -98,7 +94,26 @@ LANG=한국어(액토즈)
340=테스트 && 알림설정 저장
341=말하기 사용
342=올바른 디스코드 웹훅 주소를 입력해주세요.
343=연결된 IP주소
400=핑
401=핑 사용
402=속도별 색깔
403=매우 좋음
404=좋음
405=보통
406=나쁨
407=그래프 보기
408=클라이언트의 접속이 없을때 사용할 DC 선택
409=연결된 IP주소
410=그래프 모양
411=선형
412=곡선
413=손실율 표시
500=로그
501=복사
502=모두 지우기
503=자동으로 스크롤
10001="{0}" 발생했어요!
10002=찾습니다: {0}

View file

@ -6,8 +6,8 @@ LANG=한국어
2=FFXIV 플러그인이 없어요!
3=FFXIV 플러그인을 찾았어요!
4=FFXIV 듀티 콘텐츠: {0}
5=ACT 정보: {0} ({1})
6=FFXIV 플러그인 정보: {0} ({1})
5=ACT 정보: {0}
6=FFXIV 플러그인 정보: {0}
7=잘못된 데이터: {0}
8=분석할 수 없어요
9=알수없는 듀티: {0}
@ -16,20 +16,25 @@ LANG=한국어
12=알수없는 페이트: {0}
13=데이터를 읽을 수가 없어요!
14=데이터 파일이 없어요! {0}
20=듀티 콘텐츠 정보: {1}({0}) / A:{2} / R:{3} / I:{4} / F:{5} ({6})
20=듀티 콘텐츠 정보: {1}({0}) / A:{2} / R:{3} / I:{4} / F:{5}
21=루렛
22=인스턴스
23=페이트
24=스커미시
25=크리티컬 인게이지먼트
25=인게이지먼트
26=기본
27=없음
28=패킷 파일이 없어요! {0}
29=패킷 정보: {0} "{1}" ({2})
29=패킷 정보: {0} "{1}"
30=웹 요청중 에러 발생
31=임무 데이터 업데이트중 에러 발생
32=패킷 데이터 업데이트중 에러 발생
33=새 패킷 업데이트: {0} "{1}"
35=클립보드를 사용할 수 없습니다!
36=윈도우 컨트롤에 오류가 있습니다!
37=디버그
38=매칭
39=찾아요
99=듀티 콘텐츠 플러그인 {0}
@ -54,13 +59,13 @@ LANG=한국어
213=보이기
214=감추기
215=※플러그인을 다시 실행해야합니다
216=로그 글꼴
300=듀티
301=콘텐츠
302=설정
303=패킷
304=데이터셋
305=로그 글꼴
306=오버레이 보기
307=투명도
308=소리 듣기
@ -82,15 +87,6 @@ LANG=한국어
324=상태
325=사람수
326=진행도
327=핑
328=핑 사용
329=속도별 색깔
330=매우 좋음
331=좋음
332=보통
333=나쁨
334=그래프 보기
335=클라이언트의 접속이 없을때 사용할 DC 선택
336=패킷
337=커스텀 패킷
338=디스코드 Webhook 알림
@ -98,7 +94,26 @@ LANG=한국어
340=테스트 && 알림설정 저장
341=TTS 사용
342=올바른 디스코드 Webhook을 입력해주세요.
343=현재 연결 IP
400=핑
401=핑 사용
402=속도별 색깔
403=매우 좋음
404=좋음
405=보통
406=나쁨
407=그래프 보기
408=클라이언트의 접속이 없을때 사용할 DC 선택
409=현재 연결 IP
410=그래프 모양
411=선형
412=곡선
413=손실율 표시
500=로그
501=복사
502=모두 지우기
503=자동으로 스크롤
10001="{0}" 떠스요!
10002=찾아요: {0}

View file

@ -12,7 +12,7 @@ namespace DutyContent
{
class DcConfig
{
public static int PluginTag => 14;
public static int PluginTag => 15;
public static Version PluginVersion => System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
public static bool PluginEnable { get; set; }
@ -33,6 +33,7 @@ namespace DutyContent
public static int LastUpdatedPlugin { get; set; } = 0;
public static string UiFontFamily { get; set; } = "Microsoft Sans Serif";
public static bool StatusBar { get; set; } = false;
public static bool DebugEnable { get; set; } = false;
//
public static string BuildDataFileName(string header, string context, string ext)
@ -75,6 +76,7 @@ namespace DutyContent
sw.WriteLine("LastUpdatedPlugin={0}", LastUpdatedPlugin);
sw.WriteLine("UiFontFamily={0}", UiFontFamily);
sw.WriteLine("StatusBar={0}", StatusBar);
sw.WriteLine("DebugEnable={0}", DebugEnable);
sw.WriteLine();
Duty.InternalSaveStream(sw);
@ -97,6 +99,7 @@ namespace DutyContent
LastUpdatedPlugin = ThirdParty.Converter.ToInt(db["LastUpdatedPlugin"]);
UiFontFamily = db.Get("UiFontFamily", UiFontFamily);
StatusBar = ThirdParty.Converter.ToBool(db["StatusBar"], StatusBar);
DebugEnable = ThirdParty.Converter.ToBool(db["DebugEnable"], DebugEnable);
Duty.InternalReadFromDb(db);
}
@ -107,16 +110,16 @@ namespace DutyContent
if (string.IsNullOrWhiteSpace(Language))
{
if (!is_in_init)
MesgLog.Initialize(Properties.Resources.DefaultMessage);
Locale.Initialize(Properties.Resources.DefaultMessage);
}
else
{
string filename = BuildLangFileName(Language);
if (File.Exists(filename))
MesgLog.LoadFile(filename);
Locale.LoadFile(filename);
else
MesgLog.Initialize(Properties.Resources.DefaultMessage);
Locale.Initialize(Properties.Resources.DefaultMessage);
}
}
@ -139,7 +142,7 @@ namespace DutyContent
if (!File.Exists(filename))
{
MesgLog.E(27, " ");
Logger.E(27, " ");
return false;
}
}
@ -150,8 +153,7 @@ namespace DutyContent
// load. if file not exist, create new one with default value
Packet.Load(filename);
MesgLog.I(29, Packet.Version, Packet.Description, filename);
Logger.Write(Packet.GetInformation());
return true;
}
@ -160,13 +162,13 @@ namespace DutyContent
public class PacketConfig
{
// Packet
public long Version { get; set; } = 2005551;
public string Description { get; set; } = "5.55 HotFix";
public ushort OpFate { get; set; } = 858;
public ushort OpDuty { get; set; } = 271;
public ushort OpMatch { get; set; } = 220;
public ushort OpInstance { get; set; } = 923;
public ushort OpSouthernBozja { get; set; } = 584;
public long Version { get; set; } = 2005580;
public string Description { get; set; } = "5.58 (JP/NA/EU/OC)";
public ushort OpFate { get; set; } = 788;
public ushort OpDuty { get; set; } = 676;
public ushort OpMatch { get; set; } = 428;
public ushort OpInstance { get; set; } = 234;
public ushort OpCe { get; set; } = 269;
// packet version structure
// 0 - Service area (1:Custom, 2:Global, 3:Korea)
@ -197,7 +199,7 @@ namespace DutyContent
OpDuty = right.OpDuty;
OpMatch = right.OpMatch;
OpInstance = right.OpInstance;
OpSouthernBozja = right.OpSouthernBozja;
OpCe = right.OpCe;
}
else
{
@ -205,10 +207,22 @@ namespace DutyContent
OpDuty = 0;
OpMatch = 0;
OpInstance = 0;
OpSouthernBozja = 0;
OpCe = 0;
}
}
//
public string GetInformation()
{
return Locale.Text(29, Version, Description);
}
//
public override string ToString()
{
return GetInformation();
}
//
public bool Save(string filename)
{
@ -227,7 +241,7 @@ namespace DutyContent
sw.WriteLine("OpDuty={0}", OpDuty);
sw.WriteLine("OpMatch={0}", OpMatch);
sw.WriteLine("OpInstance={0}", OpInstance);
sw.WriteLine("OpSouthernBozja={0}", OpSouthernBozja);
sw.WriteLine("OpSouthernBozja={0}", OpCe);
sw.WriteLine();
}
@ -242,7 +256,7 @@ namespace DutyContent
OpDuty = ThirdParty.Converter.ToUshort(db["OpDuty"], OpDuty);
OpMatch = ThirdParty.Converter.ToUshort(db["OpMatch"], OpMatch);
OpInstance = ThirdParty.Converter.ToUshort(db["OpInstance"], OpInstance);
OpSouthernBozja = ThirdParty.Converter.ToUshort(db["OpSouthernBozja"], OpSouthernBozja);
OpCe = ThirdParty.Converter.ToUshort(db["OpSouthernBozja"], OpCe);
}
//
@ -302,7 +316,9 @@ namespace DutyContent
Color.FromArgb(0xFF, 0xDD, 0xA0, 0xDD),
};
public bool PingGraph { get; set; }
public bool PingShowLoss { get; set; }
public string PingDefAddr { get; set; }
public int PingGraphType { get; set; }
//
public bool EnableNotify => UseNotifyLine || UseNotifyTelegram || UseNotifyDiscordWebhook;
@ -356,8 +372,10 @@ namespace DutyContent
sw.WriteLine("DutyPingColor1={0:X}", PingColors[1].ToArgb());
sw.WriteLine("DutyPingColor2={0:X}", PingColors[2].ToArgb());
sw.WriteLine("DutyPingColor3={0:X}", PingColors[3].ToArgb());
sw.WriteLine("DutyPingShowLoss={0}", PingShowLoss);
sw.WriteLine("DutyPingGraph={0}", PingGraph);
sw.WriteLine("DutyPingDefAddr={0}", PingDefAddr);
sw.WriteLine("DutyPingGraphType={0}", PingGraphType);
sw.WriteLine();
}
@ -401,8 +419,10 @@ namespace DutyContent
PingColors[1] = ThirdParty.Converter.ToColorArgb(db["DutyPingColor1"], PingColors[1]);
PingColors[2] = ThirdParty.Converter.ToColorArgb(db["DutyPingColor2"], PingColors[2]);
PingColors[3] = ThirdParty.Converter.ToColorArgb(db["DutyPingColor3"], PingColors[3]);
PingShowLoss = ThirdParty.Converter.ToBool(db["DutyPingShowLoss"]);
PingGraph = ThirdParty.Converter.ToBool(db["DutyPingGraph"]);
PingDefAddr = db.Get("DutyPingDefAddr", string.Empty);
PingGraphType = ThirdParty.Converter.ToInt(db["PingGraphType"]);
}
}
@ -440,19 +460,24 @@ namespace DutyContent
//
public class ConnectionList
{
public List<ThirdParty.NativeMethods.TcpRow> Conns = new List<ThirdParty.NativeMethods.TcpRow>();
public SortedSet<ThirdParty.NativeMethods.TcpRow> Conns = new SortedSet<ThirdParty.NativeMethods.TcpRow>();
public int Count => Conns.Count;
public ThirdParty.NativeMethods.TcpRow[] CopyConnection()
{
ThirdParty.NativeMethods.TcpRow[] ret;
lock (Conns)
ret = Conns.ToArray();
{
ret = new ThirdParty.NativeMethods.TcpRow[Conns.Count];
Conns.CopyTo(ret);
}
return ret;
}
public void GetConnections(Process process)
public void BuildConnections(Process process)
{
var size = 0;
ThirdParty.NativeMethods.GetExtendedTcpTable(IntPtr.Zero, ref size, true, AddressFamily.InterNetwork, 4);

View file

@ -72,6 +72,18 @@ namespace DutyContent
public static IReadOnlyDictionary<int, Fate> Fates { get; private set; } = new Dictionary<int, Fate>();
public static Dictionary<int, int> Missions { get; private set; } = new Dictionary<int, int>();
//
public static string GetInformation()
{
return Locale.Text(20,
Language,
Version,
Areas.Count,
Roulettes.Count,
Instances.Count,
Fates.Count);
}
//
public static bool Initialize(string json)
{
@ -116,12 +128,12 @@ namespace DutyContent
}
catch (NullReferenceException /*nex*/)
{
MesgLog.E(7, fate.Key);
Logger.E(7, fate.Key);
return false;
}
catch (Exception ex)
{
MesgLog.Ex(ex, 8);
Logger.Ex(ex, 8);
return false;
}
}
@ -167,28 +179,28 @@ namespace DutyContent
public static Roulette GetRoulette(int code)
{
return Roulettes.TryGetValue(code, out Roulette roulette) ? roulette :
new Roulette { Name = MesgLog.Text(9, code) };
new Roulette { Name = Locale.Text(9, code) };
}
//
public static Instance GetInstance(int code)
{
return Instances.TryGetValue(code, out Instance instance) ? instance :
new Instance { Name = MesgLog.Text(10, code) };
new Instance { Name = Locale.Text(10, code) };
}
//
public static Area GetArea(int code)
{
return Areas.TryGetValue(code, out Area area) ? area :
new Area { Name = MesgLog.Text(11, code) };
new Area { Name = Locale.Text(11, code) };
}
//
public static Fate GetFate(int code)
{
return Fates.ContainsKey(code) ? Fates[code] :
new Fate { Name = MesgLog.Text(12, code) };
new Fate { Name = Locale.Text(12, code) };
}
//
@ -207,7 +219,7 @@ namespace DutyContent
if (!File.Exists(filename))
{
MesgLog.E(14, filename);
Logger.E(14, filename);
return false;
}
@ -217,22 +229,15 @@ namespace DutyContent
string json = File.ReadAllText(filename, Encoding.UTF8);
if (!Initialize(json))
if (Initialize(json))
{
MesgLog.E(13);
return false;
Logger.Write(GetInformation());
return true;
}
else
{
MesgLog.I(20,
Language,
Version,
Areas.Count,
Roulettes.Count,
Instances.Count,
Fates.Count,
filename);
return true;
Logger.E(13);
return false;
}
}
@ -241,11 +246,11 @@ namespace DutyContent
// 10[1] status 0=end, 1=wait, 2=??, 3=progress
switch (s)
{
case 0: return MesgLog.Text(10017);
case 1: return MesgLog.Text(10018);
case 2: return MesgLog.Text(10019);
case 3: return MesgLog.Text(10020);
default: return MesgLog.Text(10021);
case 0: return Locale.Text(10017);
case 1: return Locale.Text(10018);
case 2: return Locale.Text(10019);
case 3: return Locale.Text(10020);
default: return Locale.Text(10021);
}
}

108
DcControl.Designer.cs generated
View file

@ -29,77 +29,67 @@ namespace DutyContent
/// </summary>
private void InitializeComponent()
{
this.spctBase = new System.Windows.Forms.SplitContainer();
this.tabMain = new System.Windows.Forms.TabControl();
this.tabPageLog = new System.Windows.Forms.TabPage();
this.tabPageDuty = new System.Windows.Forms.TabPage();
this.tabPagePing = new System.Windows.Forms.TabPage();
this.tabPageConfig = new System.Windows.Forms.TabPage();
this.txtMesg = new System.Windows.Forms.RichTextBox();
this.btnClearMesg = new System.Windows.Forms.Button();
this.panelBase = new System.Windows.Forms.Panel();
this.lblStatusLeft = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.spctBase)).BeginInit();
this.spctBase.Panel1.SuspendLayout();
this.spctBase.Panel2.SuspendLayout();
this.spctBase.SuspendLayout();
this.tabMain.SuspendLayout();
this.panelBase.SuspendLayout();
this.SuspendLayout();
//
// spctBase
//
this.spctBase.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.spctBase.Location = new System.Drawing.Point(3, 3);
this.spctBase.Name = "spctBase";
this.spctBase.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// spctBase.Panel1
//
this.spctBase.Panel1.Controls.Add(this.tabMain);
//
// spctBase.Panel2
//
this.spctBase.Panel2.Controls.Add(this.txtMesg);
this.spctBase.Panel2.Controls.Add(this.btnClearMesg);
this.spctBase.Size = new System.Drawing.Size(786, 534);
this.spctBase.SplitterDistance = 467;
this.spctBase.TabIndex = 0;
//
// tabMain
//
this.tabMain.Alignment = System.Windows.Forms.TabAlignment.Left;
this.tabMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.tabMain.Controls.Add(this.tabPageLog);
this.tabMain.Controls.Add(this.tabPageDuty);
this.tabMain.Controls.Add(this.tabPagePing);
this.tabMain.Controls.Add(this.tabPageConfig);
this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabMain.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
this.tabMain.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tabMain.ItemSize = new System.Drawing.Size(30, 100);
this.tabMain.Location = new System.Drawing.Point(0, 0);
this.tabMain.Margin = new System.Windows.Forms.Padding(4);
this.tabMain.Multiline = true;
this.tabMain.Name = "tabMain";
this.tabMain.SelectedIndex = 0;
this.tabMain.Size = new System.Drawing.Size(786, 467);
this.tabMain.Size = new System.Drawing.Size(820, 465);
this.tabMain.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabMain.TabIndex = 0;
this.tabMain.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.TabMain_DrawItem);
//
// tabPageLog
//
this.tabPageLog.Location = new System.Drawing.Point(104, 4);
this.tabPageLog.Margin = new System.Windows.Forms.Padding(4);
this.tabPageLog.Name = "tabPageLog";
this.tabPageLog.Size = new System.Drawing.Size(712, 457);
this.tabPageLog.TabIndex = 3;
this.tabPageLog.Text = "Log";
this.tabPageLog.UseVisualStyleBackColor = true;
//
// tabPageDuty
//
this.tabPageDuty.BackColor = System.Drawing.Color.Transparent;
this.tabPageDuty.Location = new System.Drawing.Point(104, 4);
this.tabPageDuty.Margin = new System.Windows.Forms.Padding(4);
this.tabPageDuty.Name = "tabPageDuty";
this.tabPageDuty.Padding = new System.Windows.Forms.Padding(3);
this.tabPageDuty.Size = new System.Drawing.Size(678, 459);
this.tabPageDuty.Padding = new System.Windows.Forms.Padding(4);
this.tabPageDuty.Size = new System.Drawing.Size(712, 441);
this.tabPageDuty.TabIndex = 0;
this.tabPageDuty.Text = "Duty";
//
// tabPagePing
//
this.tabPagePing.Location = new System.Drawing.Point(104, 4);
this.tabPagePing.Margin = new System.Windows.Forms.Padding(4);
this.tabPagePing.Name = "tabPagePing";
this.tabPagePing.Size = new System.Drawing.Size(678, 459);
this.tabPagePing.Size = new System.Drawing.Size(712, 441);
this.tabPagePing.TabIndex = 2;
this.tabPagePing.Text = "Ping";
this.tabPagePing.UseVisualStyleBackColor = true;
@ -107,43 +97,23 @@ namespace DutyContent
// tabPageConfig
//
this.tabPageConfig.Location = new System.Drawing.Point(104, 4);
this.tabPageConfig.Margin = new System.Windows.Forms.Padding(4);
this.tabPageConfig.Name = "tabPageConfig";
this.tabPageConfig.Padding = new System.Windows.Forms.Padding(3);
this.tabPageConfig.Size = new System.Drawing.Size(678, 459);
this.tabPageConfig.Padding = new System.Windows.Forms.Padding(4);
this.tabPageConfig.Size = new System.Drawing.Size(712, 441);
this.tabPageConfig.TabIndex = 1;
this.tabPageConfig.Text = "Config";
this.tabPageConfig.UseVisualStyleBackColor = true;
//
// txtMesg
//
this.txtMesg.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtMesg.Location = new System.Drawing.Point(104, 3);
this.txtMesg.Name = "txtMesg";
this.txtMesg.ReadOnly = true;
this.txtMesg.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.txtMesg.Size = new System.Drawing.Size(679, 57);
this.txtMesg.TabIndex = 1;
this.txtMesg.Text = "";
//
// btnClearMesg
//
this.btnClearMesg.Location = new System.Drawing.Point(3, 3);
this.btnClearMesg.Name = "btnClearMesg";
this.btnClearMesg.Size = new System.Drawing.Size(95, 33);
this.btnClearMesg.TabIndex = 0;
this.btnClearMesg.Text = "Clear Mesg";
this.btnClearMesg.UseVisualStyleBackColor = true;
//
// panelBase
//
this.panelBase.Controls.Add(this.tabMain);
this.panelBase.Controls.Add(this.lblStatusLeft);
this.panelBase.Controls.Add(this.spctBase);
this.panelBase.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelBase.Location = new System.Drawing.Point(0, 0);
this.panelBase.Margin = new System.Windows.Forms.Padding(4);
this.panelBase.Name = "panelBase";
this.panelBase.Size = new System.Drawing.Size(792, 567);
this.panelBase.Size = new System.Drawing.Size(820, 490);
this.panelBase.TabIndex = 1;
//
// lblStatusLeft
@ -153,9 +123,10 @@ namespace DutyContent
this.lblStatusLeft.BackColor = System.Drawing.Color.MidnightBlue;
this.lblStatusLeft.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblStatusLeft.ForeColor = System.Drawing.Color.White;
this.lblStatusLeft.Location = new System.Drawing.Point(0, 540);
this.lblStatusLeft.Location = new System.Drawing.Point(0, 462);
this.lblStatusLeft.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblStatusLeft.Name = "lblStatusLeft";
this.lblStatusLeft.Size = new System.Drawing.Size(792, 27);
this.lblStatusLeft.Size = new System.Drawing.Size(820, 28);
this.lblStatusLeft.TabIndex = 1;
this.lblStatusLeft.Text = "99";
this.lblStatusLeft.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
@ -163,15 +134,13 @@ namespace DutyContent
//
// DcControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.panelBase);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "DcControl";
this.Size = new System.Drawing.Size(792, 567);
this.spctBase.Panel1.ResumeLayout(false);
this.spctBase.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.spctBase)).EndInit();
this.spctBase.ResumeLayout(false);
this.Size = new System.Drawing.Size(820, 490);
this.tabMain.ResumeLayout(false);
this.panelBase.ResumeLayout(false);
this.ResumeLayout(false);
@ -179,15 +148,12 @@ namespace DutyContent
}
#endregion
private System.Windows.Forms.SplitContainer spctBase;
private System.Windows.Forms.Button btnClearMesg;
private System.Windows.Forms.TabControl tabMain;
private System.Windows.Forms.TabPage tabPageDuty;
private System.Windows.Forms.TabPage tabPageConfig;
private System.Windows.Forms.RichTextBox txtMesg;
private System.Windows.Forms.TabPage tabPagePing;
private System.Windows.Forms.Panel panelBase;
private System.Windows.Forms.Label lblStatusLeft;
private System.Windows.Forms.TabPage tabPageLog;
}
}

View file

@ -65,6 +65,9 @@ namespace DutyContent
Tab.ConfigForm configform = new Tab.ConfigForm();
tabPageConfig.Controls.Add(configform.Controls[0]);
Tab.LogForm logform = new Tab.LogForm();
tabPageLog.Controls.Add(logform.Controls[0]);
}
//
@ -89,7 +92,7 @@ namespace DutyContent
ActGlobals.oFormActMain.Shown += OFormActMain_Shown;
var actinfo = System.Reflection.Assembly.GetAssembly(typeof(ActGlobals));
MesgLog.I(5, actinfo.GetName().Version, actinfo.Location);
Logger.I(5, actinfo.GetName().Version);
if (_ffxiv_plugin_data == null)
{
@ -101,7 +104,7 @@ namespace DutyContent
}
if (_ffxiv_plugin_data == null)
MesgLog.E(2); // FFXIV plugin is missing!
Logger.E(2); // FFXIV plugin is missing!
else
{
var ids = ((FFXIV_ACT_Plugin.FFXIV_ACT_Plugin)_ffxiv_plugin_data.pluginObj).DataSubscription;
@ -110,7 +113,7 @@ namespace DutyContent
ids.ZoneChanged -= FFXIVPlugin_ZoneChanged;
ids.ZoneChanged += FFXIVPlugin_ZoneChanged;
MesgLog.I(6, System.Diagnostics.FileVersionInfo.GetVersionInfo(_ffxiv_plugin_data.pluginFile.FullName).FileVersion, _ffxiv_plugin_data.pluginFile.FullName);
Logger.I(6, System.Diagnostics.FileVersionInfo.GetVersionInfo(_ffxiv_plugin_data.pluginFile.FullName).FileVersion);
}
_save_timer = new System.Timers.Timer() { Interval = 5000 };
@ -142,10 +145,9 @@ namespace DutyContent
Tab.PingForm.Self?.PluginDeinitialize();
Tab.DutyForm.Self?.PluginDeinitialize();
Tab.ConfigForm.Self?.PluginDeinitialize();
Tab.LogForm.Self?.PluginDeinitialize();
DcConfig.SaveConfig();
MesgLog.SetTextBox(null);
_act_tab = null;
if (_act_label != null)
@ -171,10 +173,9 @@ namespace DutyContent
_act_label.Text = "Starting...";
//
MesgLog.SetTextBox(txtMesg);
MesgLog.Initialize(Properties.Resources.DefaultMessage);
Locale.Initialize(Properties.Resources.DefaultMessage);
MesgLog.C(Color.Aquamarine, 4, DcConfig.PluginVersion.ToString());
Logger.I(4, DcConfig.PluginVersion.ToString());
DcConfig.LoadConfig();
ShowStatusBarAsConfig(true);
@ -185,17 +186,20 @@ namespace DutyContent
UpdateUiLocale();
lblStatusLeft.Text = MesgLog.Text(99, DcConfig.PluginVersion); // once here
lblStatusLeft.Text = Locale.Text(99, DcConfig.PluginVersion); // once here
//
Dock = DockStyle.Fill;
_act_tab.Controls.Add(this);
//
Tab.LogForm.Self?.PluginInitialize();
Tab.ConfigForm.Self?.PluginInitialize();
Tab.DutyForm.Self?.PluginInitialize();
Tab.PingForm.Self?.PluginInitialize();
tabMain.SelectedTab = tabPageDuty;
//
if (DcConfig.DataRemoteUpdate)
{
@ -206,7 +210,7 @@ namespace DutyContent
frm.PluginInitialize();
frm.UpdateUiLocale();
TabPage tp = new TabPage(MesgLog.Text(206));
TabPage tp = new TabPage(Locale.Text(206));
try
{
// why? sometimes trouble
@ -214,7 +218,7 @@ namespace DutyContent
}
catch (Exception ex)
{
MesgLog.Ex(ex);
Logger.Ex(ex);
}
tabMain.TabPages.Add(tp);
@ -227,7 +231,7 @@ namespace DutyContent
DcConfig.SaveConfig();
}
MesgLog.C(Color.Aquamarine, 207, DcConfig.PluginTag, tag);
Logger.C(Color.Aquamarine, 207, DcConfig.PluginTag, tag);
}
}
@ -254,7 +258,7 @@ namespace DutyContent
if (tabMain.SelectedIndex == e.Index)
{
f = new Font(tabMain.Font.FontFamily, 12.0f, FontStyle.Bold, GraphicsUnit.Pixel);
f = new Font(tabMain.Font.FontFamily, 14.0f, FontStyle.Bold, GraphicsUnit.Pixel);
#if false
b = new SolidBrush(Color.Black);
h = SystemBrushes.Window;
@ -266,7 +270,7 @@ namespace DutyContent
//else if (p.col)
else
{
f = new Font(tabMain.Font.FontFamily, 12.0f, FontStyle.Regular, GraphicsUnit.Pixel);
f = new Font(tabMain.Font.FontFamily, 14.0f, FontStyle.Regular, GraphicsUnit.Pixel);
b = new SolidBrush(Color.DarkSlateGray);
h = SystemBrushes.Control;
}
@ -320,7 +324,7 @@ namespace DutyContent
if (span.TotalSeconds > 2)
{
_game_connection_tick = now;
DcConfig.Connections.GetConnections(_game_process.Process);
DcConfig.Connections.BuildConnections(_game_process.Process);
}
}
@ -353,7 +357,7 @@ namespace DutyContent
{
Tab.DutyForm.Self?.ZoneChanged(zone_id, zone_name);
lblStatusLeft.Text = MesgLog.Text(34, zone_name, zone_id);
lblStatusLeft.Text = Locale.Text(34, zone_name, zone_id);
}
//
@ -361,18 +365,21 @@ namespace DutyContent
{
ThirdParty.FontUtilities.SimpleChangeFont(this, DcConfig.UiFontFamily, true);
_act_label.Text = MesgLog.Text(1); // Duty ready
_act_tab.Text = MesgLog.Text(0); // FFXIV dc
_act_label.Text = Locale.Text(1); // Duty ready
_act_tab.Text = Locale.Text(0); // FFXIV dc
tabPageDuty.Text = MesgLog.Text(300);
tabPageDuty.Text = Locale.Text(300);
Tab.DutyForm.Self?.UpdateUiLocale();
tabPagePing.Text = MesgLog.Text(327);
tabPagePing.Text = Locale.Text(400);
Tab.PingForm.Self?.UpdateUiLocale();
tabPageConfig.Text = MesgLog.Text(200);
tabPageConfig.Text = Locale.Text(200);
Tab.ConfigForm.Self?.UpdateUiLocale();
tabPageLog.Text = Locale.Text(500);
Tab.LogForm.Self?.UpdateUiLocale();
Tab.UpdateNotifyForm.Self?.UpdateUiLocale();
}
@ -383,7 +390,7 @@ namespace DutyContent
{
if (!lblStatusLeft.Visible || force)
{
spctBase.Dock = DockStyle.None;
tabMain.Dock = DockStyle.None;
lblStatusLeft.Visible = true;
}
}
@ -392,7 +399,7 @@ namespace DutyContent
if (lblStatusLeft.Visible || force)
{
lblStatusLeft.Visible = false;
spctBase.Dock = DockStyle.Fill;
tabMain.Dock = DockStyle.Fill;
}
}
}

View file

@ -73,6 +73,7 @@
<DependentUpon>DcControl.cs</DependentUpon>
</Compile>
<Compile Include="Libre\PingGrapher.cs" />
<Compile Include="Logger.cs" />
<Compile Include="Tab\ConfigForm.cs">
<SubType>Form</SubType>
</Compile>
@ -95,6 +96,12 @@
<Compile Include="Overlay\DutyOvForm.Designer.cs">
<DependentUpon>DutyOvForm.cs</DependentUpon>
</Compile>
<Compile Include="Tab\LogForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Tab\LogForm.Designer.cs">
<DependentUpon>LogForm.cs</DependentUpon>
</Compile>
<Compile Include="Tab\PingForm.cs">
<SubType>Form</SubType>
</Compile>
@ -108,16 +115,23 @@
<DependentUpon>UpdateNotifyForm.cs</DependentUpon>
</Compile>
<Compile Include="ThirdParty\Converter.cs" />
<Compile Include="ThirdParty\EXComboBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ThirdParty\EXListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ThirdParty\FontUtilities.cs" />
<Compile Include="ThirdParty\LineDb.cs" />
<Compile Include="ThirdParty\NativeMethods.cs" />
<Compile Include="ThirdParty\ThreadWorker.cs" />
<Compile Include="ThirdParty\WebApi.cs" />
<Compile Include="ThirdParty\WinFormSupp.cs" />
<Compile Include="Updater.cs" />
<Compile Include="WorkerAct.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="MesgLog.cs" />
<Compile Include="Locale.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
@ -147,6 +161,9 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Tab\LogForm.resx">
<DependentUpon>LogForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Tab\PingForm.resx">
<DependentUpon>PingForm.cs</DependentUpon>
</EmbeddedResource>
@ -159,7 +176,7 @@
<None Include="Data\DcDuty-Korean.json" />
<None Include="Data\DcPacket-Custom.config" />
<None Include="Data\DcPacket-Global.config" />
<None Include="Data\DcPacket-LocalChina.config" />
<None Include="Data\DcPacketReserved-LocalChina.config" />
<None Include="Data\DcPacket-LocalKorea.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
@ -204,6 +221,18 @@
<ItemGroup>
<Resource Include="Data\DcLang-Korean%28Test%29.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\pix_rdrt_green.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\pix_rdrt_red.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\pix_rdrt_puple.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\pix_rdrt_bline.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if exist "%25APPDATA%25\Advanced Combat Tracker\Plugins\DutyContent" copy $(TargetPath) "%25APPDATA%25\Advanced Combat Tracker\Plugins\DutyContent" /y

View file

@ -89,7 +89,7 @@ namespace DutyContent.Libre
}
}
public void DrawValues(List<int> values)
public void DrawValues(List<int> values, DrawType drawtype = DrawType.Linear)
{
if (_bmp == null || values.Count < 2)
return;
@ -136,7 +136,10 @@ namespace DutyContent.Libre
for (var i = 0; i < cd.Count - 1; i++, u += Step)
pts[i] = new PointF(u, height - cd.Values[i] * scale);
g.DrawCurve(pen, pts, 0.6f);
if (drawtype == DrawType.Linear)
g.DrawLines(pen, pts);
else if (drawtype == DrawType.Curved)
g.DrawCurve(pen, pts, 0.6f);
}
#endif
}
@ -148,5 +151,12 @@ namespace DutyContent.Libre
_pbx.Image = _bmp;
_pbx.Refresh();
}
//
public enum DrawType : int
{
Linear = 0,
Curved = 1
}
}
}

52
Locale.cs Normal file
View file

@ -0,0 +1,52 @@
using System.Text;
namespace DutyContent
{
static class Locale
{
private static ThirdParty.LineDb _lines;
public static string Language { get; private set; }
public static void Initialize(string text)
{
_lines = new ThirdParty.LineDb(text, true);
}
public static bool LoadFile(string filename, Encoding enc)
{
if (_lines == null)
return false;
else
{
_lines.LoadFile(filename, enc, true);
return true;
}
}
public static bool LoadFile(string filename)
{
return LoadFile(filename, Encoding.UTF8);
}
public static string Text(string text)
{
return _lines == null || !_lines.Try(text, out string v) ? $"<{text}>" : v;
}
public static string Text(string text, params object[] prms)
{
return _lines == null || !_lines.Try(text, out string v) ? $"<{text}>" : string.Format(v, prms);
}
public static string Text(int key)
{
return _lines == null || !_lines.Try(key, out string v) ? $"<{key}>" : v;
}
public static string Text(int key, params object[] prms)
{
return _lines == null || !_lines.Try(key, out string v) ? $"<{key}>" : string.Format(v, prms);
}
}
}

77
Logger.cs Normal file
View file

@ -0,0 +1,77 @@
using System;
using System.Drawing;
using System.Text.RegularExpressions;
namespace DutyContent
{
static class Logger
{
private static readonly Regex ExceptionPattern = new Regex(@"\{(.+?)\}");
public static void Write(Color color, string fmt, params object[] prms)
{
if (Tab.LogForm.Self != null)
Tab.LogForm.Self.WriteLog(color, string.Format(fmt, prms));
}
public static void Write(string format, params object[] prms)
{
Write(Color.Black, format, prms);
}
public static void WriteCategory(Color color, string category, string fmt, params object[] prms)
{
if (Tab.LogForm.Self != null)
Tab.LogForm.Self.WriteLogSection(color, category, string.Format(fmt, prms));
}
public static void WriteCategory(string category, string format, params object[] prms)
{
Write(Color.Black, category, format, prms);
}
public static void L(string format, params object[] prms)
{
Write(Color.DarkBlue, format, prms);
}
// color
public static void C(Color color, int key, params object[] prms)
{
Write(color, Locale.Text(key, prms));
}
// info / black
public static void I(int key, params object[] prms)
{
Write(Color.Black, Locale.Text(key, prms));
}
// error / red
public static void E(int key, params object[] prms)
{
Write(Color.Red, Locale.Text(key, prms));
}
// gray
public static void Y(int key, params object[] prms)
{
Write(Color.Gray, Locale.Text(key, prms));
}
// exception
public static void Ex(Exception ex, int key, params object[] prms)
{
string text = Locale.Text(key, prms);
string msg = ExceptionPattern.Replace(ex.Message, "{{$1}}");
Write(Color.Red, $"{text}: {msg}");
}
// exception
public static void Ex(Exception ex)
{
string msg = ExceptionPattern.Replace(ex.Message, "{{$1}}");
Write(Color.Red, $"EX: {msg}");
}
}
}

View file

@ -1,134 +0,0 @@
using System;
using System.Drawing;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace DutyContent
{
class MesgLog
{
private static ThirdParty.LineDb _lines;
private static RichTextBox _logs;
private static readonly Regex ExceptionPattern = new Regex(@"\{(.+?)\}");
public static string Language { get; private set; }
public static void Initialize(string text)
{
_lines = new ThirdParty.LineDb(text, true);
}
public static bool LoadFile(string filename, Encoding enc)
{
if (_lines == null)
return false;
else
{
_lines.LoadFile(filename, enc, true);
return true;
}
}
public static bool LoadFile(string filename