Finished migration to TypeScript, temporary disabled char creator

This commit is contained in:
hydrant
2019-03-11 22:17:49 +01:00
parent 715cf3c1e6
commit 8ce3fd6f52
71 changed files with 4800 additions and 4627 deletions

View File

@@ -0,0 +1,63 @@
import * as NativeUI from 'NativeUI';
const Menu = NativeUI.Menu;
const UIMenuItem = NativeUI.UIMenuItem;
const UIMenuListItem = NativeUI.UIMenuListItem;
const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem;
const UIMenuSliderItem = NativeUI.UIMenuSliderItem;
const BadgeStyle = NativeUI.BadgeStyle;
const Point = NativeUI.Point;
const ItemsCollection = NativeUI.ItemsCollection;
const Color = NativeUI.Color;
const ListItem = NativeUI.ListItem;
import moneyFormat from '../moneyformat';
export default function carDealer() {
var shopMenu;
mp.events.add('ShopVehicle_OpenMenu', (businessName, price) => {
var veh = mp.players.local.vehicle;
if (!veh) return;
mp.gui.chat.show(false);
shopMenu = new Menu("Fahrzeugkauf", "Kaufe ein neues Auto", new Point(50, 50), null, null);
var carItem = new UIMenuItem("Fahrzeugname");
carItem.SetRightLabel(mp.game.ui.getLabelText(mp.game.vehicle.getDisplayNameFromVehicleModel(veh.model)));
shopMenu.AddItem(carItem);
var shopItem = new UIMenuItem("Autohaus");
shopItem.SetRightLabel(businessName);
shopMenu.AddItem(shopItem);
var priceItem = new UIMenuItem("Preis");
priceItem.SetRightLabel("~g~$~s~ " + moneyFormat(price));
shopMenu.AddItem(priceItem);
var saveItem = new UIMenuItem("Kaufen");
saveItem.BackColor = new Color(0, 100, 0);
saveItem.HighlightedBackColor = new Color(0, 150, 0);
shopMenu.AddItem(saveItem);
var cancelItem = new UIMenuItem("Abbrechen");
cancelItem.BackColor = new Color(213, 0, 0);
cancelItem.HighlightedBackColor = new Color(229, 57, 53);
shopMenu.AddItem(cancelItem);
shopMenu.ItemSelect.on((item, index) => {
if (item === cancelItem) {
shopMenu.Close();
} else if (item === saveItem) {
mp.events.callRemote("VehShop_BuyVehicle");
shopMenu.Close();
}
});
shopMenu.MenuClose.on(() => {
mp.gui.chat.show(true);
mp.players.local.taskLeaveVehicle(veh.handle, 0);
});
shopMenu.Open();
});
}