Skip to content

Commit 2d76c47

Browse files
committed
tweak(web/cursor): Use FiveM provided cursor for loadscreens
Added in citizenfx/fivem@517c63e. This is a better alternative than the svg based cursor
1 parent 8513653 commit 2d76c47

7 files changed

Lines changed: 3 additions & 41 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ The config can be found in `web/config.js`. This holds a plethora of configurati
4242
| TIP_CHANGE_INTERVAL | The interval (ms) at which Tips change automatically | `TIP_CHANGE_INTERVAL = 12000` |
4343
| BACKGROUND_CHANGE_INTERVAL | The interval (ms) at which backgrounds automatically switch | `BACKGROUND_CHANGE_INTERVAL = 15000` |
4444
| BACKGROUND_IMAGES | An array of file names for images present in the `web/backgrounds` folder. | `BACKGROUND_IMAGES = ["1.jpg","2.jpg"]`
45-
| ENABLE_CURSOR | Whether to enable the cursor while in the loading screen | `ENABLE_CURSOR = false`
4645
| ENABLE_GFM_MARKDOWN | Whether to enable the `Github Flavored Markdown` spec for the parser | `ENABLE_GFM_MARKDOWN = true`
4746
| ENABLE_SERVER_LOGO | Whether to enable the server logo | `ENABLE_SERVER_LOGO = true`
4847
| SERVER_LOGO_POSITION | Where to place logo if enabled | `SERVER_LOGO_POSITION = 'top-left'`

fxmanifest.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ loadscreen 'web/index.html'
1010

1111
client_script 'client.lua'
1212

13+
loadscreen_cursor 'yes'
14+
1315
loadscreen_manual_shutdown 'yes'
1416

1517
files {

web/assets/images/cursor.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

web/assets/script.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
TIP_CHANGE_INTERVAL,
33
BACKGROUND_CHANGE_INTERVAL,
44
BACKGROUND_IMAGES,
5-
ENABLE_CURSOR,
65
SERVER_LOGO_POSITION,
76
ENABLE_SERVER_LOGO,
87
MUSIC_ENABLED, SERVER_LOGO_FILE_NAME
@@ -167,21 +166,4 @@ const leftArrow = document.getElementById('tip-left-arrow')
167166
const rightArrow = document.getElementById('tip-right-arrow')
168167

169168
leftArrow.addEventListener('click', showPrevTip)
170-
rightArrow.addEventListener('click', showNextTip)
171-
172-
if (ENABLE_CURSOR) {
173-
const cursor = document.getElementById('cursor')
174-
175-
cursor.style.visibility = 'visible'
176-
177-
window.addEventListener("mousemove", e => {
178-
// These offsets are related to the size of the SVG
179-
// for now this is fine
180-
const x = e.pageX - cursor.offsetWidth + 20
181-
const y = e.pageY - 2
182-
183-
cursor.style.left = `${x}px`
184-
cursor.style.top = `${y}px`
185-
})
186-
187-
}
169+
rightArrow.addEventListener('click', showNextTip)

web/assets/styles.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,6 @@ a[onclick] {
4848
--main-bg: rgba(0, 0, 0, 0.85)
4949
}
5050

51-
#cursor {
52-
width: 30px;
53-
height: 30px;
54-
pointer-events: none;
55-
top: 0;
56-
left: 0;
57-
visibility: hidden;
58-
background-image: url("images/cursor.svg");
59-
background-position: center;
60-
position: absolute;
61-
z-index: 999999;
62-
}
63-
6451
#bgImg {
6552
background-image: url(../backgrounds/1.jpg);
6653
transition: background 1.5s linear;

web/config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ export const MUSIC_FILE_NAME = 'music.mp3'
5353

5454
export const MUSIC_START_VOLUME = 0.3
5555

56-
// Whether we should enable the cursor for the loadscreen
57-
export const ENABLE_CURSOR = true
58-
5956
// Enable github flavored markdown
6057
export const ENABLE_GFM_MARKDOWN = false
6158

web/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<audio id="loadscreen-music" autoplay="autoplay" autostart loop preload src="">
1818
</audio>
1919
<div id="page-wrapper">
20-
<div id="cursor"></div>
2120
<div id="bgImg"></div>
2221
<div id="server-logo"></div>
2322
<div id="audio-controls">

0 commit comments

Comments
 (0)