Skip to content

Commit

Permalink
wip: hud customizer
Browse files Browse the repository at this point in the history
  • Loading branch information
tsa96 committed May 6, 2024
1 parent d0916c2 commit c072706
Show file tree
Hide file tree
Showing 10 changed files with 891 additions and 0 deletions.
4 changes: 4 additions & 0 deletions images/hudcustomizer/snap-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/hudcustomizer/snap-x-max.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/hudcustomizer/snap-x-mid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/hudcustomizer/snap-x-min.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/hudcustomizer/snap-y-max.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/hudcustomizer/snap-y-mid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions images/hudcustomizer/snap-y-min.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions layout/hud/hud.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
<include src="file://{resources}/styles/main.scss" />
</styles>

<scripts>
<include src="file://{scripts}/common/layout.js" />
<include src="file://{scripts}/util/functions.js" />
<include src="file://{scripts}/hud/customizer.js" />
</scripts>

<Hud class="hud" hittest="false" useglobalcontext="false">
<!-- Non-interactive HUD elements have hit test disabled for efficiency -->
Expand All @@ -16,6 +21,15 @@
<MomHudReticle />
</Panel>

<Panel id="HudCustomizer" class="hud-customizer hud-customizer--disabled" hittest="false">
<Panel class="hud-customizer__settings">
<Button onactivate="HudCustomizer.disableEditing()">
<Image class="hud-customizer-settings__close" src="file://{images}/close.svg"/>
</Button>
<NumberEntry id="HudCustomizerGridSize" class="hud-customizer-settings__gridsize" min="4" max="12" onvaluechanged="HudCustomizer.updateGridSize()" />
</Panel>
<Panel id="HudCustomizerKnobContainer" class="hud-customizer__knob-container" hittest="false" />
<Panel id="HudCustomizerGrid" class="hud-customizer__grid" hittest="false" hittestchildren="false" />
</Panel>

<HudTrickTracker id="TrickTracker" />
Expand Down Expand Up @@ -49,6 +63,38 @@

<HudLeaderboards id="Leaderboards" hittest="true" />

<Panel id="HudCustomizerVirtual" class="hud-customizer-virtual" draggable="true">
<Label id="HudCustomizerVirtualName" class="hud-customizer-virtual__name" />
<Panel id="HudCustomizerSnaps" class="hud-customizer-virtual-snaps" onmouseover="HudCustomizer.showSnapTooltip();" onmouseout="HudCustomizer.hideSnapTooltip();">
<Panel class="hud-customizer-virtual-snaps__row">
<RadioButton id="HudCustomizerSnapsXMin" class="hud-customizer-virtual-snaps__button" onactivate="HudCustomizer.setSnapMode(0, 1);" group="SnapX">
<Image class="hud-customizer-virtual-snaps__icon" src="file://{images}/hudcustomizer/snap-x-min.svg" texturewidth="32" textureheight="32" />
</RadioButton>
<RadioButton id="HudCustomizerSnapsXMid" class="hud-customizer-virtual-snaps__button" onactivate="HudCustomizer.setSnapMode(0, 2);" group="SnapX">
<Image class="hud-customizer-virtual-snaps__icon" src="file://{images}/hudcustomizer/snap-x-mid.svg" texturewidth="32" textureheight="32" />
</RadioButton>
<RadioButton id="HudCustomizerSnapsXMax" class="hud-customizer-virtual-snaps__button" onactivate="HudCustomizer.setSnapMode(0, 3);" group="SnapX">
<Image class="hud-customizer-virtual-snaps__icon" src="file://{images}/hudcustomizer/snap-x-max.svg" texturewidth="32" textureheight="32" />
</RadioButton>
<RadioButton id="HudCustomizerSnapsXOff" class="hud-customizer-virtual-snaps__button hud-customizer-virtual-snaps__button--last" onactivate="HudCustomizer.setSnapMode(0, 4);" group="SnapX">
<Image class="hud-customizer-virtual-snaps__icon" src="file://{images}/hudcustomizer/snap-off.svg" texturewidth="32" textureheight="32" />
</RadioButton>
</Panel>
<Panel class="hud-customizer-virtual-snaps__row hud-customizer-virtual-snaps__row--last">
<RadioButton id="HudCustomizerSnapsYMin" class="hud-customizer-virtual-snaps__button" onactivate="HudCustomizer.setSnapMode(1, 1);" group="SnapY">
<Image class="hud-customizer-virtual-snaps__icon" src="file://{images}/hudcustomizer/snap-y-min.svg" texturewidth="32" textureheight="32" />
</RadioButton>
<RadioButton id="HudCustomizerSnapsYMid" class="hud-customizer-virtual-snaps__button" onactivate="HudCustomizer.setSnapMode(1, 2);" group="SnapY">
<Image class="hud-customizer-virtual-snaps__icon" src="file://{images}/hudcustomizer/snap-y-mid.svg" texturewidth="32" textureheight="32" />
</RadioButton>
<RadioButton id="HudCustomizerSnapsYMax" class="hud-customizer-virtual-snaps__button" onactivate="HudCustomizer.setSnapMode(1, 3);" group="SnapY">
<Image class="hud-customizer-virtual-snaps__icon" src="file://{images}/hudcustomizer/snap-y-max.svg" texturewidth="32" textureheight="32" />
</RadioButton>
<RadioButton id="HudCustomizerSnapsYOff" class="hud-customizer-virtual-snaps__button hud-customizer-virtual-snaps__button--last" onactivate="HudCustomizer.setSnapMode(1, 4);" group="SnapY">
<Image class="hud-customizer-virtual-snaps__icon" src="file://{images}/hudcustomizer/snap-off.svg" texturewidth="32" textureheight="32" />
</RadioButton>
</Panel>
</Panel>
</Panel>

<!-- Make sure these are at the bottom to get the z-order right -->
Expand Down
Loading

0 comments on commit c072706

Please sign in to comment.