clothe shop test, Report Error Msg
This commit is contained in:
@@ -55,9 +55,9 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
let mainMenu = null;
|
let mainMenu = null;
|
||||||
let categoryMenu = null;
|
let categoryMenu = null;
|
||||||
|
|
||||||
let categoryMenus = [];
|
|
||||||
let clotheMenus = [];
|
let clotheMenus = [];
|
||||||
|
|
||||||
|
|
||||||
let clothingData = [];
|
let clothingData = [];
|
||||||
let currentMenuIdx = -1;
|
let currentMenuIdx = -1;
|
||||||
let menuTransition = false; // workaround for ItemSelect event being called twice between menu transitions
|
let menuTransition = false; // workaround for ItemSelect event being called twice between menu transitions
|
||||||
@@ -155,9 +155,9 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
var cloth = [];
|
var cloth = [];
|
||||||
var tx = [];
|
var tx = [];
|
||||||
|
|
||||||
if (Object.keys(categoryMenus).length > 0) {
|
if (Object.keys(clotheMenus).length > 0) {
|
||||||
for (var i = 0; i < categoryMenus.length; i++) {
|
for (var i = 0; i < clotheMenus.length; i++) {
|
||||||
if (categoryMenus[i].slotIdx == key) {
|
if (clotheMenus[i].slotIdx == key) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -210,13 +210,6 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
categoryMenus.push({
|
|
||||||
menu: categoryMenu,
|
|
||||||
type: type,
|
|
||||||
slotIdx: Number(key),
|
|
||||||
item: cloth,
|
|
||||||
texture: tx
|
|
||||||
});
|
|
||||||
clotheMenus.push({
|
clotheMenus.push({
|
||||||
menu: clotheSubMenu,
|
menu: clotheSubMenu,
|
||||||
type: type,
|
type: type,
|
||||||
@@ -224,10 +217,11 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
item: cloth,
|
item: cloth,
|
||||||
texture: tx
|
texture: tx
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function submenuItemChangeHandler(newIndex) {
|
function submenuItemChangeHandler(newIndex) {
|
||||||
const currentMenu = categoryMenus[currentMenuIdx];
|
const currentMenu = clotheMenus[currentMenuIdx];
|
||||||
const currentItem = currentMenu.item[newIndex];
|
const currentItem = currentMenu.item[newIndex];
|
||||||
const currentTexture = currentMenu.texture[newIndex].id;
|
const currentTexture = currentMenu.texture[newIndex].id;
|
||||||
//const currentItem = clothingData[currentMenu.type][currentMenu.slotIdx][newIndex];
|
//const currentItem = clothingData[currentMenu.type][currentMenu.slotIdx][newIndex];
|
||||||
@@ -284,7 +278,7 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
if (dist > 3) {
|
if (dist > 3) {
|
||||||
clearInterval(myVar);
|
clearInterval(myVar);
|
||||||
resetPreview();
|
resetPreview();
|
||||||
if (currentMenuIdx !== -1) categoryMenus[currentMenuIdx].menu.Close();
|
if (currentMenuIdx !== -1) clotheMenus[currentMenuIdx].menu.Close();
|
||||||
if (mainMenu && mainMenu.Visible) mainMenu.Close();
|
if (mainMenu && mainMenu.Visible) mainMenu.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -323,7 +317,7 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
mp.gui.chat.show(false);
|
mp.gui.chat.show(false);
|
||||||
|
|
||||||
// Reset some variables
|
// Reset some variables
|
||||||
categoryMenus = [];
|
clotheMenus = [];
|
||||||
currentMenuIdx = -1;
|
currentMenuIdx = -1;
|
||||||
menuTransition = false;
|
menuTransition = false;
|
||||||
lastClothing = null;
|
lastClothing = null;
|
||||||
@@ -346,7 +340,7 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
// for (const [key, value] of Object.entries(clothingData.props)) addClothingItems("props", bannerSprite, key, value);
|
// for (const [key, value] of Object.entries(clothingData.props)) addClothingItems("props", bannerSprite, key, value);
|
||||||
|
|
||||||
// Submenu events
|
// Submenu events
|
||||||
for (const item of categoryMenus) {
|
for (const item of clotheMenus) {
|
||||||
// Preview hovering item
|
// Preview hovering item
|
||||||
item.menu.IndexChange.on(submenuItemChangeHandler);
|
item.menu.IndexChange.on(submenuItemChangeHandler);
|
||||||
|
|
||||||
@@ -357,7 +351,7 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentMenu = categoryMenus[currentMenuIdx];
|
const currentMenu = clotheMenus[currentMenuIdx];
|
||||||
const currentItem = currentMenu.item[itemIndex];
|
const currentItem = currentMenu.item[itemIndex];
|
||||||
const currentTexture = currentMenu.texture[itemIndex].id;
|
const currentTexture = currentMenu.texture[itemIndex].id;
|
||||||
if (currentMenu.slotIdx == 11) {
|
if (currentMenu.slotIdx == 11) {
|
||||||
@@ -390,7 +384,7 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
|
|
||||||
// Main menu events
|
// Main menu events
|
||||||
mainMenu.ItemSelect.on((selectedItem, itemIndex) => {
|
mainMenu.ItemSelect.on((selectedItem, itemIndex) => {
|
||||||
const nextMenu = categoryMenus[itemIndex];
|
const nextMenu = clotheMenus[itemIndex];
|
||||||
const slot = Number(nextMenu.slotIdx);
|
const slot = Number(nextMenu.slotIdx);
|
||||||
|
|
||||||
lastClothing = {
|
lastClothing = {
|
||||||
@@ -460,7 +454,7 @@ export default function clotheShopList(globalData: IGlobalData) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mp.events.add("clothesMenu:close", () => {
|
mp.events.add("clothesMenu:close", () => {
|
||||||
if (currentMenuIdx !== -1) categoryMenus[currentMenuIdx].menu.Close();
|
if (currentMenuIdx !== -1) clotheMenus[currentMenuIdx].menu.Close();
|
||||||
if (mainMenu && mainMenu.Visible) mainMenu.Close();
|
if (mainMenu && mainMenu.Visible) mainMenu.Close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ namespace ReallifeGamemode.Server.Report
|
|||||||
|
|
||||||
if (listReports.Count == 0)
|
if (listReports.Count == 0)
|
||||||
{
|
{
|
||||||
|
ChatService.ErrorMessage(client, "Im Moment gibt es keine Tickets.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
User user = client.GetUser();
|
User user = client.GetUser();
|
||||||
|
|||||||
Reference in New Issue
Block a user