Clean up all

Remvoe TextBoxXP
This commit is contained in:
2022-11-27 16:51:47 +08:00
parent d169de9a9e
commit c7898401ce
52 changed files with 925 additions and 1102 deletions

View File

@ -1,186 +0,0 @@
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace GrasscutterTools.Controls
{
[ToolboxItem(true)]
public class TextBoxXP : TextBox
{
/// <summary>
/// 获得当前进程,以便重绘控件
/// </summary>
/// <param name="hWnd"></param>
/// <returns></returns>
[DllImport("user32.dll")]
private static extern IntPtr GetWindowDC(IntPtr hWnd);
[DllImport("user32.dll")]
private static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
private const int EM_SETCUEBANNER = 0x1501;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern Int32 SendMessage
(IntPtr hWnd, int msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
/// <summary>
/// 水印文本
/// </summary>
private string _Watermark = "";
private float maximum;
private float minimum;
#region
/// <summary>
/// 是否启用热点效果
/// </summary>
[Category("外观")]
[Browsable(true)]
[Localizable(true)]
[Description("获取或设置输入框水印文本")]
[DefaultValue("")]
public string Watermark
{
get
{
return this._Watermark;
}
set
{
this._Watermark = value;
SendMessage(Handle, EM_SETCUEBANNER, 0, _Watermark);
this.Invalidate();
}
}
/// <summary>
/// 是否只能输入数字
/// </summary>
[Category("行为")]
[Browsable(true)]
[Description("获取或设置TextBox是否只允许输入数字")]
[DefaultValue(false)]
public bool DigitOnly { get; set; }
/// <summary>
/// 转为数值
/// </summary>
public float Number
{
get
{
if (float.TryParse(Text, out float value))
return value;
else
return 0f;
}
}
[Category("数据")]
[Browsable(true)]
[DefaultValue(0)]
[Description("指示小数点后位数")]
public int DecimalPlaces { get; set; }
[Category("数据")]
[Description("获取或设置限制的最大值")]
public float Maximum
{
get
{
return maximum;
}
set
{
maximum = value;
if (minimum > maximum)
{
minimum = maximum;
}
}
}
[Category("数据")]
[Browsable(true)]
[Description("获取或设置限制的最小值")]
public float Minimum
{
get
{
return minimum;
}
set
{
minimum = value;
if (minimum > maximum)
{
maximum = value;
}
}
}
#endregion
/// <summary>
///
/// </summary>
public TextBoxXP()
: base()
{
//BorderStyle = BorderStyle.FixedSingle;
//Font = Styles.StaticResources.DefaultFont;
}
protected override void OnKeyPress(KeyPressEventArgs e)
{
base.OnKeyPress(e);
// 如果只允许输入数字,则判断输入是否为退格或者数字
if (DigitOnly)
{
//IsNumber指定字符串中位于指定位置的字符是否属于数字类别
//IsPunctuation指定字符串中位于指定位置的字符是否属于标点符号类别
//IsControl指定字符串中位于指定位置的字符是否属于控制字符类别
if (!Char.IsNumber(e.KeyChar) && !Char.IsPunctuation(e.KeyChar) && !Char.IsControl(e.KeyChar))
{
e.Handled = true; //获取或设置一个值指示是否处理过System.Windows.Forms.Control.KeyPress事件
}
else if (Char.IsPunctuation(e.KeyChar) && DecimalPlaces > 0)
{
if (e.KeyChar == '.')
{
if (Text.LastIndexOf('.') != -1)
{
e.Handled = true;
}
}
else
{
e.Handled = true;
}
}
}
}
protected override void OnLeave(EventArgs e)
{
base.OnLeave(e);
if (DigitOnly)
{
if (!string.IsNullOrWhiteSpace(Text))
{
if (Number > Maximum)
Text = Maximum.ToString("F" + DecimalPlaces);
if (Number < Minimum)
Text = Minimum.ToString("F" + DecimalPlaces);
}
}
}
}
}

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.Threading.Tasks; using System.Threading.Tasks;
using GrasscutterTools.DispatchServer.Model; using GrasscutterTools.DispatchServer.Model;

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using Newtonsoft.Json; using Newtonsoft.Json;
namespace GrasscutterTools.DispatchServer.Model namespace GrasscutterTools.DispatchServer.Model

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -485,7 +486,6 @@ namespace GrasscutterTools.Forms
dropList[i] = data; dropList[i] = data;
} }
#endregion - - #endregion - -
#region - - #region - -

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -99,25 +100,25 @@ namespace GrasscutterTools.Forms
{ {
try try
{ {
NUDGachaType.Value = banner.GachaType; NUDGachaType.Value = banner.GachaType;
NUDScheduleId.Value = banner.ScheduleId; NUDScheduleId.Value = banner.ScheduleId;
CmbBannerType.SelectedIndex = (int)banner.BannerType; CmbBannerType.SelectedIndex = (int)banner.BannerType;
if (string.IsNullOrEmpty(banner.TitlePath) || !int.TryParse(banner.TitlePath.Substring("UI_GACHA_SHOW_PANEL_A".Length, 3), out int prefabId)) if (string.IsNullOrEmpty(banner.TitlePath) || !int.TryParse(banner.TitlePath.Substring("UI_GACHA_SHOW_PANEL_A".Length, 3), out int prefabId))
CmbPrefab.SelectedIndex = -1; CmbPrefab.SelectedIndex = -1;
else else
CmbPrefab.SelectedIndex = Array.IndexOf(GameData.GachaBannerPrefabs.Ids, prefabId); CmbPrefab.SelectedIndex = Array.IndexOf(GameData.GachaBannerPrefabs.Ids, prefabId);
RbCostItem224.Checked = banner.CostItem == 224; RbCostItem224.Checked = banner.CostItem == 224;
RbCostItem223.Checked = banner.CostItem == 223; RbCostItem223.Checked = banner.CostItem == 223;
NUDBeginTime.Value = banner.BeginTime; NUDBeginTime.Value = banner.BeginTime;
NUDEndTime.Value = banner.EndTime; NUDEndTime.Value = banner.EndTime;
NUDSortId.Value = banner.SortId; NUDSortId.Value = banner.SortId;
TxtRateUpItems1.Text = string.Join(", ", banner.RateUpItems1); TxtRateUpItems1.Text = string.Join(", ", banner.RateUpItems1);
TxtRateUpItems2.Text = string.Join(", ", banner.RateUpItems2); TxtRateUpItems2.Text = string.Join(", ", banner.RateUpItems2);
NUDBaseYellowWeight.Value = banner.BaseYellowWeight * 0.01M; NUDBaseYellowWeight.Value = banner.BaseYellowWeight * 0.01M;
NUDBasePurpleWeight.Value = banner.BasePurpleWeight * 0.01M; NUDBasePurpleWeight.Value = banner.BasePurpleWeight * 0.01M;
NUDEventChance.Value = banner.EventChance; NUDEventChance.Value = banner.EventChance;
NUDSoftPity.Value = banner.SoftPity; NUDSoftPity.Value = banner.SoftPity;
NUDHardPity.Value = banner.HardPity; NUDHardPity.Value = banner.HardPity;
InitRateUpItems(banner); InitRateUpItems(banner);
} }
catch (Exception ex) catch (Exception ex)
@ -155,23 +156,23 @@ namespace GrasscutterTools.Forms
var prefabId = GameData.GachaBannerPrefabs.Ids[CmbPrefab.SelectedIndex]; var prefabId = GameData.GachaBannerPrefabs.Ids[CmbPrefab.SelectedIndex];
GachaBanner banner = new GachaBanner GachaBanner banner = new GachaBanner
{ {
GachaType = (int)NUDGachaType.Value, GachaType = (int)NUDGachaType.Value,
ScheduleId = (int)NUDScheduleId.Value, ScheduleId = (int)NUDScheduleId.Value,
BannerType = (BannerType)CmbBannerType.SelectedIndex, BannerType = (BannerType)CmbBannerType.SelectedIndex,
PrefabPath = $"GachaShowPanel_A{prefabId:000}", PrefabPath = $"GachaShowPanel_A{prefabId:000}",
PreviewPrefabPath = $"UI_Tab_GachaShowPanel_A{prefabId:000}", PreviewPrefabPath = $"UI_Tab_GachaShowPanel_A{prefabId:000}",
TitlePath = $"UI_GACHA_SHOW_PANEL_A{prefabId:000}_TITLE", TitlePath = $"UI_GACHA_SHOW_PANEL_A{prefabId:000}_TITLE",
CostItem = RbCostItem224.Checked ? 224 : 223, CostItem = RbCostItem224.Checked ? 224 : 223,
BeginTime = (int)NUDBeginTime.Value, BeginTime = (int)NUDBeginTime.Value,
EndTime = (int)NUDEndTime.Value, EndTime = (int)NUDEndTime.Value,
SortId = (int)NUDSortId.Value, SortId = (int)NUDSortId.Value,
RateUpItems1 = yellowIds, RateUpItems1 = yellowIds,
RateUpItems2 = purpleIds, RateUpItems2 = purpleIds,
BaseYellowWeight = (int)(NUDBaseYellowWeight.Value * 100), BaseYellowWeight = (int)(NUDBaseYellowWeight.Value * 100),
BasePurpleWeight = (int)(NUDBasePurpleWeight.Value * 100), BasePurpleWeight = (int)(NUDBasePurpleWeight.Value * 100),
EventChance = (int)NUDEventChance.Value, EventChance = (int)NUDEventChance.Value,
SoftPity = (int)NUDSoftPity.Value, SoftPity = (int)NUDSoftPity.Value,
HardPity = (int)NUDHardPity.Value HardPity = (int)NUDHardPity.Value
}; };
return banner; return banner;
} }

View File

@ -22,7 +22,6 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using GrasscutterTools.Game; using GrasscutterTools.Game;
using GrasscutterTools.Game.Gacha; using GrasscutterTools.Game.Gacha;
@ -301,7 +300,7 @@ namespace GrasscutterTools.Forms
{ {
var json = JsonConvert.SerializeObject(banner); var json = JsonConvert.SerializeObject(banner);
json = json.Replace(",\"", ",\r\n \"").Insert(1, "\r\n "); json = json.Replace(",\"", ",\r\n \"").Insert(1, "\r\n ");
TxtJson.Text = json.Insert(json.Length-1, "\r\n"); TxtJson.Text = json.Insert(json.Length - 1, "\r\n");
ShowBanner(banner); ShowBanner(banner);
} }
} }

View File

@ -24,10 +24,8 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using GrasscutterTools.Game; using GrasscutterTools.Game;
using GrasscutterTools.Game.Drop;
using GrasscutterTools.Game.Gacha; using GrasscutterTools.Game.Gacha;
using GrasscutterTools.Properties; using GrasscutterTools.Properties;
@ -44,7 +42,7 @@ namespace GrasscutterTools.Forms
private List<GachaBanner3> Banners; private List<GachaBanner3> Banners;
#endregion #endregion - -
#region - - #region - -
@ -105,11 +103,10 @@ namespace GrasscutterTools.Forms
new FormGachaBannerEditor().ShowDialog(); new FormGachaBannerEditor().ShowDialog();
} }
#endregion #endregion - -
#region - Banners.json - #region - Banners.json -
/// <summary> /// <summary>
/// 加载按钮点击时触发 /// 加载按钮点击时触发
/// </summary> /// </summary>
@ -174,7 +171,7 @@ namespace GrasscutterTools.Forms
} }
} }
#endregion #endregion - Banners.json -
#region - - #region - -
@ -254,7 +251,7 @@ namespace GrasscutterTools.Forms
} }
} }
#endregion #endregion - -
#region - - #region - -
@ -497,8 +494,6 @@ namespace GrasscutterTools.Forms
return banner; return banner;
} }
#endregion - - #endregion - -
} }
} }

View File

@ -163,7 +163,6 @@ namespace GrasscutterTools.Forms
} }
throw firstEx; throw firstEx;
//{ //{
// try // try
// { // {

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using Newtonsoft.Json; using Newtonsoft.Json;
namespace GrasscutterTools.GOOD namespace GrasscutterTools.GOOD
@ -91,4 +92,4 @@ namespace GrasscutterTools.GOOD
public double Value { get; set; } public double Value { get; set; }
} }
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using Newtonsoft.Json; using Newtonsoft.Json;
namespace GrasscutterTools.GOOD namespace GrasscutterTools.GOOD

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -26,7 +27,7 @@ namespace GrasscutterTools.GOOD
/// Genshin Open Object Description (GOOD) /// Genshin Open Object Description (GOOD)
/// Doc: https://frzyc.github.io/genshin-optimizer/#/doc /// Doc: https://frzyc.github.io/genshin-optimizer/#/doc
/// Modified from https://github.com/Andrewthe13th/Inventory_Kamera/blob/master/InventoryKamera/data/GOOD.cs /// Modified from https://github.com/Andrewthe13th/Inventory_Kamera/blob/master/InventoryKamera/data/GOOD.cs
/// ///
/// Available for /// Available for
/// https://frzyc.github.io/genshin-optimizer/ /// https://frzyc.github.io/genshin-optimizer/
/// https://github.com/Andrewthe13th/Inventory_Kamera /// https://github.com/Andrewthe13th/Inventory_Kamera
@ -60,4 +61,4 @@ namespace GrasscutterTools.GOOD
[JsonProperty("materials", DefaultValueHandling = DefaultValueHandling.Ignore)] [JsonProperty("materials", DefaultValueHandling = DefaultValueHandling.Ignore)]
public Dictionary<string, int> Materials { get; set; } public Dictionary<string, int> Materials { get; set; }
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@ -55,10 +56,8 @@ namespace GrasscutterTools.GOOD
Weapons = ToGOODMap(weapons); Weapons = ToGOODMap(weapons);
} }
public static Dictionary<string, int> ArtifactCats { get; private set; } public static Dictionary<string, int> ArtifactCats { get; private set; }
public static Dictionary<string, int> ArtifactSlotMap = new Dictionary<string, int> { public static Dictionary<string, int> ArtifactSlotMap = new Dictionary<string, int> {
{"goblet", 1}, {"plume", 2}, {"circlet", 3}, {"flower", 4}, {"sands", 5} {"goblet", 1}, {"plume", 2}, {"circlet", 3}, {"flower", 4}, {"sands", 5}
}; };
@ -103,6 +102,5 @@ namespace GrasscutterTools.GOOD
public static Dictionary<string, int> Avatars { get; private set; } public static Dictionary<string, int> Avatars { get; private set; }
public static Dictionary<string, int> Weapons { get; private set; } public static Dictionary<string, int> Weapons { get; private set; }
} }
} }

View File

@ -14,9 +14,11 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.ComponentModel; using System.ComponentModel;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace GrasscutterTools.GOOD namespace GrasscutterTools.GOOD

View File

@ -14,18 +14,19 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
namespace GrasscutterTools.Game namespace GrasscutterTools.Game
{ {
/// <summary> /// <summary>
/// 命令版本 /// 命令版本
/// ///
/// 用法: /// 用法:
/// ver = Version.TryParse(input, out Version current) ? new CommandVersion(current) : CommandVersion.Latest(); /// ver = Version.TryParse(input, out Version current) ? new CommandVersion(current) : CommandVersion.Latest();
/// ///
/// </summary> /// </summary>
internal class CommandVersion internal class CommandVersion
{ {
@ -152,4 +153,4 @@ namespace GrasscutterTools.Game
#endregion - Version List - #endregion - Version List -
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using Newtonsoft.Json; using Newtonsoft.Json;
namespace GrasscutterTools.Game.Drop namespace GrasscutterTools.Game.Drop

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -36,4 +37,4 @@ namespace GrasscutterTools.Game.Drop
[JsonProperty("dropDataList")] [JsonProperty("dropDataList")]
public List<DropData> DropDataList { get; set; } = new List<DropData>(); public List<DropData> DropDataList { get; set; } = new List<DropData>();
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
namespace GrasscutterTools.Game.Gacha namespace GrasscutterTools.Game.Gacha
{ {
public enum BannerType public enum BannerType

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.ComponentModel; using System.ComponentModel;
using Newtonsoft.Json; using Newtonsoft.Json;

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters; using Newtonsoft.Json.Converters;

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
@ -215,7 +216,6 @@ namespace GrasscutterTools.Game.Gacha
[JsonProperty("bannerType"), JsonConverter(typeof(StringEnumConverter)), DefaultValue(BannerType.STANDARD)] [JsonProperty("bannerType"), JsonConverter(typeof(StringEnumConverter)), DefaultValue(BannerType.STANDARD)]
public BannerType BannerType { get; set; } = BannerType.STANDARD; public BannerType BannerType { get; set; } = BannerType.STANDARD;
public override string ToString() public override string ToString()
{ {
return $"[{GachaType}|{ScheduleId}] 5*:[{string.Join(",", RateUpItems5.Select(GetName))}] 4*:[{string.Join(",", RateUpItems4.Select(GetName))}]"; return $"[{GachaType}|{ScheduleId}] 5*:[{string.Join(",", RateUpItems5.Select(GetName))}] 4*:[{string.Join(",", RateUpItems4.Select(GetName))}]";

View File

@ -1,6 +1,6 @@
 using System.Collections.Generic;
using System.Collections.Generic;
using System.Text; using System.Text;
/** /**
* Grasscutter Tools * Grasscutter Tools
* Copyright (C) 2022 jie65535 * Copyright (C) 2022 jie65535
@ -17,8 +17,9 @@ using System.Text;
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
namespace GrasscutterTools.Game namespace GrasscutterTools.Game
{ {
public class GameCommand public class GameCommand

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using GrasscutterTools.Properties; using GrasscutterTools.Properties;
namespace GrasscutterTools.Game namespace GrasscutterTools.Game
@ -43,7 +44,6 @@ namespace GrasscutterTools.Game
ShopType = new ItemMap(Resources.ShopType); ShopType = new ItemMap(Resources.ShopType);
} }
public static ItemMap Artifacts { get; private set; } public static ItemMap Artifacts { get; private set; }
public static ItemMap ArtifactCats { get; private set; } public static ItemMap ArtifactCats { get; private set; }
@ -71,11 +71,11 @@ namespace GrasscutterTools.Game
public static ItemMap WeaponColors { get; private set; } public static ItemMap WeaponColors { get; private set; }
public static ItemMap GachaBannerPrefabs { get; private set; } public static ItemMap GachaBannerPrefabs { get; private set; }
public static ItemMap GachaBannerTitles { get; private set; } public static ItemMap GachaBannerTitles { get; private set; }
public static ItemMap Quests { get; private set; } public static ItemMap Quests { get; private set; }
public static ItemMap ShopType { get; private set; } public static ItemMap ShopType { get; private set; }
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -37,7 +38,7 @@ namespace GrasscutterTools.Game
if (categoryLineEndIndex == -1) if (categoryLineEndIndex == -1)
break; break;
var category = idNamePairs.Substring(categoryLineStartIndex+2, categoryLineEndIndex - categoryLineStartIndex - 3).Trim(); var category = idNamePairs.Substring(categoryLineStartIndex + 2, categoryLineEndIndex - categoryLineStartIndex - 3).Trim();
var nextStartIndex = idNamePairs.IndexOf("//", categoryLineEndIndex); var nextStartIndex = idNamePairs.IndexOf("//", categoryLineEndIndex);
if (nextStartIndex == -1) if (nextStartIndex == -1)
@ -63,4 +64,4 @@ namespace GrasscutterTools.Game
/// </summary> /// </summary>
public IEnumerable<string> AllLines => Values.SelectMany(it => it.Lines); public IEnumerable<string> AllLines => Values.SelectMany(it => it.Lines);
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -58,7 +59,7 @@ namespace GrasscutterTools.Game.Mail
/// 附件列表 /// 附件列表
/// </summary> /// </summary>
public List<MailItem> ItemList { get; set; } public List<MailItem> ItemList { get; set; }
/// <summary> /// <summary>
/// 发送时间 /// 发送时间
/// </summary> /// </summary>
@ -72,4 +73,4 @@ namespace GrasscutterTools.Game.Mail
return $"To[{Recipient}]: [{Title}] {Content} | {SendTime}"; return $"To[{Recipient}]: [{Title}] {Content} | {SendTime}";
} }
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
namespace GrasscutterTools.Game.Mail namespace GrasscutterTools.Game.Mail
{ {
/// <summary> /// <summary>
@ -53,4 +54,4 @@ namespace GrasscutterTools.Game.Mail
return $"{ItemId}:{name}"; return $"{ItemId}:{name}";
} }
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
namespace GrasscutterTools.Game.Player namespace GrasscutterTools.Game.Player
{ {
/// <summary> /// <summary>
@ -39,4 +40,4 @@ namespace GrasscutterTools.Game.Player
/// </summary> /// </summary>
public const int PlayerMaxLevel = 60; public const int PlayerMaxLevel = 60;
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.Text; using System.Text;
using GrasscutterTools.Properties; using GrasscutterTools.Properties;

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using Newtonsoft.Json; using Newtonsoft.Json;
namespace GrasscutterTools.Game.Shop namespace GrasscutterTools.Game.Shop
@ -34,4 +35,4 @@ namespace GrasscutterTools.Game.Shop
[JsonProperty("count")] [JsonProperty("count")]
public int Count { get; set; } public int Count { get; set; }
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -74,4 +75,4 @@ namespace GrasscutterTools.Game.Shop
[JsonProperty("endTime")] [JsonProperty("endTime")]
public DateTime? EndTime { get; set; } public DateTime? EndTime { get; set; }
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -29,28 +30,27 @@ namespace GrasscutterTools.Game.Shop
{ {
public ShopInfo() public ShopInfo()
{ {
} }
public ShopInfo(ShopGoodsData sgd) public ShopInfo(ShopGoodsData sgd)
{ {
GoodsId = sgd.GoodsId; GoodsId = sgd.GoodsId;
GoodsItem = new ItemParamData(sgd.ItemId, sgd.ItemCount); GoodsItem = new ItemParamData(sgd.ItemId, sgd.ItemCount);
SCoin = sgd.CostScoin; SCoin = sgd.CostScoin;
MCoin = sgd.CostMcion; MCoin = sgd.CostMcion;
HCoin = sgd.CostHcoin; HCoin = sgd.CostHcoin;
BuyLimit = sgd.BuyLimit; BuyLimit = sgd.BuyLimit;
MinLevel = sgd.MinPlayerLevel; MinLevel = sgd.MinPlayerLevel;
MaxLevel = sgd.MaxPlayerLevel; MaxLevel = sgd.MaxPlayerLevel;
CostItemList = sgd.CostItems.Where(it => it.Id != 0).ToList(); CostItemList = sgd.CostItems.Where(it => it.Id != 0).ToList();
SecondarySheetId = sgd.SubTabId; SecondarySheetId = sgd.SubTabId;
RefreshType = sgd.RefreshType; RefreshType = sgd.RefreshType;
ShopRefreshParam = sgd.RefreshParam; ShopRefreshParam = sgd.RefreshParam;
if (sgd.BeginTime != null && sgd.EndTime != null) if (sgd.BeginTime != null && sgd.EndTime != null)
{ {
BeginTime = (int)new DateTimeOffset(sgd.BeginTime.Value).ToUnixTimeSeconds(); BeginTime = (int)new DateTimeOffset(sgd.BeginTime.Value).ToUnixTimeSeconds();
EndTime = (int)new DateTimeOffset(sgd.EndTime.Value).ToUnixTimeSeconds(); EndTime = (int)new DateTimeOffset(sgd.EndTime.Value).ToUnixTimeSeconds();
} }
} }
@ -115,10 +115,9 @@ namespace GrasscutterTools.Game.Shop
[JsonProperty("shopRefreshParam")] [JsonProperty("shopRefreshParam")]
public int ShopRefreshParam { get; set; } public int ShopRefreshParam { get; set; }
public override string ToString() public override string ToString()
{ {
return $"{GoodsId}:{GameData.Items[GoodsItem.Id]} x{GoodsItem.Count}"; return $"{GoodsId}:{GameData.Items[GoodsItem.Id]} x{GoodsItem.Count}";
} }
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
namespace GrasscutterTools.Game.Shop namespace GrasscutterTools.Game.Shop
{ {
/// <summary> /// <summary>
@ -43,4 +44,4 @@ namespace GrasscutterTools.Game.Shop
/// </summary> /// </summary>
SHOP_REFRESH_MONTHLY, SHOP_REFRESH_MONTHLY,
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -30,4 +31,4 @@ namespace GrasscutterTools.Game.Shop
[JsonProperty("items")] [JsonProperty("items")]
public List<ShopInfo> Items { get; set; } public List<ShopInfo> Items { get; set; }
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;

View File

@ -85,9 +85,6 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Controls\TextBoxXP.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="DispatchServer\DispatchServerAPI.cs" /> <Compile Include="DispatchServer\DispatchServerAPI.cs" />
<Compile Include="DispatchServer\Model\ServerStatus.cs" /> <Compile Include="DispatchServer\Model\ServerStatus.cs" />
<Compile Include="Forms\FormDropEditor.cs"> <Compile Include="Forms\FormDropEditor.cs">

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;

View File

@ -63,25 +63,28 @@ namespace GrasscutterTools.Pages
/// </summary> /// </summary>
public Func<string> GetCommand { get; set; } public Func<string> GetCommand { get; set; }
#endregion #endregion - -
#region - - #region - -
/// <summary> /// <summary>
/// 加载时触发(修改语言时会再次触发) /// 加载时触发(修改语言时会再次触发)
/// </summary> /// </summary>
public virtual void OnLoad() { } public virtual void OnLoad()
{ }
/// <summary> /// <summary>
/// 进入页面时触发(可触发多次) /// 进入页面时触发(可触发多次)
/// </summary> /// </summary>
public virtual void OnEnter() { } public virtual void OnEnter()
{ }
/// <summary> /// <summary>
/// 关闭时触发(用于保存页面数据) /// 关闭时触发(用于保存页面数据)
/// </summary> /// </summary>
public virtual void OnClosed() { } public virtual void OnClosed()
{ }
#endregion #endregion - -
} }
} }

View File

@ -22,6 +22,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using GrasscutterTools.Game; using GrasscutterTools.Game;
using GrasscutterTools.Properties; using GrasscutterTools.Properties;
@ -40,7 +41,6 @@ namespace GrasscutterTools.Pages
InitGiveItemRecord(); InitGiveItemRecord();
} }
/// <summary> /// <summary>
/// 初始化游戏物品列表 /// 初始化游戏物品列表
/// </summary> /// </summary>
@ -185,6 +185,5 @@ namespace GrasscutterTools.Pages
} }
#endregion -- -- #endregion -- --
} }
} }

View File

@ -18,14 +18,6 @@
**/ **/
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using GrasscutterTools.Game; using GrasscutterTools.Game;
using GrasscutterTools.Utils; using GrasscutterTools.Utils;
@ -39,7 +31,6 @@ namespace GrasscutterTools.Pages
InitializeComponent(); InitializeComponent();
} }
protected override void OnLoad(EventArgs e) protected override void OnLoad(EventArgs e)
{ {
base.OnLoad(e); base.OnLoad(e);
@ -80,4 +71,4 @@ namespace GrasscutterTools.Pages
SetCommand("/give", $"weapons x{NUDWeaponAmout.Value} lv{NUDWeaponLevel.Value} r{NUDWeaponRefinement.Value}"); SetCommand("/give", $"weapons x{NUDWeaponAmout.Value} lv{NUDWeaponLevel.Value} r{NUDWeaponRefinement.Value}");
} }
} }
} }

View File

@ -85,7 +85,6 @@ namespace GrasscutterTools.Pages
#region - Check update - #region - Check update -
private ReleaseAPI.ReleaseInfo LastestInfo = null; private ReleaseAPI.ReleaseInfo LastestInfo = null;
private Version lastestVersion = null; private Version lastestVersion = null;

View File

@ -14,10 +14,10 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Globalization;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@ -77,7 +77,7 @@ namespace GrasscutterTools
MultiLanguage.SetDefaultLanguage(Settings.Default.DefaultLanguage); MultiLanguage.SetDefaultLanguage(Settings.Default.DefaultLanguage);
Application.Run(new Forms.FormMain()); Application.Run(new Forms.FormMain());
Console.WriteLine("Program end."); Console.WriteLine("Program end.");
} }
#region - - #region - -

File diff suppressed because it is too large Load Diff

View File

@ -191,4 +191,4 @@
"Percent": true, "Percent": true,
"Tip": "This doesn't seem to work." "Tip": "This doesn't seem to work."
} }
] ]

View File

@ -191,4 +191,4 @@
"Percent": true, "Percent": true,
"Tip": "Это, кажется, не работает." "Tip": "Это, кажется, не работает."
} }
] ]

View File

@ -191,4 +191,4 @@
"Percent": true, "Percent": true,
"Tip": "似乎不起作用" "Tip": "似乎不起作用"
} }
] ]

View File

@ -14,15 +14,16 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace GrasscutterTools.Utils namespace GrasscutterTools.Utils
{ {
class SubstatSumEquality : IEqualityComparer<List<KeyValuePair<int, double>>> internal class SubstatSumEquality : IEqualityComparer<List<KeyValuePair<int, double>>>
{ {
public bool Equals(List<KeyValuePair<int, double>> left, List<KeyValuePair<int, double>> right) public bool Equals(List<KeyValuePair<int, double>> left, List<KeyValuePair<int, double>> right)
{ {
@ -48,8 +49,8 @@ namespace GrasscutterTools.Utils
} }
} }
class ArtifactUtils internal class ArtifactUtils
{ {
public static Dictionary<string, double[][]> substats_rolls = new Dictionary<string, double[][]> public static Dictionary<string, double[][]> substats_rolls = new Dictionary<string, double[][]>
{ {
{ {
@ -179,6 +180,7 @@ namespace GrasscutterTools.Utils
// Default, should never happen // Default, should never happen
return last_stat_list; return last_stat_list;
} }
private static void InitSubstats() private static void InitSubstats()
{ {
substats_dict = new Dictionary<string, Dictionary<int, List<KeyValuePair<double, int[]>>>>(); substats_dict = new Dictionary<string, Dictionary<int, List<KeyValuePair<double, int[]>>>>();
@ -193,7 +195,7 @@ namespace GrasscutterTools.Utils
substat_options.Add(new KeyValuePair<int, double>(0, 0)); substat_options.Add(new KeyValuePair<int, double>(0, 0));
for (int substat_index = 0; substat_index < substats_rolls[stat_name][rarity_index].Length; substat_index++) for (int substat_index = 0; substat_index < substats_rolls[stat_name][rarity_index].Length; substat_index++)
{ {
substat_options.Add(new KeyValuePair<int, double>(substat_index+1, substats_rolls[stat_name][rarity_index][substat_index])); substat_options.Add(new KeyValuePair<int, double>(substat_index + 1, substats_rolls[stat_name][rarity_index][substat_index]));
} }
var substat_sum_data = (from s1 in substat_options from s2 in substat_options from s3 in substat_options from s4 in substat_options from s5 in substat_options from s6 in substat_options select new { s1, s2, s3, s4, s5, s6 }) var substat_sum_data = (from s1 in substat_options from s2 in substat_options from s3 in substat_options from s4 in substat_options from s5 in substat_options from s6 in substat_options select new { s1, s2, s3, s4, s5, s6 })
@ -219,4 +221,4 @@ namespace GrasscutterTools.Utils
private static bool substats_initiated = false; private static bool substats_initiated = false;
} }
} }

View File

@ -32,4 +32,4 @@ namespace GrasscutterTools.Utils
"GrasscutterTools", "GrasscutterTools",
filename); filename);
} }
} }

View File

@ -14,8 +14,9 @@
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
**/ **/
using System; using System;
using System.Net; using System.Net;
using System.Net.Http; using System.Net.Http;

View File

@ -47,4 +47,4 @@ namespace GrasscutterTools.Utils
public string Body { get; set; } public string Body { get; set; }
} }
} }
} }

View File

@ -45,7 +45,6 @@ namespace GrasscutterTools.Utils
listBox.EndUpdate(); listBox.EndUpdate();
} }
/// <summary> /// <summary>
/// 使用浏览器打开网址 /// 使用浏览器打开网址
/// </summary> /// </summary>
@ -63,11 +62,10 @@ namespace GrasscutterTools.Utils
} }
} }
/// <summary> /// <summary>
/// 提示气泡对象 /// 提示气泡对象
/// </summary> /// </summary>
private readonly static ToolTip TTip = new ToolTip(); private static readonly ToolTip TTip = new ToolTip();
/// <summary> /// <summary>
/// 在指定控件上显示提示气泡 /// 在指定控件上显示提示气泡
@ -79,4 +77,4 @@ namespace GrasscutterTools.Utils
TTip.Show(message, control, 0, control.Size.Height, 3000); TTip.Show(message, control, 0, control.Size.Height, 3000);
} }
} }
} }