room tool work
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2025-05-15 17:08:54 -04:00
parent 50a5da2f81
commit 279c7e3f38
7 changed files with 39 additions and 3 deletions

View File

@ -204,8 +204,12 @@
"path" : "Models/basic/geometry/unitvector.glb"
}
},
"primaryUsage" : {
"clientHook" : "ROOM_TOOL_ACTION",
"suppressServerRequest": true
},
"secondaryUsage" : {
"clientHook" : "SELECT_ROOM",
"clientHook" : "ROOM_TOOL_MENU",
"suppressServerRequest": true
},
"collidable": {

View File

@ -0,0 +1,20 @@
<style>
testClass {
margin-top: "50px";
margin-left: "50px";
}
mainPanel {
margin-top: 50px;
margin-right: 50px;
margin-bottom: 50px;
margin-left: 50px;
}
</style>
<div class="mainPanel">
<p class="testClass">Room Tool Menu!</p>
<button onclick="hook('ROOM_TOOL_TOGGLE')">Select Rooms</button>
<button onclick="hook('ROOM_TOOL_TOGGLE')">Show Rooms</button>
<button onclick="hook('ROOM_TOOL_TOGGLE')">Select Furniture Spots</button>
<button onclick="hook('ROOM_TOOL_TOGGLE')">Show Furniture Spots</button>
<button onclick="hook('ROOM_TOOL_TOGGLE')">Detect Room</button>
</div>

View File

@ -61,10 +61,16 @@ export const clientHooks: Hook[] = [
}
},
{
signal: "SELECT_ROOM",
signal: "ROOM_TOOL_ACTION",
callback: (engine: Engine) => {
engine.classes.areaUtils.static.selectAreaRectangular()
}
},
{
signal: "ROOM_TOOL_MENU",
callback: (engine: Engine) => {
engine.classes.menuUtils.static.openDialog('Data/menu/room/roomToolConfig.html')
}
},
clientUIButtonHook,
]

View File

@ -1,3 +1,4 @@
import { GLOBAL_SCENE_ID } from "/Scripts/engine/hooks/hook-manager";
import { Engine } from "/Scripts/types/engine";
import { Hook } from "/Scripts/types/hook";
@ -10,6 +11,8 @@ export const clientUIButtonHook: Hook =
callback: (engine: Engine, data: string) => {
if(data.length > 4 && data.substring(0,9) === "openDiag("){
engine.classes.menuUtils.static.openDialog(data.substring(9,data.length - 1))
} else if(data.length > 4 && data.substring(0,5) === "hook("){
engine.hookManager.fireSignal(GLOBAL_SCENE_ID,data.substring(5,data.length - 1))
} else {
console.log("button clicked " + data)
}

View File

@ -1830,6 +1830,7 @@ Move engine flags under engineState
Move rendering flags under renderingEngine
Move database connection into serverState
Move more services into engineState
Room tool functionality scaffolding

View File

@ -66,7 +66,8 @@ public class DialogMenuGenerator {
rVal.setParentAlignItem(YogaAlignment.Center);
rVal.setParentJustifyContent(YogaJustification.Center);
rVal.setOnNavigationCallback(new NavigationEventCallback() {public boolean execute(NavigationEvent event){
WindowUtils.recursiveSetVisible(Globals.elementService.getWindow(WindowStrings.NPC_DIALOG), false);
WindowUtils.closeWindow(WindowStrings.NPC_DIALOG);
Globals.controlHandler.hintUpdateControlState(ControlsState.MAIN_GAME);
return false;
}});

View File

@ -99,6 +99,7 @@ public class ControlHandler {
WindowStrings.WINDOW_MENU_INGAME_MAIN,
WindowStrings.WINDOW_MENU_INVENTORY,
WindowStrings.WINDOW_MENU_MAIN,
WindowStrings.NPC_DIALOG,
};