feat: update wired editor extras and selection handling

This commit is contained in:
Lorenzune
2026-03-22 16:48:51 +01:00
parent ccaec9185e
commit 3e20f65f3a
15 changed files with 956 additions and 1251 deletions
+20 -1
View File
@@ -20,5 +20,24 @@
"widget.room.chat.clear_history": "leeg geschiedenis", "widget.room.chat.clear_history": "leeg geschiedenis",
"widget.room.youtube.shared": "YouTube word gedeeld", "widget.room.youtube.shared": "YouTube word gedeeld",
"widget.room.youtube.open_video": "Open de video", "widget.room.youtube.open_video": "Open de video",
"wiredfurni.params.area_selection.selected": "Geselecteerd gebied: Lengte=%x%, Breedte=%y%, breedte=%w%, hoogte=%h%" "wiredfurni.params.area_selection.selected": "Geselecteerd gebied: Lengte=%x%, Breedte=%y%, breedte=%w%, hoogte=%h%",
"wiredfurni.params.carry_mode": "Gli utenti sono trasportati quando:",
"wiredfurni.params.carry_mode.0": "rimani fermo direttamente sul Furni in movimento",
"wiredfurni.params.carry_mode.1": "rimani fermo sulla stessa casella del Furni in movimento",
"wiredfurni.params.sources.users.title.carry": "Consentire il trasporto per:",
"wiredfurni.params.sources.users.900": "Tutti gli utenti nella Stanza",
"wiredfurni.params.anim_time.title": "Durata animazione movimento",
"wiredfurni.params.anim_time.description": "Regola la velocita dello slide per i Wired che spostano utenti e furni.",
"wiredfurni.params.anim_time.value": "%ms% ms",
"wiredfurni.params.mov_no_animation.title": "Animazione movimento",
"wiredfurni.params.mov_no_animation.description": "Questo extra disattiva lo slide per i Wired che spostano utenti e furni.",
"wiredfurni.params.select_options": "Seleziona opzioni:",
"wiredfurni.params.movephysics.keep_altitude": "Mantieni altitudine del Furni",
"wiredfurni.params.movephysics.move_through_furni": "Muovi attraverso Furni",
"wiredfurni.params.movephysics.move_through_users": "Muovi attraverso utenti",
"wiredfurni.params.movephysics.block_by_furni": "è bloccato da Furni",
"wiredfurni.params.sources.furni.title.physics.0": "Muovi attraverso Furni:",
"wiredfurni.params.sources.furni.title.physics.1": "Bloccato da Furni:",
"wiredfurni.params.sources.users.title.physics.0": "Muovi attraverso gli utenti:",
"wiredfurni.params.sources.furni.900": "Tutti i Furni nella Stanza"
} }
+586 -109
View File
@@ -1,110 +1,587 @@
{ {
"socket.url": "ws://localhost:2097", "socket.url": "ws://192.168.1.52:2096",
"asset.url": "http://localhost:3000/nitro-assets", "asset.url": "https://client.paxxo.online/nitro/bundled",
"image.library.url": "http://localhost:3000/swf/c_images/", "image.library.url": "https://client.paxxo.online/c_images/",
"hof.furni.url": "http://localhost:3000/swf/dcr/hof_furni", "hof.furni.url": "https://client.paxxo.online/c_images/dcr/hof_furni",
"images.url": "${asset.url}/images", "images.url": "https://client.paxxo.online/nitro/images",
"gamedata.url": "${asset.url}/gamedata", "gamedata.url": "https://client.paxxo.online/nitro/gamedata",
"sounds.url": "${asset.url}/sounds/%sample%.mp3", "sounds.url": "${asset.url}/sounds/%sample%.mp3",
"external.texts.url": [ "${gamedata.url}/ExternalTexts.json", "${gamedata.url}/UITexts.json" ], "external.texts.url": [
"external.samples.url": "${hof.furni.url}/mp3/sound_machine_sample_%sample%.mp3", "${gamedata.url}/ExternalTexts.json",
"furnidata.url": "${gamedata.url}/FurnitureData.json", "${gamedata.url}/UITexts.json"
"productdata.url": "${gamedata.url}/ProductData.json", ],
"avatar.actions.url": "${gamedata.url}/HabboAvatarActions.json", "external.samples.url": "${hof.furni.url}/mp3/sound_machine_sample_%sample%.mp3",
"avatar.figuredata.url": "${gamedata.url}/FigureData.json", "furnidata.url": "${gamedata.url}/FurnitureData.json?v=1",
"avatar.figuremap.url": "${gamedata.url}/FigureMap.json", "productdata.url": "${gamedata.url}/ProductData.json?v=1",
"avatar.effectmap.url": "${gamedata.url}/EffectMap.json", "avatar.actions.url": "${gamedata.url}/HabboAvatarActions.json?v=1",
"avatar.asset.url": "${asset.url}/bundled/figure/%libname%.nitro", "avatar.figuredata.url": "${gamedata.url}/FigureData.json?v=1",
"avatar.asset.effect.url": "${asset.url}/bundled/effect/%libname%.nitro", "avatar.figuremap.url": "${gamedata.url}/FigureMap.json?v=1",
"furni.asset.url": "${asset.url}/bundled/furniture/%libname%.nitro", "avatar.effectmap.url": "${gamedata.url}/EffectMap.json?v=1",
"furni.asset.icon.url": "${hof.furni.url}/icons/%libname%%param%_icon.png", "avatar.asset.url": "${asset.url}/figure/%libname%.nitro",
"pet.asset.url": "${asset.url}/bundled/pet/%libname%.nitro", "avatar.asset.effect.url": "${asset.url}/effect/%libname%.nitro",
"generic.asset.url": "${asset.url}/bundled/generic/%libname%.nitro", "furni.asset.url": "${asset.url}/furniture/%libname%.nitro",
"badge.asset.url": "${image.library.url}album1584/%badgename%.gif", "furni.asset.icon.url": "${hof.furni.url}/icons/%libname%%param%_icon.png",
"furni.rotation.bounce.steps": 20, "pet.asset.url": "${asset.url}/pets/%libname%.nitro",
"furni.rotation.bounce.height": 0.0625, "generic.asset.url": "${asset.url}/generic/%libname%.nitro",
"enable.avatar.arrow": false, "badge.asset.url": "${image.library.url}album1584/%badgename%.gif",
"system.log.debug": false, "furni.rotation.bounce.steps": 20,
"system.log.warn": false, "furni.rotation.bounce.height": 0.0625,
"system.log.error": false, "enable.avatar.arrow": false,
"system.log.events": false, "system.log.debug": true,
"system.log.packets": false, "system.log.warn": true,
"system.fps.animation": 24, "system.log.error": true,
"system.fps.max": 60, "system.log.events": false,
"system.pong.manually": true, "system.log.packets": true,
"system.pong.interval.ms": 20000, "system.fps.animation": 24,
"room.color.skip.transition": true, "system.fps.max": 60,
"room.landscapes.enabled": true, "system.pong.manually": true,
"avatar.mandatory.libraries": [ "system.pong.interval.ms": 20000,
"bd:1", "room.color.skip.transition": true,
"li:0" "room.landscapes.enabled": true,
], "room.zoom.enabled": true,
"avatar.mandatory.effect.libraries": [ "avatar.mandatory.libraries": [
"dance.1", "bd:1",
"dance.2", "li:0"
"dance.3", ],
"dance.4" "avatar.mandatory.effect.libraries": [
], "dance.1",
"avatar.default.figuredata": {"palettes":[{"id":1,"colors":[{"id":99999,"index":1001,"club":0,"selectable":false,"hexCode":"DDDDDD"},{"id":99998,"index":1001,"club":0,"selectable":false,"hexCode":"FAFAFA"}]},{"id":3,"colors":[{"id":10001,"index":1001,"club":0,"selectable":false,"hexCode":"EEEEEE"},{"id":10002,"index":1002,"club":0,"selectable":false,"hexCode":"FA3831"},{"id":10003,"index":1003,"club":0,"selectable":false,"hexCode":"FD92A0"},{"id":10004,"index":1004,"club":0,"selectable":false,"hexCode":"2AC7D2"},{"id":10005,"index":1005,"club":0,"selectable":false,"hexCode":"35332C"},{"id":10006,"index":1006,"club":0,"selectable":false,"hexCode":"EFFF92"},{"id":10007,"index":1007,"club":0,"selectable":false,"hexCode":"C6FF98"},{"id":10008,"index":1008,"club":0,"selectable":false,"hexCode":"FF925A"},{"id":10009,"index":1009,"club":0,"selectable":false,"hexCode":"9D597E"},{"id":10010,"index":1010,"club":0,"selectable":false,"hexCode":"B6F3FF"},{"id":10011,"index":1011,"club":0,"selectable":false,"hexCode":"6DFF33"},{"id":10012,"index":1012,"club":0,"selectable":false,"hexCode":"3378C9"},{"id":10013,"index":1013,"club":0,"selectable":false,"hexCode":"FFB631"},{"id":10014,"index":1014,"club":0,"selectable":false,"hexCode":"DFA1E9"},{"id":10015,"index":1015,"club":0,"selectable":false,"hexCode":"F9FB32"},{"id":10016,"index":1016,"club":0,"selectable":false,"hexCode":"CAAF8F"},{"id":10017,"index":1017,"club":0,"selectable":false,"hexCode":"C5C6C5"},{"id":10018,"index":1018,"club":0,"selectable":false,"hexCode":"47623D"},{"id":10019,"index":1019,"club":0,"selectable":false,"hexCode":"8A8361"},{"id":10020,"index":1020,"club":0,"selectable":false,"hexCode":"FF8C33"},{"id":10021,"index":1021,"club":0,"selectable":false,"hexCode":"54C627"},{"id":10022,"index":1022,"club":0,"selectable":false,"hexCode":"1E6C99"},{"id":10023,"index":1023,"club":0,"selectable":false,"hexCode":"984F88"},{"id":10024,"index":1024,"club":0,"selectable":false,"hexCode":"77C8FF"},{"id":10025,"index":1025,"club":0,"selectable":false,"hexCode":"FFC08E"},{"id":10026,"index":1026,"club":0,"selectable":false,"hexCode":"3C4B87"},{"id":10027,"index":1027,"club":0,"selectable":false,"hexCode":"7C2C47"},{"id":10028,"index":1028,"club":0,"selectable":false,"hexCode":"D7FFE3"},{"id":10029,"index":1029,"club":0,"selectable":false,"hexCode":"8F3F1C"},{"id":10030,"index":1030,"club":0,"selectable":false,"hexCode":"FF6393"},{"id":10031,"index":1031,"club":0,"selectable":false,"hexCode":"1F9B79"},{"id":10032,"index":1032,"club":0,"selectable":false,"hexCode":"FDFF33"}]}],"setTypes":[{"type":"hd","paletteId":1,"mandatory_f_0":true,"mandatory_f_1":true,"mandatory_m_0":true,"mandatory_m_1":true,"sets":[{"id":99999,"gender":"U","club":0,"colorable":true,"selectable":false,"preselectable":false,"sellable":false,"parts":[{"id":1,"type":"bd","colorable":true,"index":0,"colorindex":1},{"id":1,"type":"hd","colorable":true,"index":0,"colorindex":1},{"id":1,"type":"lh","colorable":true,"index":0,"colorindex":1},{"id":1,"type":"rh","colorable":true,"index":0,"colorindex":1}]}]},{"type":"bds","paletteId":1,"mandatory_f_0":false,"mandatory_f_1":false,"mandatory_m_0":false,"mandatory_m_1":false,"sets":[{"id":10001,"gender":"U","club":0,"colorable":true,"selectable":false,"preselectable":false,"sellable":false,"parts":[{"id":10001,"type":"bds","colorable":true,"index":0,"colorindex":1},{"id":10001,"type":"lhs","colorable":true,"index":0,"colorindex":1},{"id":10001,"type":"rhs","colorable":true,"index":0,"colorindex":1}],"hiddenLayers":[{"partType":"bd"},{"partType":"rh"},{"partType":"lh"}]}]},{"type":"ss","paletteId":3,"mandatory_f_0":false,"mandatory_f_1":false,"mandatory_m_0":false,"mandatory_m_1":false,"sets":[{"id":10010,"gender":"F","club":0,"colorable":true,"selectable":false,"preselectable":false,"sellable":false,"parts":[{"id":10001,"type":"ss","colorable":true,"index":0,"colorindex":1}],"hiddenLayers":[{"partType":"ch"},{"partType":"lg"},{"partType":"ca"},{"partType":"wa"},{"partType":"sh"},{"partType":"ls"},{"partType":"rs"},{"partType":"lc"},{"partType":"rc"},{"partType":"cc"},{"partType":"cp"}]},{"id":10011,"gender":"M","club":0,"colorable":true,"selectable":false,"preselectable":false,"sellable":false,"parts":[{"id":10002,"type":"ss","colorable":true,"index":0,"colorindex":1}],"hiddenLayers":[{"partType":"ch"},{"partType":"lg"},{"partType":"ca"},{"partType":"wa"},{"partType":"sh"},{"partType":"ls"},{"partType":"rs"},{"partType":"lc"},{"partType":"rc"},{"partType":"cc"},{"partType":"cp"}]}]}]}, "dance.2",
"avatar.default.actions": { "dance.3",
"actions": [ "dance.4"
{ ],
"id": "Default", "avatar.default.figuredata": {
"state": "std", "palettes": [
"precedence": 1000, {
"main": true, "id": 1,
"isDefault": true, "colors": [
"geometryType": "vertical", {
"activePartSet": "figure", "id": 99999,
"assetPartDefinition": "std" "index": 1001,
} "club": 0,
] "selectable": false,
}, "hexCode": "DDDDDD"
"pet.types": [ },
"dog", {
"cat", "id": 99998,
"croco", "index": 1001,
"terrier", "club": 0,
"bear", "selectable": false,
"pig", "hexCode": "FAFAFA"
"lion", }
"rhino", ]
"spider", },
"turtle", {
"chicken", "id": 3,
"frog", "colors": [
"dragon", {
"monster", "id": 10001,
"monkey", "index": 1001,
"horse", "club": 0,
"monsterplant", "selectable": false,
"bunnyeaster", "hexCode": "EEEEEE"
"bunnyevil", },
"bunnydepressed", {
"bunnylove", "id": 10002,
"pigeongood", "index": 1002,
"pigeonevil", "club": 0,
"demonmonkey", "selectable": false,
"bearbaby", "hexCode": "FA3831"
"terrierbaby", },
"gnome", {
"leprechaun", "id": 10003,
"kittenbaby", "index": 1003,
"puppybaby", "club": 0,
"pigletbaby", "selectable": false,
"haloompa", "hexCode": "FD92A0"
"fools", },
"pterosaur", {
"velociraptor", "id": 10004,
"cow", "index": 1004,
"dragondog" "club": 0,
], "selectable": false,
"preload.assets.urls": [ "hexCode": "2AC7D2"
"${asset.url}/bundled/generic/avatar_additions.nitro", },
"${asset.url}/bundled/generic/group_badge.nitro", {
"${asset.url}/bundled/generic/floor_editor.nitro", "id": 10005,
"${images.url}/loading_icon.png", "index": 1005,
"${images.url}/clear_icon.png", "club": 0,
"${images.url}/big_arrow.png" "selectable": false,
] "hexCode": "35332C"
} },
{
"id": 10006,
"index": 1006,
"club": 0,
"selectable": false,
"hexCode": "EFFF92"
},
{
"id": 10007,
"index": 1007,
"club": 0,
"selectable": false,
"hexCode": "C6FF98"
},
{
"id": 10008,
"index": 1008,
"club": 0,
"selectable": false,
"hexCode": "FF925A"
},
{
"id": 10009,
"index": 1009,
"club": 0,
"selectable": false,
"hexCode": "9D597E"
},
{
"id": 10010,
"index": 1010,
"club": 0,
"selectable": false,
"hexCode": "B6F3FF"
},
{
"id": 10011,
"index": 1011,
"club": 0,
"selectable": false,
"hexCode": "6DFF33"
},
{
"id": 10012,
"index": 1012,
"club": 0,
"selectable": false,
"hexCode": "3378C9"
},
{
"id": 10013,
"index": 1013,
"club": 0,
"selectable": false,
"hexCode": "FFB631"
},
{
"id": 10014,
"index": 1014,
"club": 0,
"selectable": false,
"hexCode": "DFA1E9"
},
{
"id": 10015,
"index": 1015,
"club": 0,
"selectable": false,
"hexCode": "F9FB32"
},
{
"id": 10016,
"index": 1016,
"club": 0,
"selectable": false,
"hexCode": "CAAF8F"
},
{
"id": 10017,
"index": 1017,
"club": 0,
"selectable": false,
"hexCode": "C5C6C5"
},
{
"id": 10018,
"index": 1018,
"club": 0,
"selectable": false,
"hexCode": "47623D"
},
{
"id": 10019,
"index": 1019,
"club": 0,
"selectable": false,
"hexCode": "8A8361"
},
{
"id": 10020,
"index": 1020,
"club": 0,
"selectable": false,
"hexCode": "FF8C33"
},
{
"id": 10021,
"index": 1021,
"club": 0,
"selectable": false,
"hexCode": "54C627"
},
{
"id": 10022,
"index": 1022,
"club": 0,
"selectable": false,
"hexCode": "1E6C99"
},
{
"id": 10023,
"index": 1023,
"club": 0,
"selectable": false,
"hexCode": "984F88"
},
{
"id": 10024,
"index": 1024,
"club": 0,
"selectable": false,
"hexCode": "77C8FF"
},
{
"id": 10025,
"index": 1025,
"club": 0,
"selectable": false,
"hexCode": "FFC08E"
},
{
"id": 10026,
"index": 1026,
"club": 0,
"selectable": false,
"hexCode": "3C4B87"
},
{
"id": 10027,
"index": 1027,
"club": 0,
"selectable": false,
"hexCode": "7C2C47"
},
{
"id": 10028,
"index": 1028,
"club": 0,
"selectable": false,
"hexCode": "D7FFE3"
},
{
"id": 10029,
"index": 1029,
"club": 0,
"selectable": false,
"hexCode": "8F3F1C"
},
{
"id": 10030,
"index": 1030,
"club": 0,
"selectable": false,
"hexCode": "FF6393"
},
{
"id": 10031,
"index": 1031,
"club": 0,
"selectable": false,
"hexCode": "1F9B79"
},
{
"id": 10032,
"index": 1032,
"club": 0,
"selectable": false,
"hexCode": "FDFF33"
}
]
}
],
"setTypes": [
{
"type": "hd",
"paletteId": 1,
"mandatory_f_0": true,
"mandatory_f_1": true,
"mandatory_m_0": true,
"mandatory_m_1": true,
"sets": [
{
"id": 99999,
"gender": "U",
"club": 0,
"colorable": true,
"selectable": false,
"preselectable": false,
"sellable": false,
"parts": [
{
"id": 1,
"type": "bd",
"colorable": true,
"index": 0,
"colorindex": 1
},
{
"id": 1,
"type": "hd",
"colorable": true,
"index": 0,
"colorindex": 1
},
{
"id": 1,
"type": "lh",
"colorable": true,
"index": 0,
"colorindex": 1
},
{
"id": 1,
"type": "rh",
"colorable": true,
"index": 0,
"colorindex": 1
}
]
}
]
},
{
"type": "bds",
"paletteId": 1,
"mandatory_f_0": false,
"mandatory_f_1": false,
"mandatory_m_0": false,
"mandatory_m_1": false,
"sets": [
{
"id": 10001,
"gender": "U",
"club": 0,
"colorable": true,
"selectable": false,
"preselectable": false,
"sellable": false,
"parts": [
{
"id": 10001,
"type": "bds",
"colorable": true,
"index": 0,
"colorindex": 1
},
{
"id": 10001,
"type": "lhs",
"colorable": true,
"index": 0,
"colorindex": 1
},
{
"id": 10001,
"type": "rhs",
"colorable": true,
"index": 0,
"colorindex": 1
}
],
"hiddenLayers": [
{
"partType": "bd"
},
{
"partType": "rh"
},
{
"partType": "lh"
}
]
}
]
},
{
"type": "ss",
"paletteId": 3,
"mandatory_f_0": false,
"mandatory_f_1": false,
"mandatory_m_0": false,
"mandatory_m_1": false,
"sets": [
{
"id": 10010,
"gender": "F",
"club": 0,
"colorable": true,
"selectable": false,
"preselectable": false,
"sellable": false,
"parts": [
{
"id": 10001,
"type": "ss",
"colorable": true,
"index": 0,
"colorindex": 1
}
],
"hiddenLayers": [
{
"partType": "ch"
},
{
"partType": "lg"
},
{
"partType": "ca"
},
{
"partType": "wa"
},
{
"partType": "sh"
},
{
"partType": "ls"
},
{
"partType": "rs"
},
{
"partType": "lc"
},
{
"partType": "rc"
},
{
"partType": "cc"
},
{
"partType": "cp"
}
]
},
{
"id": 10011,
"gender": "M",
"club": 0,
"colorable": true,
"selectable": false,
"preselectable": false,
"sellable": false,
"parts": [
{
"id": 10002,
"type": "ss",
"colorable": true,
"index": 0,
"colorindex": 1
}
],
"hiddenLayers": [
{
"partType": "ch"
},
{
"partType": "lg"
},
{
"partType": "ca"
},
{
"partType": "wa"
},
{
"partType": "sh"
},
{
"partType": "ls"
},
{
"partType": "rs"
},
{
"partType": "lc"
},
{
"partType": "rc"
},
{
"partType": "cc"
},
{
"partType": "cp"
}
]
}
]
}
]
},
"avatar.default.actions": {
"actions": [
{
"id": "Default",
"state": "std",
"precedence": 1000,
"main": true,
"isDefault": true,
"geometryType": "vertical",
"activePartSet": "figure",
"assetPartDefinition": "std"
}
]
},
"pet.types": [
"dog",
"cat",
"croco",
"terrier",
"bear",
"pig",
"lion",
"rhino",
"spider",
"turtle",
"chicken",
"frog",
"dragon",
"monster",
"monkey",
"horse",
"monsterplant",
"bunnyeaster",
"bunnyevil",
"bunnydepressed",
"bunnylove",
"pigeongood",
"pigeonevil",
"demonmonkey",
"bearbaby",
"terrierbaby",
"gnome",
"gnome",
"kittenbaby",
"puppybaby",
"pigletbaby",
"haloompa",
"fools",
"pterosaur",
"velociraptor",
"cow",
"LeetPen",
"bbwibb",
"elephants"
],
"preload.assets.urls": [
"${asset.url}/generic/avatar_additions.nitro",
"${asset.url}/generic/group_badge.nitro",
"${asset.url}/generic/floor_editor.nitro",
"${images.url}/loading_icon.png",
"${images.url}/clear_icon.png",
"${images.url}/big_arrow.png"
]
}
+6 -1112
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -56,4 +56,8 @@ export class WiredActionLayoutCode
public static USERS_HANDITEM_SELECTOR: number = 55; public static USERS_HANDITEM_SELECTOR: number = 55;
public static FILTER_FURNI_EXTRA: number = 56; public static FILTER_FURNI_EXTRA: number = 56;
public static FILTER_USER_EXTRA: number = 57; public static FILTER_USER_EXTRA: number = 57;
public static MOVE_CARRY_USERS_EXTRA: number = 58;
public static MOVE_NO_ANIMATION_EXTRA: number = 59;
public static ANIMATION_TIME_EXTRA: number = 60;
public static MOVE_PHYSICS_EXTRA: number = 61;
} }
@@ -81,9 +81,14 @@ export const WiredActionFurniToFurniView: FC<{}> = () =>
if(mode === 'move' && !canEditMove) return; if(mode === 'move' && !canEditMove) return;
if(mode === 'target' && !canEditTarget) return; if(mode === 'target' && !canEditTarget) return;
const nextMoveIds = (selectionMode === 'move') ? [ ...furniIds ] : [ ...moveFurniIds ];
const nextTargetIds = (selectionMode === 'target') ? [ ...furniIds ] : [ ...targetFurniIds ];
setMoveFurniIds(nextMoveIds);
setTargetFurniIds(nextTargetIds);
setSelectionMode(mode); setSelectionMode(mode);
setFurniIds([ ...(mode === 'move' ? moveFurniIds : targetFurniIds) ]); setFurniIds([ ...(mode === 'move' ? nextMoveIds : nextTargetIds) ]);
}, [ moveSource, targetSource, moveFurniIds, targetFurniIds, setFurniIds ]); }, [ selectionMode, furniIds, moveSource, targetSource, moveFurniIds, targetFurniIds, setFurniIds ]);
useEffect(() => useEffect(() =>
{ {
@@ -153,10 +158,16 @@ export const WiredActionFurniToFurniView: FC<{}> = () =>
const save = useCallback(() => const save = useCallback(() =>
{ {
const nextMoveIds = (selectionMode === 'move') ? [ ...furniIds ] : [ ...moveFurniIds ];
const nextTargetIds = (selectionMode === 'target') ? [ ...furniIds ] : [ ...targetFurniIds ];
setMoveFurniIds(nextMoveIds);
setTargetFurniIds(nextTargetIds);
if(selectionMode === 'target') if(selectionMode === 'target')
{ {
setSelectionMode('move'); setSelectionMode('move');
setFurniIds([ ...moveFurniIds ]); setFurniIds([ ...nextMoveIds ]);
} }
setIntParams([ setIntParams([
@@ -164,8 +175,8 @@ export const WiredActionFurniToFurniView: FC<{}> = () =>
targetSource targetSource
]); ]);
setStringParam(serializeIds(targetFurniIds)); setStringParam(serializeIds(nextTargetIds));
}, [ selectionMode, moveFurniIds, moveSource, targetSource, targetFurniIds, setFurniIds, setIntParams, setStringParam ]); }, [ selectionMode, furniIds, moveFurniIds, moveSource, targetSource, targetFurniIds, setFurniIds, setIntParams, setStringParam ]);
const selectionLimit = trigger?.maximumItemSelectionCount ?? 0; const selectionLimit = trigger?.maximumItemSelectionCount ?? 0;
@@ -52,6 +52,10 @@ import { WiredActionToggleFurniStateView } from './WiredActionToggleFurniStateVi
import { WiredActionUnfreezeView } from './WiredActionUnfreezeView'; import { WiredActionUnfreezeView } from './WiredActionUnfreezeView';
import { WiredExtraFilterFurniView } from '../extras/WiredExtraFilterFurniView'; import { WiredExtraFilterFurniView } from '../extras/WiredExtraFilterFurniView';
import { WiredExtraFilterUserView } from '../extras/WiredExtraFilterUserView'; import { WiredExtraFilterUserView } from '../extras/WiredExtraFilterUserView';
import { WiredExtraAnimationTimeView } from '../extras/WiredExtraAnimationTimeView';
import { WiredExtraMoveCarryUsersView } from '../extras/WiredExtraMoveCarryUsersView';
import { WiredExtraMoveNoAnimationView } from '../extras/WiredExtraMoveNoAnimationView';
import { WiredExtraMovePhysicsView } from '../extras/WiredExtraMovePhysicsView';
export const WiredActionLayoutView = (code: number) => export const WiredActionLayoutView = (code: number) =>
{ {
@@ -165,6 +169,14 @@ export const WiredActionLayoutView = (code: number) =>
return <WiredExtraFilterFurniView />; return <WiredExtraFilterFurniView />;
case WiredActionLayoutCode.FILTER_USER_EXTRA: case WiredActionLayoutCode.FILTER_USER_EXTRA:
return <WiredExtraFilterUserView />; return <WiredExtraFilterUserView />;
case WiredActionLayoutCode.MOVE_CARRY_USERS_EXTRA:
return <WiredExtraMoveCarryUsersView />;
case WiredActionLayoutCode.MOVE_NO_ANIMATION_EXTRA:
return <WiredExtraMoveNoAnimationView />;
case WiredActionLayoutCode.ANIMATION_TIME_EXTRA:
return <WiredExtraAnimationTimeView />;
case WiredActionLayoutCode.MOVE_PHYSICS_EXTRA:
return <WiredExtraMovePhysicsView />;
case WiredActionLayoutCode.SEND_SIGNAL: case WiredActionLayoutCode.SEND_SIGNAL:
return <WiredActionSendSignalView />; return <WiredActionSendSignalView />;
} }
@@ -115,17 +115,28 @@ export const WiredActionSendSignalView: FC<{}> = () =>
if(mode === selectionMode) return; if(mode === selectionMode) return;
if(mode === 'furni' && furniSource !== SOURCE_SELECTED) return; if(mode === 'furni' && furniSource !== SOURCE_SELECTED) return;
const nextAntennaIds = (selectionMode === 'antenna') ? [ ...furniIds ] : [ ...antennaIds ];
const nextForwardFurniIds = (selectionMode === 'furni') ? [ ...furniIds ] : [ ...forwardFurniIds ];
setAntennaIds(nextAntennaIds);
setForwardFurniIds(nextForwardFurniIds);
setSelectionMode(mode); setSelectionMode(mode);
if(setFurniIds) setFurniIds([ ...((mode === 'antenna') ? antennaIds : forwardFurniIds) ]); if(setFurniIds) setFurniIds([ ...((mode === 'antenna') ? nextAntennaIds : nextForwardFurniIds) ]);
}, [ selectionMode, furniSource, antennaIds, forwardFurniIds, setFurniIds ]); }, [ selectionMode, furniSource, furniIds, antennaIds, forwardFurniIds, setFurniIds ]);
const onChangeFurniSource = (next: number) => const onChangeFurniSource = (next: number) =>
{ {
if(forwardFurniIds.length) setForwardFurniIds([]); const nextAntennaIds = (selectionMode === 'antenna') ? [ ...furniIds ] : [ ...antennaIds ];
setAntennaIds(nextAntennaIds);
if(forwardFurniIds.length || selectionMode === 'furni')
{
setForwardFurniIds([]);
}
if(selectionMode === 'furni') if(selectionMode === 'furni')
{ {
if(setFurniIds) setFurniIds([ ...antennaIds ]); if(setFurniIds) setFurniIds([ ...nextAntennaIds ]);
setSelectionMode('antenna'); setSelectionMode('antenna');
} }
@@ -134,7 +145,19 @@ export const WiredActionSendSignalView: FC<{}> = () =>
const save = useCallback(() => const save = useCallback(() =>
{ {
const antennaSource = (antennaIds && antennaIds.length) ? antennaIds[0] : 0; const nextAntennaIds = (selectionMode === 'antenna') ? [ ...furniIds ] : [ ...antennaIds ];
const nextForwardFurniIds = (selectionMode === 'furni') ? [ ...furniIds ] : [ ...forwardFurniIds ];
setAntennaIds(nextAntennaIds);
setForwardFurniIds(nextForwardFurniIds);
if(selectionMode === 'furni')
{
setSelectionMode('antenna');
if(setFurniIds) setFurniIds([ ...nextAntennaIds ]);
}
const antennaSource = (nextAntennaIds && nextAntennaIds.length) ? nextAntennaIds[0] : 0;
setIntParams([ setIntParams([
antennaSource, antennaSource,
@@ -145,8 +168,8 @@ export const WiredActionSendSignalView: FC<{}> = () =>
0, 0,
]); ]);
setStringParam(serializeForwardIds(forwardFurniIds)); setStringParam(serializeForwardIds(nextForwardFurniIds));
}, [ antennaIds, furniSource, userSource, signalPerFurni, signalPerUser, forwardFurniIds, setIntParams, setStringParam ]); }, [ selectionMode, furniIds, antennaIds, furniSource, userSource, signalPerFurni, signalPerUser, forwardFurniIds, setFurniIds, setIntParams, setStringParam ]);
useEffect(() => useEffect(() =>
{ {
@@ -85,9 +85,14 @@ export const WiredConditionFurniIsOfTypeView: FC<WiredConditionFurniIsOfTypeView
if(mode === 'primary' && !canEditPrimary) return; if(mode === 'primary' && !canEditPrimary) return;
if(mode === 'secondary' && !canEditSecondary) return; if(mode === 'secondary' && !canEditSecondary) return;
const nextPrimaryIds = (selectionMode === 'primary') ? [ ...furniIds ] : [ ...primaryFurniIds ];
const nextSecondaryIds = (selectionMode === 'secondary') ? [ ...furniIds ] : [ ...secondaryFurniIds ];
setPrimaryFurniIds(nextPrimaryIds);
setSecondaryFurniIds(nextSecondaryIds);
setSelectionMode(mode); setSelectionMode(mode);
setFurniIds([ ...(mode === 'primary' ? primaryFurniIds : secondaryFurniIds) ]); setFurniIds([ ...(mode === 'primary' ? nextPrimaryIds : nextSecondaryIds) ]);
}, [ matchSource, compareSource, primaryFurniIds, secondaryFurniIds, setFurniIds ]); }, [ selectionMode, furniIds, matchSource, compareSource, primaryFurniIds, secondaryFurniIds, setFurniIds ]);
useEffect(() => useEffect(() =>
{ {
@@ -161,10 +166,16 @@ export const WiredConditionFurniIsOfTypeView: FC<WiredConditionFurniIsOfTypeView
const save = useCallback(() => const save = useCallback(() =>
{ {
const nextPrimaryIds = (selectionMode === 'primary') ? [ ...furniIds ] : [ ...primaryFurniIds ];
const nextSecondaryIds = (selectionMode === 'secondary') ? [ ...furniIds ] : [ ...secondaryFurniIds ];
setPrimaryFurniIds(nextPrimaryIds);
setSecondaryFurniIds(nextSecondaryIds);
if(selectionMode === 'secondary') if(selectionMode === 'secondary')
{ {
setSelectionMode('primary'); setSelectionMode('primary');
setFurniIds([ ...primaryFurniIds ]); setFurniIds([ ...nextPrimaryIds ]);
} }
setIntParams([ setIntParams([
@@ -172,8 +183,8 @@ export const WiredConditionFurniIsOfTypeView: FC<WiredConditionFurniIsOfTypeView
compareSource, compareSource,
quantifier quantifier
]); ]);
setStringParam(serializeIds(secondaryFurniIds)); setStringParam(serializeIds(nextSecondaryIds));
}, [ selectionMode, primaryFurniIds, matchSource, compareSource, quantifier, secondaryFurniIds, setFurniIds, setIntParams, setStringParam ]); }, [ selectionMode, furniIds, primaryFurniIds, matchSource, compareSource, quantifier, secondaryFurniIds, setFurniIds, setIntParams, setStringParam ]);
const selectionLimit = trigger?.maximumItemSelectionCount ?? 0; const selectionLimit = trigger?.maximumItemSelectionCount ?? 0;
const quantifierKeyPrefix = negative ? 'wiredfurni.params.quantifier.furni.neg' : 'wiredfurni.params.quantifier.furni'; const quantifierKeyPrefix = negative ? 'wiredfurni.params.quantifier.furni.neg' : 'wiredfurni.params.quantifier.furni';
@@ -0,0 +1,47 @@
import { FC, useEffect, useState } from 'react';
import { LocalizeText, WiredFurniType } from '../../../../api';
import { Slider, Text } from '../../../../common';
import { useWired } from '../../../../hooks';
import { WiredExtraBaseView } from './WiredExtraBaseView';
const MIN_DURATION = 50;
const MAX_DURATION = 2000;
const STEP_DURATION = 50;
const DEFAULT_DURATION = 500;
const normalizeDuration = (value: number) =>
{
if(isNaN(value)) return DEFAULT_DURATION;
return Math.max(MIN_DURATION, Math.min(MAX_DURATION, Math.round(value / STEP_DURATION) * STEP_DURATION));
};
export const WiredExtraAnimationTimeView: FC<{}> = () =>
{
const { trigger = null, setIntParams = null, setStringParam = null } = useWired();
const [ duration, setDuration ] = useState(DEFAULT_DURATION);
useEffect(() =>
{
if(!trigger) return;
setDuration(normalizeDuration((trigger.intData.length > 0) ? trigger.intData[0] : DEFAULT_DURATION));
}, [ trigger ]);
const save = () =>
{
setIntParams([ normalizeDuration(duration) ]);
setStringParam('');
};
return (
<WiredExtraBaseView hasSpecialInput={ true } requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save } cardStyle={ { width: 380 } }>
<div className="flex flex-col gap-2">
<Text bold>{ LocalizeText('wiredfurni.params.anim_time.title') }</Text>
<Text>{ LocalizeText('wiredfurni.params.anim_time.description') }</Text>
<Text bold>{ LocalizeText('wiredfurni.params.anim_time.value', [ 'ms' ], [ duration.toString() ]) }</Text>
<Slider min={ MIN_DURATION } max={ MAX_DURATION } step={ STEP_DURATION } value={ duration } onChange={ value => setDuration(normalizeDuration(Array.isArray(value) ? value[0] : Number(value))) } />
</div>
</WiredExtraBaseView>
);
};
@@ -0,0 +1,62 @@
import { FC, useEffect, useState } from 'react';
import { LocalizeText, WiredFurniType } from '../../../../api';
import { Text } from '../../../../common';
import { useWired } from '../../../../hooks';
import { WiredSourceOption, WiredSourcesSelector } from '../WiredSourcesSelector';
import { WiredExtraBaseView } from './WiredExtraBaseView';
const CARRY_MODE_DIRECT = 0;
const CARRY_MODE_SAME_TILE = 1;
const SOURCE_ALL_ROOM_USERS = 900;
const USER_SOURCES: WiredSourceOption[] = [
{ value: SOURCE_ALL_ROOM_USERS, label: 'wiredfurni.params.sources.users.900' },
{ value: 0, label: 'wiredfurni.params.sources.users.0' },
{ value: 200, label: 'wiredfurni.params.sources.users.200' },
{ value: 201, label: 'wiredfurni.params.sources.users.201' }
];
const normalizeCarryMode = (value: number) => ((value === CARRY_MODE_SAME_TILE) ? CARRY_MODE_SAME_TILE : CARRY_MODE_DIRECT);
const normalizeUserSource = (value: number) => (USER_SOURCES.some(option => option.value === value) ? value : 0);
export const WiredExtraMoveCarryUsersView: FC<{}> = () =>
{
const { trigger = null, setIntParams = null, setStringParam = null } = useWired();
const [ carryMode, setCarryMode ] = useState(CARRY_MODE_DIRECT);
const [ userSource, setUserSource ] = useState(0);
useEffect(() =>
{
if(!trigger) return;
setCarryMode(normalizeCarryMode((trigger.intData.length > 0) ? trigger.intData[0] : CARRY_MODE_DIRECT));
setUserSource(normalizeUserSource((trigger.intData.length > 1) ? trigger.intData[1] : 0));
}, [ trigger ]);
const save = () =>
{
setIntParams([ normalizeCarryMode(carryMode), normalizeUserSource(userSource) ]);
setStringParam('');
};
return (
<WiredExtraBaseView
hasSpecialInput={ true }
requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE }
save={ save }
cardStyle={ { width: 420 } }
footer={ <WiredSourcesSelector showUsers={ true } userSource={ userSource } userSources={ USER_SOURCES } usersTitle="wiredfurni.params.sources.users.title.carry" onChangeUsers={ value => setUserSource(normalizeUserSource(value)) } /> }>
<div className="flex flex-col gap-2">
<Text bold>{ LocalizeText('wiredfurni.params.carry_mode') }</Text>
<label className="flex items-center gap-1 cursor-pointer">
<input checked={ (carryMode === CARRY_MODE_DIRECT) } className="form-check-input" name="wiredCarryMode" type="radio" onChange={ () => setCarryMode(CARRY_MODE_DIRECT) } />
<Text>{ LocalizeText('wiredfurni.params.carry_mode.0') }</Text>
</label>
<label className="flex items-center gap-1 cursor-pointer">
<input checked={ (carryMode === CARRY_MODE_SAME_TILE) } className="form-check-input" name="wiredCarryMode" type="radio" onChange={ () => setCarryMode(CARRY_MODE_SAME_TILE) } />
<Text>{ LocalizeText('wiredfurni.params.carry_mode.1') }</Text>
</label>
</div>
</WiredExtraBaseView>
);
};
@@ -0,0 +1,25 @@
import { FC } from 'react';
import { LocalizeText, WiredFurniType } from '../../../../api';
import { Text } from '../../../../common';
import { useWired } from '../../../../hooks';
import { WiredExtraBaseView } from './WiredExtraBaseView';
export const WiredExtraMoveNoAnimationView: FC<{}> = () =>
{
const { setIntParams = null, setStringParam = null } = useWired();
const save = () =>
{
setIntParams([]);
setStringParam('');
};
return (
<WiredExtraBaseView hasSpecialInput={ true } requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save } cardStyle={ { width: 360 } }>
<div className="flex flex-col gap-1">
<Text bold>{ LocalizeText('wiredfurni.params.mov_no_animation.title') }</Text>
<Text>{ LocalizeText('wiredfurni.params.mov_no_animation.description') }</Text>
</div>
</WiredExtraBaseView>
);
};
@@ -0,0 +1,120 @@
import { FC, useEffect, useMemo, useState } from 'react';
import { LocalizeText, WiredFurniType } from '../../../../api';
import { Text } from '../../../../common';
import { useWired } from '../../../../hooks';
import { WiredSourceOption, WiredSourcesSelector } from '../WiredSourcesSelector';
import { WiredExtraBaseView } from './WiredExtraBaseView';
const SOURCE_ALL_ROOM = 900;
const DEFAULT_SOURCE = 0;
const FURNI_SOURCES: WiredSourceOption[] = [
{ value: SOURCE_ALL_ROOM, label: 'wiredfurni.params.sources.furni.900' },
{ value: 0, label: 'wiredfurni.params.sources.furni.0' },
{ value: 200, label: 'wiredfurni.params.sources.furni.200' },
{ value: 201, label: 'wiredfurni.params.sources.furni.201' }
];
const USER_SOURCES: WiredSourceOption[] = [
{ value: SOURCE_ALL_ROOM, label: 'wiredfurni.params.sources.users.900' },
{ value: 0, label: 'wiredfurni.params.sources.users.0' },
{ value: 200, label: 'wiredfurni.params.sources.users.200' },
{ value: 201, label: 'wiredfurni.params.sources.users.201' }
];
const normalizeSource = (value: number, options: WiredSourceOption[]) => (options.some(option => option.value === value) ? value : DEFAULT_SOURCE);
const getFlag = (value: number) => (value === 1);
export const WiredExtraMovePhysicsView: FC<{}> = () =>
{
const { trigger = null, setIntParams = null, setStringParam = null } = useWired();
const [ keepAltitude, setKeepAltitude ] = useState(false);
const [ moveThroughFurni, setMoveThroughFurni ] = useState(false);
const [ moveThroughUsers, setMoveThroughUsers ] = useState(false);
const [ blockByFurni, setBlockByFurni ] = useState(false);
const [ moveThroughFurniSource, setMoveThroughFurniSource ] = useState(DEFAULT_SOURCE);
const [ blockByFurniSource, setBlockByFurniSource ] = useState(DEFAULT_SOURCE);
const [ moveThroughUsersSource, setMoveThroughUsersSource ] = useState(DEFAULT_SOURCE);
useEffect(() =>
{
if(!trigger) return;
setKeepAltitude(getFlag(trigger.intData[0] ?? 0));
setMoveThroughFurni(getFlag(trigger.intData[1] ?? 0));
setMoveThroughUsers(getFlag(trigger.intData[2] ?? 0));
setBlockByFurni(getFlag(trigger.intData[3] ?? 0));
setMoveThroughFurniSource(normalizeSource((trigger.intData[4] ?? DEFAULT_SOURCE), FURNI_SOURCES));
setBlockByFurniSource(normalizeSource((trigger.intData[5] ?? DEFAULT_SOURCE), FURNI_SOURCES));
setMoveThroughUsersSource(normalizeSource((trigger.intData[6] ?? DEFAULT_SOURCE), USER_SOURCES));
}, [ trigger ]);
const save = () =>
{
setIntParams([
keepAltitude ? 1 : 0,
moveThroughFurni ? 1 : 0,
moveThroughUsers ? 1 : 0,
blockByFurni ? 1 : 0,
normalizeSource(moveThroughFurniSource, FURNI_SOURCES),
normalizeSource(blockByFurniSource, FURNI_SOURCES),
normalizeSource(moveThroughUsersSource, USER_SOURCES)
]);
setStringParam('');
};
const footer = useMemo(() =>
{
if(!moveThroughFurni && !blockByFurni && !moveThroughUsers) return null;
return (
<div className="flex flex-col gap-3">
{ moveThroughFurni &&
<WiredSourcesSelector
showFurni={ true }
furniSource={ moveThroughFurniSource }
furniSources={ FURNI_SOURCES }
furniTitle="wiredfurni.params.sources.furni.title.physics.0"
onChangeFurni={ value => setMoveThroughFurniSource(normalizeSource(value, FURNI_SOURCES)) } /> }
{ blockByFurni &&
<WiredSourcesSelector
showFurni={ true }
furniSource={ blockByFurniSource }
furniSources={ FURNI_SOURCES }
furniTitle="wiredfurni.params.sources.furni.title.physics.1"
onChangeFurni={ value => setBlockByFurniSource(normalizeSource(value, FURNI_SOURCES)) } /> }
{ moveThroughUsers &&
<WiredSourcesSelector
showUsers={ true }
userSource={ moveThroughUsersSource }
userSources={ USER_SOURCES }
usersTitle="wiredfurni.params.sources.users.title.physics.0"
onChangeUsers={ value => setMoveThroughUsersSource(normalizeSource(value, USER_SOURCES)) } /> }
</div>
);
}, [ blockByFurni, blockByFurniSource, moveThroughFurni, moveThroughFurniSource, moveThroughUsers, moveThroughUsersSource ]);
return (
<WiredExtraBaseView hasSpecialInput={ true } requiresFurni={ WiredFurniType.STUFF_SELECTION_OPTION_NONE } save={ save } cardStyle={ { width: 430 } } footer={ footer }>
<div className="flex flex-col gap-2">
<Text bold>{ LocalizeText('wiredfurni.params.select_options') }</Text>
<label className="flex items-center gap-2 cursor-pointer">
<input checked={ keepAltitude } className="form-check-input" type="checkbox" onChange={ event => setKeepAltitude(event.target.checked) } />
<Text>{ LocalizeText('wiredfurni.params.movephysics.keep_altitude') }</Text>
</label>
<label className="flex items-center gap-2 cursor-pointer">
<input checked={ moveThroughFurni } className="form-check-input" type="checkbox" onChange={ event => setMoveThroughFurni(event.target.checked) } />
<Text>{ LocalizeText('wiredfurni.params.movephysics.move_through_furni') }</Text>
</label>
<label className="flex items-center gap-2 cursor-pointer">
<input checked={ moveThroughUsers } className="form-check-input" type="checkbox" onChange={ event => setMoveThroughUsers(event.target.checked) } />
<Text>{ LocalizeText('wiredfurni.params.movephysics.move_through_users') }</Text>
</label>
<label className="flex items-center gap-2 cursor-pointer">
<input checked={ blockByFurni } className="form-check-input" type="checkbox" onChange={ event => setBlockByFurni(event.target.checked) } />
<Text>{ LocalizeText('wiredfurni.params.movephysics.block_by_furni') }</Text>
</label>
</div>
</WiredExtraBaseView>
);
};
@@ -12,7 +12,7 @@ export const WiredSelectorFurniByTypeView: FC<{}> = () =>
const [ filterExisting, setFilterExisting ] = useState(false); const [ filterExisting, setFilterExisting ] = useState(false);
const [ invert, setInvert ] = useState(false); const [ invert, setInvert ] = useState(false);
const { trigger = null, setIntParams, setSelectByType } = useWired(); const { trigger = null, setIntParams } = useWired();
useEffect(() => useEffect(() =>
{ {
@@ -24,11 +24,6 @@ export const WiredSelectorFurniByTypeView: FC<{}> = () =>
if(p.length >= 4) setInvert(p[3] === 1); if(p.length >= 4) setInvert(p[3] === 1);
}, [ trigger ]); }, [ trigger ]);
useEffect(() =>
{
setSelectByType(true);
}, [ setSelectByType ]);
const save = useCallback(() => const save = useCallback(() =>
{ {
setIntParams([ setIntParams([
+2 -3
View File
@@ -13,7 +13,7 @@ const useWiredState = () =>
const [ furniIds, setFurniIds ] = useState<number[]>([]); const [ furniIds, setFurniIds ] = useState<number[]>([]);
const [ actionDelay, setActionDelay ] = useState<number>(0); const [ actionDelay, setActionDelay ] = useState<number>(0);
const [ allowsFurni, setAllowsFurni ] = useState<number>(WiredFurniType.STUFF_SELECTION_OPTION_NONE); const [ allowsFurni, setAllowsFurni ] = useState<number>(WiredFurniType.STUFF_SELECTION_OPTION_NONE);
const [ selectByType, setSelectByType ] = useState<boolean>(false); const selectByType = false;
const [ neighborhoodTiles, setNeighborhoodTiles ] = useState<{ x: number; y: number }[] | null>(null); const [ neighborhoodTiles, setNeighborhoodTiles ] = useState<{ x: number; y: number }[] | null>(null);
const [ neighborhoodInvert, setNeighborhoodInvert ] = useState<boolean>(false); const [ neighborhoodInvert, setNeighborhoodInvert ] = useState<boolean>(false);
const [ allowedInteractionTypes, setAllowedInteractionTypes ] = useState<string[] | null>(null); const [ allowedInteractionTypes, setAllowedInteractionTypes ] = useState<string[] | null>(null);
@@ -303,7 +303,6 @@ const useWiredState = () =>
return []; return [];
}); });
setAllowsFurni(WiredFurniType.STUFF_SELECTION_OPTION_NONE); setAllowsFurni(WiredFurniType.STUFF_SELECTION_OPTION_NONE);
setSelectByType(false);
setNeighborhoodTiles(null); setNeighborhoodTiles(null);
setNeighborhoodInvert(false); setNeighborhoodInvert(false);
setAllowedInteractionTypes(null); setAllowedInteractionTypes(null);
@@ -311,7 +310,7 @@ const useWiredState = () =>
}; };
}, [ trigger ]); }, [ trigger ]);
return { trigger, setTrigger, intParams, setIntParams, stringParam, setStringParam, furniIds, setFurniIds, actionDelay, setActionDelay, setAllowsFurni, saveWired, selectObjectForWired, setSelectByType, setNeighborhoodTiles, setNeighborhoodInvert, setAllowedInteractionTypes, setAllowedInteractionErrorKey }; return { trigger, setTrigger, intParams, setIntParams, stringParam, setStringParam, furniIds, setFurniIds, actionDelay, setActionDelay, setAllowsFurni, saveWired, selectObjectForWired, setNeighborhoodTiles, setNeighborhoodInvert, setAllowedInteractionTypes, setAllowedInteractionErrorKey };
}; };
export const useWired = () => useBetween(useWiredState); export const useWired = () => useBetween(useWiredState);
+9 -3
View File
@@ -1,9 +1,15 @@
import react from '@vitejs/plugin-react'; import react from '@vitejs/plugin-react';
import { existsSync } from 'fs';
import { resolve } from 'path'; import { resolve } from 'path';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths'; import tsconfigPaths from 'vite-tsconfig-paths';
const renderer3 = resolve(__dirname, '..', 'renderer3'); const rendererCandidates = [
resolve(__dirname, '..', 'Nitro_Render_V3'),
resolve(__dirname, '..', 'renderer3')
];
const renderer3 = rendererCandidates.find(path => existsSync(path)) ?? rendererCandidates[0];
export default defineConfig({ export default defineConfig({
plugins: [ react(), tsconfigPaths() ], plugins: [ react(), tsconfigPaths() ],
@@ -39,7 +45,7 @@ export default defineConfig({
'@nitrots/sound': resolve(renderer3, 'packages/sound/src/index.ts'), '@nitrots/sound': resolve(renderer3, 'packages/sound/src/index.ts'),
'@nitrots/utils/src': resolve(renderer3, 'packages/utils/src'), '@nitrots/utils/src': resolve(renderer3, 'packages/utils/src'),
'@nitrots/utils': resolve(renderer3, 'packages/utils/src/index.ts'), '@nitrots/utils': resolve(renderer3, 'packages/utils/src/index.ts'),
// Resolve pixi.js and pixi-filters from renderer3's node_modules // Resolve renderer peer dependencies from the renderer workspace
'pixi.js': resolve(renderer3, 'node_modules/pixi.js'), 'pixi.js': resolve(renderer3, 'node_modules/pixi.js'),
'pixi-filters': resolve(renderer3, 'node_modules/pixi-filters'), 'pixi-filters': resolve(renderer3, 'node_modules/pixi-filters'),
'howler': resolve(renderer3, 'node_modules/howler'), 'howler': resolve(renderer3, 'node_modules/howler'),
@@ -55,7 +61,7 @@ export default defineConfig({
{ {
if(id.includes('node_modules')) if(id.includes('node_modules'))
{ {
if(id.includes('@nitrots/nitro-renderer') || id.includes('renderer3')) return 'nitro-renderer'; if(id.includes('@nitrots/nitro-renderer') || id.includes('renderer3') || id.includes('Nitro_Render_V3')) return 'nitro-renderer';
return 'vendor'; return 'vendor';
} }