diff --git a/nui/radar.css b/nui/radar.css index f3f10e8..f762c9d 100644 --- a/nui/radar.css +++ b/nui/radar.css @@ -22,16 +22,22 @@ /* Removes the outline when buttons have been clicked */ button:focus { outline: none; } -.unit_frame { +/* The alignment classes for the dynamic repositioning system */ +#radarFrame.top_left { top: 10px; left: 10px; } +#radarFrame.top_middle { top: 10px; left: 0; right: 0; } +#radarFrame.top_right { top: 10px; right: 10px; } +#radarFrame.middle_right { top: 0; bottom: 0; right: 10px; } +#radarFrame.middle_left { top: 0; bottom: 0; left: 10px; } +#radarFrame.bottom_left { bottom: 10px; left: 10px; } +#radarFrame.bottom_middle { bottom: 10px; left: 0; right: 0; } +#radarFrame.bottom_right { bottom: 10px; right: 10px; } + +#radarFrame { width: 715px; height: 230px; position: absolute; margin: auto; - /* top: 0; */ - right: 10px; - bottom: 10px; - /* left: 0; */ background-image: url( "frame.png" ); diff --git a/nui/radar.html b/nui/radar.html index 2b8b084..172f60f 100644 --- a/nui/radar.html +++ b/nui/radar.html @@ -4,7 +4,8 @@ -
+ +
@@ -175,15 +176,47 @@

Radar Position

-
-
-
-
+
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+
-
-
-
-
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
diff --git a/nui/radar.js b/nui/radar.js index 842d9b2..18bed84 100644 --- a/nui/radar.js +++ b/nui/radar.js @@ -311,6 +311,10 @@ function sendData( name, data ) { } // UI stuff +elements.closeUiBtn.click( function() { + toggleUISettings(); +} ) + function toggleUISettings() { elements.uiSettingsBox.fadeToggle(); @@ -323,6 +327,15 @@ function hideUISettings() } } +elements.uiSettingsBox.find( "button" ).each( function( i, obj ) { + if ( $( this ).attr( "data-value" ) ) { + $( this ).click( function() { + let align = $( this ).data( "value" ); + elements.radar.removeClass().addClass( align ); + } ) + } +} ); + // This runs when the JS file is loaded, loops through all of the remote buttons and assigns them an onclick function elements.remote.find( "button" ).each( function( i, obj ) { if ( $( this ).attr( "data-nuitype" ) ) {