Skip to content

Commit 78059b8

Browse files
authored
Merge pull request #158 from JulieWinchester/ui-show-above-stage
Add configuration setting to show UI elements above stage
2 parents c95a401 + 3c57886 commit 78059b8

File tree

3 files changed

+38
-9
lines changed

3 files changed

+38
-9
lines changed

src/lang/en.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,16 @@
7070
"nameFontHint": "Put in the name of the font you want to use. If the font exists in Theatre, it can be used. Requires actors to re-stage or for the GM to resync.",
7171
"nameFontSize": "Actor Name Size (Experimental)",
7272
"nameFontSizeHint": "Sets the size of the name font. Note that the sizes may be different depending on your display or font choice. Using huge sizes is not recommended.",
73-
"autoHideBottom": "Auto Hide Bottom",
74-
"autoHideBottomHint": "Hide bottom UI(player&hotbar) when actor shows on stage.",
75-
"suppressMacroHotbar": "Show Player List and Macro Hotbar When Stage is Suppressed",
73+
"autoHideBottom": "Hide Bottom UI Elements Automatically",
74+
"autoHideBottomHint": "Hide bottom UI elements (players list and macro hotbar) when actor shows on stage.",
75+
"suppressMacroHotbar": "Show Bottom UI Elements When Stage Is Suppressed",
76+
"suppressMacroHotbarHint": "Only has an effect if Hide Bottom UI Elements Automatically is enabled. Bottom UI elements (players list and macro hotbar) are shown again after hiding if stage is suppressed when actors are on stage.",
77+
"showUIAboveStage": "Show UI Elements Above Stage",
78+
"showUIAboveStageHint": "Useful mainly if Hide Bottom UI Elements Automatically is disabled. UI elements to show above the stage. Users can interact with UI elements above the stage even when actors are on stage.",
79+
"showUIAboveStageNone": "None (Stage Above UI)",
80+
"showUIAboveStageLeft": "Players List and Controls",
81+
"showUIAboveStageMiddle": "Macro Hotbar",
82+
"showUIAboveStageBoth": "Both (UI Above Stage)",
7683
"removeLabelSheetHeader": "Remove Text Labels From Actor Sheet Header",
7784
"removeLabelSheetHeaderHint": "Removes text labels from actor sheet header buttons, useful for small screens and mobile devices. Button will still be displayed with icon.",
7885
"ignoreMessagesToChat": "Ignore Theatre Messages From Chat",

src/scripts/Theatre.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,13 @@ export class Theatre {
196196
// set narrator height
197197
this.settings.narrHeight = game.settings.get(Theatre.SETTINGS, "theatreNarratorHeight");
198198
this.theatreNarrator.style.top = `calc(${this.settings.narrHeight} - 50px)`;
199-
199+
// set z-index class for other UI elements
200+
const uiAbove = game.settings.get(Theatre.SETTINGS, "showUIAboveStage");
201+
const leftAbove = uiAbove == "left" || uiAbove == "both";
202+
if (leftAbove) document.getElementById("ui-left").classList.add("z-higher");
203+
const middleAbove = uiAbove == "middle" || uiAbove == "both";
204+
if (middleAbove) document.getElementById("ui-middle").classList.add("z-higher");
205+
200206
// set dock canvas hard dimensions after CSS has caclulated it
201207

202208
/**
@@ -497,13 +503,29 @@ export class Theatre {
497503

498504
game.settings.register(Theatre.SETTINGS, "suppressMacroHotbar", {
499505
name: "Theatre.UI.Settings.suppressMacroHotbar",
500-
hint: "",
506+
hint: "Theatre.UI.Settings.suppressMacroHotbarHint",
501507
scope: "world",
502508
config: true,
503509
type: Boolean,
504510
default: true,
505511
});
506512

513+
game.settings.register(Theatre.SETTINGS, "showUIAboveStage", {
514+
name: "Theatre.UI.Settings.showUIAboveStage",
515+
hint: "Theatre.UI.Settings.showUIAboveStageHint",
516+
scope: "world",
517+
config: true,
518+
default: "none",
519+
requiresReload: true,
520+
type: String,
521+
choices: {
522+
none: "Theatre.UI.Settings.showUIAboveStageNone",
523+
left: "Theatre.UI.Settings.showUIAboveStageLeft",
524+
middle: "Theatre.UI.Settings.showUIAboveStageMiddle",
525+
both: "Theatre.UI.Settings.showUIAboveStageBoth",
526+
}
527+
});
528+
507529
game.settings.register(Theatre.SETTINGS, "removeLabelSheetHeader", {
508530
name: "Theatre.UI.Settings.removeLabelSheetHeader",
509531
hint: "Theatre.UI.Settings.removeLabelSheetHeaderHint",

src/styles/theatre.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,10 +1680,6 @@
16801680
bottom: calc(50% - 50px);
16811681
}
16821682

1683-
#players {
1684-
z-index: 1;
1685-
}
1686-
16871683
#players,
16881684
#hotbar {
16891685
transition: opacity 500ms ease 0ms;
@@ -1702,6 +1698,10 @@
17021698
pointer-events: none;
17031699
}
17041700

1701+
#ui-left.z-higher, #ui-middle.z-higher {
1702+
z-index: calc(var(--z-index-app) + 1);
1703+
}
1704+
17051705
@-moz-document url-prefix() {
17061706
.emote-box .emotebar .colorselect {
17071707
padding: 3px;

0 commit comments

Comments
 (0)