Compare commits

..

24 Commits

Author SHA1 Message Date
8eca0a728b Add global exception handling 2022-05-13 11:41:09 +08:00
2a3ba29b1d Clean up all files 2022-05-13 11:39:07 +08:00
3defcbbdc1 Small optimization 2022-05-13 11:33:52 +08:00
e471253b12 Update the English translation in the code 2022-05-13 11:24:53 +08:00
0a0d33ae4a Update English translation 2022-05-13 10:54:22 +08:00
fb17ebe60b Fix F5 not working 2022-05-13 10:50:21 +08:00
2f161a5586 Update package
Fix 404 error
Add debug mode title
2022-05-13 10:29:12 +08:00
d82b5b590e Update README_en-US.md 2022-05-13 09:49:35 +08:00
a36c376fc0 Update README.md 2022-05-13 09:48:01 +08:00
c4c543b0d4 Update README_en-US.md 2022-05-13 09:30:26 +08:00
182f71d4ca Update README.md 2022-05-13 09:29:57 +08:00
0b7347e118 Support Open Command Plugin
Support Remove Command
Update version to 1.0.0
2022-05-13 08:52:35 +08:00
e30a2f79cf Fix UID upper limit issue (#18) 2022-05-11 22:22:05 +08:00
94a8a490b3 Fix English UI dislocation problem 2022-05-11 22:19:06 +08:00
68c42b16dd Implement prefab options #17 2022-05-11 22:15:19 +08:00
c089b7ac07 Fixed custom commands not reloading when switching languages 2022-05-11 21:48:24 +08:00
da7033395b Merge pull request #19 from renkin-atorie/i18n
[en] translate CustomCommands.txt
2022-05-11 21:30:56 +08:00
arub3do
3264ed8de6 [en] translate CustomCommands.txt 2022-05-11 21:03:35 +08:00
3e98e551de Update README 2022-05-10 22:54:41 +08:00
5ba7cd74fb Add Text Map Browser
Update Avatar Tab Image
2022-05-10 22:47:09 +08:00
9c7e4864b0 Update README.md 2022-05-08 18:50:34 +08:00
ca6441e780 Update Readme.md
Add Readme_en-US.md
Update Screenshots
Add Screenshots-en
Update Languages
2022-05-08 18:49:31 +08:00
65393c4d7b Update package
Update Language files
2022-05-07 22:10:03 +08:00
c83804ce92 Update Version to v0.10.0 2022-05-07 21:50:47 +08:00
69 changed files with 8061 additions and 4374 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
Doc/Screenshots/0-Home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -1,50 +1,43 @@
# Grasscutter Tools
中文 | [EN](README_en-US.md)
## Commands Generator
请从 [Releases](https://github.com/jie65535/GrasscutterCommandGenerator/releases) 中获取最新版本
## v0.9.0 更新
命令@UID随版本重构指令中指定ID改为`@ uid`,因此与旧版本服务端不兼容,不使用`指令含UID`则不影响)
## 远程执行
权限管理新增下拉框选择权限(方便选择)
服务端需要 [gc-opencommand-plugin](https://github.com/jie65535/gc-opencommand-plugin) 插件支持
![PermComboBox](Doc/Screenshots/PermComboBox.png)
---
场景页面新增天气设置(呼风唤雨~
## TODO List
- [ ] 多语言支持进度UI已经支持英语但还有许多ID映射文件缺失欢迎补充
- [ ] Animal.txt
- [ ] Artifact.txt
- [ ] ArtifactCat.txt
- [ ] ArtifactMainAttribution.txt
- [ ] ArtifactSubAttribution.txt
- [x] Avatar.txt
- [x] CustomCommands.txt
- [x] Item.txt
- [x] Monster.txt
- [ ] NPC.txt
- [ ] Ornament.txt
- [x] Scene.txt
- [ ] Weapon.txt
- [x] 远程执行命令
- [ ] 割草机启动器(无进度)
- [ ] 邮件编辑器(无进度)
- [ ] 商店编辑器(无进度)
![SetClimate](Doc/Screenshots/SetClimate.png)
## 软件截图
## v0.8.0 更新
圣遗物套装下拉框可键入提示
`状态` 标签改为 `数据`设置角色数据模块重构支持最新版指令。_部分属性旧版本可能不支持_
![Custom Stats Screenshort](Doc/Screenshots/8-CustomStats.png)
`其它` 页面改为 `管理` ,新增帐号创建和删除。
![Management](Doc/Screenshots/9-Manage.png)
## v0.7.0 更新
物品生成记录本
![Give Item Screenshort](Doc/Screenshots/4-GiveItem.png)
实体生成记录本
![Spawn Entity Screenshort](Doc/Screenshots/6-SpawnEntity.png)
## v0.6.0 更新
新增奖池编辑器
![GachaBannerEditor](Doc/Screenshots/10-GachaBannerEditor.png)
## Screenshots
![Logo](Doc/Screenshots/GrasscutterLogo.png)
![Home](Doc/Screenshots/0-Home.png)
![Custom Commands Screenshot](Doc/Screenshots/1-CustomCommands.png)
![Custom Artifact Screenshot](Doc/Screenshots/2-CustomArtifact.png)
@@ -62,3 +55,7 @@
![Custom Stats Screenshort](Doc/Screenshots/8-CustomStats.png)
![Management](Doc/Screenshots/9-Manage.png)
![GachaBannerEditor](Doc/Screenshots/10-GachaBannerEditor.png)
![Text Map Browser](Doc/Screenshots/11-TextMapBrowser.png)

61
README_en-US.md Normal file
View File

@@ -0,0 +1,61 @@
# Grasscutter Tools
[中文](README.md) | EN
## Commands Generator
Please download the latest version from [Releases](https://github.com/jie65535/GrasscutterCommandGenerator/releases)
## Remote command
The server require [gc-opencommand-plugin](https://github.com/jie65535/gc-opencommand-plugin) support
---
## TODO List
- [ ] Multi-language support (progress: UI already supports English, but there are still many ID mapping files missing, welcome to add)
- [ ] Animal.txt
- [ ] Artifact.txt
- [ ] ArtifactCat.txt
- [ ] ArtifactMainAttribution.txt
- [ ] ArtifactSubAttribution.txt
- [x] Avatar.txt
- [x] CustomCommands.txt
- [x] Item.txt
- [x] Monster.txt
- [ ] NPC.txt
- [ ] Ornament.txt
- [x] Scene.txt
- [ ] Weapon.txt
- [x] Execute command remotely
- [ ] Grasscutter Launcher (no progress)
- [ ] Mail Editor (no progress)
- [ ] Shop Editor (no progress)
## Screenshots
![Logo](Doc/Screenshots/GrasscutterLogo.png)
![Home](Doc/Screenshots-en/0-Home.png)
![Custom Commands Screenshot](Doc/Screenshots-en/1-CustomCommands.png)
![Custom Artifact Screenshot](Doc/Screenshots-en/2-CustomArtifact.png)
![Custom Weapon Screenshort](Doc/Screenshots-en/3-CustomWeapon.png)
![Give Item Screenshort](Doc/Screenshots-en/4-GiveItem.png)
![Give Avatar Screenshort](Doc/Screenshots-en/5-GiveAvatar.png)
![Spawn Entity Screenshort](Doc/Screenshots-en/6-SpawnEntity.png)
![Change Scene Screenshort](Doc/Screenshots-en/7-ChangeScene.png)
![Custom Stats Screenshort](Doc/Screenshots-en/8-CustomStats.png)
![Management](Doc/Screenshots-en/9-Manage.png)
![GachaBannerEditor](Doc/Screenshots-en/10-GachaBannerEditor.png)
![Text Map Browser](Doc/Screenshots-en/11-TextMapBrowser.png)

View File

@@ -2,11 +2,11 @@
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="GrasscutterTools.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
<section name="GrasscutterTools.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<userSettings>
<GrasscutterTools.Properties.Settings>
@@ -19,6 +19,18 @@
<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>
<setting name="RemoteUid" serializeAs="String">
<value>10001</value>
</setting>
<setting name="Host" serializeAs="String">
<value>https://127.0.0.1</value>
</setting>
</GrasscutterTools.Properties.Settings>
</userSettings>
</configuration>
</configuration>

View File

@@ -0,0 +1,16 @@
using System.Threading.Tasks;
using GrasscutterTools.DispatchServer.Model;
using GrasscutterTools.Utils;
namespace GrasscutterTools.DispatchServer
{
public static class DispatchServerAPI
{
public static async Task<ServerStatus> QueryServerStatus(string host)
{
var response = await HttpHelper.GetAsync<ServerStatusResponse>(host + "/status/server");
return response?.Status;
}
}
}

View File

@@ -0,0 +1,22 @@
using Newtonsoft.Json;
namespace GrasscutterTools.DispatchServer.Model
{
public class ServerStatus
{
[JsonProperty("playerCount")]
public int PlayerCount { get; set; }
[JsonProperty("version")]
public string Version { get; set; }
}
public class ServerStatusResponse
{
[JsonProperty("retcode")]
public int RetCode { get; set; }
[JsonProperty("status")]
public ServerStatus Status { get; set; }
}
}

View File

@@ -31,6 +31,7 @@ namespace GrasscutterTools
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormGachaBannerEditor));
this.GrpBannerValues = new System.Windows.Forms.GroupBox();
this.CmbPrefab = new System.Windows.Forms.ComboBox();
this.LblEventChanceTip = new System.Windows.Forms.Label();
this.NUDEventChance = new System.Windows.Forms.NumericUpDown();
this.LblGachaType = new System.Windows.Forms.Label();
@@ -60,19 +61,14 @@ namespace GrasscutterTools
this.LblSoftPityTip = new System.Windows.Forms.Label();
this.LblBasePurpleWeight = new System.Windows.Forms.Label();
this.CmbBannerType = new System.Windows.Forms.ComboBox();
this.TxtTitlePath = new System.Windows.Forms.TextBox();
this.LblSortIdTip = new System.Windows.Forms.Label();
this.NUDBasePurpleWeight = new System.Windows.Forms.NumericUpDown();
this.LblBannerType = new System.Windows.Forms.Label();
this.LblTitlePath = new System.Windows.Forms.Label();
this.LblBasePurpleWeightTip = new System.Windows.Forms.Label();
this.RbCostItem224 = new System.Windows.Forms.RadioButton();
this.TxtPrefabPath = new System.Windows.Forms.TextBox();
this.TxtPreviewPrefabPath = new System.Windows.Forms.TextBox();
this.LblBaseYellowWeightTip = new System.Windows.Forms.Label();
this.LblCostItem = new System.Windows.Forms.Label();
this.LblPrefabPath = new System.Windows.Forms.Label();
this.LblPreviewPrefabPath = new System.Windows.Forms.Label();
this.RbCostItem223 = new System.Windows.Forms.RadioButton();
this.GrpPurplePool = new System.Windows.Forms.GroupBox();
this.ListPurplePool = new System.Windows.Forms.CheckedListBox();
@@ -101,6 +97,7 @@ namespace GrasscutterTools
// GrpBannerValues
//
resources.ApplyResources(this.GrpBannerValues, "GrpBannerValues");
this.GrpBannerValues.Controls.Add(this.CmbPrefab);
this.GrpBannerValues.Controls.Add(this.LblEventChanceTip);
this.GrpBannerValues.Controls.Add(this.NUDEventChance);
this.GrpBannerValues.Controls.Add(this.LblGachaType);
@@ -130,23 +127,25 @@ namespace GrasscutterTools
this.GrpBannerValues.Controls.Add(this.LblSoftPityTip);
this.GrpBannerValues.Controls.Add(this.LblBasePurpleWeight);
this.GrpBannerValues.Controls.Add(this.CmbBannerType);
this.GrpBannerValues.Controls.Add(this.TxtTitlePath);
this.GrpBannerValues.Controls.Add(this.LblSortIdTip);
this.GrpBannerValues.Controls.Add(this.NUDBasePurpleWeight);
this.GrpBannerValues.Controls.Add(this.LblBannerType);
this.GrpBannerValues.Controls.Add(this.LblTitlePath);
this.GrpBannerValues.Controls.Add(this.LblBasePurpleWeightTip);
this.GrpBannerValues.Controls.Add(this.RbCostItem224);
this.GrpBannerValues.Controls.Add(this.TxtPrefabPath);
this.GrpBannerValues.Controls.Add(this.TxtPreviewPrefabPath);
this.GrpBannerValues.Controls.Add(this.LblBaseYellowWeightTip);
this.GrpBannerValues.Controls.Add(this.LblCostItem);
this.GrpBannerValues.Controls.Add(this.LblPrefabPath);
this.GrpBannerValues.Controls.Add(this.LblPreviewPrefabPath);
this.GrpBannerValues.Controls.Add(this.RbCostItem223);
this.GrpBannerValues.Name = "GrpBannerValues";
this.GrpBannerValues.TabStop = false;
//
// CmbPrefab
//
resources.ApplyResources(this.CmbPrefab, "CmbPrefab");
this.CmbPrefab.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CmbPrefab.FormattingEnabled = true;
this.CmbPrefab.Name = "CmbPrefab";
//
// LblEventChanceTip
//
resources.ApplyResources(this.LblEventChanceTip, "LblEventChanceTip");
@@ -383,11 +382,6 @@ namespace GrasscutterTools
resources.GetString("CmbBannerType.Items2")});
this.CmbBannerType.Name = "CmbBannerType";
//
// TxtTitlePath
//
resources.ApplyResources(this.TxtTitlePath, "TxtTitlePath");
this.TxtTitlePath.Name = "TxtTitlePath";
//
// LblSortIdTip
//
resources.ApplyResources(this.LblSortIdTip, "LblSortIdTip");
@@ -409,11 +403,6 @@ namespace GrasscutterTools
resources.ApplyResources(this.LblBannerType, "LblBannerType");
this.LblBannerType.Name = "LblBannerType";
//
// LblTitlePath
//
resources.ApplyResources(this.LblTitlePath, "LblTitlePath");
this.LblTitlePath.Name = "LblTitlePath";
//
// LblBasePurpleWeightTip
//
resources.ApplyResources(this.LblBasePurpleWeightTip, "LblBasePurpleWeightTip");
@@ -427,16 +416,6 @@ namespace GrasscutterTools
this.RbCostItem224.TabStop = true;
this.RbCostItem224.UseVisualStyleBackColor = true;
//
// TxtPrefabPath
//
resources.ApplyResources(this.TxtPrefabPath, "TxtPrefabPath");
this.TxtPrefabPath.Name = "TxtPrefabPath";
//
// TxtPreviewPrefabPath
//
resources.ApplyResources(this.TxtPreviewPrefabPath, "TxtPreviewPrefabPath");
this.TxtPreviewPrefabPath.Name = "TxtPreviewPrefabPath";
//
// LblBaseYellowWeightTip
//
resources.ApplyResources(this.LblBaseYellowWeightTip, "LblBaseYellowWeightTip");
@@ -452,11 +431,6 @@ namespace GrasscutterTools
resources.ApplyResources(this.LblPrefabPath, "LblPrefabPath");
this.LblPrefabPath.Name = "LblPrefabPath";
//
// LblPreviewPrefabPath
//
resources.ApplyResources(this.LblPreviewPrefabPath, "LblPreviewPrefabPath");
this.LblPreviewPrefabPath.Name = "LblPreviewPrefabPath";
//
// RbCostItem223
//
resources.ApplyResources(this.RbCostItem223, "RbCostItem223");
@@ -583,19 +557,14 @@ namespace GrasscutterTools
private System.Windows.Forms.Label LblSoftPityTip;
private System.Windows.Forms.Label LblBasePurpleWeight;
private System.Windows.Forms.ComboBox CmbBannerType;
private System.Windows.Forms.TextBox TxtTitlePath;
private System.Windows.Forms.Label LblSortIdTip;
private System.Windows.Forms.NumericUpDown NUDBasePurpleWeight;
private System.Windows.Forms.Label LblBannerType;
private System.Windows.Forms.Label LblTitlePath;
private System.Windows.Forms.Label LblBasePurpleWeightTip;
private System.Windows.Forms.RadioButton RbCostItem224;
private System.Windows.Forms.TextBox TxtPrefabPath;
private System.Windows.Forms.TextBox TxtPreviewPrefabPath;
private System.Windows.Forms.Label LblBaseYellowWeightTip;
private System.Windows.Forms.Label LblCostItem;
private System.Windows.Forms.Label LblPrefabPath;
private System.Windows.Forms.Label LblPreviewPrefabPath;
private System.Windows.Forms.RadioButton RbCostItem223;
private System.Windows.Forms.GroupBox GrpPurplePool;
private System.Windows.Forms.CheckedListBox ListPurplePool;
@@ -605,5 +574,6 @@ namespace GrasscutterTools
private System.Windows.Forms.TextBox TxtJson;
private System.Windows.Forms.Button BtnGen;
private System.Windows.Forms.Button BtnParse;
private System.Windows.Forms.ComboBox CmbPrefab;
}
}

View File

@@ -26,9 +26,16 @@ namespace GrasscutterTools
Icon = Resources.IconGrasscutter;
CmbBannerType.SelectedIndex = 0;
InitBannerPrefab();
InitCheckedListBoxs();
}
private void InitBannerPrefab()
{
CmbPrefab.Items.Clear();
CmbPrefab.Items.AddRange(GameData.GachaBannerPrefabs.Names);
}
private void InitCheckedListBoxs()
{
InitCheckedListBox(ListYellowPool, "yellow");
@@ -78,9 +85,10 @@ namespace GrasscutterTools
NUDGachaType.Value = banner.GachaType;
NUDScheduleId.Value = banner.ScheduleId;
CmbBannerType.SelectedIndex = (int)banner.BannerType;
TxtPrefabPath.Text = banner.PrefabPath;
TxtPreviewPrefabPath.Text = banner.PreviewPrefabPath;
TxtTitlePath.Text = banner.TitlePath;
if (string.IsNullOrEmpty(banner.TitlePath) || !int.TryParse(banner.TitlePath.Substring("UI_GACHA_SHOW_PANEL_A".Length, 3), out int prefabId))
CmbPrefab.SelectedIndex = -1;
else
CmbPrefab.SelectedIndex = Array.IndexOf(GameData.GachaBannerPrefabs.Ids, prefabId);
RbCostItem224.Checked = banner.CostItem == 224;
RbCostItem223.Checked = banner.CostItem == 223;
NUDBeginTime.Value = banner.BeginTime;
@@ -97,7 +105,7 @@ namespace GrasscutterTools
}
catch (Exception ex)
{
MessageBox.Show("UI更新失败" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("UI更新失败" + ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -105,9 +113,16 @@ namespace GrasscutterTools
{
if (CmbBannerType.SelectedIndex < 0)
{
MessageBox.Show("请选择奖池类型", "输入错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("请选择奖池类型", Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
return null;
}
if (CmbPrefab.SelectedIndex < 0)
{
MessageBox.Show("请选择奖池预制", Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
return null;
}
int[] yellowIds;
if (string.IsNullOrEmpty(TxtRateUpItems1.Text))
yellowIds = new int[0];
@@ -120,14 +135,15 @@ namespace GrasscutterTools
else
purpleIds = TxtRateUpItems2.Text.Split(',').Select(s => int.Parse(s.Trim())).ToArray();
var prefabId = GameData.GachaBannerPrefabs.Ids[CmbPrefab.SelectedIndex];
GachaBanner banner = new GachaBanner
{
GachaType = (int)NUDGachaType.Value,
ScheduleId = (int)NUDScheduleId.Value,
BannerType = (BannerType)CmbBannerType.SelectedIndex,
PrefabPath = TxtPrefabPath.Text,
PreviewPrefabPath = TxtPreviewPrefabPath.Text,
TitlePath = TxtTitlePath.Text,
PrefabPath = $"GachaShowPanel_A{prefabId:000}",
PreviewPrefabPath = $"UI_Tab_GachaShowPanel_A{prefabId:000}",
TitlePath = $"UI_GACHA_SHOW_PANEL_A{prefabId:000}_TITLE",
CostItem = RbCostItem224.Checked ? 224 : 223,
BeginTime = (int)NUDBeginTime.Value,
EndTime = (int)NUDEndTime.Value,
@@ -186,7 +202,7 @@ namespace GrasscutterTools
foreach (string item in list.CheckedItems)
builder.Append(item.Substring(0, item.IndexOf(':')))
.Append(", ");
txt.Text = builder.ToString(0, builder.Length-2);
txt.Text = builder.ToString(0, builder.Length - 2);
}
}
@@ -207,7 +223,7 @@ namespace GrasscutterTools
}
catch (Exception ex)
{
MessageBox.Show("Json解析失败错误消息" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Json解析失败错误消息" + ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

View File

@@ -119,10 +119,10 @@
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="LblEventChanceTip.Location" type="System.Drawing.Point, System.Drawing">
<value>401, 318</value>
<value>401, 262</value>
</data>
<data name="NUDEventChance.Location" type="System.Drawing.Point, System.Drawing">
<value>332, 316</value>
<value>332, 260</value>
</data>
<data name="LblEventChance.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 17</value>
@@ -130,11 +130,14 @@
<data name="LblEventChance.Text" xml:space="preserve">
<value>Event chance</value>
</data>
<data name="LblSortId.Location" type="System.Drawing.Point, System.Drawing">
<value>72, 204</value>
</data>
<data name="LblSortId.Text" xml:space="preserve">
<value>Sort</value>
</data>
<data name="LblBaseYellowWeight.Location" type="System.Drawing.Point, System.Drawing">
<value>23, 318</value>
<value>22, 262</value>
</data>
<data name="LblBaseYellowWeight.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 17</value>
@@ -143,7 +146,7 @@
<value>5 star weight</value>
</data>
<data name="LblRateUpItems2.Location" type="System.Drawing.Point, System.Drawing">
<value>45, 406</value>
<value>44, 350</value>
</data>
<data name="LblRateUpItems2.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 17</value>
@@ -152,7 +155,7 @@
<value>4 star UP</value>
</data>
<data name="LblSoftPity.Location" type="System.Drawing.Point, System.Drawing">
<value>50, 347</value>
<value>49, 291</value>
</data>
<data name="LblSoftPity.Size" type="System.Drawing.Size, System.Drawing">
<value>56, 17</value>
@@ -173,7 +176,7 @@
<value>End Time</value>
</data>
<data name="LblRateUpItems1.Location" type="System.Drawing.Point, System.Drawing">
<value>45, 290</value>
<value>44, 234</value>
</data>
<data name="LblRateUpItems1.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 17</value>
@@ -182,7 +185,7 @@
<value>5 star UP</value>
</data>
<data name="LblBeginTime.Location" type="System.Drawing.Point, System.Drawing">
<value>33, 231</value>
<value>32, 175</value>
</data>
<data name="LblBeginTime.Size" type="System.Drawing.Size, System.Drawing">
<value>73, 17</value>
@@ -191,7 +194,7 @@
<value>Begin Time</value>
</data>
<data name="LblHardPity.Location" type="System.Drawing.Point, System.Drawing">
<value>43, 376</value>
<value>42, 320</value>
</data>
<data name="LblHardPity.Size" type="System.Drawing.Size, System.Drawing">
<value>62, 17</value>
@@ -200,7 +203,7 @@
<value>Hard pity</value>
</data>
<data name="NUDEndTime.Location" type="System.Drawing.Point, System.Drawing">
<value>287, 230</value>
<value>287, 174</value>
</data>
<data name="LblHardPityTip.Size" type="System.Drawing.Size, System.Drawing">
<value>17, 17</value>
@@ -221,7 +224,7 @@
<value>...</value>
</data>
<data name="LblBasePurpleWeight.Location" type="System.Drawing.Point, System.Drawing">
<value>23, 434</value>
<value>22, 378</value>
</data>
<data name="LblBasePurpleWeight.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 17</value>
@@ -229,6 +232,15 @@
<data name="LblBasePurpleWeight.Text" xml:space="preserve">
<value>4 star weight</value>
</data>
<data name="CmbBannerType.Items" xml:space="preserve">
<value>Standard Wish</value>
</data>
<data name="CmbBannerType.Items1" xml:space="preserve">
<value>Character Event Wish</value>
</data>
<data name="CmbBannerType.Items2" xml:space="preserve">
<value>Weapon Event Wish</value>
</data>
<data name="LblSortIdTip.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 17</value>
</data>
@@ -244,15 +256,6 @@
<data name="LblBannerType.Text" xml:space="preserve">
<value>Banner Type</value>
</data>
<data name="LblTitlePath.Location" type="System.Drawing.Point, System.Drawing">
<value>45, 176</value>
</data>
<data name="LblTitlePath.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 17</value>
</data>
<data name="LblTitlePath.Text" xml:space="preserve">
<value>Title Path</value>
</data>
<data name="RbCostItem224.Size" type="System.Drawing.Size, System.Drawing">
<value>104, 21</value>
</data>
@@ -260,7 +263,7 @@
<value>Acquaint Fate</value>
</data>
<data name="LblCostItem.Location" type="System.Drawing.Point, System.Drawing">
<value>42, 204</value>
<value>41, 148</value>
</data>
<data name="LblCostItem.Size" type="System.Drawing.Size, System.Drawing">
<value>64, 17</value>
@@ -269,25 +272,16 @@
<value>Cost Item</value>
</data>
<data name="LblPrefabPath.Location" type="System.Drawing.Point, System.Drawing">
<value>31, 118</value>
<value>59, 118</value>
</data>
<data name="LblPrefabPath.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 17</value>
<value>46, 17</value>
</data>
<data name="LblPrefabPath.Text" xml:space="preserve">
<value>Prefab Path</value>
</data>
<data name="LblPreviewPrefabPath.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 147</value>
</data>
<data name="LblPreviewPrefabPath.Size" type="System.Drawing.Size, System.Drawing">
<value>98, 17</value>
</data>
<data name="LblPreviewPrefabPath.Text" xml:space="preserve">
<value>Pre Prefab Path</value>
<value>Prefab</value>
</data>
<data name="RbCostItem223.Location" type="System.Drawing.Point, System.Drawing">
<value>222, 202</value>
<value>222, 146</value>
</data>
<data name="RbCostItem223.Size" type="System.Drawing.Size, System.Drawing">
<value>119, 21</value>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,15 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using GrasscutterTools.DispatchServer;
using GrasscutterTools.Game;
using GrasscutterTools.OpenCommand;
using GrasscutterTools.Properties;
namespace GrasscutterTools
@@ -26,10 +29,15 @@ namespace GrasscutterTools
{
MultiLanguage.LoadLanguage(this, typeof(FormMain));
Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
#if DEBUG
Text += " - by jie65535 - v" + version.ToString(3) + "-debug";
#else
Text += " - by jie65535 - v" + version.ToString(3);
#endif
GameData.LoadResources();
LoadCustomCommands();
InitArtifactList();
InitGameItemList();
InitWeapons();
@@ -45,8 +53,6 @@ namespace GrasscutterTools
SaveSettings();
}
private readonly string CustomCommandsFilePath = Path.Combine(Application.LocalUserAppDataPath, "CustomCommands.txt");
private readonly string[] LanguageNames = new string[] { "简体中文", "English" };
private readonly string[] Languages = new string[] { "zh-CN", "en-US" };
@@ -60,16 +66,13 @@ namespace GrasscutterTools
CmbLanguage.Items.AddRange(LanguageNames);
CmbLanguage.SelectedIndex = Array.IndexOf(Languages, Settings.Default.DefaultLanguage);
if (File.Exists(CustomCommandsFilePath))
LoadCustomCommands(File.ReadAllText(CustomCommandsFilePath));
else
LoadCustomCommands(Resources.CustomCommands);
InitGiveItemRecord();
InitSpawnRecord();
InitOpenCommand();
}
catch (Exception ex)
{
MessageBox.Show("加载设置时异常:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(Resources.SettingLoadError + ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -80,13 +83,14 @@ namespace GrasscutterTools
Settings.Default.AutoCopy = ChkAutoCopy.Checked;
Settings.Default.Uid = NUDUid.Value;
Settings.Default.Save();
File.WriteAllText(CustomCommandsFilePath, SaveCustomCommands());
SaveCustomCommands();
SaveGiveItemRecord();
SaveSpawnRecord();
SaveOpenCommand();
}
catch (Exception ex)
{
MessageBox.Show("保存设置时异常:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(Resources.SettingSaveError + ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -94,8 +98,8 @@ namespace GrasscutterTools
#region - -
private FormGachaBannerEditor FormGachaBannerEditor;
FormGachaBannerEditor FormGachaBannerEditor;
private void BtnOpenGachaBannerEditor_Click(object sender, EventArgs e)
{
if (FormGachaBannerEditor == null || FormGachaBannerEditor.IsDisposed)
@@ -110,35 +114,59 @@ namespace GrasscutterTools
}
}
private 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 - -
private void LoadCustomCommands(string commands)
private readonly string CustomCommandsFilePath = Path.Combine(Application.LocalUserAppDataPath, "CustomCommands.txt");
private bool CustomCommandsChanged;
private void LoadCustomCommands()
{
if (File.Exists(CustomCommandsFilePath))
LoadCustomCommandControls(File.ReadAllText(CustomCommandsFilePath));
else
LoadCustomCommandControls(Resources.CustomCommands);
}
private void LoadCustomCommandControls(string commands)
{
FLPCustomCommands.Controls.Clear();
var lines = commands.Split('\n');
for (int i = 0; i < lines.Length-1; i += 2)
AddCustomCommand(lines[i].Trim(), lines[i+1].Trim());
for (int i = 0; i < lines.Length - 1; i += 2)
AddCustomCommand(lines[i].Trim(), lines[i + 1].Trim());
}
private string SaveCustomCommands()
private void SaveCustomCommands()
{
if (CustomCommandsChanged)
File.WriteAllText(CustomCommandsFilePath, SaveCustomCommandControls());
}
private string SaveCustomCommandControls()
{
StringBuilder builder = new StringBuilder();
foreach (LinkLabel lnk in FLPCustomCommands.Controls)
@@ -162,12 +190,12 @@ namespace GrasscutterTools
{
if (string.IsNullOrWhiteSpace(TxtCustomName.Text))
{
MessageBox.Show("命令标签不能为空", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(Resources.CommandTagCannotBeEmpty, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (string.IsNullOrWhiteSpace(TxtCommand.Text))
{
MessageBox.Show("命令内容不能为空", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(Resources.CommandContentCannotBeEmpty, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
var name = TxtCustomName.Text.Trim();
@@ -178,11 +206,13 @@ namespace GrasscutterTools
if (lnk.Text == name)
{
lnk.Tag = command;
CustomCommandsChanged = true;
await ButtonComplete(BtnSaveCustomCommand);
return;
}
}
CustomCommandsChanged = true;
AddCustomCommand(name, command);
await ButtonComplete(BtnSaveCustomCommand);
}
@@ -203,16 +233,17 @@ namespace GrasscutterTools
{
if (string.IsNullOrWhiteSpace(TxtCustomName.Text))
{
MessageBox.Show("命令标签不能为空", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(Resources.CommandTagCannotBeEmpty, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
var name = TxtCustomName.Text.Trim();
foreach (LinkLabel lnk in FLPCustomCommands.Controls)
{
if (lnk.Text == name && MessageBox.Show("确认删除?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
if (lnk.Text == name && MessageBox.Show(Resources.AskConfirmDeletion, Resources.Tips, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
FLPCustomCommands.Controls.Remove(lnk);
CustomCommandsChanged = true;
//TxtCustomName.Text = "";
//TxtCommand.Text = "";
await ButtonComplete(BtnRemoveCustomCommand);
@@ -220,7 +251,7 @@ namespace GrasscutterTools
}
}
MessageBox.Show("未找到该命令", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(Resources.CommandNotFound, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
private void BtnImport_Click(object sender, EventArgs e)
@@ -234,7 +265,8 @@ namespace GrasscutterTools
using (var stream = dialog.OpenFile())
using (var reader = new StreamReader(stream))
{
LoadCustomCommands(reader.ReadToEnd());
LoadCustomCommandControls(reader.ReadToEnd());
CustomCommandsChanged = true;
}
}
}
@@ -251,7 +283,7 @@ namespace GrasscutterTools
using (var stream = dialog.OpenFile())
using (var writer = new StreamWriter(stream))
{
writer.Write(SaveCustomCommands());
writer.Write(SaveCustomCommandControls());
}
}
}
@@ -318,10 +350,9 @@ namespace GrasscutterTools
// 限制星级输入范围
NUDArtifactStars.Minimum = GameData.Artifacts.Ids[beginIndex] / 100 % 10;
NUDArtifactStars.Maximum = GameData.Artifacts.Ids[endIndex] / 100 % 10;
NUDArtifactStars.Maximum = GameData.Artifacts.Ids[endIndex] / 100 % 10;
var parts = GameData.Artifacts.Names.Skip(beginIndex).Take(endIndex-beginIndex+1).Distinct().ToArray();
var parts = GameData.Artifacts.Names.Skip(beginIndex).Take(endIndex - beginIndex + 1).Distinct().ToArray();
var i = CmbArtifactPart.SelectedIndex;
CmbArtifactPart.Items.Clear();
CmbArtifactPart.Items.AddRange(parts);
@@ -331,7 +362,8 @@ namespace GrasscutterTools
ArtifactInputChanged(sender, e);
}
readonly string[] ArtifactPartLabels = new string[] { "空之杯", "死之羽", "理之冠", "生之花", "时之沙"};
private readonly string[] ArtifactPartLabels = new string[] { "空之杯", "死之羽", "理之冠", "生之花", "时之沙" };
private void CmbArtifactPart_SelectedIndexChanged(object sender, EventArgs e)
{
if (CmbArtifactPart.SelectedIndex < 0)
@@ -355,7 +387,7 @@ namespace GrasscutterTools
//var setId = GameData.ArtifactCats.Ids[CmbArtifactSet.SelectedIndex];
//var part = CmbArtifactPart.SelectedIndex+1;
//var index = Array.FindLastIndex(
// GameData.Artifacts.Ids,
// GameData.Artifacts.Ids,
// it => it / 1000 == setId // 套装ID
// //&& it / 100 % 10 == NUDArtifactStars.Value // 星级
// && it / 10 % 10 == part // 部位
@@ -376,7 +408,7 @@ namespace GrasscutterTools
foreach (string item in ListSubAttributionChecked.Items)
{
var subId = item.Substring(0, item.IndexOf(':')).Trim();
var times = int.Parse(item.Substring(item.LastIndexOf('x')+1));
var times = int.Parse(item.Substring(item.LastIndexOf('x') + 1));
if (subAttrDir.ContainsKey(subId))
subAttrDir[subId] += times;
else
@@ -492,8 +524,9 @@ namespace GrasscutterTools
#region -- --
readonly string GiveItemCommandsRecordPath = Path.Combine(Application.LocalUserAppDataPath, "GiveItemCommands.txt");
List<GameCommand> GiveItemCommands;
private readonly string GiveItemCommandsRecordPath = Path.Combine(Application.LocalUserAppDataPath, "GiveItemCommands.txt");
private List<GameCommand> GiveItemCommands;
private void InitGiveItemRecord()
{
if (File.Exists(GiveItemCommandsRecordPath))
@@ -543,7 +576,8 @@ namespace GrasscutterTools
ListGiveItemLogs.Items.RemoveAt(ListGiveItemLogs.SelectedIndex);
}
}
#endregion
#endregion -- --
#endregion - -
@@ -641,8 +675,9 @@ namespace GrasscutterTools
#region -- --
readonly string SpawnCommandsRecordPath = Path.Combine(Application.LocalUserAppDataPath, "SpawnCommands.txt");
List<GameCommand> SpawnCommands;
private readonly string SpawnCommandsRecordPath = Path.Combine(Application.LocalUserAppDataPath, "SpawnCommands.txt");
private List<GameCommand> SpawnCommands;
private void InitSpawnRecord()
{
if (File.Exists(SpawnCommandsRecordPath))
@@ -655,6 +690,7 @@ namespace GrasscutterTools
SpawnCommands = new List<GameCommand>();
}
}
private void SaveSpawnRecord()
{
File.WriteAllText(SpawnCommandsRecordPath, GetCommandsText(SpawnCommands));
@@ -692,7 +728,7 @@ namespace GrasscutterTools
}
}
#endregion
#endregion -- --
#endregion - -
@@ -702,6 +738,9 @@ namespace GrasscutterTools
{
ListScenes.Items.Clear();
ListScenes.Items.AddRange(GameData.Scenes.Lines);
CmbClimateType.Items.Clear();
CmbClimateType.Items.AddRange(Resources.ClimateType.Split(','));
}
private void ListScenes_SelectedIndexChanged(object sender, EventArgs e)
@@ -727,6 +766,7 @@ namespace GrasscutterTools
private void InitStatList()
{
LblStatTip.Text = "";
SetStatsCommand.InitStats();
CmbStat.Items.Clear();
CmbStat.Items.AddRange(SetStatsCommand.Stats.Select(s => s.Name).ToArray());
}
@@ -740,7 +780,7 @@ namespace GrasscutterTools
LblStatPercent.Visible = stat.Percent;
LblStatTip.Text = stat.Tip;
SetCommand("/setstats", $"{stat.ArgName} {NUDStat.Value}{(stat.Percent?"%":"")}");
SetCommand("/setstats", $"{stat.ArgName} {NUDStat.Value}{(stat.Percent ? "%" : "")}");
}
private void LnkSetTalentClicked(object sender, LinkLabelLinkClickedEventArgs e)
@@ -764,7 +804,7 @@ namespace GrasscutterTools
var perm = CmbPerm.Text.Trim();
if (string.IsNullOrEmpty(perm))
{
MessageBox.Show("权限不能为空!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(Resources.PermissionCannotBeEmpty, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
SetCommand($"/permission {(sender as Button).Tag} @{uid} {perm}");
@@ -775,7 +815,7 @@ namespace GrasscutterTools
var username = TxtAccountUserName.Text.Trim();
if (string.IsNullOrEmpty(username))
{
MessageBox.Show("用户名不能为空!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(Resources.UsernameCannotBeEmpty, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
SetCommand($"/account {(sender as Button).Tag} {username} {(ChkAccountSetUid.Checked ? NUDAccountUid.Value.ToString() : "")}");
@@ -793,13 +833,13 @@ namespace GrasscutterTools
}
catch (Exception)
{
MessageBox.Show("浏览器打开失败,你可以通过以下链接手动访问:\n"
+ "https://github.com/jie65535/GrasscutterCommandGenerator",
"错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
MessageBox.Show(Resources.BrowserOpenFailedTip
+ "\n https://github.com/jie65535/GrasscutterCommandGenerator",
Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
#endregion
#endregion - -
#region - -
@@ -808,6 +848,8 @@ namespace GrasscutterTools
TxtCommand.Text = command;
if (ChkAutoCopy.Checked)
CopyCommand();
if (ModifierKeys == Keys.Control)
OnOpenCommandInvoke();
}
private void SetCommand(string command, string args)
@@ -843,20 +885,33 @@ namespace GrasscutterTools
btn.Enabled = true;
}
private void FormMain_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.F5)
{
OnOpenCommandInvoke();
}
}
private void ShowTip(string message, Control control)
{
TTip.Show(message, control, 0, control.Size.Height, 3000);
}
#endregion - -
#region - -
List<GameCommand> GetCommands(string commandsText)
private List<GameCommand> GetCommands(string commandsText)
{
var lines = commandsText.Split('\n');
List<GameCommand> commands = new List<GameCommand>(lines.Length/2);
for (int i = 0; i < lines.Length-1; i += 2)
commands.Add(new GameCommand(lines[i].Trim(), lines[i+1].Trim()));
List<GameCommand> commands = new List<GameCommand>(lines.Length / 2);
for (int i = 0; i < lines.Length - 1; i += 2)
commands.Add(new GameCommand(lines[i].Trim(), lines[i + 1].Trim()));
return commands;
}
string GetCommandsText(List<GameCommand> commands)
private string GetCommandsText(List<GameCommand> commands)
{
StringBuilder builder = new StringBuilder();
foreach (var cmd in commands)
@@ -867,6 +922,169 @@ namespace GrasscutterTools
return builder.ToString();
}
#endregion
#endregion - -
#region - -
private void InitOpenCommand()
{
NUDRemotePlayerId.Value = Settings.Default.RemoteUid;
TxtHost.Text = Settings.Default.Host;
}
private void SaveOpenCommand()
{
Settings.Default.RemoteUid = NUDRemotePlayerId.Value;
Settings.Default.Host = TxtHost.Text;
}
private OpenCommandAPI OC;
private async void BtnQueryServerStatus_Click(object sender, EventArgs e)
{
var btn = sender as Button;
btn.Enabled = false;
btn.Cursor = Cursors.WaitCursor;
try
{
var status = await DispatchServerAPI.QueryServerStatus(TxtHost.Text);
LblServerVersion.Text = status.Version;
LblPlayerCount.Text = status.PlayerCount.ToString();
OC = new OpenCommandAPI(TxtHost.Text);
if (await OC.Ping())
{
LblOpenCommandSupport.Text = "√";
LblOpenCommandSupport.ForeColor = Color.Green;
GrpRemoteCommand.Enabled = true;
}
else
{
LblOpenCommandSupport.Text = "×";
LblOpenCommandSupport.ForeColor = Color.Red;
GrpRemoteCommand.Enabled = false;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
btn.Cursor = Cursors.Default;
btn.Enabled = true;
}
}
private async void BtnSendVerificationCode_Click(object sender, EventArgs e)
{
var btn = sender as Button;
var t = btn.Text;
btn.Enabled = false;
NUDRemotePlayerId.Enabled = false;
try
{
btn.Text = Resources.CodeSending;
await OC.SendCode((int)NUDRemotePlayerId.Value);
BtnConnectOpenCommand.Enabled = true;
NUDVerificationCode.Enabled = true;
NUDVerificationCode.Focus();
for (int i = 60; i > 0 && !OC.CanInvoke; i--)
{
btn.Text = string.Format(Resources.CodeResendTip, i);
await Task.Delay(1000);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
btn.Text = t;
btn.Enabled = true;
NUDRemotePlayerId.Enabled = true;
}
}
private async void BtnConnectOpenCommand_Click(object sender, EventArgs e)
{
var btn = sender as Button;
btn.Enabled = false;
try
{
await OC.Verify((int)NUDVerificationCode.Value);
GrpRemoteCommand.Enabled = false;
BtnInvokeOpenCommand.Focus();
ShowTip(Resources.ConnectedTip, BtnInvokeOpenCommand);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
btn.Cursor = Cursors.Default;
btn.Enabled = true;
}
}
private void OnOpenCommandInvoke()
{
BtnInvokeOpenCommand_Click(BtnInvokeOpenCommand, EventArgs.Empty);
}
private async void BtnInvokeOpenCommand_Click(object sender, EventArgs e)
{
if (OC == null || !OC.CanInvoke)
{
ShowTip(Resources.RequireOpenCommandTip, BtnInvokeOpenCommand);
TCMain.SelectedTab = TPRemoteCall;
return;
}
if (TxtCommand.Text.Length < 2)
{
ShowTip(Resources.CommandContentCannotBeEmpty, TxtCommand);
return;
}
var cmd = TxtCommand.Text.Substring(1);
var btn = sender as Button;
btn.Enabled = false;
try
{
var msg = await OC.Invoke(cmd);
ShowTip(msg, btn);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
btn.Cursor = Cursors.Default;
btn.Enabled = true;
}
}
private void LnkOpenCommandLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
System.Diagnostics.Process.Start("https://github.com/jie65535/gc-opencommand-plugin");
}
catch (Exception)
{
MessageBox.Show(Resources.BrowserOpenFailedTip
+ "\n https://github.com/jie65535/gc-opencommand-plugin",
Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
private void LnkRCHelp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
MessageBox.Show(Resources.OpenCommandHelp, Resources.Help, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
#endregion - -
}
}

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,183 @@
using System;
using System.Collections.Generic;
using System.Data;
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, Resources.Error, 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, Resources.Error, 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, Resources.Error, 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

@@ -1,13 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GrasscutterTools.Game.Gacha
namespace GrasscutterTools.Game.Gacha
{
public enum BannerType
{
STANDARD, EVENT, WEAPON
}
}
}

View File

@@ -117,6 +117,5 @@ namespace GrasscutterTools.Game.Gacha
/// </summary>
[JsonProperty("hardPity", DefaultValueHandling = DefaultValueHandling.Ignore), DefaultValue(90)]
public int HardPity { get; set; } = 90;
}
}

View File

@@ -4,12 +4,12 @@
{
public GameCommand(string name, string command)
{
Name=name;
Command=command;
Name = name;
Command = command;
}
public string Name { get; set; }
public string Command { get; set; }
}
}
}

View File

@@ -20,6 +20,7 @@ namespace GrasscutterTools.Game
Weapons = new ItemMap(Resources.Weapon);
WeaponColors = new ItemMap(Resources.WeaponColor);
Ornaments = new ItemMap(Resources.Ornament);
GachaBannerPrefabs = new ItemMap(Resources.GachaBennerPrefab);
}
public static ItemMap Animals { get; private set; }
@@ -50,5 +51,6 @@ namespace GrasscutterTools.Game
public static ItemMap Ornaments { get; private set; }
public static ItemMap GachaBannerPrefabs { get; private set; }
}
}

View File

@@ -19,7 +19,7 @@ namespace GrasscutterTools.Game
var si = line.IndexOf(':');
if (si > 0 && int.TryParse(line.Substring(0, si).Trim(), out int id))
{
var name = line.Substring(si+1).Trim();
var name = line.Substring(si + 1).Trim();
if (!string.IsNullOrEmpty(name))
{
//IdMap[id] = name;
@@ -41,17 +41,16 @@ namespace GrasscutterTools.Game
//List<int> IdList;
//List<string> NameList;
public int Count => Ids.Length;
//public string this[int id] => IdMap[id];
//public int this[string name] => NameMap[name];
public int[] Ids { get; }
public string[] Names { get; }
public string[] Lines { get; }
}
}
}

View File

@@ -1,4 +1,8 @@
using System.Collections.Generic;
using System.Text;
using GrasscutterTools.Properties;
using Newtonsoft.Json;
namespace GrasscutterTools.Game
{
@@ -8,9 +12,9 @@ namespace GrasscutterTools.Game
{
public Stat(string name, string argName, bool percent, string tip = "")
{
Name=name;
ArgName=argName;
Percent=percent;
Name = name;
ArgName = argName;
Percent = percent;
Tip = tip;
}
@@ -35,45 +39,51 @@ namespace GrasscutterTools.Game
public string Tip { get; set; }
}
public static List<Stat> Stats { get; set; }
public static Stat[] Stats { get; private set; }
static SetStatsCommand()
public static void InitStats()
{
Stats = new List<Stat>
{
new Stat("最大生命值", "maxhp", false),
new Stat("当前生命值", "hp", false),
new Stat("当前攻击力", "atk", false),
new Stat("基础攻击力", "atkb", false, "这似乎不会重新计算攻击力可能只对buff类有效。"),
new Stat("防御力", "def", false),
new Stat("元素精通", "em", false),
new Stat("元素充能效率", "er", true),
new Stat("暴击率", "crate", true),
new Stat("暴击伤害", "cdmg", true),
new Stat("伤害加成", "dmg", true, "这似乎在攻击后被重置"),
new Stat("风元素伤害加成", "eanemo", true),
new Stat("冰元素伤害加成", "ecryo", true),
new Stat("草元素伤害加成", "edendro", true),
new Stat("雷元素伤害加成", "eelectro", true),
new Stat("土元素伤害加成", "egeo", true),
new Stat("水元素伤害加成", "ehydro", true),
new Stat("火元素伤害加成", "epyro", true),
new Stat("物理伤害加成", "ephys", true),
new Stat("伤害减免", "resall", true, "这似乎在攻击后被重置"),
new Stat("风元素伤害减免", "resanemo", true),
new Stat("冰元素伤害减免", "rescryo", true),
new Stat("草元素伤害减免", "resdendro", true),
new Stat("雷元素伤害减免", "reselectro", true),
new Stat("土元素伤害减免", "resgeo", true),
new Stat("水元素伤害减免", "reshydro", true),
new Stat("火元素伤害减免", "respyro", true),
new Stat("物理伤害减免", "resphys", true),
new Stat("冷却缩减", "cdr", true),
new Stat("治疗加成", "heal", true),
new Stat("受治疗加成", "heali", true),
new Stat("护盾强效","shield", true),
new Stat("忽略防御", "defi", true),
};
var json = Encoding.UTF8.GetString(Resources.AvatarStats);
Stats = JsonConvert.DeserializeObject<Stat[]>(json);
}
//static SetStatsCommand()
//{
// Stats = new List<Stat>
// {
// new Stat("最大生命值", "maxhp", false),
// new Stat("当前生命值", "hp", false),
// new Stat("当前攻击力", "atk", false),
// new Stat("基础攻击力", "atkb", false, "这似乎不会重新计算攻击力可能只对buff类有效。"),
// new Stat("防御力", "def", false),
// new Stat("元素精通", "em", false),
// new Stat("元素充能效率", "er", true),
// new Stat("暴击率", "crate", true),
// new Stat("暴击伤害", "cdmg", true),
// new Stat("伤害加成", "dmg", true, "这似乎在攻击后被重置"),
// new Stat("风元素伤害加成", "eanemo", true),
// new Stat("冰元素伤害加成", "ecryo", true),
// new Stat("草元素伤害加成", "edendro", true),
// new Stat("雷元素伤害加成", "eelectro", true),
// new Stat("土元素伤害加成", "egeo", true),
// new Stat("水元素伤害加成", "ehydro", true),
// new Stat("火元素伤害加成", "epyro", true),
// new Stat("物理伤害加成", "ephys", true),
// new Stat("伤害减免", "resall", true, "这似乎在攻击后被重置"),
// new Stat("风元素伤害减免", "resanemo", true),
// new Stat("冰元素伤害减免", "rescryo", true),
// new Stat("草元素伤害减免", "resdendro", true),
// new Stat("雷元素伤害减免", "reselectro", true),
// new Stat("土元素伤害减免", "resgeo", true),
// new Stat("水元素伤害减免", "reshydro", true),
// new Stat("火元素伤害减免", "respyro", true),
// new Stat("物理伤害减免", "resphys", true),
// new Stat("冷却缩减", "cdr", true),
// new Stat("治疗加成", "heal", true),
// new Stat("受治疗加成", "heali", true),
// new Stat("护盾强效","shield", true),
// new Stat("忽略防御", "defi", true),
// };
//}
}
}

View File

@@ -0,0 +1,66 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
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;
private 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);
}
}
}
}
private 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

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Resource.Embedder.2.2.0\build\Resource.Embedder.props" Condition="Exists('..\packages\Resource.Embedder.2.2.0\build\Resource.Embedder.props')" />
<Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@@ -191,6 +192,8 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="DispatchServer\DispatchServerAPI.cs" />
<Compile Include="DispatchServer\Model\ServerStatus.cs" />
<Compile Include="FormGachaBannerEditor.cs">
<SubType>Form</SubType>
</Compile>
@@ -203,29 +206,42 @@
<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="MojoConsole\MojoConsole.cs" />
<Compile Include="Game\TextMapData.cs" />
<Compile Include="OpenCommand\OpenCommandAPI.cs" />
<Compile Include="MultiLanguage.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="FormGachaBannerEditor.en.resx">
<Compile Include="Utils\HttpHelper.cs" />
<EmbeddedResource Include="FormGachaBannerEditor.en-us.resx">
<DependentUpon>FormGachaBannerEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormGachaBannerEditor.resx">
<DependentUpon>FormGachaBannerEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormMain.en.resx">
<EmbeddedResource Include="FormMain.en-us.resx">
<DependentUpon>FormMain.cs</DependentUpon>
</EmbeddedResource>
<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>
@@ -256,6 +272,8 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="Resources\en-us\AvatarStats.json" />
<None Include="Resources\zh-cn\AvatarStats.json" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
@@ -269,6 +287,7 @@
<Content Include="Resources\en-us\ArtifactSubAttribution.txt" />
<Content Include="Resources\en-us\Avatar.txt" />
<Content Include="Resources\en-us\CustomCommands.txt" />
<Content Include="Resources\en-us\GachaBennerPrefab.txt" />
<Content Include="Resources\en-us\Item.txt" />
<Content Include="Resources\en-us\Monster.txt" />
<Content Include="Resources\en-us\NPC.txt" />
@@ -278,6 +297,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" />
@@ -288,6 +308,7 @@
<Content Include="Resources\zh-cn\Avatar.txt" />
<Content Include="Resources\zh-cn\CustomCommands.txt" />
<Content Include="Resources\AvatarColor.txt" />
<Content Include="Resources\zh-cn\GachaBennerPrefab.txt" />
<Content Include="Resources\zh-cn\Item.txt" />
<Content Include="Resources\zh-cn\Monster.txt" />
<Content Include="Resources\zh-cn\NPC.txt" />
@@ -297,14 +318,17 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.6.5.5\build\Fody.targets" Condition="Exists('..\packages\Fody.6.5.5\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.6.5.5\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.5.5\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.props'))" />
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets'))" />
<Error Condition="!Exists('..\packages\Fody.6.6.1\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.6.6.1\build\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Resource.Embedder.2.2.0\build\Resource.Embedder.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Resource.Embedder.2.2.0\build\Resource.Embedder.props'))" />
<Error Condition="!Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" />
<Import Project="..\packages\Fody.6.6.1\build\Fody.targets" Condition="Exists('..\packages\Fody.6.6.1\build\Fody.targets')" />
<Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
</Project>

View File

@@ -1,89 +0,0 @@
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace GrasscutterTools.MojoConsole
{
internal class MojoConsole
{
static readonly HttpClient httpClient = new HttpClient();
public string Host { get; set; }
private string API => Host + "/mojoplus/api";
public string Key { get; set; }
public async Task<string> Invoke(string payload)
{
var response = await DoRequest(new Request(Key, "invoke", payload));
if (response.Code == 500)
throw new InvokeException(response.Payload);
return response.Payload;
}
public async Task<bool> Ping()
{
try
{
var response = await DoRequest(new Request(Key, "ping"));
return response?.Code == 200;
}
catch (Exception)
{
return false;
}
}
private async Task<Response> DoRequest(Request request)
{
var content = new StringContent(JsonConvert.SerializeObject(request), Encoding.UTF8, "application/json");
var response = await httpClient.PostAsync(API, content);
var responseString = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<Response>(responseString);
}
public class Request
{
public Request(string k, string method, string payload = "")
{
K = k;
Method = method;
Payload = payload;
}
[JsonProperty("k")]
public string K { get; set; }
[JsonProperty("request")]
public string Method { get; set; }
[JsonProperty("payload")]
public string Payload { get; set; }
}
public class Response
{
[JsonProperty("message")]
public string Message { get; set; }
[JsonProperty("code")]
public int Code { get; set; }
[JsonProperty("payload")]
public string Payload { get; set; }
}
internal class InvokeException : Exception
{
public InvokeException(string message) : base(message)
{
}
}
}
}

View File

@@ -3,9 +3,8 @@ using System.Windows.Forms;
namespace GrasscutterTools
{
static class MultiLanguage
internal static class MultiLanguage
{
public static string DefaultLanguage = "zh-CN";
public static void SetDefaultLanguage(string lang)
@@ -16,7 +15,6 @@ namespace GrasscutterTools
Properties.Settings.Default.Save();
}
/// <summary>
/// 加载语言
/// </summary>
@@ -80,4 +78,4 @@ namespace GrasscutterTools
}
}
}
}
}

View File

@@ -0,0 +1,105 @@
using System;
using System.Threading.Tasks;
using GrasscutterTools.Utils;
using Newtonsoft.Json;
namespace GrasscutterTools.OpenCommand
{
public class OpenCommandAPI
{
public OpenCommandAPI(string host)
{
Host = host;
API = host + "/opencommand/api";
}
public string Host { get; }
private readonly string API;
public string Token { get; set; }
public bool CanInvoke { get; private set; }
public async Task<bool> Ping()
{
try
{
var response = await DoRequest("ping");
return response.RetCode == 200;
}
catch (Exception)
{
return false;
}
}
public async Task SendCode(int playerId)
{
var response = await DoRequest("sendCode", playerId);
Token = response.Data as string;
}
public async Task Verify(int code)
{
await DoRequest("verify", code);
CanInvoke = true;
}
public async Task<string> Invoke(string command)
{
var response = await DoRequest("command", command);
return response.Data as string;
}
private async Task<Response> DoRequest(string action, object data = null)
{
var response = await HttpHelper.PostAsync<Response>(API, new Request(Token, action, data));
if (response.RetCode == 401)
Token = "";
if (response.RetCode != 200)
throw new InvokeException(response.Message);
return response;
}
public class Request
{
public Request(string token, string action, object data)
{
Token = token;
Action = action;
Data = data;
}
[JsonProperty("token")]
public string Token { get; set; }
[JsonProperty("action")]
public string Action { get; set; }
[JsonProperty("data")]
public object Data { get; set; }
}
public class Response
{
[JsonProperty("retcode")]
public int RetCode { get; set; }
[JsonProperty("message")]
public string Message { get; set; }
[JsonProperty("data")]
public object Data { get; set; }
}
internal class InvokeException : Exception
{
public InvokeException(string message) : base(message)
{
}
}
}
}

View File

@@ -1,22 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using GrasscutterTools.Properties;
namespace GrasscutterTools
{
static class Program
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
private static void Main()
{
//设置应用程序处理异常方式ThreadException处理
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
//处理线程异常
Application.ThreadException += Application_ThreadException;
//处理非UI线程异常
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FormMain());
}
#region - -
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
string str = GetExceptionMsg(e.Exception, e.ToString());
MessageBox.Show(str, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
MessageBox.Show(str, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
/// <summary>
/// 生成自定义异常消息
/// </summary>
/// <param name="ex">异常对象</param>
/// <param name="backStr">备用异常消息当ex为null时有效</param>
/// <returns>异常字符串文本</returns>
private static string GetExceptionMsg(Exception ex, string backStr)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("****************************异常文本****************************");
sb.AppendLine("【出现时间】:" + DateTime.Now.ToString());
if (ex != null)
{
sb.AppendLine("【异常类型】:" + ex.GetType().Name);
sb.AppendLine("【异常信息】:" + ex.Message);
#if DEBUG
sb.AppendLine("【堆栈调用】:" + ex.StackTrace);
#endif
}
else
{
sb.AppendLine("【未处理异常】:" + backStr);
}
sb.AppendLine("***************************************************************");
return sb.ToString();
}
#endregion - -
}
}
}

View File

@@ -21,7 +21,7 @@ using System.Runtime.InteropServices;
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("b26333ff-5560-4cba-af3c-4b80db6f8025")]
// 程序集的版本信息由下列四个值组成:
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]

View File

@@ -283,6 +283,15 @@ namespace GrasscutterTools.Properties {
}
}
/// <summary>
/// 查找类似 确认删除? 的本地化字符串。
/// </summary>
internal static string AskConfirmDeletion {
get {
return ResourceManager.GetString("AskConfirmDeletion", resourceCulture);
}
}
/// <summary>
/// 查找类似 10000001: 凯特
///10000002: 神里绫华
@@ -375,6 +384,88 @@ namespace GrasscutterTools.Properties {
}
}
/// <summary>
/// 查找 System.Byte[] 类型的本地化资源。
/// </summary>
internal static byte[] AvatarStats {
get {
object obj = ResourceManager.GetObject("AvatarStats", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// 查找类似 浏览器打开失败,你可以通过以下链接手动访问: 的本地化字符串。
/// </summary>
internal static string BrowserOpenFailedTip {
get {
return ResourceManager.GetString("BrowserOpenFailedTip", resourceCulture);
}
}
/// <summary>
/// 查找类似 无,晴天,多云,雨天,雷暴,雪天,雾天 的本地化字符串。
/// </summary>
internal static string ClimateType {
get {
return ResourceManager.GetString("ClimateType", resourceCulture);
}
}
/// <summary>
/// 查找类似 {0} 秒后可重发 的本地化字符串。
/// </summary>
internal static string CodeResendTip {
get {
return ResourceManager.GetString("CodeResendTip", resourceCulture);
}
}
/// <summary>
/// 查找类似 发送中... 的本地化字符串。
/// </summary>
internal static string CodeSending {
get {
return ResourceManager.GetString("CodeSending", resourceCulture);
}
}
/// <summary>
/// 查找类似 命令内容不能为空 的本地化字符串。
/// </summary>
internal static string CommandContentCannotBeEmpty {
get {
return ResourceManager.GetString("CommandContentCannotBeEmpty", resourceCulture);
}
}
/// <summary>
/// 查找类似 未找到该命令 的本地化字符串。
/// </summary>
internal static string CommandNotFound {
get {
return ResourceManager.GetString("CommandNotFound", resourceCulture);
}
}
/// <summary>
/// 查找类似 命令标签不能为空 的本地化字符串。
/// </summary>
internal static string CommandTagCannotBeEmpty {
get {
return ResourceManager.GetString("CommandTagCannotBeEmpty", resourceCulture);
}
}
/// <summary>
/// 查找类似 现在你可以远程执行命令了哦! 的本地化字符串。
/// </summary>
internal static string ConnectedTip {
get {
return ResourceManager.GetString("ConnectedTip", resourceCulture);
}
}
/// <summary>
/// 查找类似 无敌
////godmode
@@ -431,6 +522,67 @@ namespace GrasscutterTools.Properties {
}
}
/// <summary>
/// 查找类似 错误 的本地化字符串。
/// </summary>
internal static string Error {
get {
return ResourceManager.GetString("Error", resourceCulture);
}
}
/// <summary>
/// 查找类似 007: 初行者推荐祈愿
///008: 奔行世间
///009: 杯装之诗
///010: 黎明巡礼
///011: 南风之眷
///012: 靖妖傩舞
///013: 神铸赋形
///015: 闪焰的驻足
///016: 初行者推荐祈愿
///017: 奔行世间
///018: 闪焰的驻足
///019: 杯装之诗
///020: 神铸赋形
///021: 神铸赋形
///022: 奔行世间
///023: 暂别冬都
///024: 陵薮市朝
///027: 深秘之息
///028: 浮生孰来
///031: 烟火之邀
///032: 鱼龙灯昼
///033: 赤团开时
///036: 杯装之诗
///037: 暂别冬都
///040: 陵薮市朝
///041: 浪涌之瞬
///045: 叶落风随
///048: 白鹭之庭
///049: 焰色天河
///052: 影寂天下人
///053: 浮岳虹珠
///061: 鬼门斗宴
///065: 出尘入世
///071: 华紫樱绯
///076: 苍流踏花 的本地化字符串。
/// </summary>
internal static string GachaBennerPrefab {
get {
return ResourceManager.GetString("GachaBennerPrefab", resourceCulture);
}
}
/// <summary>
/// 查找类似 帮助 的本地化字符串。
/// </summary>
internal static string Help {
get {
return ResourceManager.GetString("Help", resourceCulture);
}
}
/// <summary>
/// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
/// </summary>
@@ -441,6 +593,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>
@@ -582,6 +744,15 @@ namespace GrasscutterTools.Properties {
}
}
/// <summary>
/// 查找类似 1. 填写正确的UID\n2. 向玩家发送验证码\n3. 输入正确的验证码\n4. 连接\n5. 享受 的本地化字符串。
/// </summary>
internal static string OpenCommandHelp {
get {
return ResourceManager.GetString("OpenCommandHelp", resourceCulture);
}
}
/// <summary>
/// 查找类似 369101: 翠目猫
///369102: 北地犬
@@ -632,6 +803,15 @@ namespace GrasscutterTools.Properties {
}
}
/// <summary>
/// 查找类似 要设置的权限不能为空! 的本地化字符串。
/// </summary>
internal static string PermissionCannotBeEmpty {
get {
return ResourceManager.GetString("PermissionCannotBeEmpty", resourceCulture);
}
}
/// <summary>
/// 查找类似 *
///player.*
@@ -673,7 +853,23 @@ namespace GrasscutterTools.Properties {
}
}
/// <summary>
/// <summary>
/// 查找类似 请先连接到支持[OpenCommand]的服务器 的本地化字符串。
/// </summary>
internal static string RequireOpenCommandTip {
get {
return ResourceManager.GetString("RequireOpenCommandTip", resourceCulture);
}
}
/// <summary>
/// 查找类似 1 : BigWorld_LevelStreaming
///2 : BigWorld_LevelStreaming
///3 : BigWorld_LevelStreaming
///4 : LostParadise_LevelStreaming
///5 : AbyssalPalace_LevelStreaming
///6 : TheChasm_LevelStreaming
///7 : MichiaeMatsuri_LevelStreaming
///20008: 深入狼之殿
///20008: 丘丘人大本营(test)
///20008: 丘丘人巢穴(test)
@@ -688,16 +884,7 @@ namespace GrasscutterTools.Properties {
///1019: 洞天云海地城玩法测试(test)
///1011: 角色战斗测试(test)
///50002: 低温关卡白盒(test)
///1001: 移动平台性能测试(test)
///50003: 战斗性能测试(test)
///50004: 电桩电源白盒(test)
///50027: 圣遗物新因子测试关卡3(test)
///50025: 圣遗物新因子测试关卡1(test)
///50026: 圣遗物新因子测试关卡2(test)
///1024: 黑夜循环地城(test)
///50009: 关卡玩法白盒CX(test)
///50010: 机关玩法白盒(test)
///50014: 怪物元素对抗地城(test)
///1001: 移动平台性能测试(test)
///50 [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
internal static string Scene {
@@ -705,6 +892,42 @@ namespace GrasscutterTools.Properties {
return ResourceManager.GetString("Scene", resourceCulture);
}
}
/// <summary>
/// 查找类似 加载设置时异常: 的本地化字符串。
/// </summary>
internal static string SettingLoadError {
get {
return ResourceManager.GetString("SettingLoadError", resourceCulture);
}
}
/// <summary>
/// 查找类似 保存设置时异常: 的本地化字符串。
/// </summary>
internal static string SettingSaveError {
get {
return ResourceManager.GetString("SettingSaveError", resourceCulture);
}
}
/// <summary>
/// 查找类似 提示 的本地化字符串。
/// </summary>
internal static string Tips {
get {
return ResourceManager.GetString("Tips", resourceCulture);
}
}
/// <summary>
/// 查找类似 用户名不能为空! 的本地化字符串。
/// </summary>
internal static string UsernameCannotBeEmpty {
get {
return ResourceManager.GetString("UsernameCannotBeEmpty", resourceCulture);
}
}
/// <summary>
/// 查找类似 11101: 无锋剑

View File

@@ -133,15 +133,54 @@
<data name="ArtifactSubAttribution" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\ArtifactSubAttribution.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="AskConfirmDeletion" xml:space="preserve">
<value>Are you sure you want to delete this command?</value>
</data>
<data name="Avatar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\Avatar.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="AvatarColor" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AvatarColor.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="AvatarStats" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\AvatarStats.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="BrowserOpenFailedTip" xml:space="preserve">
<value>The browser failed to open. You can manually access the following address:</value>
</data>
<data name="ClimateType" xml:space="preserve">
<value>None,Sunny,Partly cloudy,Rain,Thunderstorm,Snow,Fog</value>
</data>
<data name="CodeResendTip" xml:space="preserve">
<value>Resend in {0} seconds</value>
</data>
<data name="CodeSending" xml:space="preserve">
<value>sending...</value>
</data>
<data name="CommandContentCannotBeEmpty" xml:space="preserve">
<value>Command cannot be empty</value>
</data>
<data name="CommandNotFound" xml:space="preserve">
<value>Command not found</value>
</data>
<data name="CommandTagCannotBeEmpty" xml:space="preserve">
<value>Command tag cannot be empty</value>
</data>
<data name="ConnectedTip" xml:space="preserve">
<value>Now you can execute commands remotely!</value>
</data>
<data name="CustomCommands" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\CustomCommands.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="Error" xml:space="preserve">
<value>Error</value>
</data>
<data name="GachaBennerPrefab" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\GachaBennerPrefab.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="Help" xml:space="preserve">
<value>Help</value>
</data>
<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>
@@ -160,15 +199,36 @@
<data name="NPC" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\NPC.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="OpenCommandHelp" xml:space="preserve">
<value>1. Fill in the correct uid\n2. Send verification code to player\n3. Enter the correct verification code\n4. Connection\n5. Enjoy</value>
</data>
<data name="Ornament" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\Ornament.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="PermissionCannotBeEmpty" xml:space="preserve">
<value>Permission cannot be empty!</value>
</data>
<data name="Permissions" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Permissions.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="RequireOpenCommandTip" xml:space="preserve">
<value>Please connect to a server that supports [opencommand] first</value>
</data>
<data name="Scene" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\Scene.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="SettingLoadError" xml:space="preserve">
<value>Settings load failed:</value>
</data>
<data name="SettingSaveError" xml:space="preserve">
<value>Settings save failed:</value>
</data>
<data name="Tips" xml:space="preserve">
<value>Tips</value>
</data>
<data name="UsernameCannotBeEmpty" xml:space="preserve">
<value>Username cannot be empty!</value>
</data>
<data name="Weapon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\en-us\Weapon.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>

View File

@@ -133,18 +133,60 @@
<data name="ArtifactSubAttribution" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\ArtifactSubAttribution.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="AskConfirmDeletion" xml:space="preserve">
<value>确认删除?</value>
</data>
<data name="Avatar" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\Avatar.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="AvatarColor" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AvatarColor.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="AvatarStats" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\AvatarStats.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="BrowserOpenFailedTip" xml:space="preserve">
<value>浏览器打开失败,你可以通过以下链接手动访问:</value>
</data>
<data name="ClimateType" xml:space="preserve">
<value>无,晴天,多云,雨天,雷暴,雪天,雾天</value>
</data>
<data name="CodeResendTip" xml:space="preserve">
<value>{0} 秒后可重发</value>
</data>
<data name="CodeSending" xml:space="preserve">
<value>发送中...</value>
</data>
<data name="CommandContentCannotBeEmpty" xml:space="preserve">
<value>命令内容不能为空</value>
</data>
<data name="CommandNotFound" xml:space="preserve">
<value>未找到该命令</value>
</data>
<data name="CommandTagCannotBeEmpty" xml:space="preserve">
<value>命令标签不能为空</value>
</data>
<data name="ConnectedTip" xml:space="preserve">
<value>现在你可以远程执行命令了哦!</value>
</data>
<data name="CustomCommands" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\CustomCommands.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="Error" xml:space="preserve">
<value>错误</value>
</data>
<data name="GachaBennerPrefab" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\GachaBennerPrefab.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="Help" xml:space="preserve">
<value>帮助</value>
</data>
<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>
@@ -160,15 +202,36 @@
<data name="NPC" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\NPC.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="OpenCommandHelp" xml:space="preserve">
<value>1. 填写正确的UID\n2. 向玩家发送验证码\n3. 输入正确的验证码\n4. 连接\n5. 享受</value>
</data>
<data name="Ornament" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\Ornament.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="PermissionCannotBeEmpty" xml:space="preserve">
<value>要设置的权限不能为空!</value>
</data>
<data name="Permissions" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Permissions.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="RequireOpenCommandTip" xml:space="preserve">
<value>请先连接到支持[OpenCommand]的服务器</value>
</data>
<data name="Scene" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\Scene.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="SettingLoadError" xml:space="preserve">
<value>加载设置时异常:</value>
</data>
<data name="SettingSaveError" xml:space="preserve">
<value>保存设置时异常:</value>
</data>
<data name="Tips" xml:space="preserve">
<value>提示</value>
</data>
<data name="UsernameCannotBeEmpty" xml:space="preserve">
<value>用户名不能为空!</value>
</data>
<data name="Weapon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zh-cn\Weapon.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>

View File

@@ -58,5 +58,53 @@ 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;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("10001")]
public decimal RemoteUid {
get {
return ((decimal)(this["RemoteUid"]));
}
set {
this["RemoteUid"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("https://127.0.0.1")]
public string Host {
get {
return ((string)(this["Host"]));
}
set {
this["Host"] = value;
}
}
}
}

View File

@@ -11,5 +11,17 @@
<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>
<Setting Name="RemoteUid" Type="System.Decimal" Scope="User">
<Value Profile="(Default)">10001</Value>
</Setting>
<Setting Name="Host" Type="System.String" Scope="User">
<Value Profile="(Default)">https://127.0.0.1</Value>
</Setting>
</Settings>
</SettingsFile>

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

View File

@@ -0,0 +1,194 @@
[
{
"Name": "MAX HP",
"ArgName": "maxhp",
"Percent": false,
"Tip": ""
},
{
"Name": "CUR HP",
"ArgName": "hp",
"Percent": false,
"Tip": ""
},
{
"Name": "CUR Attack",
"ArgName": "atk",
"Percent": false,
"Tip": ""
},
{
"Name": "Base Attack",
"ArgName": "atkb",
"Percent": false,
"Tip": "This doesn't seem to get used to recalculate ATK, so it's only useful for stuff like Bennett's buff."
},
{
"Name": "DEFENSE",
"ArgName": "def",
"Percent": false,
"Tip": ""
},
{
"Name": "ELEMENT MASTERY",
"ArgName": "em",
"Percent": false,
"Tip": ""
},
{
"Name": "CHARGE EFFICIENCY",
"ArgName": "er",
"Percent": true,
"Tip": ""
},
{
"Name": "CRITICAL",
"ArgName": "crate",
"Percent": true,
"Tip": ""
},
{
"Name": "CRITICAL HURT",
"ArgName": "cdmg",
"Percent": true,
"Tip": ""
},
{
"Name": "ADD HURT",
"ArgName": "dmg",
"Percent": true,
"Tip": "This seems to get reset after attacks"
},
{
"Name": "WIND ADD HURT",
"ArgName": "eanemo",
"Percent": true,
"Tip": ""
},
{
"Name": "ICE ADD HURT",
"ArgName": "ecryo",
"Percent": true,
"Tip": ""
},
{
"Name": "GRASS ADD HURT",
"ArgName": "edendro",
"Percent": true,
"Tip": ""
},
{
"Name": "ELEC ADD HURT",
"ArgName": "eelectro",
"Percent": true,
"Tip": ""
},
{
"Name": "ROCK ADD HURT",
"ArgName": "egeo",
"Percent": true,
"Tip": ""
},
{
"Name": "WATER ADD HURT",
"ArgName": "ehydro",
"Percent": true,
"Tip": ""
},
{
"Name": "FIRE ADD HURT",
"ArgName": "epyro",
"Percent": true,
"Tip": ""
},
{
"Name": "PHYSICAL ADD HURT",
"ArgName": "ephys",
"Percent": true,
"Tip": ""
},
{
"Name": "SUB HURT",
"ArgName": "resall",
"Percent": true,
"Tip": "This seems to get reset after attacks"
},
{
"Name": "WIND SUB HURT",
"ArgName": "resanemo",
"Percent": true,
"Tip": ""
},
{
"Name": "ICE SUB HURT",
"ArgName": "rescryo",
"Percent": true,
"Tip": ""
},
{
"Name": "GRASS SUB HURT",
"ArgName": "resdendro",
"Percent": true,
"Tip": ""
},
{
"Name": "ELEC SUB HURT",
"ArgName": "reselectro",
"Percent": true,
"Tip": ""
},
{
"Name": "ROCK SUB HURT",
"ArgName": "resgeo",
"Percent": true,
"Tip": ""
},
{
"Name": "WATER SUB HURT",
"ArgName": "reshydro",
"Percent": true,
"Tip": ""
},
{
"Name": "FIRE SUB HURT",
"ArgName": "respyro",
"Percent": true,
"Tip": ""
},
{
"Name": "PHYSICAL SUB HURT",
"ArgName": "resphys",
"Percent": true,
"Tip": ""
},
{
"Name": "SKILL CD MINUS RATIO",
"ArgName": "cdr",
"Percent": true,
"Tip": ""
},
{
"Name": "HEAL ADD",
"ArgName": "heal",
"Percent": true,
"Tip": ""
},
{
"Name": "HEALED ADD",
"ArgName": "heali",
"Percent": true,
"Tip": ""
},
{
"Name": "SHIELD COST MINUS RATIO",
"ArgName": "shield",
"Percent": true,
"Tip": ""
},
{
"Name": "DEFENCE IGNORE RATIO",
"ArgName": "defi",
"Percent": true,
"Tip": ""
}
]

View File

@@ -1,52 +1,52 @@
无敌
God Mode
/godmode
升到60
Level up to 60
/give 102 1880200
Heal
/heal
我全都要!
Give me ALL!
/giveall
我在哪?
Where am I?
/position
设置世界等级
Set World Level
/setworldlevel 8
设置羁绊等级
Set Fetter Level
/setfetterlevel 1
清空背包
Clear Backpack(ALL)
/clear all
清空武器
Clear Weapons
/clear wp
清空圣物
Clear Artifacts
/clear art
清空材料
Clear Materials
/clear mat
发送广播
/broadcast 大家好啊~
清空当前角色命之座(需重登)
Broadcast
/broadcast Hello everyone~
Reset Current Constellation(Need Re-login)
/resetconst
清空全部角色命之座(需重登)
Reset ALL Constellation(Need Re-login)
/resetconst all
一万纠缠
100k Intertwined Fates
/give 223 10000
一万相遇
100k Acquaint Fate
/give 224 10000
十万原石
100k Primogem
/give 201 100000
十万摩拉
100k Mora
/give 202 100000
速速集合!
TP Everyone
/tpall
拔线
Restart Server
/restart
私信
Send PM
/say <player> <message>
进来吧你
Pull in team
/coop <playerId> <target playerId>
自杀
Suicide
/killcharacter
暗杀
Kill Somebody
/killcharacter <playerId>
都有谁在?
List ALL users
/list uid
重载服务配置
Reload service config
/reload

View File

@@ -0,0 +1,35 @@
007: Beginners' wish
008: Wanderlust Invocation
009: Ballad in Goblets
010: Dawn Pilgrimage
011: Grace of Southwind
012: Bane of All Evil
013: Epitome Invocation
015: Sparkling Steps
016: Beginners' wish
017: Wanderlust Invocation
018: Sparkling Steps
019: Ballad in Goblets
020: Epitome Invocation
021: Epitome Invocation
022: Wanderlust Invocation
023: Farewell of Snezhnaya
024: Gentry of Hermitage
027: Secretum Secretorum
028: Adrift in the Harbor
031: Invitation to Mundane Life
032: Dance of Lanterns
033: Moment of Bloom
036: Ballad in Goblets
037: Farewell of Snezhnaya
040: Gentry of Hermitage
041: Born of Ocean Swell
045: Leaves in the Wind
048: The Heron's Court
049: Tapestry of Golden Flames
052: Reign of Serenity
053: Drifting Luminescence
061: Oni's Royale
065: The Transcendent One Returns
071: Everbloom Violet
076: Azure Excursion

View File

@@ -0,0 +1,194 @@
[
{
"Name": "最大生命值",
"ArgName": "maxhp",
"Percent": false,
"Tip": ""
},
{
"Name": "当前生命值",
"ArgName": "hp",
"Percent": false,
"Tip": ""
},
{
"Name": "当前攻击力",
"ArgName": "atk",
"Percent": false,
"Tip": ""
},
{
"Name": "基础攻击力",
"ArgName": "atkb",
"Percent": false,
"Tip": "这似乎不会重新计算攻击力可能只对buff类有效。"
},
{
"Name": "防御力",
"ArgName": "def",
"Percent": false,
"Tip": ""
},
{
"Name": "元素精通",
"ArgName": "em",
"Percent": false,
"Tip": ""
},
{
"Name": "元素充能效率",
"ArgName": "er",
"Percent": true,
"Tip": ""
},
{
"Name": "暴击率",
"ArgName": "crate",
"Percent": true,
"Tip": ""
},
{
"Name": "暴击伤害",
"ArgName": "cdmg",
"Percent": true,
"Tip": ""
},
{
"Name": "伤害加成",
"ArgName": "dmg",
"Percent": true,
"Tip": "这似乎在攻击后被重置"
},
{
"Name": "风元素伤害加成",
"ArgName": "eanemo",
"Percent": true,
"Tip": ""
},
{
"Name": "冰元素伤害加成",
"ArgName": "ecryo",
"Percent": true,
"Tip": ""
},
{
"Name": "草元素伤害加成",
"ArgName": "edendro",
"Percent": true,
"Tip": ""
},
{
"Name": "雷元素伤害加成",
"ArgName": "eelectro",
"Percent": true,
"Tip": ""
},
{
"Name": "土元素伤害加成",
"ArgName": "egeo",
"Percent": true,
"Tip": ""
},
{
"Name": "水元素伤害加成",
"ArgName": "ehydro",
"Percent": true,
"Tip": ""
},
{
"Name": "火元素伤害加成",
"ArgName": "epyro",
"Percent": true,
"Tip": ""
},
{
"Name": "物理伤害加成",
"ArgName": "ephys",
"Percent": true,
"Tip": ""
},
{
"Name": "伤害减免",
"ArgName": "resall",
"Percent": true,
"Tip": "这似乎在攻击后被重置"
},
{
"Name": "风元素伤害减免",
"ArgName": "resanemo",
"Percent": true,
"Tip": ""
},
{
"Name": "冰元素伤害减免",
"ArgName": "rescryo",
"Percent": true,
"Tip": ""
},
{
"Name": "草元素伤害减免",
"ArgName": "resdendro",
"Percent": true,
"Tip": ""
},
{
"Name": "雷元素伤害减免",
"ArgName": "reselectro",
"Percent": true,
"Tip": ""
},
{
"Name": "土元素伤害减免",
"ArgName": "resgeo",
"Percent": true,
"Tip": ""
},
{
"Name": "水元素伤害减免",
"ArgName": "reshydro",
"Percent": true,
"Tip": ""
},
{
"Name": "火元素伤害减免",
"ArgName": "respyro",
"Percent": true,
"Tip": ""
},
{
"Name": "物理伤害减免",
"ArgName": "resphys",
"Percent": true,
"Tip": ""
},
{
"Name": "冷却缩减",
"ArgName": "cdr",
"Percent": true,
"Tip": ""
},
{
"Name": "治疗加成",
"ArgName": "heal",
"Percent": true,
"Tip": ""
},
{
"Name": "受治疗加成",
"ArgName": "heali",
"Percent": true,
"Tip": ""
},
{
"Name": "护盾强效",
"ArgName": "shield",
"Percent": true,
"Tip": ""
},
{
"Name": "忽略防御",
"ArgName": "defi",
"Percent": true,
"Tip": ""
}
]

View File

@@ -0,0 +1,35 @@
007: 初行者推荐祈愿
008: 奔行世间
009: 杯装之诗
010: 黎明巡礼
011: 南风之眷
012: 靖妖傩舞
013: 神铸赋形
015: 闪焰的驻足
016: 初行者推荐祈愿
017: 奔行世间
018: 闪焰的驻足
019: 杯装之诗
020: 神铸赋形
021: 神铸赋形
022: 奔行世间
023: 暂别冬都
024: 陵薮市朝
027: 深秘之息
028: 浮生孰来
031: 烟火之邀
032: 鱼龙灯昼
033: 赤团开时
036: 杯装之诗
037: 暂别冬都
040: 陵薮市朝
041: 浪涌之瞬
045: 叶落风随
048: 白鹭之庭
049: 焰色天河
052: 影寂天下人
053: 浮岳虹珠
061: 鬼门斗宴
065: 出尘入世
071: 华紫樱绯
076: 苍流踏花

View File

@@ -0,0 +1,67 @@
using System;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace GrasscutterTools.Utils
{
public static class HttpHelper
{
private static readonly HttpClient httpClient = new HttpClient();
static HttpHelper()
{
ServicePointManager.ServerCertificateValidationCallback = (_, _1, _2, _3) => true;
}
public static async Task<T> GetAsync<T>(string url)
{
try
{
var responseMessage = await httpClient.GetAsync(url);
if (responseMessage.IsSuccessStatusCode)
{
var responseString = await responseMessage.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<T>(responseString);
}
else
{
throw new HttpRequestException(responseMessage.ReasonPhrase);
}
}
catch (Exception ex)
{
if (ex.InnerException != null)
throw ex.InnerException;
throw;
}
}
public static async Task<T> PostAsync<T>(string url, object obj)
{
try
{
var content = new StringContent(JsonConvert.SerializeObject(obj), Encoding.UTF8, "application/json");
var responseMessage = await httpClient.PostAsync(url, content);
if (responseMessage.IsSuccessStatusCode)
{
var responseString = await responseMessage.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<T>(responseString);
}
else
{
throw new HttpRequestException(responseMessage.ReasonPhrase);
}
}
catch (Exception ex)
{
if (ex.InnerException != null)
throw ex.InnerException;
throw;
}
}
}
}

View File

@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="5.7.0" targetFramework="net48" developmentDependency="true" />
<package id="Fody" version="6.5.5" targetFramework="net48" developmentDependency="true" />
<package id="Fody" version="6.6.1" targetFramework="net48" developmentDependency="true" />
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net48" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net48" />
<package id="NETStandard.Library" version="1.6.1" targetFramework="net48" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net452" />
<package id="Resource.Embedder" version="2.2.0" targetFramework="net48" />
<package id="System.AppContext" version="4.3.0" targetFramework="net48" />
<package id="System.Collections" version="4.3.0" targetFramework="net48" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net48" />