Add Weather Page

This commit is contained in:
2023-10-14 11:36:17 +08:00
parent cfdca6f031
commit f8b920100d
18 changed files with 2199 additions and 566 deletions

View File

@@ -55,8 +55,6 @@ namespace GrasscutterTools.Pages
public override void OnLoad()
{
Scenes = GameData.Scenes.Lines;
CmbClimateType.Items.Clear();
CmbClimateType.Items.AddRange(Resources.ClimateType.Split(','));
}
/// <summary>
@@ -130,24 +128,6 @@ namespace GrasscutterTools.Pages
}
}
/// <summary>
/// 气候类型列表
/// </summary>
private static readonly string[] climateTypes = { "none", "sunny", "cloudy", "rain", "thunderstorm", "snow", "mist" };
/// <summary>
/// 气候类型下拉框选中项改变时触发
/// </summary>
private void CmbClimateType_SelectedIndexChanged(object sender, EventArgs e)
{
if (CmbClimateType.SelectedIndex < 0)
return;
if (CommandVersion.Check(CommandVersion.V1_2_2))
SetCommand("/weather", CmbClimateType.SelectedIndex < climateTypes.Length ? climateTypes[CmbClimateType.SelectedIndex] : "none");
else
SetCommand("/weather", $"0 {CmbClimateType.SelectedIndex}");
}
/// <summary>
/// 点击传送按钮时触发
/// </summary>
@@ -159,14 +139,6 @@ namespace GrasscutterTools.Pages
SetCommand("/tp", args);
}
/// <summary>
/// 锁定天气
/// </summary>
private void ChkLockClimate_CheckedChanged(object sender, EventArgs e)
{
SetCommand("/prop", $"is_weather_locked {(ChkLockClimate.Checked ? "on" : "off")}");
}
/// <summary>
/// 冻结游戏时间
/// </summary>