This repository has been archived by the owner on Jun 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Init New Inventory Functions * not inventory stuff, but putting it here because why not * Additional WebSocket Changes * Debug Plugin
- Loading branch information
Showing
22 changed files
with
1,081 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as alt from 'alt-client'; | ||
|
||
const fontsToLoad = [ | ||
{ | ||
path: '/client/rmlui/fonts/arialbd.ttf', // Only supports TTF | ||
name: 'arial', | ||
italic: false, | ||
bold: false, | ||
}, | ||
]; | ||
|
||
for (let i = 0; i < fontsToLoad.length; i++) { | ||
if (!fontsToLoad[i].path.includes('ttf')) { | ||
console.warn(`Could not load Font: ${fontsToLoad[i].path}. TTF only fonts.`); | ||
continue; | ||
} | ||
|
||
try { | ||
alt.loadRmlFont(fontsToLoad[i].path, fontsToLoad[i].name, fontsToLoad[i].italic, fontsToLoad[i].bold); | ||
} catch (err) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<rml> | ||
<head> | ||
<title>Quick Input</title> | ||
<style> | ||
html, | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
overflow: hidden; | ||
} | ||
|
||
body { | ||
font-family: arial; | ||
font-style: normal; | ||
font-size: 16px; | ||
width: 100vw; | ||
box-sizing: border-box; | ||
padding-left: 25vw; | ||
padding-right: 25vw; | ||
padding-top: 75vh; | ||
} | ||
|
||
.text-input { | ||
font-family: arial; | ||
font-style: normal; | ||
font-size: 16px; | ||
width: 100%; | ||
border: 2px rgb(22, 22, 22); | ||
border-radius: 6px; | ||
min-height: 30px; | ||
background: rgba(0, 0, 0, 100); | ||
padding: 12px; | ||
color: white; | ||
box-sizing: border-box; | ||
font-effect: shadow(2px 2px black); | ||
} | ||
|
||
.invisible { | ||
font-family: arial; | ||
font-style: normal; | ||
font-size: 16px; | ||
/* height: 0px; | ||
opacity: 0; */ | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<form id="form" onsubmit="submit"> | ||
<input class="text-input" id="input" onchange="(e) => console.log(e)" tabindex="0" /> | ||
<input class="invisible" type="submit" value="submit">Submit</input> | ||
</form> | ||
</body> | ||
</rml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import alt, { RmlElement } from 'alt-client'; | ||
import { SYSTEM_EVENTS } from '../../../shared/enums/system'; | ||
import { disableAllControls } from '../../utility/disableControls'; | ||
|
||
let document: alt.RmlDocument; | ||
let form: alt.RmlElement; | ||
let input: alt.RmlElement; | ||
let callback: (result: string) => void; | ||
let currentValue = ''; | ||
|
||
class Internal { | ||
static init() { | ||
document = new alt.RmlDocument('/client/rmlui/input/index.rml'); | ||
document.hide(); | ||
} | ||
|
||
static handleKey(key: number) { | ||
if (key === 13) { | ||
} | ||
|
||
// Closing | ||
if (key !== 27) { | ||
return; | ||
} | ||
|
||
disableAllControls(false); | ||
alt.toggleRmlControls(false); | ||
alt.off('keyup', Internal.handleKey); | ||
input.off('textinput', Internal.handleInput); | ||
callback(''); | ||
document.hide(); | ||
} | ||
|
||
static handleInput(element: alt.RmlElement, text: string) { | ||
console.log('submitted'); | ||
console.log(text); | ||
|
||
// disableAllControls(false); | ||
// alt.toggleRmlControls(false); | ||
// alt.off('keyup', Internal.handleKey); | ||
// input.off('textinput', Internal.handleInput); | ||
// callback(''); | ||
// document.hide(); | ||
} | ||
} | ||
|
||
export class QuickInput { | ||
static open(_callback: (result: string) => void) { | ||
if (callback) { | ||
alt.logWarning(`Tried to Open Quick Input when Input is Already Open`); | ||
return; | ||
} | ||
|
||
callback = _callback; | ||
document.show(); | ||
form = document.getElementByID('form'); | ||
input = document.getElementByID('input'); | ||
|
||
input.focus(); | ||
alt.on('keyup', Internal.handleKey); | ||
form.on('submit', (e, args) => { | ||
console.log(e); | ||
console.log(args); | ||
}); | ||
|
||
form.on('onsubmit', (e, args) => { | ||
console.log(e); | ||
console.log(args); | ||
}); | ||
|
||
form.on('customevent', (e, args) => { | ||
console.log(e); | ||
console.log(args); | ||
}); | ||
|
||
alt.nextTick(() => { | ||
alt.toggleGameControls(false); | ||
alt.toggleRmlControls(true); | ||
alt.showCursor(true); | ||
disableAllControls(true); | ||
}); | ||
} | ||
} | ||
|
||
// Internal.init(); | ||
|
||
// alt.onServer(SYSTEM_EVENTS.TICKS_START, async () => { | ||
// await alt.Utils.wait(2000); | ||
|
||
// QuickInput.open((result) => { | ||
// console.log(`Final Text: ${result}`); | ||
// }); | ||
// }); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +0,0 @@ | ||
import * as alt from 'alt-client'; | ||
import * as native from 'natives'; | ||
import MinimapHelper from './minimap'; | ||
import { drawRectangle2D, drawText2D } from './text'; | ||
// TODO: Still in Usage? Can't tell properly, so i'll keep it for now. | ||
|
||
// const polygon = new Polygon([ | ||
// { x: -1498.1483154296875, y: -677.0752563476562, z: 28.048023223876953 }, | ||
// { x: -1491.2274169921875, y: -671.2970581054688, z: 28.943195343017578 }, | ||
// { x: -1498.2650146484375, y: -664.248291015625, z: 29.025087356567383 }, | ||
// { x: -1463.30908203125, y: -638.9778442382812, z: 29.582916259765625 }, | ||
// { x: -1452.80712890625, y: -652.8944091796875, z: 29.582338333129883 }, | ||
// { x: -1478.6595458984375, y: -672.8909301757812, z: 29.041839599609375 }, | ||
// { x: -1481.732421875, y: -672.94677734375, z: 28.943140029907227 }, | ||
// { x: -1493.603271484375, y: -681.1644897460938, z: 27.73985481262207 }, | ||
// { x: -1493.603271484375, y: -681.1644897460938, z: 27.73985481262207 }, | ||
// ]); | ||
|
||
// alt.setInterval(() => { | ||
// if (!polygon) { | ||
// return; | ||
// } | ||
|
||
// const lines = polygon.getDrawLines(); | ||
// for (let i = 0; i < lines.length; i++) { | ||
// const a = lines[i].a; | ||
// const b = lines[i].b; | ||
// native.drawLine(a.x, a.y, a.z, b.x, b.y, b.z, 255, 0, 0, 255); | ||
// } | ||
|
||
// const center = polygon.getCenter(); | ||
// native.drawLine(center.x, center.y, center.z, center.x, center.y, center.z + 2, 255, 0, 0, 255); | ||
|
||
// if (polygon.isInPolygon(alt.Player.local.pos)) { | ||
// drawText2D('INSIDE', { x: 0.5, y: 0.2 }, 0.4, new alt.RGBA(255, 255, 255, 100)); | ||
// } else { | ||
// drawText2D('OUTSIDE', { x: 0.5, y: 0.2 }, 0.4, new alt.RGBA(255, 255, 255, 100)); | ||
// } | ||
// }, 0); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as alt from 'alt-client'; | ||
import { SYSTEM_EVENTS } from '../../../shared/enums/system'; | ||
import { ATHENA_DEBUG_EVENTS } from '../shared/events'; | ||
|
||
alt.onServer(SYSTEM_EVENTS.TICKS_START, () => { | ||
alt.on('keyup', (key: number) => { | ||
if (key !== 112) { | ||
return; | ||
} | ||
|
||
alt.emitServer(ATHENA_DEBUG_EVENTS.ClientToServer.FORWARD); | ||
}); | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as alt from 'alt-server'; | ||
import { PluginSystem } from '../../../server/systems/plugins'; | ||
import { Keys } from './system/keys'; | ||
import { WebSocketClient } from './system/ws'; | ||
|
||
const PLUGIN_NAME = 'Athena Debug'; | ||
|
||
PluginSystem.registerPlugin(PLUGIN_NAME, () => { | ||
WebSocketClient.init(); | ||
Keys.init(); | ||
alt.log(`~lg~CORE ==> ${PLUGIN_NAME} was Loaded`); | ||
}); |
Oops, something went wrong.