Added ShiftRightClick (#2582)

* Added ShiftRightClick

* Added ShiftRightClick

* Added ShiftRightClick

* Added ShiftRightClick

* Added ShiftRightClick

* Added ShiftRightClick

* Added ShiftRightClick

* Added ShiftRightClick

* Updated Protocol18.cs ShiftRightClick Description for ReinforceZwei's  Suggestion

* Just Deleted Added ShiftRightClick's Description Line

* Just Deleted Added ShiftRightClick's Description Lines

* Made Change With Informaiton ReinforceZwei Given to Me About Switch-Case and Shorten the Code.

* Re Added Lines That Got Deleted By Mistake

* Add translation key for shift right-click

---------

Co-authored-by: ReinforceZwei <39955851+ReinforceZwei@users.noreply.github.com>
This commit is contained in:
ozi2285 2023-09-16 14:39:55 +03:00 committed by GitHub
parent 37bcad37e0
commit 968f864f34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 5938 additions and 3896 deletions

View file

@ -16,6 +16,7 @@ namespace MinecraftClient.CommandHandler.ArgumentType
WindowActionType.RightClick,
WindowActionType.MiddleClick,
WindowActionType.ShiftClick,
WindowActionType.ShiftRightClick,
};
public override WindowActionType Parse(IStringReader reader)
@ -33,6 +34,7 @@ namespace MinecraftClient.CommandHandler.ArgumentType
"middleclick" => WindowActionType.MiddleClick,
"shift" => WindowActionType.ShiftClick,
"shiftclick" => WindowActionType.ShiftClick,
"shiftrightclick" => WindowActionType.ShiftRightClick,
_ => throw CommandSyntaxException.BuiltInExceptions.LiteralIncorrect().CreateWithContext(reader, inputStr)
};
}

View file

@ -115,7 +115,7 @@ namespace MinecraftClient.Commands
#pragma warning disable format // @formatter:off
"list" => Translations.cmd_inventory_help_list + usageStr + "/inventory <player|container|<id>> list",
"close" => Translations.cmd_inventory_help_close + usageStr + "/inventory <player|container|<id>> close",
"click" => Translations.cmd_inventory_help_click + usageStr + "/inventory <player|container|<id>> click <slot> [left|right|middle|shift]\nDefault is left click",
"click" => Translations.cmd_inventory_help_click + usageStr + "/inventory <player|container|<id>> click <slot> [left|right|middle|shift|shiftright]\nDefault is left click",
"drop" => Translations.cmd_inventory_help_drop + usageStr + "/inventory <player|container|<id>> drop <slot> [all]\nAll means drop full stack",
"creativegive" => Translations.cmd_inventory_help_creativegive + usageStr + "/inventory creativegive <slot> <itemtype> <amount>",
"creativedelete" => Translations.cmd_inventory_help_creativedelete + usageStr + "/inventory creativedelete <slot>",
@ -351,6 +351,7 @@ namespace MinecraftClient.Commands
WindowActionType.RightClick => Translations.cmd_inventory_right,
WindowActionType.MiddleClick => Translations.cmd_inventory_middle,
WindowActionType.ShiftClick => Translations.cmd_inventory_shiftclick,
WindowActionType.ShiftRightClick => Translations.cmd_inventory_shiftrightclick,
_ => "unknown",
};

View file

@ -25,6 +25,11 @@
/// </summary>
ShiftClick,
/// <summary>
/// Shift+Right click with mouse on a slot: send a whole item stack to the hotbar or other inventory. Differece from ShiftClick is how it reported to server
/// </summary>
ShiftRightClick,
/// <summary>
/// Drop a single item on ground
/// </summary>

View file

@ -1582,6 +1582,7 @@ namespace MinecraftClient
changedSlots.Add(new Tuple<short, Item?>((short)slotId, null));
break;
case WindowActionType.ShiftClick:
case WindowActionType.ShiftRightClick:
if (slotId == 0) break;
if (item != null)
{

View file

@ -3723,6 +3723,11 @@ namespace MinecraftClient.Protocol.Handlers
mode = 1;
item = new Item(ItemType.Null, 0, null);
break;
case WindowActionType.ShiftRightClick: // Right-shift click uses button 1
button = 1;
mode = 1;
item = new Item(ItemType.Null, 0, null);
break;
case WindowActionType.DropItem:
button = 0;
mode = 4;

File diff suppressed because it is too large Load diff

View file

@ -2118,4 +2118,7 @@ Logging in...</value>
<data name="cmd.wait.random.min.bigger" xml:space="preserve">
<value>Minimum number that you have provided is bigger than the maximum, swapping them around!</value>
</data>
<data name="cmd.inventory.shiftrightclick" xml:space="preserve">
<value>Shift right-clicking slot {0} in window #{1}</value>
</data>
</root>