[+] Add Bikes to Driving School
//Driving School finished
This commit is contained in:
71
ReallifeGamemode.Client/Interaction/drivingschool.ts
Normal file
71
ReallifeGamemode.Client/Interaction/drivingschool.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import * as NativeUI from 'NativeUI';
|
||||
|
||||
const Menu = NativeUI.Menu;
|
||||
const UIMenuItem = NativeUI.UIMenuItem;
|
||||
const UIMenuListItem = NativeUI.UIMenuListItem;
|
||||
const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem;
|
||||
const BadgeStyle = NativeUI.BadgeStyle;
|
||||
const Point = NativeUI.Point;
|
||||
const ItemsCollection = NativeUI.ItemsCollection;
|
||||
const Color = NativeUI.Color;
|
||||
|
||||
let screenRes = mp.game.graphics.getScreenResolution(0, 0);
|
||||
let saveItem = new UIMenuItem("Bestätigen", "");
|
||||
saveItem.BackColor = new Color(13, 71, 161);
|
||||
saveItem.HighlightedBackColor = new Color(25, 118, 210);
|
||||
|
||||
let cancelItem = new UIMenuItem("Abbrechen", "");
|
||||
cancelItem.BackColor = new Color(213, 0, 0);
|
||||
cancelItem.HighlightedBackColor = new Color(229, 57, 53);
|
||||
|
||||
export default function drivingSchoolList(globalData: GlobalData) {
|
||||
|
||||
var drivingMenu: NativeUI.Menu;
|
||||
|
||||
var stages;
|
||||
|
||||
var stage = "";
|
||||
|
||||
|
||||
//Weapon Menu
|
||||
|
||||
mp.events.add('showDrivingSchoolSelector', () => {
|
||||
if (!globalData.InMenu) {
|
||||
|
||||
globalData.InMenu = true;
|
||||
|
||||
drivingMenu = new Menu("Fahrschule", "", new Point(50, 50), null, null);
|
||||
|
||||
|
||||
drivingMenu.AddItem(new UIMenuListItem("Prüfung", "", new ItemsCollection(["Auto", "Motorrad"])));
|
||||
|
||||
drivingMenu.AddItem(saveItem);
|
||||
drivingMenu.AddItem(cancelItem);
|
||||
drivingMenu.Visible = true;
|
||||
|
||||
drivingMenu.ListChange.on((item, index) => {
|
||||
switch (item.Text) {
|
||||
case "Prüfung":
|
||||
stage = String(item.SelectedItem.DisplayText);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
drivingMenu.ItemSelect.on((item) => {
|
||||
if (item.Text === "Auto") {
|
||||
mp.events.callRemote("startDrivingSchool");
|
||||
drivingMenu.Close();
|
||||
globalData.InMenu = false;
|
||||
} else if (item.Text === "Motorrad") {
|
||||
mp.events.callRemote("startBikeSchool");
|
||||
drivingMenu.Close();
|
||||
globalData.InMenu = false;
|
||||
}
|
||||
});
|
||||
|
||||
drivingMenu.MenuClose.on(() => {
|
||||
globalData.InMenu = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user