script engine passing methods back into engine
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
f73f110aa8
commit
d656d75535
@ -71,11 +71,9 @@ export const clientHooks: Hook[] = [
|
|||||||
} break;
|
} break;
|
||||||
case 'SelectRoom': {
|
case 'SelectRoom': {
|
||||||
const areaSelection: AreaSelection = engine.classes.areaUtils.static.selectAreaRectangular()
|
const areaSelection: AreaSelection = engine.classes.areaUtils.static.selectAreaRectangular()
|
||||||
console.log(JSON.stringify(areaSelection))
|
|
||||||
console.log(areaSelection.getType())
|
|
||||||
console.log(JSON.stringify(areaSelection.getType()))
|
|
||||||
console.log(areaSelection.getRectStart())
|
console.log(areaSelection.getRectStart())
|
||||||
console.log(JSON.stringify(areaSelection.getRectStart()))
|
console.log(JSON.stringify(areaSelection.getRectStart()))
|
||||||
|
engine.classes.areaUtils.static.makeSelectionVisible(areaSelection)
|
||||||
} break;
|
} break;
|
||||||
case 'ShowFurniture': {
|
case 'ShowFurniture': {
|
||||||
} break;
|
} break;
|
||||||
|
|||||||
@ -25,4 +25,10 @@ export interface ClientAreaUtils {
|
|||||||
*/
|
*/
|
||||||
readonly selectAreaRectangular: () => AreaSelection
|
readonly selectAreaRectangular: () => AreaSelection
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Makes a selection visible
|
||||||
|
* @param selection The selection
|
||||||
|
*/
|
||||||
|
readonly makeSelectionVisible: (selection: AreaSelection) => void
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1848,6 +1848,7 @@ HTML-defined buttons now directly eval in the js context instead of going throug
|
|||||||
Fix caching with deleted source files
|
Fix caching with deleted source files
|
||||||
Proof of concept of ui button calling engine code
|
Proof of concept of ui button calling engine code
|
||||||
Script engine direct access to joml vectors
|
Script engine direct access to joml vectors
|
||||||
|
Script engine passing objects back into methods successfully
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -25,9 +25,17 @@ public class ScriptClientAreaUtils {
|
|||||||
Vector3i chunkPos = Globals.clientState.clientWorldData.convertRealToWorldSpace(cursorPos);
|
Vector3i chunkPos = Globals.clientState.clientWorldData.convertRealToWorldSpace(cursorPos);
|
||||||
Vector3i blockPos = ClientWorldData.convertRealToLocalBlockSpace(cursorPos);
|
Vector3i blockPos = ClientWorldData.convertRealToLocalBlockSpace(cursorPos);
|
||||||
AreaSelection selection = AreaSelection.selectRectangularBlockCavity(chunkPos, blockPos, AreaSelection.DEFAULT_SELECTION_RADIUS);
|
AreaSelection selection = AreaSelection.selectRectangularBlockCavity(chunkPos, blockPos, AreaSelection.DEFAULT_SELECTION_RADIUS);
|
||||||
Globals.cursorState.selectRectangularArea(selection);
|
|
||||||
CursorState.makeAreaVisible();
|
|
||||||
return selection;
|
return selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Makes a selection visible
|
||||||
|
* @param selection The selection
|
||||||
|
*/
|
||||||
|
@Export
|
||||||
|
public static void makeSelectionVisible(AreaSelection selection){
|
||||||
|
Globals.cursorState.selectRectangularArea(selection);
|
||||||
|
CursorState.makeAreaVisible();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user