@@ -2,25 +2,25 @@ import { Quality } from "@wayward/game/game/IObject";
22import Human from "@wayward/game/game/entity/Human" ;
33import { EntityType } from "@wayward/game/game/entity/IEntity" ;
44import { Action } from "@wayward/game/game/entity/action/Action" ;
5- import { ActionArgument } from "@wayward/game/game/entity/action/IAction" ;
5+ import { ActionArgument , ActionUsability } from "@wayward/game/game/entity/action/IAction" ;
66import { ItemType , ItemTypeGroup } from "@wayward/game/game/item/IItem" ;
7- import Item from "@wayward/game/game/item/Item" ;
7+ import type Item from "@wayward/game/game/item/Item" ;
88import ItemManager from "@wayward/game/game/item/ItemManager" ;
99import Dictionary from "@wayward/game/language/Dictionary" ;
1010import Translation from "@wayward/game/language/Translation" ;
1111import Enums from "@wayward/game/utilities/enum/Enums" ;
1212import Arrays from "@wayward/utilities/collection/Arrays" ;
1313import { Tuple } from "@wayward/utilities/collection/Tuple" ;
1414import StackMap from "@wayward/utilities/collection/map/StackMap" ;
15- import { defaultCanUseHandler , defaultUsability } from "../Actions" ;
15+ import { defaultCanUseHandler } from "../Actions" ;
1616import InspectDialog from "../ui/InspectDialog" ;
1717
1818export const ADD_ITEM_RANDOM = 1000000001 ;
1919export const ADD_ITEM_ALL = 1000000002 ;
2020
2121const FILTER_REGEX_CACHE = new StackMap < string , RegExp > ( undefined , 500 ) ;
2222const WORD_TO_GROUPS_MAP = new StackMap < string , ItemTypeGroup [ ] > ( undefined , 100 ) ;
23- const GROUP_REGEX = new RegExp ( ` ^group:(.*)$` ) ;
23+ const GROUP_REGEX = new RegExp ( " ^group:(.*)$" ) ;
2424let GROUP_MAP : Map < string , ItemTypeGroup > | undefined ;
2525
2626function itemMatchesWord ( word : string , item : ItemType , text : string ) : boolean {
@@ -54,7 +54,7 @@ function itemMatchesWord(word: string, item: ItemType, text: string): boolean {
5454 */
5555export default new Action ( ActionArgument . Container , ActionArgument . ANY ( ActionArgument . Integer32 , ActionArgument . String ) , ActionArgument . ENUM ( Quality ) , ActionArgument . Integer32 )
5656 . setUsableBy ( EntityType . Human )
57- . setUsableWhen ( ... defaultUsability )
57+ . setUsableWhen ( ActionUsability . Always )
5858 . setCanUse ( defaultCanUseHandler )
5959 . setHandler ( ( action , target , item : ItemType | typeof ADD_ITEM_RANDOM | typeof ADD_ITEM_ALL | string , quality , quantity ) => {
6060 const containerObject = action . executor . island . items . resolveContainer ( target ) ;
@@ -67,7 +67,7 @@ export default new Action(ActionArgument.Container, ActionArgument.ANY(ActionArg
6767 const text = Translation . get ( Dictionary . Item , item ) . getString ( ) ;
6868 return text . includes ( filterBy ) || filterWords . every ( word =>
6969 itemMatchesWord ( word , item , text ) ) ;
70- } )
70+ } ) ;
7171 }
7272
7373 const createdItems : Item [ ] = [ ] ;
0 commit comments