Skip to content

Commit acad711

Browse files
committed
un-nest InputType
1 parent cfd32fe commit acad711

File tree

13 files changed

+51
-50
lines changed

13 files changed

+51
-50
lines changed

Intersect.Client.Core/Entities/Player.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public void TryDropItem(int inventorySlotIndex)
396396

397397
var quantity = inventorySlot.Quantity;
398398
var canDropMultiple = quantity > 1;
399-
var inputType = canDropMultiple ? InputBox.InputType.NumericSliderInput : InputBox.InputType.YesNo;
399+
var inputType = canDropMultiple ? InputType.NumericSliderInput : InputType.YesNo;
400400
var prompt = canDropMultiple ? Strings.Inventory.DropItemPrompt : Strings.Inventory.DropPrompt;
401401
_ = new InputBox(
402402
title: Strings.Inventory.DropItemTitle,
@@ -682,7 +682,7 @@ public void TrySellItem(int inventorySlotIndex)
682682
|| shop?.BuyingWhitelist == false && !shop.BuyingItems.Any(buyingItem => buyingItem.ItemId == itemDescriptor.Id);
683683

684684
var prompt = Strings.Shop.SellPrompt;
685-
var inputType = InputBox.InputType.YesNo;
685+
var inputType = InputType.YesNo;
686686
EventHandler? onSuccess = (s, e) =>
687687
{
688688
if (s is InputBox inputBox && inputBox.UserData is int invSlot)
@@ -697,7 +697,7 @@ public void TrySellItem(int inventorySlotIndex)
697697
if (!shopCanBuyItem)
698698
{
699699
prompt = Strings.Shop.CannotSell;
700-
inputType = InputBox.InputType.OkayOnly;
700+
inputType = InputType.OkayOnly;
701701
onSuccess = null;
702702
userData = -1;
703703
}
@@ -708,7 +708,7 @@ public void TrySellItem(int inventorySlotIndex)
708708
{
709709
maxQuantity = inventoryQuantity;
710710
prompt = Strings.Shop.SellItemPrompt;
711-
inputType = InputBox.InputType.NumericSliderInput;
711+
inputType = InputType.NumericSliderInput;
712712
onSuccess = (s, e) =>
713713
{
714714
if (s is InputBox inputBox && inputBox.UserData is int invSlot)
@@ -771,7 +771,7 @@ public void TryBuyItem(int shopSlotIndex)
771771
_ = new InputBox(
772772
title: Strings.Shop.BuyItem,
773773
prompt: Strings.Shop.BuyItemPrompt.ToString(itemDescriptor.Name),
774-
inputType: InputBox.InputType.NumericSliderInput,
774+
inputType: InputType.NumericSliderInput,
775775
quantity: maxBuyAmount,
776776
maxQuantity: maxBuyAmount,
777777
userData: shopSlotIndex,
@@ -881,7 +881,7 @@ public bool TryDepositItem(
881881
_ = new InputBox(
882882
title: Strings.Bank.DepositItem,
883883
prompt: Strings.Bank.DepositItemPrompt.ToString(itemDescriptor.Name),
884-
inputType: InputBox.InputType.NumericSliderInput,
884+
inputType: InputType.NumericSliderInput,
885885
quantity: movableQuantity,
886886
maxQuantity: maximumQuantity,
887887
userData: new Tuple<int, int>(inventorySlotIndex, bankSlotIndex),
@@ -999,7 +999,7 @@ public bool TryWithdrawItem(
999999
_ = new InputBox(
10001000
title: Strings.Bank.WithdrawItem,
10011001
prompt: Strings.Bank.WithdrawItemPrompt.ToString(itemDescriptor.Name),
1002-
inputType: InputBox.InputType.NumericSliderInput,
1002+
inputType: InputType.NumericSliderInput,
10031003
quantity: movableQuantity,
10041004
maxQuantity: maximumQuantity,
10051005
userData: new Tuple<int, int>(bankSlotIndex, inventorySlotIndex),
@@ -1047,7 +1047,7 @@ public void TryStoreBagItem(int inventorySlotIndex, int bagSlotIndex)
10471047
_ = new InputBox(
10481048
title: Strings.Bags.StoreItem,
10491049
prompt: Strings.Bags.StoreItemPrompt.ToString(itemDescriptor.Name),
1050-
inputType: InputBox.InputType.NumericSliderInput,
1050+
inputType: InputType.NumericSliderInput,
10511051
quantity: quantity,
10521052
maxQuantity: maxQuantity,
10531053
userData: new Tuple<int, int>(inventorySlotIndex, bagSlotIndex),
@@ -1091,7 +1091,7 @@ public void TryRetreiveBagItem(int bagSlotIndex, int inventorySlotIndex)
10911091
_ = new InputBox(
10921092
title: Strings.Bags.RetrieveItem,
10931093
prompt: Strings.Bags.RetrieveItemPrompt.ToString(itemDescriptor.Name),
1094-
inputType: InputBox.InputType.NumericSliderInput,
1094+
inputType: InputType.NumericSliderInput,
10951095
quantity: quantity,
10961096
maxQuantity: maxQuantity,
10971097
userData: new Tuple<int, int>(bagSlotIndex, inventorySlotIndex),
@@ -1130,7 +1130,7 @@ public void TryTradeItem(int index)
11301130
_ = new InputBox(
11311131
title: Strings.Trading.OfferItem,
11321132
prompt: Strings.Trading.OfferItemPrompt.ToString(tradingItem.Name),
1133-
inputType: InputBox.InputType.NumericSliderInput,
1133+
inputType: InputType.NumericSliderInput,
11341134
quantity: quantity,
11351135
maxQuantity: quantity,
11361136
userData: index,
@@ -1167,7 +1167,7 @@ public void TryRevokeItem(int index)
11671167
_ = new InputBox(
11681168
title: Strings.Trading.RevokeItem,
11691169
prompt: Strings.Trading.RevokeItemPrompt.ToString(revokedItem.Name),
1170-
inputType: InputBox.InputType.NumericSliderInput,
1170+
inputType: InputType.NumericSliderInput,
11711171
quantity: quantity,
11721172
maxQuantity: quantity,
11731173
userData: index,
@@ -1200,7 +1200,7 @@ public void TryForgetSpell(int spellIndex)
12001200
_ = new InputBox(
12011201
title: Strings.Spells.ForgetSpell,
12021202
prompt: Strings.Spells.ForgetSpellPrompt.ToString(spellDescriptor.Name),
1203-
inputType: InputBox.InputType.YesNo,
1203+
inputType: InputType.YesNo,
12041204
userData: spellIndex,
12051205
onSuccess: (s, e) =>
12061206
{

Intersect.Client.Core/Interface/Game/Admin/AdminWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public AdminWindow(Base gameCanvas) : base(
150150
_ = new InputBox(
151151
Strings.Admin.UnbanCaption.ToString(_textboxName.Text),
152152
Strings.Admin.UnbanPrompt.ToString(_textboxName.Text),
153-
InputBox.InputType.YesNo,
153+
InputType.YesNo,
154154
(_, _) => PacketSender.SendAdminAction(new UnbanAction(_textboxName.Text))
155155
);
156156
}
@@ -174,7 +174,7 @@ public AdminWindow(Base gameCanvas) : base(
174174
_ = new InputBox(
175175
Strings.Admin.UnmuteCaption.ToString(_textboxName.Text),
176176
Strings.Admin.UnmutePrompt.ToString(_textboxName.Text),
177-
InputBox.InputType.YesNo,
177+
InputType.YesNo,
178178
(_, _) => PacketSender.SendAdminAction(new UnmuteAction(_textboxName.Text))
179179
);
180180
}

Intersect.Client.Core/Interface/Game/EscapeMenu.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private void ShowCombatWarning()
192192
Strings.Combat.WarningTitle,
193193
AlertType.Warning,
194194
handleSubmit: LogoutToCharacterSelect,
195-
inputType: InputBox.InputType.YesNo
195+
inputType: InputType.YesNo
196196
);
197197
}
198198

Intersect.Client.Core/Interface/Game/Friends/FriendsRow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private void MRemove_Clicked(Base sender, MouseButtonState arguments)
9292
var iBox = new InputBox(
9393
title: Strings.Friends.RemoveFriend,
9494
prompt: Strings.Friends.RemoveFriendPrompt.ToString(mMyName),
95-
inputType: InputBox.InputType.YesNo,
95+
inputType: InputType.YesNo,
9696
onSuccess: (s, e) => PacketSender.SendRemoveFriend(mMyName)
9797
);
9898
}

Intersect.Client.Core/Interface/Game/Friends/FriendsWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void addButton_Clicked(Base sender, MouseButtonState arguments)
102102
_ = new InputBox(
103103
title: Strings.Friends.AddFriend,
104104
prompt: Strings.Friends.AddFriendPrompt,
105-
inputType: InputBox.InputType.TextInput,
105+
inputType: InputType.TextInput,
106106
onSuccess: (s, e) =>
107107
{
108108
if (s is InputBox inputBox && inputBox.TextValue.Trim().Length >= 3)

Intersect.Client.Core/Interface/Game/GuildWindow.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public GuildWindow(Canvas gameCanvas) : base(gameCanvas, Globals.Me?.Guild, fals
6767
_ = new InputBox(
6868
title: Strings.Guilds.LeaveTitle,
6969
prompt: Strings.Guilds.LeavePrompt.ToString(Globals.Me?.Guild),
70-
inputType: InputBox.InputType.YesNo,
70+
inputType: InputType.YesNo,
7171
onSuccess: (s, e) => PacketSender.SendLeaveGuild()
7272
);
7373
};
@@ -83,7 +83,7 @@ public GuildWindow(Canvas gameCanvas) : base(gameCanvas, Globals.Me?.Guild, fals
8383
new InputBox(
8484
title: Strings.Guilds.InviteMemberTitle,
8585
prompt: Strings.Guilds.InviteMemberPrompt.ToString(Globals.Me?.Guild),
86-
inputType: InputBox.InputType.TextInput,
86+
inputType: InputType.TextInput,
8787
onSuccess: (s, e) =>
8888
{
8989
if (s is InputBox inputBox && inputBox.TextValue.Trim().Length >= 3)
@@ -335,7 +335,7 @@ private void promoteOption_Clicked(Base sender, MouseButtonState arguments)
335335
_ = new InputBox(
336336
Strings.Guilds.PromoteTitle,
337337
Strings.Guilds.PromotePrompt.ToString(_selectedMember.Name, Options.Instance.Guild.Ranks[newRank].Title),
338-
InputBox.InputType.YesNo,
338+
InputType.YesNo,
339339
userData: new Tuple<GuildMember, int>(_selectedMember, newRank),
340340
onSuccess: (s, e) =>
341341
{
@@ -368,7 +368,7 @@ private void demoteOption_Clicked(Base sender, MouseButtonState arguments)
368368
_ = new InputBox(
369369
Strings.Guilds.DemoteTitle,
370370
Strings.Guilds.DemotePrompt.ToString(_selectedMember.Name, Options.Instance.Guild.Ranks[newRank].Title),
371-
InputBox.InputType.YesNo,
371+
InputType.YesNo,
372372
userData: new Tuple<GuildMember, int>(_selectedMember, newRank),
373373
onSuccess: (s, e) =>
374374
{
@@ -400,7 +400,7 @@ private void kickOption_Clicked(Base sender, MouseButtonState arguments)
400400
_ = new InputBox(
401401
Strings.Guilds.KickTitle,
402402
Strings.Guilds.KickPrompt.ToString(_selectedMember?.Name),
403-
InputBox.InputType.YesNo,
403+
InputType.YesNo,
404404
userData: _selectedMember,
405405
onSuccess: (s, e) =>
406406
{
@@ -431,7 +431,7 @@ private void transferOption_Clicked(Base sender, MouseButtonState arguments)
431431
_ = new InputBox(
432432
Strings.Guilds.TransferTitle,
433433
Strings.Guilds.TransferPrompt.ToString(_selectedMember?.Name, rank.Title, Globals.Me?.Guild),
434-
InputBox.InputType.TextInput,
434+
InputType.TextInput,
435435
userData: _selectedMember,
436436
onSuccess: (s, e) =>
437437
{

Intersect.Client.Core/Interface/Game/QuestsWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private void _quitButton_Clicked(Base sender, MouseButtonState arguments)
7676
_ = new InputBox(
7777
title: Strings.QuestLog.AbandonTitle.ToString(mSelectedQuest.Name),
7878
prompt: Strings.QuestLog.AbandonPrompt.ToString(mSelectedQuest.Name),
79-
inputType: InputBox.InputType.YesNo,
79+
inputType: InputType.YesNo,
8080
userData: mSelectedQuest.Id,
8181
onSuccess: (s, e) =>
8282
{

Intersect.Client.Core/Interface/Game/SimplifiedEscapeMenu.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private static void ShowCombatWarning()
120120
Strings.Combat.WarningTitle,
121121
AlertType.Warning,
122122
handleSubmit: LogoutToCharacterSelect,
123-
inputType: InputBox.InputType.YesNo
123+
inputType: InputType.YesNo
124124
);
125125
}
126126

Intersect.Client.Core/Interface/Menu/SelectCharacterWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ private void _buttonDelete_Clicked(Base sender, MouseButtonState arguments)
283283
_ = new InputBox(
284284
title: Strings.CharacterSelection.DeleteTitle.ToString(Characters[mSelectedChar].Name),
285285
prompt: Strings.CharacterSelection.DeletePrompt.ToString(Characters[mSelectedChar].Name),
286-
inputType: InputBox.InputType.YesNo,
286+
inputType: InputType.YesNo,
287287
userData: Characters[mSelectedChar].Id,
288288
onSuccess: DeleteCharacter
289289
);

Intersect.Client.Core/Interface/Shared/InputBox.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,6 @@ namespace Intersect.Client.Interface.Shared;
1212

1313
public partial class InputBox : Window
1414
{
15-
public enum InputType
16-
{
17-
OkayOnly,
18-
19-
YesNo,
20-
21-
YesNoCancel,
22-
23-
NumericInput,
24-
25-
TextInput,
26-
27-
NumericSliderInput,
28-
}
29-
3015
public string TextValue { get; set; } = string.Empty;
3116

3217
public new object? UserData { get; set; }
@@ -409,4 +394,4 @@ protected override void EnsureInitialized()
409394
Show();
410395
Focus();
411396
}
412-
}
397+
}

0 commit comments

Comments
 (0)