@wayward/types 2.13.3-beta.dev.20230621.1 → 2.13.3-beta.dev.20230622.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/definitions/game/game/entity/action/usable/IUsableAction.d.ts +2 -1
- package/definitions/game/game/entity/action/usable/UsableAction.d.ts +2 -1
- package/definitions/game/game/entity/action/usable/UsableActionRegistrar.d.ts +4 -2
- package/definitions/game/game/entity/action/usable/actions/item/UsableActionsUseItem.d.ts +3 -0
- package/definitions/game/language/dictionary/Message.d.ts +119 -118
- package/definitions/game/ui/screen/screens/game/component/ItemComponent.d.ts +1 -0
- package/definitions/game/ui/screen/screens/game/static/actions/ActionsDrawer.d.ts +3 -1
- package/package.json +1 -1
|
@@ -40,8 +40,9 @@ export interface IUsableActionRequirement<TYPE> {
|
|
|
40
40
|
}
|
|
41
41
|
export interface IUsableActionItemRequirement extends Omit<IUsableActionRequirement<Item>, "find"> {
|
|
42
42
|
allowOnlyItemType?(player: Player, type: ItemType): boolean;
|
|
43
|
-
finder?(player: Player,
|
|
43
|
+
finder?(player: Player, defaultOptions?: IItemFinderOptions, provided?: Omit<IUsableActionPossibleUsing, "item">): ItemFinder | undefined;
|
|
44
44
|
requiresQuality?: true;
|
|
45
|
+
requiresType?: true;
|
|
45
46
|
}
|
|
46
47
|
export declare namespace IUsableActionRequirement {
|
|
47
48
|
interface Maybe<TYPE> {
|
|
@@ -16,6 +16,7 @@ import type { ActionWhichTranslation } from "game/entity/action/usable/UsableAct
|
|
|
16
16
|
import type Player from "game/entity/player/Player";
|
|
17
17
|
import type { IIcon } from "game/inspection/InfoProvider";
|
|
18
18
|
import type Item from "game/item/Item";
|
|
19
|
+
import Message from "language/dictionary/Message";
|
|
19
20
|
import type Translation from "language/Translation";
|
|
20
21
|
import type { HighlightSelector } from "ui/util/IHighlight";
|
|
21
22
|
export declare const USABLE_ACTION_USE_ON_MOVE_UNLOCK_AT = 20;
|
|
@@ -44,7 +45,7 @@ declare class UsableAction<REQUIREMENTS extends IUsableActionRequirements = IUsa
|
|
|
44
45
|
constructor(requirements: REQUIREMENTS, definition: DEFINITION);
|
|
45
46
|
isExecutable(): this is UsableAction<REQUIREMENTS, IUsableActionDefinitionExecutable<REQUIREMENTS>>;
|
|
46
47
|
execute(player: Player, provided: IUsableActionUsing<REQUIREMENTS>, context: UsableActionExecutionContext | IUsableActionExecutionContext): boolean;
|
|
47
|
-
resolveUsing(player: Player, using: IUsableActionUsing<REQUIREMENTS>):
|
|
48
|
+
resolveUsing(player: Player, using: IUsableActionUsing<REQUIREMENTS>): Message.UiActionCannotUseRequiresCreature | Message.UiActionCannotUseRequiresDoodad | Message.UiActionCannotUseRequiresItem | Message.UiActionCannotUseRequiresNPC | IUsableActionUsing<REQUIREMENTS>;
|
|
48
49
|
isUsable(player: Player, provided: IUsableActionUsing<REQUIREMENTS>, context: UsableActionExecutionContext | IUsableActionExecutionContext): UsableActionUsability<REQUIREMENTS>;
|
|
49
50
|
isApplicable(player: Player, provided?: IUsableActionPossibleUsing, fullUsabilityCheck?: boolean): provided is IUsableActionUsing<REQUIREMENTS>;
|
|
50
51
|
private isItemApplicable;
|
|
@@ -15,9 +15,11 @@ import type { ActionId, IUsableActionPossibleUsing, IUsableActionRequirements }
|
|
|
15
15
|
import type UsableAction from "game/entity/action/usable/UsableAction";
|
|
16
16
|
import ContextMenu from "ui/component/ContextMenu";
|
|
17
17
|
export default class UsableActionRegistrar {
|
|
18
|
+
private readonly id;
|
|
18
19
|
readonly actions: Array<[string, UsableAction]>;
|
|
19
20
|
readonly actionIndices: Record<string, number>;
|
|
20
21
|
readonly actionIds: string[];
|
|
22
|
+
constructor(id: string);
|
|
21
23
|
byId(id?: ActionId): UsableAction | undefined;
|
|
22
24
|
filter(filter: (action: UsableAction, id: string) => any): UsableActionRegistrar;
|
|
23
25
|
private contextMenuInitializer?;
|
|
@@ -70,8 +72,8 @@ export declare class UsableActionGenerator<ARGS extends any[] = []> extends Even
|
|
|
70
72
|
* Forcibly regenerates and returns a new action registrar from this generator.
|
|
71
73
|
* If this generator is marked for persistence, the generated registrar will be cached and accessible thereafter by `get()`.
|
|
72
74
|
*/
|
|
73
|
-
generate
|
|
74
|
-
private
|
|
75
|
+
private generate;
|
|
76
|
+
private existingPersistenceId?;
|
|
75
77
|
/**
|
|
76
78
|
* Marks this generator for persistence when the "when" event occurs,
|
|
77
79
|
* and unmarks this generator for persistence when the "until" event occurs.
|
|
@@ -21,11 +21,14 @@ export interface IUseItemAction extends IUsableActionDynamicDefinition {
|
|
|
21
21
|
allowAnyItems?: true;
|
|
22
22
|
allowNoItem?: true;
|
|
23
23
|
hasNoBestItem?: true;
|
|
24
|
+
skipUseCheck?: true;
|
|
24
25
|
filterFind?(item: Item, player: Player): boolean;
|
|
25
26
|
validate?(item: Item, player: Player): boolean;
|
|
26
27
|
initialiseFinder?(finder: UsableActionItemFinder): any;
|
|
27
28
|
onFinderTrack?(finder: UsableActionItemFinder): any;
|
|
28
29
|
onFinderDispose?(finder: UsableActionItemFinder): any;
|
|
30
|
+
requiresQuality?: true;
|
|
31
|
+
requiresType?: true;
|
|
29
32
|
}
|
|
30
33
|
export declare namespace IUseItemAction {
|
|
31
34
|
function getGetItemOptions(actionType: ActionType, useItemAction?: Omit<IUseItemAction, keyof IUsableActionDynamicDefinition>): Partial<IGetBestItemsOptions>;
|
|
@@ -682,123 +682,124 @@ declare enum Message {
|
|
|
682
682
|
UiActionCannotUseRequiresCreature = 670,
|
|
683
683
|
UiActionCannotUseRequiresDoodad = 671,
|
|
684
684
|
UiActionCannotUseRequiresItem = 672,
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
685
|
+
UiActionCannotUseRequiresNPC = 673,
|
|
686
|
+
Unhitch = 674,
|
|
687
|
+
UnhitchCreature = 675,
|
|
688
|
+
Unknown = 676,
|
|
689
|
+
Unlimited = 677,
|
|
690
|
+
UnlockedChest = 678,
|
|
691
|
+
UnpurifiedFreshWater = 679,
|
|
692
|
+
UnpurifiedWaterInStill = 680,
|
|
693
|
+
Use = 681,
|
|
694
|
+
UsingBareHands = 682,
|
|
695
|
+
VehicleDefense = 683,
|
|
696
|
+
Vulnerable = 684,
|
|
697
|
+
Water = 685,
|
|
698
|
+
WaterGathering = 686,
|
|
699
|
+
WaterPutOutFire = 687,
|
|
700
|
+
WellIsDry = 688,
|
|
701
|
+
WellIsFull = 689,
|
|
702
|
+
WildGoatRefusedToBeMilked = 690,
|
|
703
|
+
WillNotTrade = 691,
|
|
704
|
+
WorkingYourselfIntoExhaustion = 692,
|
|
705
|
+
WorkingYourselfIntoExhaustionAndDrowning = 693,
|
|
706
|
+
You = 694,
|
|
707
|
+
YouAbsorb = 695,
|
|
708
|
+
YouApplied = 696,
|
|
709
|
+
YouAreAlready = 697,
|
|
710
|
+
YouAte = 698,
|
|
711
|
+
YouBeginResting = 699,
|
|
712
|
+
YouCannotDoThatYet = 700,
|
|
713
|
+
YouCanNowCombatTheTides = 701,
|
|
714
|
+
YouCrafted = 702,
|
|
715
|
+
YouDoNotFindTreasureYet = 703,
|
|
716
|
+
YouDrank = 704,
|
|
717
|
+
YouDropTheTorch = 705,
|
|
718
|
+
YouEnchant = 706,
|
|
719
|
+
YouEquip = 707,
|
|
720
|
+
YouExude = 708,
|
|
721
|
+
YouExudeSome = 709,
|
|
722
|
+
YouExudeSomeReasonConflicting = 710,
|
|
723
|
+
YouExudeSomeReasonMax = 711,
|
|
724
|
+
YouExudeSomeReasonProperties = 712,
|
|
725
|
+
YouFailedTo = 713,
|
|
726
|
+
YouFailedToExtinguishedFireFully = 714,
|
|
727
|
+
YouFailedToHeal = 715,
|
|
728
|
+
YouFailedToHealOther = 716,
|
|
729
|
+
YouFire = 717,
|
|
730
|
+
YouGathered = 718,
|
|
731
|
+
YouGatheredAndDropped = 719,
|
|
732
|
+
YouHarvested = 720,
|
|
733
|
+
YouHarvestedAndDropped = 721,
|
|
734
|
+
YouHave = 722,
|
|
735
|
+
YouHaveAlreadyLearned = 723,
|
|
736
|
+
YouHaveBeenCut = 724,
|
|
737
|
+
YouHaveCaged = 725,
|
|
738
|
+
YouHaveCommanded = 726,
|
|
739
|
+
YouHaveDied = 727,
|
|
740
|
+
YouHaveHealedOther = 728,
|
|
741
|
+
YouHaveKilled = 729,
|
|
742
|
+
YouHaveReleased = 730,
|
|
743
|
+
YouHaveSummoned = 731,
|
|
744
|
+
YouHaveTamed = 732,
|
|
745
|
+
YouHaveUncaged = 733,
|
|
746
|
+
YouNeedMoreCredit = 734,
|
|
747
|
+
YouNoticeBarren = 735,
|
|
748
|
+
YouNoticeBecomeEnraged = 736,
|
|
749
|
+
YouNoticeDying = 737,
|
|
750
|
+
YouNoticeFertilityDecreasing = 738,
|
|
751
|
+
YouNoticeFertilityIncreasing = 739,
|
|
752
|
+
YouNoticeGrowing = 740,
|
|
753
|
+
YouNoticeLavaCooling = 741,
|
|
754
|
+
YouNoticeLavaHardening = 742,
|
|
755
|
+
YouNoticePerish = 743,
|
|
756
|
+
YouNoticePlantDamage = 744,
|
|
757
|
+
YouNoticePlantRegenerated = 745,
|
|
758
|
+
YouNoticeRegrowing = 746,
|
|
759
|
+
YouNoticeStumbleInjureItself = 747,
|
|
760
|
+
YouNoticeTakeFromGround = 748,
|
|
761
|
+
YouNoticeWoundsClosing = 749,
|
|
762
|
+
YouNoticeZombieHorde = 750,
|
|
763
|
+
YouOfferedToCreature = 751,
|
|
764
|
+
YouOfferedToCreatureRejects = 752,
|
|
765
|
+
YouOpen = 753,
|
|
766
|
+
YouPacked = 754,
|
|
767
|
+
YouPickedUp = 755,
|
|
768
|
+
YouRefine = 756,
|
|
769
|
+
YouReinforce = 757,
|
|
770
|
+
YouRepair = 758,
|
|
771
|
+
YouReturnFromCivilizationWith = 759,
|
|
772
|
+
YourFist = 760,
|
|
773
|
+
YourHands = 761,
|
|
774
|
+
YourInventory = 762,
|
|
775
|
+
YourIsland = 763,
|
|
776
|
+
YourRubbingNoEffect = 764,
|
|
777
|
+
YouRub = 765,
|
|
778
|
+
YouSee = 766,
|
|
779
|
+
YouSeeALivingMushroomSpore = 767,
|
|
780
|
+
YouSeeASkeletonCollapse = 768,
|
|
781
|
+
YouSeeASlimeCombine = 769,
|
|
782
|
+
YouSeeAZombieBleeding = 770,
|
|
783
|
+
YouSeeCoolDown = 771,
|
|
784
|
+
YouSeeDrop = 772,
|
|
785
|
+
YouSeeEngulfFire = 773,
|
|
786
|
+
YouSeeFireSpread = 774,
|
|
787
|
+
YouSeeHelpingPlant = 775,
|
|
788
|
+
YouSeeLay = 776,
|
|
789
|
+
YouSeeLayingTrap = 777,
|
|
790
|
+
YouSeeSpewLava = 778,
|
|
791
|
+
YouSeeSpitAcid = 779,
|
|
792
|
+
YouSeeSpringForth = 780,
|
|
793
|
+
YouSeeSummon = 781,
|
|
794
|
+
YouSeeSwampFlood = 782,
|
|
795
|
+
YouSeeTrampling = 783,
|
|
796
|
+
YouSetTheTrapOff = 784,
|
|
797
|
+
YouStokeTheCreature = 785,
|
|
798
|
+
YouSwapMainHandAndOffHand = 786,
|
|
799
|
+
YouThrew = 787,
|
|
800
|
+
YouTilled = 788,
|
|
801
|
+
YouUnequip = 789,
|
|
802
|
+
YouUsed = 790,
|
|
803
|
+
YouWhileTraveling = 791
|
|
803
804
|
}
|
|
804
805
|
export default Message;
|
|
@@ -44,6 +44,7 @@ export declare enum ItemClasses {
|
|
|
44
44
|
Icon = "item-component-icon",
|
|
45
45
|
ItemIconIsReal = "item-component-icon-item-is-real",
|
|
46
46
|
ActionIcon = "item-component-icon-action",
|
|
47
|
+
ActionIconAnyItem = "item-component-icon-action-any-item",
|
|
47
48
|
ActionIconHasItem = "item-component-icon-action-has-item",
|
|
48
49
|
ActionIconNone = "item-component-icon-action-none",
|
|
49
50
|
SlottedIcon = "item-component-icon-slotted",
|
|
@@ -126,7 +126,9 @@ export default class ActionsConfigurationDrawer extends Component implements IRe
|
|
|
126
126
|
protected onNext(): boolean;
|
|
127
127
|
protected onPrevious(): boolean;
|
|
128
128
|
protected onLeft(): boolean;
|
|
129
|
-
protected onEnterBind(api: IBindHandlerApi | Input): boolean;
|
|
129
|
+
protected onEnterBind(api: IBindHandlerApi | Input, event?: KeyboardEvent): boolean;
|
|
130
|
+
protected onSubmit(): boolean;
|
|
131
|
+
private chooseSelected;
|
|
130
132
|
protected onSelectionChange(handler: SelectionHandler, component?: Component): void;
|
|
131
133
|
private selectNext;
|
|
132
134
|
private selectPrevious;
|
package/package.json
CHANGED