mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
Enable pointer lock filters and disable them when debug draw is on
- Enable ENABLE_POINTER_LOCK_FILTER in Settings.js - Add debug mode check in onPointerLockChange to disable filters when debug is on - Add onToggleDebugMode override to remove active filters when debug is enabled - Reduce debug draw line thickness to 0.25 for cleaner visualization
This commit is contained in:
parent
925419d801
commit
9d74a01f04
3 changed files with 19 additions and 3 deletions
|
|
@ -142,6 +142,9 @@ function (Parent, domController, PIXI, Settings, nc, Exception, GameStats, Layer
|
|||
PixiView.prototype.onPointerLockChange = function(isLocked, options) {
|
||||
if (!Settings.ENABLE_POINTER_LOCK_FILTER) return;
|
||||
|
||||
// Disable pointer lock filters when debug mode is on
|
||||
if (this.debugMode) return;
|
||||
|
||||
if(isLocked) {
|
||||
this.removeFilters(this.pointerLockFilters);
|
||||
|
||||
|
|
@ -297,6 +300,19 @@ function (Parent, domController, PIXI, Settings, nc, Exception, GameStats, Layer
|
|||
return textures;
|
||||
};
|
||||
|
||||
PixiView.prototype.onToggleDebugMode = function(debugMode) {
|
||||
// Call parent method first
|
||||
Parent.prototype.onToggleDebugMode.call(this, debugMode);
|
||||
|
||||
// Remove pointer lock filters when debug mode is enabled
|
||||
if (debugMode && this.pointerLockFilters) {
|
||||
this.removeFilters(this.pointerLockFilters);
|
||||
if (this.clickToEnable) {
|
||||
this.clickToEnable.visible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
PixiView.prototype.destroy = function() {
|
||||
|
||||
this.layerManager.destroy(); // also calls all layers destroy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue