Merge branch 'nightly' into ragemp
This commit is contained in:
@@ -73,8 +73,8 @@ function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, se
|
||||
|
||||
let outputString = messageString;
|
||||
if (chatTimeStampsEnabled == true) {
|
||||
//timeStampString = `{TIMESTAMPCOLOUR}[${findResourceByName("agrp_time").exports.getTimeStampOutput(timeStamp)}]{MAINCOLOUR}`;
|
||||
let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}] `;
|
||||
let colourRGBA = rgbaArrayFromToColour(colour);
|
||||
let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}][${rgbToHex(colourRGBA[0], colourRGBA[1], colourRGBA[2])}] `;
|
||||
outputString = `${timeStampString}${messageString}`;
|
||||
}
|
||||
|
||||
@@ -163,12 +163,9 @@ function updateChatBox() {
|
||||
if (typeof chatBoxHistory[i] != "undefined") {
|
||||
let outputString = chatBoxHistory[i][0];
|
||||
if (chatTimeStampsEnabled == true) {
|
||||
//let timeStampDate = new Date(chatBoxHistory[i][2]);
|
||||
//let timeStampText = `${timeStampDate.getHours()}:${timeStampDate.getMinutes()}:${timeStampDate.getSeconds()}`;
|
||||
//let timeStampText = findResourceByName("agrp_time").exports.getTimeStampOutput(chatBoxHistory[i][2]);
|
||||
let timeStampText = `${chatBoxHistory[i][2]}:${chatBoxHistory[i][3]}:${chatBoxHistory[i][4]}`;
|
||||
|
||||
outputString = `{TIMESTAMPCOLOUR}[${timeStampText}]{MAINCOLOUR} ${chatBoxHistory[i][0]}`;
|
||||
let colourRGBA = rgbaArrayFromToColour(chatBoxHistory[i][1]);
|
||||
outputString = `{TIMESTAMPCOLOUR}[${timeStampText}][${rgbToHex(colourRGBA[0], colourRGBA[1], colourRGBA[2])}] ${chatBoxHistory[i][0]}`;
|
||||
}
|
||||
|
||||
outputString = replaceColoursInMessage(outputString);
|
||||
|
||||
@@ -62,6 +62,14 @@ function initGUI() {
|
||||
initResetPasswordGUI();
|
||||
initChangePasswordGUI();
|
||||
initLocaleChooserGUI();
|
||||
//initInventoryGUI();
|
||||
//initInventoryBulkGUI();
|
||||
//initClanManagerGUI();
|
||||
//initBusinessManagerGUI();
|
||||
//initHouseManagerGUI();
|
||||
//initFiveCardPokerGUI();
|
||||
//initBettingGUI();
|
||||
//initBlackJackGUI();
|
||||
|
||||
closeAllWindows();
|
||||
guiReady = true;
|
||||
@@ -87,6 +95,14 @@ function closeAllWindows() {
|
||||
passwordReset.window.shown = false;
|
||||
passwordChange.window.shown = false;
|
||||
localeChooser.window.shown = false;
|
||||
//houseManager.window.shown = false;
|
||||
//businessManager.window.shown = false;
|
||||
//clanManager.window.shown = false;
|
||||
//inventoryGUI.window.shown = false;
|
||||
//inventoryBulkGUI.window.shown = false;
|
||||
//bettingGUI.window.shown = false;
|
||||
//blackJackGUI.window.shown = false;
|
||||
//fiveCardPokerGUI.window.shown = false;
|
||||
|
||||
mexui.setInput(false);
|
||||
mexui.focusedControl = false;
|
||||
@@ -155,6 +171,38 @@ function isAnyGUIActive() {
|
||||
return true;
|
||||
}
|
||||
|
||||
//if (clanManager.window.shown == true) {
|
||||
// return true;
|
||||
//}
|
||||
|
||||
//if (businessManager.window.shown == true) {
|
||||
// return true;
|
||||
//}
|
||||
|
||||
//if (houseManager.window.shown == true) {
|
||||
// return true;
|
||||
//}
|
||||
|
||||
//if (inventoryGUI.window.shown == true) {
|
||||
// return true;
|
||||
//}
|
||||
|
||||
//if (inventoryBulkGUI.window.shown == true) {
|
||||
// return true;
|
||||
//}
|
||||
|
||||
//if (bettingGUI.window.shown == true) {
|
||||
// return true;
|
||||
//}
|
||||
|
||||
//if (blackJackGUI.window.shown == true) {
|
||||
// return true;
|
||||
//}
|
||||
|
||||
//if (fiveCardPokerGUI.window.shown == true) {
|
||||
// return true;
|
||||
//}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// ===========================================================================
|
||||
// Asshat Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/agrp_main
|
||||
// (c) 2022 Asshat Gaming
|
||||
// ===========================================================================
|
||||
// FILE: 5cardpoker.js
|
||||
// DESC: Provides 5-card poker games GUI
|
||||
// TYPE: Client (JavaScript)
|
||||
// ===========================================================================
|
||||
40
scripts/client/gui/games/5cardpoker.js
Normal file
40
scripts/client/gui/games/5cardpoker.js
Normal file
@@ -0,0 +1,40 @@
|
||||
// ===========================================================================
|
||||
// Asshat Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/agrp_main
|
||||
// (c) 2022 Asshat Gaming
|
||||
// ===========================================================================
|
||||
// FILE: 5cardpoker.js
|
||||
// DESC: Provides 5-card poker games GUI
|
||||
// TYPE: Client (JavaScript)
|
||||
// ===========================================================================
|
||||
|
||||
let fiveCardPokerGUI = {
|
||||
window: null,
|
||||
}
|
||||
|
||||
function initFiveCardPokerGUI() {
|
||||
// Render a five card poker game in MexUI
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating five-card poker GUI ...`);
|
||||
fiveCardPokerGUI.window = mexui.window(game.width / 2 - 200, game.height - 150, 400, 400, 'Five Card Poker', {
|
||||
main: {
|
||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
|
||||
},
|
||||
title: {
|
||||
textSize: 11.0,
|
||||
textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], 255),
|
||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||
},
|
||||
icon: {
|
||||
textSize: 0.0,
|
||||
textColour: toColour(0, 0, 0, 0),
|
||||
backgroundColour: toColour(0, 0, 0, 0),
|
||||
},
|
||||
});
|
||||
fiveCardPokerGUI.window.titleBarShown = false;
|
||||
|
||||
fiveCardPokerGUI.window.shown = false;
|
||||
|
||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created five card poker GUI`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -23,7 +23,7 @@ let dealerCards = [];
|
||||
|
||||
function initBlackJackGUI() {
|
||||
// Render a blackjack game in MexUI
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating blackjack GUI ...`);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating blackjack GUI ...`);
|
||||
blackJackGUI.window = mexui.window(game.width / 2 - 200, game.height - 150, 400, 400, 'Blackjack', {
|
||||
main: {
|
||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
|
||||
@@ -43,7 +43,7 @@ function initBlackJackGUI() {
|
||||
|
||||
blackJackGUI.window.shown = false;
|
||||
|
||||
//logToConsole(LOG_DEBUG, `[AGRP.GUI] Created blackjack GUI`);
|
||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] Created blackjack GUI`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
45
scripts/client/gui/inventory.js
Normal file
45
scripts/client/gui/inventory.js
Normal file
@@ -0,0 +1,45 @@
|
||||
// ===========================================================================
|
||||
// Asshat Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/agrp_main
|
||||
// (c) 2022 Asshat Gaming
|
||||
// ===========================================================================
|
||||
// FILE: inventory.js
|
||||
// DESC: Provides inventory dialog box GUI
|
||||
// TYPE: Client (JavaScript)
|
||||
// ===========================================================================
|
||||
|
||||
let inventoryGUI = [
|
||||
{
|
||||
window: null,
|
||||
},
|
||||
{
|
||||
window: null,
|
||||
},
|
||||
];
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function initInventoryGUI() {
|
||||
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function closeAllInventoryGUI() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all inventory GUI`);
|
||||
for (let i in inventoryGUI) {
|
||||
inventoryGUI[i].window.shown = false;
|
||||
}
|
||||
mexui.setInput(false);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showInventoryGUI(inventoryIndex, items) {
|
||||
closeAllWindows();
|
||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing inventory window. Index: ${inventoryIndex}`);
|
||||
inventoryGUI[inventoryIndex].window.shown = true;
|
||||
mexui.setInput(true);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
45
scripts/client/gui/inventorybulk.js
Normal file
45
scripts/client/gui/inventorybulk.js
Normal file
@@ -0,0 +1,45 @@
|
||||
// ===========================================================================
|
||||
// Asshat Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/agrp_main
|
||||
// (c) 2022 Asshat Gaming
|
||||
// ===========================================================================
|
||||
// FILE: inventorybulk.js
|
||||
// DESC: Provides bulk inventory box GUI
|
||||
// TYPE: Client (JavaScript)
|
||||
// ===========================================================================
|
||||
|
||||
let inventoryBulkGUI = [
|
||||
{
|
||||
window: null,
|
||||
},
|
||||
{
|
||||
window: null,
|
||||
},
|
||||
];
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function initInventoryBulkGUI() {
|
||||
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function closeAllInventoryBulkGUI() {
|
||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all bulk inventory GUI`);
|
||||
for (let i in inventoryBulkGUI) {
|
||||
inventoryBulkGUI[i].window.shown = false;
|
||||
}
|
||||
mexui.setInput(false);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showInventoryBulkGUI(inventoryIndex, items) {
|
||||
closeAllWindows();
|
||||
logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing bulk inventory window. Index: ${inventoryIndex}`);
|
||||
inventoryBulkGUI[inventoryIndex].window.shown = true;
|
||||
mexui.setInput(true);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -57,9 +57,6 @@ function closeLocaleChooserGUI() {
|
||||
// ===========================================================================
|
||||
|
||||
function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
||||
// Disabled for now until image loading crash can be fixed
|
||||
//return false;
|
||||
|
||||
if (position.x != 0.0 && position.y != 0.0) {
|
||||
localeChooser.window.position = position;
|
||||
} else {
|
||||
@@ -79,7 +76,7 @@ function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
|
||||
// ===========================================================================
|
||||
|
||||
function toggleLocaleChooserGUI() {
|
||||
if (localeChooser.window.shown) {
|
||||
if (localeChooser.window.shown == true) {
|
||||
closeLocaleChooserGUI();
|
||||
} else {
|
||||
showLocaleChooserGUI();
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
let itemActionDelayDuration = 0;
|
||||
let itemActionDelayStart = 0;
|
||||
let itemActionDelayEnabled = false;
|
||||
let itemActionDelayPosition = toVector2(0, game.height - 10);
|
||||
let itemActionDelaySize = toVector2(game.width, 10);
|
||||
let itemActionDelayPosition = toVector2(game.width / 2 - 100, game.height - 10);
|
||||
let itemActionDelaySize = toVector2(200, 5);
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -38,8 +38,8 @@ function processItemActionRendering() {
|
||||
let width = Math.ceil(getPercentage(itemActionDelaySize.x, progressPercent));
|
||||
|
||||
let backgroundColour = toColour(0, 0, 0, 255);
|
||||
graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x) - 1, itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 1], [itemActionDelaySize.x + 2, itemActionDelaySize.y + 2], backgroundColour, backgroundColour, backgroundColour, backgroundColour);
|
||||
graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x), itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME);
|
||||
graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x / 2) - 1, itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 1], [itemActionDelaySize.x + 2, itemActionDelaySize.y + 2], backgroundColour, backgroundColour, backgroundColour, backgroundColour);
|
||||
graphics.drawRectangle(null, [itemActionDelayPosition.x - (itemActionDelaySize.x / 2), itemActionDelayPosition.y - (itemActionDelaySize.y / 2) - 2], [width, itemActionDelaySize.y], COLOUR_LIME, COLOUR_LIME, COLOUR_LIME, COLOUR_LIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ function processLabelRendering() {
|
||||
}
|
||||
|
||||
if (getDistance(localPlayer.position, business.entrancePosition) <= propertyLabelRenderDistance) {
|
||||
renderPropertyEntranceLabel(business.name, business.entrancePosition, business.locked, true, getCurrencyString(business.buyPrice), getCurrencyString(business.rentPrice), business.labelInfoType);
|
||||
renderPropertyEntranceLabel(business.name, business.entrancePosition, business.locked, true, business.buyPrice, business.rentPrice, business.labelInfoType);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -330,7 +330,7 @@ function processLabelRendering() {
|
||||
}
|
||||
|
||||
if (getDistance(localPlayer.position, house.entrancePosition) <= propertyLabelRenderDistance) {
|
||||
renderPropertyEntranceLabel(house.description, house.entrancePosition, house.locked, true, getCurrencyString(house.buyPrice), getCurrencyString(house.rentPrice), house.labelInfoType);
|
||||
renderPropertyEntranceLabel(house.description, house.entrancePosition, house.locked, true, house.buyPrice, house.rentPrice, house.labelInfoType);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -360,11 +360,11 @@ function processLabelRendering() {
|
||||
let rentPrice = "0";
|
||||
let labelInfoType = AGRP_PROPLABEL_INFO_NONE;
|
||||
if (pickups[i].getData("agrp.label.price") != null) {
|
||||
price = getCurrencyString(pickups[i].getData("agrp.label.price"));
|
||||
price = pickups[i].getData("agrp.label.price");
|
||||
}
|
||||
|
||||
if (pickups[i].getData("agrp.label.rentprice") != null) {
|
||||
rentPrice = getCurrencyString(pickups[i].getData("agrp.label.rentprice"));
|
||||
rentPrice = pickups[i].getData("agrp.label.rentprice");
|
||||
}
|
||||
|
||||
if (pickups[i].getData("agrp.label.help") != null) {
|
||||
|
||||
@@ -111,7 +111,7 @@ function syncVehicleProperties(vehicle) {
|
||||
vehicle.setSuspensionHeight(suspensionHeight);
|
||||
}
|
||||
|
||||
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||
if (isGameFeatureSupported("vehicleUpgrades")) {
|
||||
//let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
|
||||
//for(let i in allUpgrades) {
|
||||
// vehicle.removeUpgrade(i);
|
||||
@@ -146,7 +146,7 @@ function syncCivilianProperties(civilian) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getGame() == AGRP_GAME_GTA_III) {
|
||||
if (isGameFeatureSupported("pedScale")) {
|
||||
if (doesEntityDataExist(civilian, "agrp.scale")) {
|
||||
let scaleFactor = getEntityData(civilian, "agrp.scale");
|
||||
let tempMatrix = civilian.matrix;
|
||||
@@ -165,7 +165,7 @@ function syncCivilianProperties(civilian) {
|
||||
}
|
||||
}
|
||||
|
||||
if (getGame() == AGRP_GAME_GTA_III) {
|
||||
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||
if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
|
||||
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
|
||||
civilian.walkStyle = walkStyle;
|
||||
@@ -238,12 +238,32 @@ function syncCivilianProperties(civilian) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function syncObjectProperties(object) {
|
||||
if (!areServerElementsSupported()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isGameFeatureSupported("objectScale")) {
|
||||
if (doesEntityDataExist(object, "agrp.scale")) {
|
||||
let scaleFactor = getEntityData(object, "agrp.scale");
|
||||
let tempMatrix = object.matrix;
|
||||
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
||||
let tempPosition = object.position;
|
||||
object.matrix = tempMatrix;
|
||||
tempPosition.z += scaleFactor.z;
|
||||
object.position = tempPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function syncPlayerProperties(player) {
|
||||
if (!areServerElementsSupported()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getGame() == AGRP_GAME_GTA_III) {
|
||||
if (isGameFeatureSupported("pedScale")) {
|
||||
if (doesEntityDataExist(player, "agrp.scale")) {
|
||||
let scaleFactor = getEntityData(player, "agrp.scale");
|
||||
let tempMatrix = player.matrix;
|
||||
@@ -356,9 +376,17 @@ function syncElementProperties(element) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(element, "agrp.interior")) {
|
||||
if (typeof element.interior != "undefined") {
|
||||
element.interior = getEntityData(element, "agrp.interior");
|
||||
if (isGameFeatureSupported("interior")) {
|
||||
if (doesEntityDataExist(element, "agrp.interior")) {
|
||||
if (typeof element.interior != "undefined") {
|
||||
element.interior = getEntityData(element, "agrp.interior");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isGameFeatureSupported("toggleCollision")) {
|
||||
if (doesEntityDataExist(element, "agrp.collisions")) {
|
||||
element.collisionsEnabled = getEntityData(element, "agrp.collisions");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,6 +421,10 @@ function syncElementProperties(element) {
|
||||
syncPlayerProperties(element);
|
||||
break;
|
||||
|
||||
case ELEMENT_OBJECT:
|
||||
syncObjectProperties(element);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user