From 1d82b3f3e210e6355c25d2b61303e9816b379ea8 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sat, 14 Mar 2020 00:21:35 +0100 Subject: [PATCH] =?UTF-8?q?Weaponschein=20im=20Interaktionsmen=C3=BC=20anz?= =?UTF-8?q?eigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Interaction/interactionmenu.ts | 12 ++++++++++-- ReallifeGamemode.Client/global.d.ts | 1 + ReallifeGamemode.Server/DrivingSchool/Licenses.cs | 6 +++++- ReallifeGamemode.Server/Events/Key.cs | 2 +- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ReallifeGamemode.Client/Interaction/interactionmenu.ts b/ReallifeGamemode.Client/Interaction/interactionmenu.ts index bcf29078..a3caeb76 100644 --- a/ReallifeGamemode.Client/Interaction/interactionmenu.ts +++ b/ReallifeGamemode.Client/Interaction/interactionmenu.ts @@ -181,12 +181,20 @@ export default function (globalData: GlobalData) { } licenseMenu.AddItem(menuItem); + menuItem = new UIMenuItem("Waffenschein"); + if (data.weaponLicense == false) { + menuItem.SetRightLabel("~r~nicht erhalten"); + } else if (data.weaponLicense == true) { + menuItem.SetRightLabel("~g~erhalten"); + } + licenseMenu.AddItem(menuItem); + licenseMenu.AddItem(new UIMenuItem("Lizenzen an Spieler zeigen")); licenseMenu.Visible = false; licenseMenu.ItemSelect.on((item, index) => { - if (index === 3) { + if (index === 4) { var input = new InputHelper("Welchen Spieler möchtest du deine Lizenzen zeigen (Name / ID)?", globalData); input.show(); input.getValue(name => { @@ -269,5 +277,5 @@ export default function (globalData: GlobalData) { return servicesMenu; } - + } diff --git a/ReallifeGamemode.Client/global.d.ts b/ReallifeGamemode.Client/global.d.ts index e50d8282..c4fa47e0 100644 --- a/ReallifeGamemode.Client/global.d.ts +++ b/ReallifeGamemode.Client/global.d.ts @@ -33,6 +33,7 @@ declare interface Licenses { drivingLicenseCar: boolean; drivingLicenseBike: boolean; flightLicensePlane: boolean; + weaponLicense: boolean; } declare interface FactionRanks { diff --git a/ReallifeGamemode.Server/DrivingSchool/Licenses.cs b/ReallifeGamemode.Server/DrivingSchool/Licenses.cs index 93745523..0e104bed 100644 --- a/ReallifeGamemode.Server/DrivingSchool/Licenses.cs +++ b/ReallifeGamemode.Server/DrivingSchool/Licenses.cs @@ -16,12 +16,16 @@ namespace ReallifeGamemode.Server.DrivingSchool [JsonProperty("flightLicensePlane")] public bool PlaneLicense { get; set; } + [JsonProperty("weaponLicense")] + public bool WeaponLicense { get; set; } - public Licenses(bool CarLicense, bool BikeLicense, bool PlaneLicense) + + public Licenses(bool CarLicense, bool BikeLicense, bool PlaneLicense, bool weaponLicense) { this.CarLicense = CarLicense; this.BikeLicense = BikeLicense; this.PlaneLicense = PlaneLicense; + this.WeaponLicense = weaponLicense; } } diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 1a234e13..4a77e1f2 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -113,7 +113,7 @@ namespace ReallifeGamemode.Server.Events Paycheck paycheck = null; if (Economy.Paychecks.ContainsKey(u.Id)) paycheck = Economy.Paychecks[u.Id]; - Licenses licenses = new Licenses(u.DriverLicenseVehicle, u.DriverLicenseBike, u.FlyingLicensePlane); + Licenses licenses = new Licenses(u.DriverLicenseVehicle, u.DriverLicenseBike, u.FlyingLicensePlane, u.WeaponLicense); var accountData = new {