Add Text Map Browser

Update Avatar Tab Image
This commit is contained in:
2022-05-10 22:47:09 +08:00
parent 9c7e4864b0
commit 5ba7cd74fb
17 changed files with 1457 additions and 406 deletions

View File

@ -19,6 +19,12 @@
<setting name="DefaultLanguage" serializeAs="String">
<value>zh-CN</value>
</setting>
<setting name="ResourcesDirPath" serializeAs="String">
<value />
</setting>
<setting name="TextMapFileName" serializeAs="String">
<value>TextMapCHS</value>
</setting>
</GrasscutterTools.Properties.Settings>
</userSettings>
</configuration>

View File

@ -36,6 +36,7 @@ namespace GrasscutterTools
this.GrpCommand = new System.Windows.Forms.GroupBox();
this.TCMain = new System.Windows.Forms.TabControl();
this.TPHome = new System.Windows.Forms.TabPage();
this.BtnOpenTextMap = new System.Windows.Forms.Button();
this.BtnOpenGachaBannerEditor = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.GrpSettings = new System.Windows.Forms.GroupBox();
@ -259,6 +260,7 @@ namespace GrasscutterTools
// TPHome
//
resources.ApplyResources(this.TPHome, "TPHome");
this.TPHome.Controls.Add(this.BtnOpenTextMap);
this.TPHome.Controls.Add(this.BtnOpenGachaBannerEditor);
this.TPHome.Controls.Add(this.pictureBox1);
this.TPHome.Controls.Add(this.GrpSettings);
@ -266,6 +268,13 @@ namespace GrasscutterTools
this.TPHome.Name = "TPHome";
this.TPHome.UseVisualStyleBackColor = true;
//
// BtnOpenTextMap
//
resources.ApplyResources(this.BtnOpenTextMap, "BtnOpenTextMap");
this.BtnOpenTextMap.Name = "BtnOpenTextMap";
this.BtnOpenTextMap.UseVisualStyleBackColor = true;
this.BtnOpenTextMap.Click += new System.EventHandler(this.BtnOpenTextMap_Click);
//
// BtnOpenGachaBannerEditor
//
resources.ApplyResources(this.BtnOpenGachaBannerEditor, "BtnOpenGachaBannerEditor");
@ -838,7 +847,7 @@ namespace GrasscutterTools
// ImgAvatar
//
resources.ApplyResources(this.ImgAvatar, "ImgAvatar");
this.ImgAvatar.Image = global::GrasscutterTools.Properties.Resources.ImgIconGrasscutter;
this.ImgAvatar.Image = global::GrasscutterTools.Properties.Resources.ImgHome;
this.ImgAvatar.Name = "ImgAvatar";
this.ImgAvatar.TabStop = false;
//
@ -1364,6 +1373,7 @@ namespace GrasscutterTools
resources.ApplyResources(this.LnkRCHelp, "LnkRCHelp");
this.LnkRCHelp.Name = "LnkRCHelp";
this.LnkRCHelp.TabStop = true;
this.LnkRCHelp.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LnkRCHelp_LinkClicked);
//
// LblSessionKey
//
@ -1390,6 +1400,7 @@ namespace GrasscutterTools
resources.ApplyResources(this.BtnPingHost, "BtnPingHost");
this.BtnPingHost.Name = "BtnPingHost";
this.BtnPingHost.UseVisualStyleBackColor = true;
this.BtnPingHost.Click += new System.EventHandler(this.BtnPingHost_Click);
//
// FormMain
//
@ -1604,6 +1615,7 @@ namespace GrasscutterTools
private System.Windows.Forms.TextBox TxtHost;
private System.Windows.Forms.Label LblHost;
private System.Windows.Forms.Button BtnPingHost;
private System.Windows.Forms.Button BtnOpenTextMap;
}
}

View File

@ -110,22 +110,27 @@ namespace GrasscutterTools
}
}
FormTextMapBrowser FormTextMapBrowser;
private void BtnOpenTextMap_Click(object sender, EventArgs e)
{
if (FormTextMapBrowser == null || FormTextMapBrowser.IsDisposed)
{
FormTextMapBrowser = new FormTextMapBrowser();
FormTextMapBrowser.Show();
}
else
{
FormTextMapBrowser.TopMost = true;
FormTextMapBrowser.TopMost = false;
}
}
private void CmbLanguage_SelectedIndexChanged(object sender, EventArgs e)
{
MultiLanguage.SetDefaultLanguage(Languages[CmbLanguage.SelectedIndex]);
FormMain_Load(this, EventArgs.Empty);
}
private void LnkRCHelp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
MessageBox.Show("TODO正在开发中", "TODO");
}
private void BtnPingHost_Click(object sender, EventArgs e)
{
MessageBox.Show("TODO正在开发中", "TODO");
}
#endregion - -
#region - -
@ -872,5 +877,19 @@ namespace GrasscutterTools
}
#endregion
#region - -
private void LnkRCHelp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
MessageBox.Show("TODO正在开发中", "TODO");
}
private void BtnPingHost_Click(object sender, EventArgs e)
{
MessageBox.Show("TODO正在开发中", "TODO");
}
#endregion
}
}

View File

@ -130,18 +130,27 @@
<data name="GrpCommand.Text" xml:space="preserve">
<value>Command</value>
</data>
<data name="TPHome.Text" xml:space="preserve">
<value>Home</value>
</data>
<data name="BtnOpenTextMap.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="BtnOpenTextMap.Text" xml:space="preserve">
<value>TextMapBrowser</value>
</data>
<data name="BtnOpenGachaBannerEditor.Text" xml:space="preserve">
<value>Banner editor</value>
</data>
<data name="GrpSettings.Text" xml:space="preserve">
<value>Settings</value>
</data>
<data name="ChkIncludeUID.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 21</value>
</data>
<data name="ChkIncludeUID.Text" xml:space="preserve">
<value>Include UID</value>
</data>
<data name="GrpSettings.Text" xml:space="preserve">
<value>Settings</value>
</data>
<data name="LblAbout.Location" type="System.Drawing.Point, System.Drawing">
<value>74, 38</value>
</data>
@ -151,8 +160,8 @@
<data name="LblAbout.Text" xml:space="preserve">
<value>Have a nice time!</value>
</data>
<data name="TPHome.Text" xml:space="preserve">
<value>Home</value>
<data name="TPCustom.Text" xml:space="preserve">
<value>Custom</value>
</data>
<data name="BtnExportCustomCommands.Location" type="System.Drawing.Point, System.Drawing">
<value>533, 216</value>
@ -202,8 +211,8 @@
<data name="TxtCustomName.Size" type="System.Drawing.Size, System.Drawing">
<value>267, 23</value>
</data>
<data name="TPCustom.Text" xml:space="preserve">
<value>Custom</value>
<data name="TPArtifact.Text" xml:space="preserve">
<value>Artifact</value>
</data>
<data name="LblArtifactStars.Location" type="System.Drawing.Point, System.Drawing">
<value>298, 41</value>
@ -268,8 +277,8 @@
<data name="LblMainAttribution.Text" xml:space="preserve">
<value>Main Stat</value>
</data>
<data name="TPArtifact.Text" xml:space="preserve">
<value>Artifact</value>
<data name="TPWeapon.Text" xml:space="preserve">
<value>Weapon</value>
</data>
<data name="LblWeaponDescription.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 6</value>
@ -313,8 +322,8 @@
<data name="NUDWeaponLevel.Location" type="System.Drawing.Point, System.Drawing">
<value>147, 216</value>
</data>
<data name="TPWeapon.Text" xml:space="preserve">
<value>Weapon</value>
<data name="TPItem.Text" xml:space="preserve">
<value>Items</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="BtnSaveGiveItemLog.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
@ -338,15 +347,15 @@
<data name="GrpGiveItemRecord.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left</value>
</data>
<data name="ListGiveItemLogs.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 140</value>
</data>
<data name="GrpGiveItemRecord.Size" type="System.Drawing.Size, System.Drawing">
<value>249, 162</value>
</data>
<data name="GrpGiveItemRecord.Text" xml:space="preserve">
<value>Records</value>
</data>
<data name="ListGiveItemLogs.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 140</value>
</data>
<data name="ChkDrop.Location" type="System.Drawing.Point, System.Drawing">
<value>278, 217</value>
</data>
@ -407,8 +416,8 @@
<data name="LblGiveCommandDescription.Text" xml:space="preserve">
<value>Give item to player</value>
</data>
<data name="TPItem.Text" xml:space="preserve">
<value>Items</value>
<data name="TPAvatar.Text" xml:space="preserve">
<value>Avatar</value>
</data>
<data name="LblAvatarGenWarning.Location" type="System.Drawing.Point, System.Drawing">
<value>88, 161</value>
@ -448,8 +457,8 @@ The data may not be cleared even if the account is recreated.</value>
<data name="CmbAvatar.Size" type="System.Drawing.Size, System.Drawing">
<value>200, 25</value>
</data>
<data name="TPAvatar.Text" xml:space="preserve">
<value>Avatar</value>
<data name="TPSpawn.Text" xml:space="preserve">
<value>Spawn</value>
</data>
<data name="BtnSaveSpawnLog.Text" xml:space="preserve">
<value>√ Record</value>
@ -460,6 +469,9 @@ The data may not be cleared even if the account is recreated.</value>
<data name="GrpSpawnRecord.Text" xml:space="preserve">
<value>Records</value>
</data>
<data name="GrpEntityType.Text" xml:space="preserve">
<value>Class</value>
</data>
<data name="RbEntityOrnament.Size" type="System.Drawing.Size, System.Drawing">
<value>84, 21</value>
</data>
@ -478,9 +490,6 @@ The data may not be cleared even if the account is recreated.</value>
<data name="RbEntityMonster.Text" xml:space="preserve">
<value>Monster</value>
</data>
<data name="GrpEntityType.Text" xml:space="preserve">
<value>Class</value>
</data>
<data name="LblSpawnDescription.Size" type="System.Drawing.Size, System.Drawing">
<value>81, 17</value>
</data>
@ -511,8 +520,8 @@ The data may not be cleared even if the account is recreated.</value>
<data name="NUDEntityLevel.Location" type="System.Drawing.Point, System.Drawing">
<value>146, 216</value>
</data>
<data name="TPSpawn.Text" xml:space="preserve">
<value>Spawn</value>
<data name="TPScene.Text" xml:space="preserve">
<value>Scene</value>
</data>
<data name="CmbClimateType.Location" type="System.Drawing.Point, System.Drawing">
<value>66, 94</value>
@ -541,8 +550,11 @@ The data may not be cleared even if the account is recreated.</value>
Tip: Most of the scenes have no effect and cannot be entered.</value>
</data>
<data name="TPScene.Text" xml:space="preserve">
<value>Scene</value>
<data name="TPStats.Text" xml:space="preserve">
<value>Stats</value>
</data>
<data name="GrpSetStats.Text" xml:space="preserve">
<value>Stats</value>
</data>
<data name="LblStatTip.Size" type="System.Drawing.Size, System.Drawing">
<value>26, 17</value>
@ -550,8 +562,8 @@ Tip: Most of the scenes have no effect and cannot be entered.</value>
<data name="LblStatTip.Text" xml:space="preserve">
<value>Tip</value>
</data>
<data name="GrpSetStats.Text" xml:space="preserve">
<value>Stats</value>
<data name="GrpTalentLevel.Text" xml:space="preserve">
<value>Talent Level</value>
</data>
<data name="LnkTalentE.Location" type="System.Drawing.Point, System.Drawing">
<value>283, 24</value>
@ -583,9 +595,6 @@ Tip: Most of the scenes have no effect and cannot be entered.</value>
<data name="NUDTalentLevel.Size" type="System.Drawing.Size, System.Drawing">
<value>128, 23</value>
</data>
<data name="GrpTalentLevel.Text" xml:space="preserve">
<value>Talent Level</value>
</data>
<data name="LblStatsDescription.Location" type="System.Drawing.Point, System.Drawing">
<value>6, 6</value>
</data>
@ -595,8 +604,11 @@ Tip: Most of the scenes have no effect and cannot be entered.</value>
<data name="LblStatsDescription.Text" xml:space="preserve">
<value>Set current active Avatar data</value>
</data>
<data name="TPStats.Text" xml:space="preserve">
<value>Stats</value>
<data name="TPManage.Text" xml:space="preserve">
<value>Manage</value>
</data>
<data name="GrpAccount.Text" xml:space="preserve">
<value>Account Management</value>
</data>
<data name="ChkAccountSetUid.Size" type="System.Drawing.Size, System.Drawing">
<value>49, 21</value>
@ -631,8 +643,8 @@ Tip: Most of the scenes have no effect and cannot be entered.</value>
<data name="TxtAccountUserName.Size" type="System.Drawing.Size, System.Drawing">
<value>127, 23</value>
</data>
<data name="GrpAccount.Text" xml:space="preserve">
<value>Account Management</value>
<data name="GrpPermission.Text" xml:space="preserve">
<value>Permission Management</value>
</data>
<data name="BtmPermRemove.Text" xml:space="preserve">
<value>Delete</value>
@ -655,11 +667,8 @@ Tip: Most of the scenes have no effect and cannot be entered.</value>
<data name="LblPermUID.Text" xml:space="preserve">
<value>UID</value>
</data>
<data name="GrpPermission.Text" xml:space="preserve">
<value>Permission Management</value>
</data>
<data name="TPManage.Text" xml:space="preserve">
<value>Manage</value>
<data name="TPAbout.Text" xml:space="preserve">
<value>About</value>
</data>
<data name="LnkGithub.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
@ -670,8 +679,8 @@ Tip: Most of the scenes have no effect and cannot be entered.</value>
<data name="LblSupportDescription.Text" xml:space="preserve">
<value>Grasscutter Tools</value>
</data>
<data name="TPAbout.Text" xml:space="preserve">
<value>About</value>
<data name="TPRemoteCall.Text" xml:space="preserve">
<value>Remote</value>
</data>
<data name="LblRemoteTODO.Location" type="System.Drawing.Point, System.Drawing">
<value>464, 3</value>
@ -679,6 +688,9 @@ Tip: Most of the scenes have no effect and cannot be entered.</value>
<data name="LblRemoteTODO.Text" xml:space="preserve">
<value>TODO...</value>
</data>
<data name="GrpRemoteCommand.Text" xml:space="preserve">
<value>Remote Cell</value>
</data>
<data name="LnkRCHelp.Size" type="System.Drawing.Size, System.Drawing">
<value>35, 17</value>
</data>
@ -700,12 +712,6 @@ Tip: Most of the scenes have no effect and cannot be entered.</value>
<data name="BtnPingHost.Text" xml:space="preserve">
<value>Test</value>
</data>
<data name="GrpRemoteCommand.Text" xml:space="preserve">
<value>Remote Cell</value>
</data>
<data name="TPRemoteCall.Text" xml:space="preserve">
<value>Remote</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>GrasscutterTools</value>
</data>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,158 @@
namespace GrasscutterTools
{
partial class FormTextMapBrowser
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormTextMapBrowser));
this.TxtTextMapFilter = new System.Windows.Forms.TextBox();
this.BtnSelectRecoursePath = new System.Windows.Forms.Button();
this.CmbLanguage = new System.Windows.Forms.ComboBox();
this.LblLanguage = new System.Windows.Forms.Label();
this.ChkTopMost = new System.Windows.Forms.CheckBox();
this.LblResourcesPath = new System.Windows.Forms.Label();
this.BtnSearch = new System.Windows.Forms.Button();
this.DGVTextMap = new System.Windows.Forms.DataGridView();
this.ColumnHash = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColumnID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColumnText = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.DGVTextMap)).BeginInit();
this.SuspendLayout();
//
// TxtTextMapFilter
//
resources.ApplyResources(this.TxtTextMapFilter, "TxtTextMapFilter");
this.TxtTextMapFilter.Name = "TxtTextMapFilter";
this.TxtTextMapFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TxtTextMapFilter_KeyDown);
//
// BtnSelectRecoursePath
//
resources.ApplyResources(this.BtnSelectRecoursePath, "BtnSelectRecoursePath");
this.BtnSelectRecoursePath.Name = "BtnSelectRecoursePath";
this.BtnSelectRecoursePath.UseVisualStyleBackColor = true;
this.BtnSelectRecoursePath.Click += new System.EventHandler(this.BtnSelectRecoursePath_Click);
//
// CmbLanguage
//
resources.ApplyResources(this.CmbLanguage, "CmbLanguage");
this.CmbLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CmbLanguage.FormattingEnabled = true;
this.CmbLanguage.Name = "CmbLanguage";
this.CmbLanguage.SelectedIndexChanged += new System.EventHandler(this.CmbLanguage_SelectedIndexChanged);
//
// LblLanguage
//
resources.ApplyResources(this.LblLanguage, "LblLanguage");
this.LblLanguage.Name = "LblLanguage";
//
// ChkTopMost
//
resources.ApplyResources(this.ChkTopMost, "ChkTopMost");
this.ChkTopMost.Name = "ChkTopMost";
this.ChkTopMost.UseVisualStyleBackColor = true;
this.ChkTopMost.CheckedChanged += new System.EventHandler(this.ChkTopMost_CheckedChanged);
//
// LblResourcesPath
//
resources.ApplyResources(this.LblResourcesPath, "LblResourcesPath");
this.LblResourcesPath.Name = "LblResourcesPath";
//
// BtnSearch
//
resources.ApplyResources(this.BtnSearch, "BtnSearch");
this.BtnSearch.Name = "BtnSearch";
this.BtnSearch.UseVisualStyleBackColor = true;
this.BtnSearch.Click += new System.EventHandler(this.BtnSearch_Click);
//
// DGVTextMap
//
this.DGVTextMap.AllowUserToAddRows = false;
this.DGVTextMap.AllowUserToDeleteRows = false;
this.DGVTextMap.AllowUserToResizeRows = false;
resources.ApplyResources(this.DGVTextMap, "DGVTextMap");
this.DGVTextMap.BackgroundColor = System.Drawing.Color.White;
this.DGVTextMap.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.DGVTextMap.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ColumnHash,
this.ColumnID,
this.ColumnText});
this.DGVTextMap.Name = "DGVTextMap";
this.DGVTextMap.ReadOnly = true;
this.DGVTextMap.RowTemplate.Height = 23;
//
// ColumnHash
//
resources.ApplyResources(this.ColumnHash, "ColumnHash");
this.ColumnHash.Name = "ColumnHash";
this.ColumnHash.ReadOnly = true;
//
// ColumnID
//
resources.ApplyResources(this.ColumnID, "ColumnID");
this.ColumnID.Name = "ColumnID";
this.ColumnID.ReadOnly = true;
//
// ColumnText
//
resources.ApplyResources(this.ColumnText, "ColumnText");
this.ColumnText.Name = "ColumnText";
this.ColumnText.ReadOnly = true;
//
// FormTextMapBrowser
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.DGVTextMap);
this.Controls.Add(this.BtnSearch);
this.Controls.Add(this.ChkTopMost);
this.Controls.Add(this.LblLanguage);
this.Controls.Add(this.CmbLanguage);
this.Controls.Add(this.LblResourcesPath);
this.Controls.Add(this.BtnSelectRecoursePath);
this.Controls.Add(this.TxtTextMapFilter);
this.Name = "FormTextMapBrowser";
this.Load += new System.EventHandler(this.FormTextMapBrowser_Load);
((System.ComponentModel.ISupportInitialize)(this.DGVTextMap)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox TxtTextMapFilter;
private System.Windows.Forms.Button BtnSelectRecoursePath;
private System.Windows.Forms.ComboBox CmbLanguage;
private System.Windows.Forms.Label LblLanguage;
private System.Windows.Forms.CheckBox ChkTopMost;
private System.Windows.Forms.Label LblResourcesPath;
private System.Windows.Forms.Button BtnSearch;
private System.Windows.Forms.DataGridView DGVTextMap;
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnHash;
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnID;
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnText;
}
}

View File

@ -0,0 +1,184 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using GrasscutterTools.Game;
using GrasscutterTools.Properties;
namespace GrasscutterTools
{
public partial class FormTextMapBrowser : Form
{
public FormTextMapBrowser()
{
InitializeComponent();
Icon = Resources.IconGrasscutter;
}
private void FormTextMapBrowser_Load(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(Settings.Default.ResourcesDirPath))
{
LoadResources(Settings.Default.ResourcesDirPath);
}
}
private TextMapData data;
private void LoadResources(string resourcesDirPath)
{
try
{
Cursor = Cursors.WaitCursor;
Application.DoEvents();
data = new TextMapData(resourcesDirPath);
LblResourcesPath.Text = resourcesDirPath;
if (Settings.Default.ResourcesDirPath != resourcesDirPath)
{
Settings.Default.ResourcesDirPath = resourcesDirPath;
Settings.Default.Save();
}
CmbLanguage.Items.Clear();
CmbLanguage.Items.AddRange(data.TextMapFiles);
if (!string.IsNullOrEmpty(Settings.Default.TextMapFileName))
{
var i = CmbLanguage.Items.IndexOf(Settings.Default.TextMapFileName);
if (i != -1)
CmbLanguage.SelectedIndex = i;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
Cursor = Cursors.Default;
}
}
private void BtnSelectRecoursePath_Click(object sender, EventArgs e)
{
var dir = new FolderBrowserDialog()
{
ShowNewFolderButton = false,
Description = "./Gasscutter/resources",
};
if (dir.ShowDialog() == DialogResult.OK)
{
LoadResources(dir.SelectedPath);
}
}
private void CmbLanguage_SelectedIndexChanged(object sender, EventArgs e)
{
if (CmbLanguage.SelectedIndex == -1 || data == null)
return;
try
{
Cursor = Cursors.WaitCursor;
Application.DoEvents();
data.LoadTextMap(data.TextMapFilePaths[CmbLanguage.SelectedIndex]);
GenLines();
Settings.Default.TextMapFileName = CmbLanguage.Text;
Settings.Default.Save();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
Cursor = Cursors.Default;
}
}
private List<ListViewItem> Items;
private void GenLines()
{
List<ListViewItem> items = new List<ListViewItem>(data.TextMap.Count);
foreach (var kv in data.TextMap)
{
if (data.ManualTextMap.TryGetValue(kv.Key, out string id))
items.Add(new ListViewItem(new string[] { kv.Key, id, kv.Value }));
else
items.Add(new ListViewItem(new string[] { kv.Key, "", kv.Value }));
}
Items = items;
}
private void ChkTopMost_CheckedChanged(object sender, EventArgs e)
{
TopMost = ChkTopMost.Checked;
}
private void BtnSearch_Click(object sender, EventArgs e)
{
if (Items == null)
{
MessageBox.Show("请先选择资源目录,并选择对应语言文件。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
var filter = TxtTextMapFilter.Text.Trim();
if (string.IsNullOrEmpty(filter))
return;
Regex r;
try
{
r = new Regex(filter, RegexOptions.IgnoreCase);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
try
{
Cursor = Cursors.WaitCursor;
Application.DoEvents();
var result = data.ManualTextMap.Where(kv => r.Match(kv.Value).Success)
.Select(kv => new { Hash = kv.Key, Id = kv.Value, Text = data.TextMap[kv.Key] })
.Concat(
data.TextMap.Where(kv => r.Match(kv.Key).Success || r.Match(kv.Value).Success)
.Select(kv => new {
Hash = kv.Key,
Id = data.ManualTextMap.TryGetValue(kv.Key, out string id) ? id : "",
Text = kv.Value
})
).ToList();
DGVTextMap.SuspendLayout();
DGVTextMap.Rows.Clear();
for (int i = 0; i < result.Count; i++)
{
DGVTextMap.Rows.Add();
DGVTextMap.Rows[i].Cells[0].Value = result[i].Hash;
DGVTextMap.Rows[i].Cells[1].Value = result[i].Id;
DGVTextMap.Rows[i].Cells[2].Value = result[i].Text;
}
DGVTextMap.ResumeLayout();
}
finally
{
Cursor = Cursors.Default;
}
}
private void TxtTextMapFilter_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
BtnSearch_Click(sender, e);
}
}
}

View File

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="BtnSelectRecoursePath.Text" xml:space="preserve">
<value>Select</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="LblLanguage.Location" type="System.Drawing.Point, System.Drawing">
<value>477, 15</value>
</data>
<data name="LblLanguage.Size" type="System.Drawing.Size, System.Drawing">
<value>65, 17</value>
</data>
<data name="LblLanguage.Text" xml:space="preserve">
<value>Language</value>
</data>
<data name="ChkTopMost.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="ChkTopMost.Text" xml:space="preserve">
<value>TopMost</value>
</data>
<data name="LblResourcesPath.Size" type="System.Drawing.Size, System.Drawing">
<value>294, 17</value>
</data>
<data name="LblResourcesPath.Text" xml:space="preserve">
<value>Please select a resource directory</value>
</data>
<data name="BtnSearch.Text" xml:space="preserve">
<value>Search</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Text Map Browser</value>
</data>
</root>

View File

@ -0,0 +1,405 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="TxtTextMapFilter.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="TxtTextMapFilter.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 41</value>
</data>
<data name="TxtTextMapFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>555, 23</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="TxtTextMapFilter.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;TxtTextMapFilter.Name" xml:space="preserve">
<value>TxtTextMapFilter</value>
</data>
<data name="&gt;&gt;TxtTextMapFilter.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;TxtTextMapFilter.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;TxtTextMapFilter.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="BtnSelectRecoursePath.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 12</value>
</data>
<data name="BtnSelectRecoursePath.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="BtnSelectRecoursePath.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="BtnSelectRecoursePath.Text" xml:space="preserve">
<value>浏览</value>
</data>
<data name="&gt;&gt;BtnSelectRecoursePath.Name" xml:space="preserve">
<value>BtnSelectRecoursePath</value>
</data>
<data name="&gt;&gt;BtnSelectRecoursePath.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;BtnSelectRecoursePath.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BtnSelectRecoursePath.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="CmbLanguage.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="CmbLanguage.Location" type="System.Drawing.Point, System.Drawing">
<value>548, 12</value>
</data>
<data name="CmbLanguage.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 25</value>
</data>
<data name="CmbLanguage.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;CmbLanguage.Name" xml:space="preserve">
<value>CmbLanguage</value>
</data>
<data name="&gt;&gt;CmbLanguage.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;CmbLanguage.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;CmbLanguage.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="LblLanguage.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="LblLanguage.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="LblLanguage.Location" type="System.Drawing.Point, System.Drawing">
<value>510, 15</value>
</data>
<data name="LblLanguage.Size" type="System.Drawing.Size, System.Drawing">
<value>32, 17</value>
</data>
<data name="LblLanguage.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="LblLanguage.Text" xml:space="preserve">
<value>语言</value>
</data>
<data name="&gt;&gt;LblLanguage.Name" xml:space="preserve">
<value>LblLanguage</value>
</data>
<data name="&gt;&gt;LblLanguage.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;LblLanguage.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;LblLanguage.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="ChkTopMost.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="ChkTopMost.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 14</value>
</data>
<data name="ChkTopMost.Size" type="System.Drawing.Size, System.Drawing">
<value>51, 21</value>
</data>
<data name="ChkTopMost.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="ChkTopMost.Text" xml:space="preserve">
<value>置顶</value>
</data>
<data name="&gt;&gt;ChkTopMost.Name" xml:space="preserve">
<value>ChkTopMost</value>
</data>
<data name="&gt;&gt;ChkTopMost.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;ChkTopMost.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;ChkTopMost.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="LblResourcesPath.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<data name="LblResourcesPath.Location" type="System.Drawing.Point, System.Drawing">
<value>177, 15</value>
</data>
<data name="LblResourcesPath.Size" type="System.Drawing.Size, System.Drawing">
<value>327, 17</value>
</data>
<data name="LblResourcesPath.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="LblResourcesPath.Text" xml:space="preserve">
<value>请选择Resources路径</value>
</data>
<data name="&gt;&gt;LblResourcesPath.Name" xml:space="preserve">
<value>LblResourcesPath</value>
</data>
<data name="&gt;&gt;LblResourcesPath.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;LblResourcesPath.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;LblResourcesPath.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="BtnSearch.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="BtnSearch.Location" type="System.Drawing.Point, System.Drawing">
<value>573, 41</value>
</data>
<data name="BtnSearch.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
</data>
<data name="BtnSearch.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="BtnSearch.Text" xml:space="preserve">
<value>搜索</value>
</data>
<data name="&gt;&gt;BtnSearch.Name" xml:space="preserve">
<value>BtnSearch</value>
</data>
<data name="&gt;&gt;BtnSearch.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;BtnSearch.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;BtnSearch.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="DGVTextMap.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left, Right</value>
</data>
<metadata name="ColumnHash.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="ColumnHash.HeaderText" xml:space="preserve">
<value>Hash</value>
</data>
<data name="ColumnHash.Width" type="System.Int32, mscorlib">
<value>80</value>
</data>
<metadata name="ColumnID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="ColumnID.HeaderText" xml:space="preserve">
<value>ID</value>
</data>
<data name="ColumnID.Width" type="System.Int32, mscorlib">
<value>240</value>
</data>
<metadata name="ColumnText.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="ColumnText.HeaderText" xml:space="preserve">
<value>Text</value>
</data>
<data name="ColumnText.Width" type="System.Int32, mscorlib">
<value>250</value>
</data>
<data name="DGVTextMap.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 70</value>
</data>
<data name="DGVTextMap.Size" type="System.Drawing.Size, System.Drawing">
<value>636, 379</value>
</data>
<data name="DGVTextMap.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data>
<data name="&gt;&gt;DGVTextMap.Name" xml:space="preserve">
<value>DGVTextMap</value>
</data>
<data name="&gt;&gt;DGVTextMap.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;DGVTextMap.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;DGVTextMap.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>7, 17</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>660, 461</value>
</data>
<data name="$this.Font" type="System.Drawing.Font, System.Drawing">
<value>微软雅黑, 9pt</value>
</data>
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 4, 4, 4</value>
</data>
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>600, 400</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>文本映射表浏览器</value>
</data>
<data name="&gt;&gt;ColumnHash.Name" xml:space="preserve">
<value>ColumnHash</value>
</data>
<data name="&gt;&gt;ColumnHash.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;ColumnID.Name" xml:space="preserve">
<value>ColumnID</value>
</data>
<data name="&gt;&gt;ColumnID.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;ColumnText.Name" xml:space="preserve">
<value>ColumnText</value>
</data>
<data name="&gt;&gt;ColumnText.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>FormTextMapBrowser</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@ -1,46 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GrasscutterTools.Game
{
internal enum ClimateType
{
/// <summary>
/// 无
/// </summary>
None,
/// <summary>
/// 晴天
/// </summary>
Sunny,
/// <summary>
/// 多云
/// </summary>
Cloudy,
/// <summary>
/// 雨
/// </summary>
Rain,
/// <summary>
/// 雷暴
/// </summary>
Thunderstorm,
/// <summary>
/// 雪
/// </summary>
Snow,
/// <summary>
/// 雾
/// </summary>
Mist
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace GrasscutterTools.Game
{
public class TextMapData
{
public TextMapData(string resourcesDirPath)
{
LoadManualTextMap(Path.Combine(resourcesDirPath, "ExcelBinOutput", "ManualTextMapConfigData.json"));
LoadTextMaps(Path.Combine(resourcesDirPath, "TextMap"));
}
public Dictionary<string, string> ManualTextMap;
public Dictionary<string, string> TextMap;
public string[] TextMapFilePaths;
public string[] TextMapFiles;
void LoadManualTextMap(string manualTextMapPath)
{
using (var fs = File.OpenRead(manualTextMapPath))
using (var sr = new StreamReader(fs))
using (var reader = new JsonTextReader(sr))
{
ManualTextMap = new Dictionary<string, string>();
while (reader.Read())
{
if (reader.TokenType == JsonToken.PropertyName && (string)reader.Value == "TextMapId")
{
var textMapId = reader.ReadAsString();
reader.Read();
ManualTextMap.Add(reader.ReadAsString(), textMapId);
}
}
}
}
void LoadTextMaps(string textMapDirPath)
{
TextMapFilePaths = Directory.GetFiles(textMapDirPath, "TextMap*.json");
if (TextMapFilePaths.Length == 0)
throw new FileNotFoundException("TextMap*.json Not Found");
TextMapFiles = TextMapFilePaths.Select(n => Path.GetFileNameWithoutExtension(n)).ToArray();
}
public void LoadTextMap(string textMapPath)
{
using (var fs = File.OpenRead(textMapPath))
using (var sr = new StreamReader(fs))
using (var reader = new JsonTextReader(sr))
{
TextMap = new Dictionary<string, string>();
while (reader.Read())
{
if (reader.TokenType == JsonToken.PropertyName)
{
TextMap.Add((string)reader.Value, reader.ReadAsString());
}
}
}
}
}
}

View File

@ -204,13 +204,19 @@
<Compile Include="FormMain.Designer.cs">
<DependentUpon>FormMain.cs</DependentUpon>
</Compile>
<Compile Include="Game\ClimateType.cs" />
<Compile Include="FormTextMapBrowser.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormTextMapBrowser.Designer.cs">
<DependentUpon>FormTextMapBrowser.cs</DependentUpon>
</Compile>
<Compile Include="Game\GameCommand.cs" />
<Compile Include="Game\Gacha\BannerType.cs" />
<Compile Include="Game\Gacha\GachaBanner.cs" />
<Compile Include="Game\GameData.cs" />
<Compile Include="Game\ItemMap.cs" />
<Compile Include="Game\SetStatsCommand.cs" />
<Compile Include="Game\TextMapData.cs" />
<Compile Include="MojoConsole\MojoConsole.cs" />
<Compile Include="MultiLanguage.cs" />
<Compile Include="Program.cs" />
@ -227,6 +233,12 @@
<EmbeddedResource Include="FormMain.resx">
<DependentUpon>FormMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormTextMapBrowser.en-US.resx">
<DependentUpon>FormTextMapBrowser.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormTextMapBrowser.resx">
<DependentUpon>FormTextMapBrowser.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.en-us.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.en-us.Designer.cs</LastGenOutput>
@ -281,6 +293,7 @@
<Content Include="Resources\IconGrasscutter.ico" />
<Content Include="Resources\IconGrasscutter.png" />
<None Include="Resources\ImgSupport.png" />
<Content Include="Resources\ImgHome.jpg" />
<Content Include="Resources\Permissions.txt" />
<Content Include="Resources\WeaponColor.txt" />
<Content Include="Resources\zh-cn\Animal.txt" />

View File

@ -460,6 +460,16 @@ namespace GrasscutterTools.Properties {
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap ImgHome {
get {
object obj = ResourceManager.GetObject("ImgHome", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>

View File

@ -151,6 +151,9 @@
<data name="IconGrasscutter" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\IconGrasscutter.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ImgHome" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ImgHome.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ImgIconGrasscutter" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\IconGrasscutter.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

View File

@ -58,5 +58,29 @@ namespace GrasscutterTools.Properties {
this["DefaultLanguage"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string ResourcesDirPath {
get {
return ((string)(this["ResourcesDirPath"]));
}
set {
this["ResourcesDirPath"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("TextMapCHS")]
public string TextMapFileName {
get {
return ((string)(this["TextMapFileName"]));
}
set {
this["TextMapFileName"] = value;
}
}
}
}

View File

@ -11,5 +11,11 @@
<Setting Name="DefaultLanguage" Type="System.String" Scope="User">
<Value Profile="(Default)">zh-CN</Value>
</Setting>
<Setting Name="ResourcesDirPath" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="TextMapFileName" Type="System.String" Scope="User">
<Value Profile="(Default)">TextMapCHS</Value>
</Setting>
</Settings>
</SettingsFile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB