fix report

This commit is contained in:
hydrant
2019-09-03 20:15:46 +02:00
parent 616516fa3a
commit bda4342076
2 changed files with 12 additions and 14 deletions

View File

@@ -96,21 +96,13 @@ export default function reportList(globalData: GlobalData) {
var types = ["Quick Report", "Ticket Report"];
reportMenu = new Menu("QuickReport/Ticket", "", new Point(50, 50), null, null);
reportMenu.AddItem(new UIMenuListItem("Typ", "", new ItemsCollection(types)));
var typesItem = new UIMenuListItem("Typ", "", new ItemsCollection(types));
reportMenu.AddItem(typesItem);
reportMenu.AddItem(sendItem);
reportMenu.AddItem(cancelItem);
reportMenu.Visible = true;
reportMenu.ListChange.on((item, index) => {
switch (item.Text) {
case "Absenden":
type = String(item.SelectedItem.DisplayText);
break;
}
});
reportMenu.ItemSelect.on((item) => {
if (item.Text === "Absenden") {
@@ -118,7 +110,12 @@ export default function reportList(globalData: GlobalData) {
ticketContentBox.show();
ticketContentBox.getValue(data => {
var content = data;
var type = typesItem.SelectedItem.DisplayText;
var content = JSON.stringify(data);
mp.gui.chat.push(content);
mp.gui.chat.push(type);
mp.events.callRemote("requestReport", type, content);
mp.events.call("SERVER:CloseReportMenu");