mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-06-08 23:19:14 +08:00
Clean up all
Remvoe TextBoxXP
This commit is contained in:
parent
d169de9a9e
commit
c7898401ce
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using GrasscutterTools.DispatchServer.Model;
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.DispatchServer.Model
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@ -485,7 +486,6 @@ namespace GrasscutterTools.Forms
|
||||
dropList[i] = data;
|
||||
}
|
||||
|
||||
|
||||
#endregion - 掉落物列表 -
|
||||
|
||||
#region - 物品列表 -
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -99,25 +100,25 @@ namespace GrasscutterTools.Forms
|
||||
{
|
||||
try
|
||||
{
|
||||
NUDGachaType.Value = banner.GachaType;
|
||||
NUDScheduleId.Value = banner.ScheduleId;
|
||||
NUDGachaType.Value = banner.GachaType;
|
||||
NUDScheduleId.Value = banner.ScheduleId;
|
||||
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))
|
||||
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;
|
||||
NUDEndTime.Value = banner.EndTime;
|
||||
NUDSortId.Value = banner.SortId;
|
||||
TxtRateUpItems1.Text = string.Join(", ", banner.RateUpItems1);
|
||||
TxtRateUpItems2.Text = string.Join(", ", banner.RateUpItems2);
|
||||
NUDBaseYellowWeight.Value = banner.BaseYellowWeight * 0.01M;
|
||||
NUDBasePurpleWeight.Value = banner.BasePurpleWeight * 0.01M;
|
||||
NUDEventChance.Value = banner.EventChance;
|
||||
NUDSoftPity.Value = banner.SoftPity;
|
||||
NUDHardPity.Value = banner.HardPity;
|
||||
RbCostItem224.Checked = banner.CostItem == 224;
|
||||
RbCostItem223.Checked = banner.CostItem == 223;
|
||||
NUDBeginTime.Value = banner.BeginTime;
|
||||
NUDEndTime.Value = banner.EndTime;
|
||||
NUDSortId.Value = banner.SortId;
|
||||
TxtRateUpItems1.Text = string.Join(", ", banner.RateUpItems1);
|
||||
TxtRateUpItems2.Text = string.Join(", ", banner.RateUpItems2);
|
||||
NUDBaseYellowWeight.Value = banner.BaseYellowWeight * 0.01M;
|
||||
NUDBasePurpleWeight.Value = banner.BasePurpleWeight * 0.01M;
|
||||
NUDEventChance.Value = banner.EventChance;
|
||||
NUDSoftPity.Value = banner.SoftPity;
|
||||
NUDHardPity.Value = banner.HardPity;
|
||||
InitRateUpItems(banner);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -155,23 +156,23 @@ namespace GrasscutterTools.Forms
|
||||
var prefabId = GameData.GachaBannerPrefabs.Ids[CmbPrefab.SelectedIndex];
|
||||
GachaBanner banner = new GachaBanner
|
||||
{
|
||||
GachaType = (int)NUDGachaType.Value,
|
||||
ScheduleId = (int)NUDScheduleId.Value,
|
||||
BannerType = (BannerType)CmbBannerType.SelectedIndex,
|
||||
PrefabPath = $"GachaShowPanel_A{prefabId:000}",
|
||||
GachaType = (int)NUDGachaType.Value,
|
||||
ScheduleId = (int)NUDScheduleId.Value,
|
||||
BannerType = (BannerType)CmbBannerType.SelectedIndex,
|
||||
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,
|
||||
SortId = (int)NUDSortId.Value,
|
||||
RateUpItems1 = yellowIds,
|
||||
RateUpItems2 = purpleIds,
|
||||
BaseYellowWeight = (int)(NUDBaseYellowWeight.Value * 100),
|
||||
BasePurpleWeight = (int)(NUDBasePurpleWeight.Value * 100),
|
||||
EventChance = (int)NUDEventChance.Value,
|
||||
SoftPity = (int)NUDSoftPity.Value,
|
||||
HardPity = (int)NUDHardPity.Value
|
||||
TitlePath = $"UI_GACHA_SHOW_PANEL_A{prefabId:000}_TITLE",
|
||||
CostItem = RbCostItem224.Checked ? 224 : 223,
|
||||
BeginTime = (int)NUDBeginTime.Value,
|
||||
EndTime = (int)NUDEndTime.Value,
|
||||
SortId = (int)NUDSortId.Value,
|
||||
RateUpItems1 = yellowIds,
|
||||
RateUpItems2 = purpleIds,
|
||||
BaseYellowWeight = (int)(NUDBaseYellowWeight.Value * 100),
|
||||
BasePurpleWeight = (int)(NUDBasePurpleWeight.Value * 100),
|
||||
EventChance = (int)NUDEventChance.Value,
|
||||
SoftPity = (int)NUDSoftPity.Value,
|
||||
HardPity = (int)NUDHardPity.Value
|
||||
};
|
||||
return banner;
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.DataVisualization.Charting;
|
||||
|
||||
using GrasscutterTools.Game;
|
||||
using GrasscutterTools.Game.Gacha;
|
||||
@ -301,7 +300,7 @@ namespace GrasscutterTools.Forms
|
||||
{
|
||||
var json = JsonConvert.SerializeObject(banner);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -24,10 +24,8 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms.DataVisualization.Charting;
|
||||
|
||||
using GrasscutterTools.Game;
|
||||
using GrasscutterTools.Game.Drop;
|
||||
using GrasscutterTools.Game.Gacha;
|
||||
using GrasscutterTools.Properties;
|
||||
|
||||
@ -44,7 +42,7 @@ namespace GrasscutterTools.Forms
|
||||
|
||||
private List<GachaBanner3> Banners;
|
||||
|
||||
#endregion
|
||||
#endregion - 成员 -
|
||||
|
||||
#region - 构造与窗体事件 -
|
||||
|
||||
@ -105,11 +103,10 @@ namespace GrasscutterTools.Forms
|
||||
new FormGachaBannerEditor().ShowDialog();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion - 构造与窗体事件 -
|
||||
|
||||
#region - Banners.json 文件相关 -
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加载按钮点击时触发
|
||||
/// </summary>
|
||||
@ -174,7 +171,7 @@ namespace GrasscutterTools.Forms
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion - Banners.json 文件相关 -
|
||||
|
||||
#region - 卡池列表 -
|
||||
|
||||
@ -254,7 +251,7 @@ namespace GrasscutterTools.Forms
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion - 卡池列表 -
|
||||
|
||||
#region - 卡池 -
|
||||
|
||||
@ -497,8 +494,6 @@ namespace GrasscutterTools.Forms
|
||||
return banner;
|
||||
}
|
||||
|
||||
|
||||
#endregion - 卡池参数 -
|
||||
|
||||
}
|
||||
}
|
@ -163,7 +163,6 @@ namespace GrasscutterTools.Forms
|
||||
}
|
||||
throw firstEx;
|
||||
|
||||
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.GOOD
|
||||
@ -91,4 +92,4 @@ namespace GrasscutterTools.GOOD
|
||||
public double Value { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.GOOD
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
@ -26,7 +27,7 @@ namespace GrasscutterTools.GOOD
|
||||
/// Genshin Open Object Description (GOOD)
|
||||
/// Doc: https://frzyc.github.io/genshin-optimizer/#/doc
|
||||
/// Modified from https://github.com/Andrewthe13th/Inventory_Kamera/blob/master/InventoryKamera/data/GOOD.cs
|
||||
///
|
||||
///
|
||||
/// Available for
|
||||
/// https://frzyc.github.io/genshin-optimizer/
|
||||
/// https://github.com/Andrewthe13th/Inventory_Kamera
|
||||
@ -60,4 +61,4 @@ namespace GrasscutterTools.GOOD
|
||||
[JsonProperty("materials", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public Dictionary<string, int> Materials { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
@ -55,10 +56,8 @@ namespace GrasscutterTools.GOOD
|
||||
Weapons = ToGOODMap(weapons);
|
||||
}
|
||||
|
||||
|
||||
public static Dictionary<string, int> ArtifactCats { get; private set; }
|
||||
|
||||
|
||||
public static Dictionary<string, int> ArtifactSlotMap = new Dictionary<string, int> {
|
||||
{"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> Weapons { get; private set; }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -14,9 +14,11 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.GOOD
|
||||
|
@ -14,18 +14,19 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
|
||||
namespace GrasscutterTools.Game
|
||||
{
|
||||
/// <summary>
|
||||
/// 命令版本
|
||||
///
|
||||
///
|
||||
/// 用法:
|
||||
/// ver = Version.TryParse(input, out Version current) ? new CommandVersion(current) : CommandVersion.Latest();
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
internal class CommandVersion
|
||||
{
|
||||
@ -152,4 +153,4 @@ namespace GrasscutterTools.Game
|
||||
|
||||
#endregion - 版本列表 Version List -
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.Game.Drop
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
@ -36,4 +37,4 @@ namespace GrasscutterTools.Game.Drop
|
||||
[JsonProperty("dropDataList")]
|
||||
public List<DropData> DropDataList { get; set; } = new List<DropData>();
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
namespace GrasscutterTools.Game.Gacha
|
||||
{
|
||||
public enum BannerType
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
||||
@ -215,7 +216,6 @@ namespace GrasscutterTools.Game.Gacha
|
||||
[JsonProperty("bannerType"), JsonConverter(typeof(StringEnumConverter)), DefaultValue(BannerType.STANDARD)]
|
||||
public BannerType BannerType { get; set; } = BannerType.STANDARD;
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[{GachaType}|{ScheduleId}] 5*:[{string.Join(",", RateUpItems5.Select(GetName))}] 4*:[{string.Join(",", RateUpItems4.Select(GetName))}]";
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
/**
|
||||
* Grasscutter Tools
|
||||
* Copyright (C) 2022 jie65535
|
||||
@ -17,8 +17,9 @@ using System.Text;
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
namespace GrasscutterTools.Game
|
||||
{
|
||||
public class GameCommand
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using GrasscutterTools.Properties;
|
||||
|
||||
namespace GrasscutterTools.Game
|
||||
@ -43,7 +44,6 @@ namespace GrasscutterTools.Game
|
||||
ShopType = new ItemMap(Resources.ShopType);
|
||||
}
|
||||
|
||||
|
||||
public static ItemMap Artifacts { 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 GachaBannerPrefabs { get; private set; }
|
||||
|
||||
|
||||
public static ItemMap GachaBannerTitles { get; private set; }
|
||||
|
||||
public static ItemMap Quests { get; private set; }
|
||||
|
||||
public static ItemMap ShopType { get; private set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@ -37,7 +38,7 @@ namespace GrasscutterTools.Game
|
||||
if (categoryLineEndIndex == -1)
|
||||
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);
|
||||
if (nextStartIndex == -1)
|
||||
@ -63,4 +64,4 @@ namespace GrasscutterTools.Game
|
||||
/// </summary>
|
||||
public IEnumerable<string> AllLines => Values.SelectMany(it => it.Lines);
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@ -58,7 +59,7 @@ namespace GrasscutterTools.Game.Mail
|
||||
/// 附件列表
|
||||
/// </summary>
|
||||
public List<MailItem> ItemList { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 发送时间
|
||||
/// </summary>
|
||||
@ -72,4 +73,4 @@ namespace GrasscutterTools.Game.Mail
|
||||
return $"To[{Recipient}]: [{Title}] {Content} | {SendTime}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
namespace GrasscutterTools.Game.Mail
|
||||
{
|
||||
/// <summary>
|
||||
@ -53,4 +54,4 @@ namespace GrasscutterTools.Game.Mail
|
||||
return $"{ItemId}:{name}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
namespace GrasscutterTools.Game.Player
|
||||
{
|
||||
/// <summary>
|
||||
@ -39,4 +40,4 @@ namespace GrasscutterTools.Game.Player
|
||||
/// </summary>
|
||||
public const int PlayerMaxLevel = 60;
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.Text;
|
||||
|
||||
using GrasscutterTools.Properties;
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.Game.Shop
|
||||
@ -34,4 +35,4 @@ namespace GrasscutterTools.Game.Shop
|
||||
[JsonProperty("count")]
|
||||
public int Count { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@ -74,4 +75,4 @@ namespace GrasscutterTools.Game.Shop
|
||||
[JsonProperty("endTime")]
|
||||
public DateTime? EndTime { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -29,28 +30,27 @@ namespace GrasscutterTools.Game.Shop
|
||||
{
|
||||
public ShopInfo()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ShopInfo(ShopGoodsData sgd)
|
||||
{
|
||||
GoodsId = sgd.GoodsId;
|
||||
GoodsItem = new ItemParamData(sgd.ItemId, sgd.ItemCount);
|
||||
SCoin = sgd.CostScoin;
|
||||
MCoin = sgd.CostMcion;
|
||||
HCoin = sgd.CostHcoin;
|
||||
BuyLimit = sgd.BuyLimit;
|
||||
GoodsId = sgd.GoodsId;
|
||||
GoodsItem = new ItemParamData(sgd.ItemId, sgd.ItemCount);
|
||||
SCoin = sgd.CostScoin;
|
||||
MCoin = sgd.CostMcion;
|
||||
HCoin = sgd.CostHcoin;
|
||||
BuyLimit = sgd.BuyLimit;
|
||||
|
||||
MinLevel = sgd.MinPlayerLevel;
|
||||
MaxLevel = sgd.MaxPlayerLevel;
|
||||
CostItemList = sgd.CostItems.Where(it => it.Id != 0).ToList();
|
||||
MinLevel = sgd.MinPlayerLevel;
|
||||
MaxLevel = sgd.MaxPlayerLevel;
|
||||
CostItemList = sgd.CostItems.Where(it => it.Id != 0).ToList();
|
||||
SecondarySheetId = sgd.SubTabId;
|
||||
RefreshType = sgd.RefreshType;
|
||||
RefreshType = sgd.RefreshType;
|
||||
ShopRefreshParam = sgd.RefreshParam;
|
||||
if (sgd.BeginTime != null && sgd.EndTime != null)
|
||||
{
|
||||
BeginTime = (int)new DateTimeOffset(sgd.BeginTime.Value).ToUnixTimeSeconds();
|
||||
EndTime = (int)new DateTimeOffset(sgd.EndTime.Value).ToUnixTimeSeconds();
|
||||
BeginTime = (int)new DateTimeOffset(sgd.BeginTime.Value).ToUnixTimeSeconds();
|
||||
EndTime = (int)new DateTimeOffset(sgd.EndTime.Value).ToUnixTimeSeconds();
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,10 +115,9 @@ namespace GrasscutterTools.Game.Shop
|
||||
[JsonProperty("shopRefreshParam")]
|
||||
public int ShopRefreshParam { get; set; }
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{GoodsId}:{GameData.Items[GoodsItem.Id]} x{GoodsItem.Count}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
namespace GrasscutterTools.Game.Shop
|
||||
{
|
||||
/// <summary>
|
||||
@ -43,4 +44,4 @@ namespace GrasscutterTools.Game.Shop
|
||||
/// </summary>
|
||||
SHOP_REFRESH_MONTHLY,
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
@ -30,4 +31,4 @@ namespace GrasscutterTools.Game.Shop
|
||||
[JsonProperty("items")]
|
||||
public List<ShopInfo> Items { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
@ -85,9 +85,6 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controls\TextBoxXP.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DispatchServer\DispatchServerAPI.cs" />
|
||||
<Compile Include="DispatchServer\Model\ServerStatus.cs" />
|
||||
<Compile Include="Forms\FormDropEditor.cs">
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
@ -63,25 +63,28 @@ namespace GrasscutterTools.Pages
|
||||
/// </summary>
|
||||
public Func<string> GetCommand { get; set; }
|
||||
|
||||
#endregion
|
||||
#endregion - 命令相关 -
|
||||
|
||||
#region - 生命周期事件 -
|
||||
|
||||
/// <summary>
|
||||
/// 加载时触发(修改语言时会再次触发)
|
||||
/// </summary>
|
||||
public virtual void OnLoad() { }
|
||||
public virtual void OnLoad()
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// 进入页面时触发(可触发多次)
|
||||
/// </summary>
|
||||
public virtual void OnEnter() { }
|
||||
public virtual void OnEnter()
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// 关闭时触发(用于保存页面数据)
|
||||
/// </summary>
|
||||
public virtual void OnClosed() { }
|
||||
public virtual void OnClosed()
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
#endregion - 生命周期事件 -
|
||||
}
|
||||
}
|
@ -22,6 +22,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using GrasscutterTools.Game;
|
||||
|
||||
using GrasscutterTools.Properties;
|
||||
@ -40,7 +41,6 @@ namespace GrasscutterTools.Pages
|
||||
InitGiveItemRecord();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化游戏物品列表
|
||||
/// </summary>
|
||||
@ -185,6 +185,5 @@ namespace GrasscutterTools.Pages
|
||||
}
|
||||
|
||||
#endregion -- 物品记录 --
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -18,14 +18,6 @@
|
||||
**/
|
||||
|
||||
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.Utils;
|
||||
@ -39,7 +31,6 @@ namespace GrasscutterTools.Pages
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
@ -80,4 +71,4 @@ namespace GrasscutterTools.Pages
|
||||
SetCommand("/give", $"weapons x{NUDWeaponAmout.Value} lv{NUDWeaponLevel.Value} r{NUDWeaponRefinement.Value}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -85,7 +85,6 @@ namespace GrasscutterTools.Pages
|
||||
|
||||
#region - 检查更新 Check update -
|
||||
|
||||
|
||||
private ReleaseAPI.ReleaseInfo LastestInfo = null;
|
||||
private Version lastestVersion = null;
|
||||
|
||||
|
@ -14,10 +14,10 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@ -77,7 +77,7 @@ namespace GrasscutterTools
|
||||
MultiLanguage.SetDefaultLanguage(Settings.Default.DefaultLanguage);
|
||||
|
||||
Application.Run(new Forms.FormMain());
|
||||
Console.WriteLine("Program end.");
|
||||
Console.WriteLine("Program end.");
|
||||
}
|
||||
|
||||
#region - 全局异常处理 -
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -191,4 +191,4 @@
|
||||
"Percent": true,
|
||||
"Tip": "This doesn't seem to work."
|
||||
}
|
||||
]
|
||||
]
|
@ -191,4 +191,4 @@
|
||||
"Percent": true,
|
||||
"Tip": "Это, кажется, не работает."
|
||||
}
|
||||
]
|
||||
]
|
@ -191,4 +191,4 @@
|
||||
"Percent": true,
|
||||
"Tip": "似乎不起作用"
|
||||
}
|
||||
]
|
||||
]
|
@ -14,15 +14,16 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
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)
|
||||
{
|
||||
@ -48,8 +49,8 @@ namespace GrasscutterTools.Utils
|
||||
}
|
||||
}
|
||||
|
||||
class ArtifactUtils
|
||||
{
|
||||
internal class ArtifactUtils
|
||||
{
|
||||
public static Dictionary<string, double[][]> substats_rolls = new Dictionary<string, double[][]>
|
||||
{
|
||||
{
|
||||
@ -179,6 +180,7 @@ namespace GrasscutterTools.Utils
|
||||
// Default, should never happen
|
||||
return last_stat_list;
|
||||
}
|
||||
|
||||
private static void InitSubstats()
|
||||
{
|
||||
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));
|
||||
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 })
|
||||
@ -219,4 +221,4 @@ namespace GrasscutterTools.Utils
|
||||
|
||||
private static bool substats_initiated = false;
|
||||
}
|
||||
}
|
||||
}
|
@ -32,4 +32,4 @@ namespace GrasscutterTools.Utils
|
||||
"GrasscutterTools",
|
||||
filename);
|
||||
}
|
||||
}
|
||||
}
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* 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/>.
|
||||
*
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
|
@ -47,4 +47,4 @@ namespace GrasscutterTools.Utils
|
||||
public string Body { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -45,7 +45,6 @@ namespace GrasscutterTools.Utils
|
||||
listBox.EndUpdate();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 使用浏览器打开网址
|
||||
/// </summary>
|
||||
@ -63,11 +62,10 @@ namespace GrasscutterTools.Utils
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 提示气泡对象
|
||||
/// </summary>
|
||||
private readonly static ToolTip TTip = new ToolTip();
|
||||
private static readonly ToolTip TTip = new ToolTip();
|
||||
|
||||
/// <summary>
|
||||
/// 在指定控件上显示提示气泡
|
||||
@ -79,4 +77,4 @@ namespace GrasscutterTools.Utils
|
||||
TTip.Show(message, control, 0, control.Size.Height, 3000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user