weaponschein fertig
This commit is contained in:
41
ReallifeGamemode.Client/Gui/policedepartment.ts
Normal file
41
ReallifeGamemode.Client/Gui/policedepartment.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import game from "..";
|
||||
import { Key } from "../game";
|
||||
import { Menu, Point, UIMenuItem } from "../libs/NativeUI";
|
||||
import { createMenuItem } from "../util";
|
||||
import moneyformat from "../moneyformat";
|
||||
|
||||
var menu: Menu = new Menu("Polizeirevier", "Die Hilfestelle der Polizei", new Point(50, 50));
|
||||
|
||||
menu.AddItem(createMenuItem("Waffenschein kaufen", "Erwerbe einen Waffenschein", (item) => {
|
||||
item.SetRightLabel("$" + moneyformat(5000));
|
||||
}));
|
||||
|
||||
menu.Close();
|
||||
|
||||
menu.ItemSelect.on((item, index: number) => {
|
||||
game.events.callServer("PoliceDepartment_MenuSelect", index);
|
||||
menu.Close();
|
||||
});
|
||||
|
||||
menu.MenuClose.on(() => {
|
||||
game.ui.inMenu = false;
|
||||
});
|
||||
|
||||
game.events.add("SERVER:PoliceDepartment_EnterColShape", () => {
|
||||
game.ui.setHelpText("Drücke ~INPUT_CONTEXT~, um das Menü des Polizeireviers zu öffnen");
|
||||
|
||||
game.events.bindKey(Key.E, false, keyPressHandler);
|
||||
});
|
||||
|
||||
game.events.add("SERVER:PoliceDepartment_ExitColShape", () => {
|
||||
game.ui.clearHelpText();
|
||||
game.events.unbindKey(Key.E, false, keyPressHandler);
|
||||
|
||||
menu.Close();
|
||||
});
|
||||
|
||||
function keyPressHandler() {
|
||||
game.ui.clearHelpText();
|
||||
game.ui.inMenu = true;
|
||||
menu.Open();
|
||||
}
|
||||
@@ -141,6 +141,7 @@ export default function keys(globalData: GlobalData) {
|
||||
|
||||
//2 // Job Starten
|
||||
mp.keys.bind(0x4A, false, () => {
|
||||
mp.gui.chat.push("inchat: " + globalData.InChat + " inInput: " + globalData.InInput + " inMenu: " + globalData.InMenu + " LoggedIn: " + globalData.LoggedIn);
|
||||
if (!globalData.InChat && !globalData.InInput && !globalData.InMenu && globalData.LoggedIn) {
|
||||
mp.events.callRemote("CLIENT:JobManager_ShowJobMenu");
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<p id="0"></p>
|
||||
<p id="1"></p>
|
||||
<p id="2"></p>
|
||||
<p id="3"></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -11,13 +11,15 @@ function add_licenses(info) {
|
||||
console.log(infoArr);
|
||||
for (var i = 0; i < infoArr.length; i++) {
|
||||
var Schein = "";
|
||||
if (infoArr[i] == true) {
|
||||
if (i == 0) {
|
||||
if (infoArr[i] === true) {
|
||||
if (i === 0) {
|
||||
Schein = "Auto";
|
||||
} else if (i == 1) {
|
||||
} else if (i === 1) {
|
||||
Schein = "Motorrad";
|
||||
} else if (i == 2) {
|
||||
} else if (i === 2) {
|
||||
Schein = "Flugzeug";
|
||||
} else if (i === 3) {
|
||||
Schein = "Waffen";
|
||||
}
|
||||
}
|
||||
$('#'+i).append(""+Schein);
|
||||
|
||||
@@ -32,7 +32,7 @@ export default class RageEvents implements IEvents {
|
||||
}
|
||||
|
||||
callServer(event: string, args?: any[] | any): void {
|
||||
if (args) {
|
||||
if (args !== null) {
|
||||
if (typeof args === 'object') {
|
||||
args.push(event);
|
||||
} else {
|
||||
@@ -41,7 +41,10 @@ export default class RageEvents implements IEvents {
|
||||
} else {
|
||||
args = [event];
|
||||
}
|
||||
mp.events.callRemote('CLIENT:Event', JSON.stringify(args));
|
||||
|
||||
var params = JSON.stringify(args);
|
||||
|
||||
mp.events.callRemote('CLIENT:Event', params);
|
||||
}
|
||||
|
||||
bindKey(key: Key, hold: boolean, callback: Function) {
|
||||
|
||||
@@ -2,6 +2,14 @@ import { IUi, IBrowser } from "../../game";
|
||||
import { Menu } from "../../libs/NativeUI/index";
|
||||
|
||||
export default class RageUi implements IUi {
|
||||
setHelpText(text: string): void {
|
||||
mp.game.ui.setTextComponentFormat('STRING');
|
||||
mp.game.ui.addTextComponentSubstringPlayerName(text);
|
||||
mp.game.ui.displayHelpTextFromStringLabel(0, true, true, -1);
|
||||
}
|
||||
clearHelpText(): void {
|
||||
mp.game.ui.clearHelp(true);
|
||||
}
|
||||
private _inMenu: boolean = false;
|
||||
private _activeMenu: Menu = null;
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ interface IUi {
|
||||
openBrower(path: string): IBrowser;
|
||||
setCursor(freeze: boolean, show: boolean): void;
|
||||
toggleChat(toggle: boolean): void;
|
||||
setHelpText(text: string): void;
|
||||
clearHelpText(): void;
|
||||
inMenu: boolean;
|
||||
inChat: boolean;
|
||||
}
|
||||
@@ -98,7 +100,8 @@ enum Key {
|
||||
ENTER = 0x0D,
|
||||
M = 0x4D,
|
||||
T = 0x54,
|
||||
X = 0x58
|
||||
X = 0x58,
|
||||
E = 0x45
|
||||
}
|
||||
|
||||
enum VehicleSeat {
|
||||
|
||||
@@ -167,7 +167,7 @@ import smoothThrottle from './vehiclesync/smoothtrottle';
|
||||
smoothThrottle();
|
||||
|
||||
import vehicleIndicators from './vehiclesync/vehicleindicators';
|
||||
vehicleIndicators();
|
||||
vehicleIndicators();
|
||||
|
||||
import reportList from './Player/reportmenu';
|
||||
reportList(globalData);
|
||||
@@ -202,6 +202,8 @@ itemShopList(globalData);
|
||||
import taximeterInput from './Gui/taximeter';
|
||||
taximeterInput(globalData);
|
||||
|
||||
require('./Gui/policedepartment');
|
||||
|
||||
interface VehicleData {
|
||||
EngineState: boolean;
|
||||
Locked: boolean;
|
||||
|
||||
Reference in New Issue
Block a user