fix UI settings a bit
This commit is contained in:
parent
eb89ba03db
commit
2cb6a88c5e
@ -15,6 +15,8 @@ export class ClientMenu {
|
||||
private trigger: HTMLDivElement;
|
||||
private visible = false;
|
||||
|
||||
private hiddenClass = 'uw-hidden';
|
||||
|
||||
private menuPositionClasses: string[] = [];
|
||||
|
||||
|
||||
@ -314,12 +316,13 @@ export class ClientMenu {
|
||||
this.onDocumentMouseMove = (e: MouseEvent) => {
|
||||
this.lastMouseMove = performance.now();
|
||||
|
||||
if (activationRadius != null) {
|
||||
if (activationRadius) {
|
||||
if (! menuActivatorRect.width) {
|
||||
recalculateActivator();
|
||||
}
|
||||
|
||||
const d = Math.hypot(e.clientX - cx, e.clientY - cy);
|
||||
|
||||
console.log('activator radius:', activationRadius, 'mouse distance:', d);
|
||||
this.isWithinActivation = d <= activationRadius;
|
||||
|
||||
} else {
|
||||
@ -384,16 +387,26 @@ export class ClientMenu {
|
||||
}
|
||||
|
||||
if (options?.forceShow !== undefined) {
|
||||
if (!this.forceShow && options.forceShow) {
|
||||
this.root.classList.add('uw-force-visible');
|
||||
}
|
||||
if (this.forceShow && !options.forceShow) {
|
||||
this.root.classList.remove('uw-force-visible');
|
||||
}
|
||||
this.forceShow = options.forceShow;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
hide(options?: {forceShow?: boolean}) {
|
||||
if (options?.forceShow !== undefined) {
|
||||
if (this.forceShow !== options.forceShow) {
|
||||
this.root.classList.remove('uw-force-visible');
|
||||
this.forceShow = options.forceShow;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.visible && !this.forceShow) {
|
||||
if (this.visible) {
|
||||
this.visible = false;
|
||||
this.root.classList.remove('uw-visible');
|
||||
this.root.classList.add('uw-hidden');
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
>
|
||||
<select
|
||||
class="unit-select !min-w-[72px]"
|
||||
v-model="settings.active.ui.inPlayer.activationDistanceUnit"
|
||||
v-model="settings.active.ui.inPlayer.activationDistanceUnits"
|
||||
@change="(event) => saveSettings(true)"
|
||||
>
|
||||
<option value="%">%</option>
|
||||
|
||||
@ -8,13 +8,21 @@
|
||||
transition: opacity 120ms ease;
|
||||
|
||||
&:not(.uw-visible) {
|
||||
&:not(.uw-force-visible) {
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
&.uw-hidden {
|
||||
&:not(.uw-force-visible) {
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
}
|
||||
&.uw-force-visible {
|
||||
@apply text-blue-500;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
&.uw-visible {
|
||||
/* pointer-events: auto; */
|
||||
opacity: 1;
|
||||
@ -68,9 +76,12 @@
|
||||
}
|
||||
|
||||
.uw-hidden {
|
||||
&:not(.uw-force-visible) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.uw-trigger, .uw-menu-item, .uw-menu-trigger {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user