fix report
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user