refactor: wpf刷理智UI变量rename

This commit is contained in:
status102
2025-08-07 11:44:24 +08:00
parent dd51f70f6e
commit b60f8ffd00
3 changed files with 32 additions and 41 deletions

View File

@@ -1890,7 +1890,7 @@ namespace MaaWpfGui.Main
AchievementTrackerHelper.Instance.SetProgress(AchievementIds.OverLimitAgent, FightTask.FightReport.TimesFinished);
}
if (Instances.TaskQueueViewModel.FightTaskRunning && FightTask.Instance.HasTimesLimitedWithNull != false && FightTask.FightReport.TimesFinished + FightTask.FightReport.Series > FightTask.Instance.MaxTimes)
if (Instances.TaskQueueViewModel.FightTaskRunning && FightTask.Instance.HasTimesLimited != false && FightTask.FightReport.TimesFinished + FightTask.FightReport.Series > FightTask.Instance.MaxTimes)
{
Instances.TaskQueueViewModel.AddLog(string.Format(LocalizationHelper.GetString("FightTimesUnused"), FightTask.FightReport.TimesFinished, FightTask.FightReport.Series, FightTask.FightReport.TimesFinished + FightTask.FightReport.Series, FightTask.Instance.MaxTimes), UiLogColor.Error);
}

View File

@@ -316,10 +316,10 @@ public class FightSettingsUserControlModel : TaskViewModel
/// </summary>
public void ResetFightVariables()
{
UseStoneWithNull ??= false;
UseMedicineWithNull ??= false;
HasTimesLimitedWithNull ??= false;
IsSpecifiedDropsWithNull ??= false;
UseStone ??= false;
UseMedicine ??= false;
HasTimesLimited ??= false;
IsSpecifiedDrops ??= false;
}
private bool? _useMedicine = ConfigurationHelper.GetValue(ConfigurationKeys.UseMedicine, false);
@@ -327,12 +327,12 @@ public class FightSettingsUserControlModel : TaskViewModel
/// <summary>
/// Gets or sets a value indicating whether to use medicine with null.
/// </summary>
public bool? UseMedicineWithNull
public bool? UseMedicine
{
get => _useMedicineWithNull;
get => _useMedicine;
set
{
SetAndNotify(ref _useMedicineWithNull, value);
SetAndNotify(ref _useMedicine, value);
if (value == false)
{
UseStoneDisplay = false;
@@ -366,15 +366,15 @@ public class FightSettingsUserControlModel : TaskViewModel
public static string UseStoneString => LocalizationHelper.GetString("UseOriginitePrime");
private bool? _useStoneWithNull = ConfigurationHelper.GetValue(ConfigurationKeys.UseMedicine, false) &&
private bool? _useStone = ConfigurationHelper.GetValue(ConfigurationKeys.UseMedicine, false) &&
ConfigurationHelper.GetValue(ConfigurationKeys.UseStone, false);
/// <summary>
/// Gets or sets a value indicating whether to use originiums with null.
/// </summary>
public bool? UseStoneWithNull
public bool? UseStone
{
get => _useStoneWithNull;
get => _useStone;
set
{
if (!AllowUseStoneSave && value == true)
@@ -382,13 +382,13 @@ public class FightSettingsUserControlModel : TaskViewModel
value = null;
}
SetAndNotify(ref _useStoneWithNull, value);
SetAndNotify(ref _useStone, value);
if (value != false)
{
MedicineNumber = 999;
if (UseMedicineWithNull == false)
if (UseMedicine == false)
{
UseMedicineWithNull = value;
UseMedicine = value;
}
}
@@ -409,8 +409,8 @@ public class FightSettingsUserControlModel : TaskViewModel
// ReSharper disable once MemberCanBePrivate.Global
public bool UseStoneDisplay
{
get => UseStoneWithNull != false;
set => UseStoneWithNull = value;
get => UseStone != false;
set => UseStone = value;
}
private int _stoneNumber = ConfigurationHelper.GetValue(ConfigurationKeys.UseStoneQuantity, 0);
@@ -438,12 +438,12 @@ public class FightSettingsUserControlModel : TaskViewModel
/// <summary>
/// Gets or sets a value indicating whether the number of times is limited with null.
/// </summary>
public bool? HasTimesLimitedWithNull
public bool? HasTimesLimited
{
get => _hasTimesLimitedWithNull;
get => _hasTimesLimited;
set
{
SetAndNotify(ref _hasTimesLimitedWithNull, value);
SetAndNotify(ref _hasTimesLimited, value);
Instances.TaskQueueViewModel.SetFightParams();
value ??= false;
ConfigurationHelper.SetValue(ConfigurationKeys.TimesLimited, value.ToString());
@@ -516,17 +516,17 @@ public class FightSettingsUserControlModel : TaskViewModel
#region Drops
private bool? _isSpecifiedDropsWithNull = ConfigurationHelper.GetValue(ConfigurationKeys.DropsEnable, false);
private bool? _isSpecifiedDrops = ConfigurationHelper.GetValue(ConfigurationKeys.DropsEnable, false);
/// <summary>
/// Gets or sets a value indicating whether the drops are specified.
/// </summary>
public bool? IsSpecifiedDropsWithNull
public bool? IsSpecifiedDrops
{
get => _isSpecifiedDropsWithNull;
get => _isSpecifiedDrops;
set
{
if (!SetAndNotify(ref _isSpecifiedDropsWithNull, value))
if (!SetAndNotify(ref _isSpecifiedDrops, value))
{
return;
}
@@ -537,15 +537,6 @@ public class FightSettingsUserControlModel : TaskViewModel
}
}
/// <summary>
/// Gets or sets a value indicating whether the drops are specified.
/// </summary>
public bool IsSpecifiedDrops
{
get => IsSpecifiedDropsWithNull != false;
set => IsSpecifiedDropsWithNull = value;
}
/// <summary>
/// Gets the list of all drops.
/// </summary>
@@ -854,10 +845,10 @@ public class FightSettingsUserControlModel : TaskViewModel
var task = new AsstFightTask()
{
Stage = Stage,
Medicine = UseMedicineWithNull != false ? MedicineNumber : 0,
Medicine = UseMedicine != false ? MedicineNumber : 0,
Stone = UseStoneDisplay ? StoneNumber : 0,
Series = Series,
MaxTimes = HasTimesLimitedWithNull != false ? MaxTimes : int.MaxValue,
MaxTimes = HasTimesLimited != false ? MaxTimes : int.MaxValue,
ExpiringMedicine = UseExpiringMedicine ? 9999 : 0,
IsDrGrandet = IsDrGrandet,
ReportToPenguin = SettingsViewModel.GameSettings.EnablePenguin,
@@ -873,7 +864,7 @@ public class FightSettingsUserControlModel : TaskViewModel
task.Stage = AnnihilationStage;
}
if (IsSpecifiedDropsWithNull != false && !string.IsNullOrEmpty(DropsItemId))
if (IsSpecifiedDrops != false && !string.IsNullOrEmpty(DropsItemId))
{
task.Drops.Add(DropsItemId, DropsQuantity);
}

View File

@@ -37,7 +37,7 @@
Margin="6"
VerticalContentAlignment="Center"
Content="{DynamicResource UseSanityPotion}"
IsChecked="{Binding UseMedicineWithNull}"
IsChecked="{Binding UseMedicine}"
IsEnabled="{c:Binding !UseStoneDisplay}"
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
Target={x:Type helper:CheckBoxHelper}}"
@@ -47,7 +47,7 @@
Margin="6"
VerticalContentAlignment="Center"
Content="{c:Binding 'UseStoneString + (AllowUseStoneSave ? &quot;&quot; : &quot;*&quot;)'}"
IsChecked="{Binding UseStoneWithNull}"
IsChecked="{Binding UseStone}"
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
Target={x:Type helper:CheckBoxHelper}}"
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
@@ -56,7 +56,7 @@
Margin="6"
VerticalContentAlignment="Center"
Content="{DynamicResource PerformBattles}"
IsChecked="{Binding HasTimesLimitedWithNull}"
IsChecked="{Binding HasTimesLimited}"
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
Target={x:Type helper:CheckBoxHelper}}"
ToolTip="{DynamicResource CheckBoxesNotSavedAsNull}" />
@@ -106,7 +106,7 @@
Height="30"
VerticalContentAlignment="Center"
Content="{DynamicResource AssignedMaterial}"
IsChecked="{Binding IsSpecifiedDropsWithNull}"
IsChecked="{Binding IsSpecifiedDrops}"
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
Target={x:Type helper:CheckBoxHelper}}"
ToolTip="{DynamicResource CheckBoxesNotSavedAsNull}" />
@@ -116,7 +116,7 @@
NormalOpacity="0.25"
TooltipText="{DynamicResource SpecifiedDropsTip}" />
</Grid>
<Grid Height="42" Visibility="{c:Binding IsSpecifiedDropsWithNull}">
<Grid Height="42" Visibility="{c:Binding IsSpecifiedDrops}">
<controls:TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
@@ -148,7 +148,7 @@
VerticalContentAlignment="Center"
Maximum="1145141919"
Minimum="1"
Visibility="{c:Binding IsSpecifiedDropsWithNull}"
Visibility="{c:Binding IsSpecifiedDrops}"
Value="{Binding DropsQuantity, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</Grid>