Fixed buggy UI black screen

Co-Authored-By: benjaminbra <benjamin.brasseur85@gmail.com>
This commit is contained in:
ElPumpo
2018-06-09 11:59:54 +02:00
parent 934ca309ff
commit 1bc9e5ede6
7 changed files with 33 additions and 58 deletions
+20 -8
View File
@@ -1,25 +1,37 @@
# esx_identity
[REQUIREMENTS]
## Requirements
* Dependencies For Full Functionality
* [esx_skin](https://github.com/ESX-Org/esx_skin)
* [esx_policejob](https://github.com/ESX-Org/esx_policejob)
* [esx_society](https://github.com/ESX-Org/esx_society)
[INSTALLATION]
## Download & Installation
1) Install To resources/[esx]/esx_identity
`<< MUST BE INSTALLED HERE`
2) Import esx_identity.sql in your database
### Using [fvm](https://github.com/qlaffont/fvm-installer)
```
fvm install --save --folder=esx esx-org/esx_identity
```
3) Add this in your server.cfg :
### Using Git
```
cd resources
git clone https://github.com/ESX-Org/esx_identity [esx]/esx_identity
```
### Manually
- Download https://github.com/ESX-Org/esx_identity/archive/master.zip
- Put it in the `[esx]` directory
## Installation
- Import `esx_identity.sql` in your database
- Add this to your `server.cfg`:
```
start esx_identity
```
4) If you are using esx_policejob or esx_society, you need to enable the following in the files config.lua:
- If you are using esx_policejob or esx_society, you need to enable the following in the scripts' `config.lua`:
```Config.EnableESXIdentity = true```
### Commands
+9 -5
View File
@@ -2,9 +2,7 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
description 'ESX Identity'
version '1.0.3'
client_script 'client/main.lua'
version '1.1.0'
server_scripts {
'@mysql-async/lib/MySQL.lua',
@@ -12,11 +10,17 @@ server_scripts {
'server/main.lua'
}
client_scripts {
'@es_extended/locale.lua',
'client/main.lua'
}
ui_page 'html/index.html'
files {
'html/index.html',
'html/script.js',
'html/style.css',
'html/cursor.png'
'html/style.css'
}
dependency 'es_extended'
+4 -10
View File
@@ -11,13 +11,13 @@ Citizen.CreateThread(function()
end
end)
function EnableGui(enable)
SetNuiFocus(enable)
guiEnabled = enable
function EnableGui(state)
SetNuiFocus(state, state)
guiEnabled = state
SendNUIMessage({
type = "enableui",
enable = enable
enable = state
})
end
@@ -105,12 +105,6 @@ Citizen.CreateThread(function()
DisableControlAction(0, 143, true) -- disable melee
DisableControlAction(0, 75, true) -- disable exit vehicle
DisableControlAction(27, 75, true) -- disable exit vehicle
if IsDisabledControlJustReleased(0, 142) then -- MeleeAttackAlternate
SendNUIMessage({
type = "click"
})
end
end
Citizen.Wait(10)
end
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

-1
View File
@@ -5,7 +5,6 @@
</head>
<body>
<img id="cursor" src="cursor.png">
<div class="dialog">
<form id="register">
<h1>Register</h1>
-27
View File
@@ -1,37 +1,10 @@
var documentWidth = document.documentElement.clientWidth;
var documentHeight = document.documentElement.clientHeight;
var cursor = document.getElementById("cursor");
var cursorX = documentWidth / 2;
var cursorY = documentHeight / 2;
function UpdateCursorPos() {
cursor.style.left = cursorX;
cursor.style.top = cursorY;
}
function Click(x, y) {
var element = $(document.elementFromPoint(x, y));
element.focus().click();
}
$(function() {
window.addEventListener('message', function(event) {
if (event.data.type == "enableui") {
cursor.style.display = event.data.enable ? "block" : "none";
document.body.style.display = event.data.enable ? "block" : "none";
} else if (event.data.type == "click") {
// Avoid clicking the cursor itself, click 1px to the top/left;
Click(cursorX - 1, cursorY - 1);
}
});
$(document).mousemove(function(event) {
cursorX = event.pageX;
cursorY = event.pageY;
UpdateCursorPos();
});
document.onkeyup = function (data) {
if (data.which == 27) { // Escape key
$.post('http://esx_identity/escape', JSON.stringify({}));
-7
View File
@@ -1,10 +1,3 @@
#cursor {
position: absolute;
z-index: 999999;
display: none;
}
/* Required */
body {
font-family: sans-serif;
overflow: hidden;