diff --git a/IDEAS.md b/IDEAS.md
index 5375c289..6b0fbfac 100644
--- a/IDEAS.md
+++ b/IDEAS.md
@@ -14,7 +14,8 @@
### Interactive peds with each one having a background story, characteristics, certain people or groups they like/dislike.
* Procedurally generated?
---
-* Nightclubs, bars, etc can employ "bouncer" peds that either prevent entry to certain people, or kick people out.
+### Bouncers
+ * Nightclubs, bars, etc can employ "bouncer" peds that either prevent entry to certain people, or kick people out.
---
### Background ambience.
* Anonymous city traffic and pedestrians
@@ -51,9 +52,9 @@
### Vehicle Towing
* Use a Yankee or something to store the vehicle "inside" (just make the car disappear) until better sync options are built.
* Universal command to tow/release a vehicle ( /tow ).
- * Attach to nearest vehicle.
+ * Try attach to nearest vehicle.
---
-### Item System
+### Item System (FINISHED)
* Several item types, including armour, skins, weapons, drugs, materials, and more.
* Items can be dropped and picked up.
* Items can be stored in a vehicle trunk or dash compartment.
@@ -68,21 +69,21 @@
* If all are full, have a waiting list.
* Allow people to go in and lay on a bed to heal (or use a check-in system)
---
-### Several NPC's
+### Several NPC's (NEEDS SPAWNED)
* Paramedics/Doctors at hospitals,
* LC/VC/LS/SF/LV police dept desk clerk and dispatcher.
* Jail guard
* Interactive. Go up and talk to them for responses etc
---
-### Use permissions/flag system for everything.
+### Use permissions/flag system for everything (FINISHED)
* Admin abilities
* Moderation (muted/frozen/etc)
- * LEO abilities
+ * LEO abilities (skipped for now)
* Clan abilities
* Account Settings
* etc
---
-### Interiors
+### Interiors (FINISHED)
* For games with interiors, properties inside of properties (possibly make it a sub-property, but using a "type" to define it. May not be necessary) AKA a business inside a business (illegal back room gambling, anyone?)
---
### Stealable skins.
@@ -174,8 +175,6 @@
* Concealable smaller weapon.
* Officers usually have a utility belt. Allow it to hold equipment as well.
---
-###
----
### Vehicle Trunks
* Can hold tied up players/peds
* Can hold items
@@ -230,10 +229,10 @@
* Tweakers
* Bouncers
---
-### Accents
+### Accents (FINISHED)
* Shown before message ... "[Japanese] John Smith says: hello"
* Pre-set accent choices
- * Custom accent
+ * Custom accent (skipped for now)
---
### Speakerphone
* While on a phone call, using /speakerphone or something can allow others near the person on the phone to hear and be heard over the call.
@@ -333,7 +332,8 @@
---
### Pointing
* Key to point sort of like FiveM has.
- * Use a 3D primitive on the spot thats pointed to, if no anim available.
+ * Use a 3D primitive on the spot thats pointed to.
+ * Use pointing (finger?) animation if available
---
### Multi-command one-liners
Obviously this would still be using slashes for commands still. The way this works is simple: Every command returns a value `{RETURN}`, and provides indexed numerical references to it's args that can be *piped* to another command `{1}`, `{2}`, etc. For example, the /tempveh command adds a vehicle and provides both a reference to the vehicle itself (`{RETURN}`) and a reference to it's only argument (`{1}`). Some commands already implement a final, optional command to override the default chosen entity to act on (for example, `/bizname Some Business 3` will set business ID 3's name instead of the closest business to the player. Only works for staff with the manageBusinesses permission or if the player using it owns or is in the clan that owns business ID 3 and has the ability to set it's name. So this: `/tempveh infernus | /vehrgb 0 0 0 0 {RETURN} | /vehrgb 1 {2} {3} {4} {RETURN}` Would spawn a temporary infernus and immediately set both colours as completely black RGB values.
@@ -350,20 +350,20 @@ Obviously this would still be using slashes for commands still. The way this wor
* Ice cream cone
* Cotton Candy
* Snow cone
-
* Misc
* Gas Can
---
-### Quick Reply
+### Quick Reply (FINISHED)
* When somebody sends a private message, use /reply to quickly reply without having to find their ID to use the private message command
---
-### Item management commands
+### Item management commands (ALMOST FINISHED)
* Item Types
* Create
* Set base price
* Set model
* Set drop position offset
* Set drop rotation offset
+ * Set forward
---
### Tutorial
* Pick up item (grab bottle of beer off ground)
@@ -378,4 +378,22 @@ Obviously this would still be using slashes for commands still. The way this wor
### Animation/emote, action, and message menu wheels
So with new Steam Deck being available now, and all the other attempts to use mobile devices that either emulate or stream the older GTA PC games, I figure we'd need a way for players to interact with each other using them. Roleplay is usually a very chat-oriented gamemode, but I can probably make things easier with simple controls. Also customizable messages, animations, and actions for each menu/wheel slot
The inventory system is already planned to use a hotbar/wheel but I don't have all the images for it yet
----
\ No newline at end of file
+---
+### Fishing
+ * Fishing works near water or on a boat (I have a way to detect both)
+ * Use the bat swing anim for casting line, and the crouch anim for applying bait.
+ * Bait is used same as ammo item for a weapon. Hold the fishing rod, make sure bait is in inventory, and press use (default U) to apply bait.
+ * Use a "press and hold" key to cast a line to a custom distance. Show progress bar to indicate how far the line will be cast.
+ * Place a single-use particle effect on the water (distance to front of player) to show where the casted line hits.
+ * Use particle effects (water spray or splash effect) to display a fish being hooked.
+ * Slowly move the particle effect to the player to show it being reeled in as the player holds the reel key.
+ * Random selection of predefined catch items, both junk and fish.
+ * Player would be wise to bring a bucket or crate to keep the fish in, using existing /take and /put system like any other item.
+ **This will need extra stuff added to keybinds system for duration key holding**
+---
+### GPS indicator like the 3D Fallout games
+An indicator at the bottom, showing compass direction and a dot or something in the direction of the GPS location. Like an object marker.
+In-world indicator too, when player gets close and is in line of sight
+---
+### Item/Object pickup and move like the 3D Fallout games
+Fallout 3 and New Vegas have a neat feature where you can "grab" an object and fling it around while the key is pressed. Could be implemented for items in GTACRP servers
\ No newline at end of file
diff --git a/TODO.md b/TODO.md
index d08be4d1..b009b409 100644
--- a/TODO.md
+++ b/TODO.md
@@ -20,4 +20,7 @@
* Drug growing/manufacturing
---
== Bug Fixes
-* Check natives for if player is console (getPlayerPosition, etc)
\ No newline at end of file
+* Check natives for if player is console (getPlayerPosition, etc)
+
+* Add command to copy account keybinds to other server(s)
+* Add command to reset all account keybinds to default
\ No newline at end of file
diff --git a/config/client/locale.json b/config/client/locale.json
index 62caa2db..f0478a35 100644
--- a/config/client/locale.json
+++ b/config/client/locale.json
@@ -7,7 +7,8 @@
"flagImageFile": "uk.png",
"countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
"requiresUnicode": false,
- "contributor": "Vortrex"
+ "contributor": "Vortrex",
+ "enabled": true
},
{
"id": 1,
@@ -17,7 +18,8 @@
"flagImageFile": "ru.png",
"countries": ["ru", "ua"],
"requiresUnicode": false,
- "contributor": "VNDTTS"
+ "contributor": "VNDTTS",
+ "enabled": true
},
{
"id": 2,
@@ -27,7 +29,8 @@
"flagImageFile": "pl.png",
"countries": ["pl"],
"requiresUnicode": false,
- "contributor": "Suprise444"
+ "contributor": "Suprise444",
+ "enabled": true
},
{
"id": 3,
@@ -37,7 +40,8 @@
"flagImageFile": "es.png",
"countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
"requiresUnicode": false,
- "contributor": "PerikiyoXD"
+ "contributor": "PerikiyoXD",
+ "enabled": true
},
{
"id": 4,
@@ -47,7 +51,8 @@
"flagImageFile": "cn.png",
"countries": ["cn", "hk", "sg", "tw"],
"requiresUnicode": true,
- "contributor": "Renzuko_Ctone"
+ "contributor": "Renzuko_Ctone",
+ "enabled": true
},
{
"id": 5,
@@ -57,7 +62,8 @@
"flagImageFile": "sa.png",
"countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
"requiresUnicode": true,
- "contributor": "! KASIR"
+ "contributor": "! KASIR",
+ "enabled": true
},
{
"id": 6,
@@ -67,7 +73,8 @@
"flagImageFile": "sk.png",
"countries": ["sk"],
"requiresUnicode": false,
- "contributor": "UAKLAUS"
+ "contributor": "UAKLAUS",
+ "enabled": false
},
{
"id": 7,
@@ -77,7 +84,8 @@
"flagImageFile": "de.png",
"countries": ["de", "at", "be", "ch", "li", "lu"],
"requiresUnicode": false,
- "contributor": "Sladernimo"
+ "contributor": "Sladernimo",
+ "enabled": true
},
{
"id": 8,
@@ -87,7 +95,8 @@
"flagImageFile": "fr.png",
"countries": ["fr", "cd", "bj", "bf", "cd", "cg", "ga", "gn", "ml", "mc", "ne", "sn"],
"requiresUnicode": false,
- "contributor": "Cocam"
+ "contributor": "Cocam",
+ "enabled": false
},
{
"id": 9,
@@ -97,7 +106,8 @@
"flagImageFile": "jp.png",
"countries": ["jp"],
"requiresUnicode": true,
- "contributor": "Cocam"
+ "contributor": "Cocam",
+ "enabled": false
},
{
"id": 10,
@@ -107,6 +117,29 @@
"flagImageFile": "fi.png",
"countries": ["fi"],
"requiresUnicode": false,
- "contributor": "SIMBA_MEOW"
+ "contributor": "SIMBA_MEOW",
+ "enabled": true
+ },
+ {
+ "id": 11,
+ "englishName": "Lithuanian",
+ "stringsFile": "lithuanian.json",
+ "isoCode": "lt",
+ "flagImageFile": "lt.png",
+ "countries": ["lt"],
+ "requiresUnicode": false,
+ "contributor": "dovis",
+ "enabled": false
+ },
+ {
+ "id": 12,
+ "englishName": "Latvian",
+ "stringsFile": "latvian.json",
+ "isoCode": "lv",
+ "flagImageFile": "lv.png",
+ "countries": ["lv"],
+ "requiresUnicode": false,
+ "contributor": "YuOn",
+ "enabled": false
}
]
\ No newline at end of file
diff --git a/config/economy.json b/config/economy.json
index 15284ba5..549a9759 100644
--- a/config/economy.json
+++ b/config/economy.json
@@ -4,6 +4,7 @@
"applyUpkeep": true,
"grossIncomeMultiplier": 1.0,
"incomeTaxRate": 0.7,
+ "currencyString": "${AMOUNT}",
"upKeepCosts": {
"upKeepPerVehicle": 250,
"upKeepPerHouse": 350,
diff --git a/config/locale.json b/config/locale.json
index 5a68a5de..11c90448 100644
--- a/config/locale.json
+++ b/config/locale.json
@@ -11,7 +11,8 @@
"flagImageFile": "uk.png",
"countries": ["gb", "us", "au", "bz", "ca", "ie", "jm", "nz", "za", "tt"],
"requiresUnicode": false,
- "contributor": "Vortrex"
+ "contributor": "Vortrex",
+ "enabled": true
},
{
"id": 1,
@@ -21,7 +22,8 @@
"flagImageFile": "ru.png",
"countries": ["ru", "ua"],
"requiresUnicode": false,
- "contributor": "VNDTTS"
+ "contributor": "VNDTTS",
+ "enabled": true
},
{
"id": 2,
@@ -31,7 +33,8 @@
"flagImageFile": "pl.png",
"countries": ["pl"],
"requiresUnicode": false,
- "contributor": "Suprise444"
+ "contributor": "Suprise444",
+ "enabled": true
},
{
"id": 3,
@@ -41,7 +44,8 @@
"flagImageFile": "es.png",
"countries": ["es", "ar", "bo", "cl", "co", "cr", "do", "ec", "sv", "gt", "hn", "mx", "ni", "pa", "py", "pe", "pr", "uy", "ve"],
"requiresUnicode": false,
- "contributor": "PerikiyoXD"
+ "contributor": "PerikiyoXD",
+ "enabled": true
},
{
"id": 4,
@@ -51,7 +55,8 @@
"flagImageFile": "cn.png",
"countries": ["cn", "hk", "sg", "tw"],
"requiresUnicode": true,
- "contributor": "Renzuko_Ctone"
+ "contributor": "Renzuko_Ctone",
+ "enabled": true
},
{
"id": 5,
@@ -61,7 +66,8 @@
"flagImageFile": "sa.png",
"countries": ["dz", "bh", "eg", "iq", "jo", "kw", "lb", "ly", "ma", "om", "qa", "sa", "sy", "tn", "ae", "ye"],
"requiresUnicode": true,
- "contributor": "! KASIR"
+ "contributor": "! KASIR",
+ "enabled": true
},
{
"id": 6,
@@ -71,7 +77,8 @@
"flagImageFile": "sk.png",
"countries": ["sk"],
"requiresUnicode": false,
- "contributor": "UAKLAUS"
+ "contributor": "UAKLAUS",
+ "enabled": false
},
{
"id": 7,
@@ -81,7 +88,8 @@
"flagImageFile": "de.png",
"countries": ["de", "at", "be", "ch", "li", "lu"],
"requiresUnicode": false,
- "contributor": "Sladernimo"
+ "contributor": "Sladernimo",
+ "enabled": true
},
{
"id": 8,
@@ -91,7 +99,8 @@
"flagImageFile": "fr.png",
"countries": ["fr", "cd", "bj", "bf", "cd", "cg", "ga", "gn", "ml", "mc", "ne", "sn"],
"requiresUnicode": false,
- "contributor": "Cocam"
+ "contributor": "Cocam",
+ "enabled": false
},
{
"id": 9,
@@ -101,7 +110,8 @@
"flagImageFile": "jp.png",
"countries": ["jp"],
"requiresUnicode": true,
- "contributor": "Cocam"
+ "contributor": "Cocam",
+ "enabled": false
},
{
"id": 10,
@@ -111,7 +121,30 @@
"flagImageFile": "fi.png",
"countries": ["fi"],
"requiresUnicode": false,
- "contributor": "SIMBA_MEOW"
+ "contributor": "SIMBA_MEOW",
+ "enabled": true
+ },
+ {
+ "id": 11,
+ "englishName": "Lithuanian",
+ "stringsFile": "lithuanian.json",
+ "isoCode": "lt",
+ "flagImageFile": "lt.png",
+ "countries": ["lt"],
+ "requiresUnicode": false,
+ "contributor": "dovis",
+ "enabled": false
+ },
+ {
+ "id": 12,
+ "englishName": "Latvian",
+ "stringsFile": "latvian.json",
+ "isoCode": "lv",
+ "flagImageFile": "lv.png",
+ "countries": ["lv"],
+ "requiresUnicode": false,
+ "contributor": "YuOn",
+ "enabled": false
}
]
}
\ No newline at end of file
diff --git a/files/fonts/aurora-bold-condensed.ttf b/files/fonts/aurora-bold-condensed.ttf
new file mode 100644
index 00000000..d8dc93ce
Binary files /dev/null and b/files/fonts/aurora-bold-condensed.ttf differ
diff --git a/files/images/cursor.png b/files/images/cursor.png
new file mode 100644
index 00000000..2f19d2d6
Binary files /dev/null and b/files/images/cursor.png differ
diff --git a/meta.xml b/meta.xml
index 55c0ae83..087714c1 100644
--- a/meta.xml
+++ b/meta.xml
@@ -1,5 +1,5 @@
-
+
@@ -15,7 +15,6 @@
-
@@ -23,10 +22,11 @@
+
-
+
@@ -34,10 +34,13 @@
+
+
+
@@ -45,9 +48,10 @@
+
+
-
@@ -81,10 +85,58 @@
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -113,51 +165,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/scripts/client/afk.js b/scripts/client/afk.js
index b0ca14e5..1c9ced08 100644
--- a/scripts/client/afk.js
+++ b/scripts/client/afk.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: afk.js
// DESC: Provides AFK detection
@@ -9,8 +10,8 @@
// Init AFK script
function initAFKScript() {
- logToConsole(LOG_DEBUG, "[VRR.AFK]: Initializing AFK script ...");
- logToConsole(LOG_DEBUG, "[VRR.AFK]: AFK script initialized!");
+ logToConsole(LOG_DEBUG, "[AGRP.AFK]: Initializing AFK script ...");
+ logToConsole(LOG_DEBUG, "[AGRP.AFK]: AFK script initialized!");
}
// ===========================================================================
diff --git a/scripts/client/animation.js b/scripts/client/animation.js
index f62db4f7..274db151 100644
--- a/scripts/client/animation.js
+++ b/scripts/client/animation.js
@@ -1,54 +1,62 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: animation.js
// DESC: Provides animation functions and usage
// TYPE: Client (JavaScript)
// ===========================================================================
+function initAnimationScript() {
+ logToConsole(LOG_DEBUG, "[AGRP.Animation]: Initializing animation script ...");
+ logToConsole(LOG_DEBUG, "[AGRP.Animation]: Animation script initialized!");
+}
+
+// ===========================================================================
+
function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
let ped = getElementFromId(pedId);
- if(ped == null) {
+ if (ped == null) {
return false;
}
let animationData = getAnimationData(animationSlot);
- logToConsole(LOG_DEBUG, `[VRR.Animation] Playing animation ${animationData[0]} for ped ${pedId}`);
+ logToConsole(LOG_DEBUG, `[AGRP.Animation] Playing animation ${animationData[0]} for ped ${pedId}`);
let freezePlayer = false;
- switch(animationData.moveType) {
- case VRR_ANIMMOVE_FORWARD: {
+ switch (animationData.moveType) {
+ case AGRP_ANIMMOVE_FORWARD: {
setElementCollisionsEnabled(ped, false);
- if(ped.isSyncer) {
+ if (ped.isSyncer) {
setElementPosition(ped, getPosInFrontOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
}
freezePlayer = true;
break;
}
- case VRR_ANIMMOVE_BACK: {
+ case AGRP_ANIMMOVE_BACK: {
setElementCollisionsEnabled(pedId, false);
- if(ped.isSyncer) {
+ if (ped.isSyncer) {
setElementPosition(pedId, getPosBehindPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
}
freezePlayer = true;
break;
}
- case VRR_ANIMMOVE_LEFT: {
+ case AGRP_ANIMMOVE_LEFT: {
setElementCollisionsEnabled(pedId, false);
- if(ped.isSyncer) {
+ if (ped.isSyncer) {
setElementPosition(pedId, getPosToLeftOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
}
freezePlayer = true;
break;
}
- case VRR_ANIMMOVE_RIGHT: {
+ case AGRP_ANIMMOVE_RIGHT: {
setElementCollisionsEnabled(pedId, false);
- if(ped.isSyncer) {
+ if (ped.isSyncer) {
setElementPosition(pedId, getPosToRightOfPos(getElementPosition(pedId), fixAngle(getElementHeading(pedId)), positionOffset));
}
freezePlayer = true;
@@ -60,21 +68,21 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
}
}
- if(getGame() < VRR_GAME_GTA_IV) {
- if(animationData.animType == VRR_ANIMTYPE_NORMAL || animationData.animType == VRR_ANIMTYPE_SURRENDER) {
- if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
+ if (getGame() < AGRP_GAME_GTA_IV) {
+ if (animationData.animType == AGRP_ANIMTYPE_NORMAL || animationData.animType == AGRP_ANIMTYPE_SURRENDER) {
+ if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) {
ped.clearAnimations();
} else {
ped.clearObjective();
}
ped.addAnimation(animationData.groupId, animationData.animId);
- if(ped == localPlayer && freezePlayer == true) {
+ if (ped == localPlayer && freezePlayer == true) {
inAnimation = true;
setLocalPlayerControlState(false, false);
localPlayer.collisionsEnabled = false;
}
- } else if(animationData.animType == VRR_ANIMTYPE_BLEND) {
+ } else if (animationData.animType == AGRP_ANIMTYPE_BLEND) {
ped.position = ped.position;
ped.blendAnimation(animationData.groupId, animationData.animId, animationData.animSpeed);
}
@@ -89,17 +97,17 @@ function makePedPlayAnimation(pedId, animationSlot, positionOffset) {
function forcePedAnimation(pedId, animSlot) {
let ped = getElementFromId(pedId);
- if(ped == null) {
+ if (ped == null) {
return false;
}
let animationData = getAnimationData(animSlot);
- if(getGame() < VRR_GAME_GTA_IV) {
+ if (getGame() < AGRP_GAME_GTA_IV) {
ped.position = ped.position;
ped.addAnimation(animationData.groupId, animationData.animId);
- if(ped == localPlayer) {
+ if (ped == localPlayer) {
inAnimation = true;
setLocalPlayerControlState(false, false);
localPlayer.collisionsEnabled = false;
@@ -115,34 +123,24 @@ function forcePedAnimation(pedId, animSlot) {
function makePedStopAnimation(pedId) {
let ped = getElementFromId(pedId);
- if(ped == null) {
+ if (ped == null) {
return false;
}
- if(getGame() != VRR_GAME_GTA_IV) {
- if(getGame() == VRR_GAME_GTA_VC || getGame() == VRR_GAME_GTA_SA) {
+ if (getGame() != AGRP_GAME_GTA_IV) {
+ if (getGame() == AGRP_GAME_GTA_VC || getGame() == AGRP_GAME_GTA_SA) {
ped.clearAnimations();
} else {
ped.clearObjective();
}
}
- if(ped == localPlayer) {
- if(getGame() != VRR_GAME_GTA_IV) {
+ if (ped == localPlayer) {
+ if (getGame() != AGRP_GAME_GTA_IV) {
localPlayer.collisionsEnabled = true;
}
setLocalPlayerControlState(true, false);
}
}
-// ===========================================================================
-
-/**
- * @param {number} animationSlot - The slot index of the animation
- * @return {AnimationData} The animation's data (array)
- */
- function getAnimationData(animationSlot, gameId = getGame()) {
- return getGameConfig().animations[gameId][animationSlot];
-}
-
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/business.js b/scripts/client/business.js
index 2c07f0de..50eed775 100644
--- a/scripts/client/business.js
+++ b/scripts/client/business.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: business.js
// DESC: Provides business functions and usage
@@ -16,32 +17,55 @@ class BusinessData {
this.blipModel = blipModel;
this.pickupModel = pickupModel;
this.hasInterior = hasInterior;
+ this.rentPrice = 0;
+ this.buyPrice = 0;
this.hasItems = hasItems;
this.blipId = -1;
this.labelInfoType = 0;
+ this.locked = false;
}
}
// ===========================================================================
-function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems) {
- logToConsole(LOG_DEBUG, `[VRR.Business] Received business ${businessId} (${name}) from server`);
+function initBusinessScript() {
+ logToConsole(LOG_DEBUG, "[AGRP.Business]: Initializing business script ...");
+ logToConsole(LOG_INFO, "[AGRP.Business]: Business script initialized!");
+}
- if(!areServerElementsSupported()) {
- if(getBusinessData(businessId) != false) {
+// ===========================================================================
+
+function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked, hasItems) {
+ logToConsole(LOG_DEBUG, `[AGRP.Business] Received business ${businessId} (${name}) from server`);
+
+ if (!areServerElementsSupported() || getGame() == AGRP_GAME_MAFIA_ONE) {
+ if (getBusinessData(businessId) != false) {
let businessData = getBusinessData(businessId);
businessData.name = name;
businessData.entrancePosition = entrancePosition;
businessData.blipModel = blipModel;
businessData.pickupModel = pickupModel;
businessData.hasInterior = hasInterior;
+ businessData.buyPrice = buyPrice;
+ businessData.rentPrice = rentPrice;
businessData.hasItems = hasItems;
+ businessData.locked = locked;
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} already exists. Checking blip ...`);
- if(blipModel == -1) {
- if(businessData.blipId != -1) {
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been removed by the server`);
- if(getGame() == VRR_GAME_GTA_IV) {
+ if (hasInterior && !hasItems) {
+ businessData.labelInfoType = AGRP_PROPLABEL_INFO_ENTER;
+ } else if (!hasInterior && hasItems) {
+ businessData.labelInfoType = AGRP_PROPLABEL_INFO_BUY;
+ } else {
+ if (businessData.buyPrice > 0) {
+ businessData.labelInfoType = AGRP_PROPLABEL_INFO_BUYBIZ;
+ }
+ }
+
+ logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId} already exists. Checking blip ...`);
+ if (blipModel == -1) {
+ if (businessData.blipId != -1) {
+ logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been removed by the server`);
+ if (getGame() == AGRP_GAME_GTA_IV) {
natives.removeBlipAndClearIndex(getBusinessData(businessId).blipId);
} else {
destroyElement(getElementFromId(blipId));
@@ -50,37 +74,37 @@ function receiveBusinessFromServer(businessId, name, entrancePosition, blipModel
//businesses.splice(businessData.index, 1);
//setAllBusinessDataIndexes();
} else {
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip is unchanged`);
+ logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip is unchanged`);
}
} else {
- if(businessData.blipId != -1) {
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been changed by the server`);
- if(getGame() == VRR_GAME_GTA_IV) {
+ if (businessData.blipId != -1) {
+ logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been changed by the server`);
+ if (getGame() == AGRP_GAME_GTA_IV) {
natives.setBlipCoordinates(businessData.blipId, businessData.entrancePosition);
natives.changeBlipSprite(businessData.blipId, businessData.blipModel);
natives.setBlipMarkerLongDistance(businessData.blipId, false);
natives.setBlipAsShortRange(tempBusinessData.blipId, true);
- natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ...": ""}`);
+ natives.changeBlipNameFromAscii(businessData.blipId, `${businessData.name.substr(0, 24)}${(businessData.name.length > 24) ? " ..." : ""}`);
}
} else {
let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name);
- if(blipId != -1) {
+ if (blipId != -1) {
tempBusinessData.blipId = blipId;
}
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
+ logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
}
}
} else {
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} doesn't exist. Adding ...`);
+ logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId} doesn't exist. Adding ...`);
let tempBusinessData = new BusinessData(businessId, name, entrancePosition, blipModel, pickupModel, hasInterior, hasItems);
- if(blipModel != -1) {
+ if (blipModel != -1) {
let blipId = createGameBlip(tempBusinessData.blipModel, tempBusinessData.entrancePosition, tempBusinessData.name);
- if(blipId != -1) {
+ if (blipId != -1) {
tempBusinessData.blipId = blipId;
}
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
+ logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId}'s blip has been added by the server (Model ${blipModel}, ID ${blipId})`);
} else {
- logToConsole(LOG_DEBUG, `[VRR.Business] Business ${businessId} has no blip.`);
+ logToConsole(LOG_DEBUG, `[AGRP.Business] Business ${businessId} has no blip.`);
}
getServerData().businesses.push(tempBusinessData);
setAllBusinessDataIndexes();
@@ -100,8 +124,8 @@ function getBusinessData(businessId) {
let businesses = getServerData().businesses;
- for(let i in businesses) {
- if(businesses[i].businessId == businessId) {
+ for (let i in businesses) {
+ if (businesses[i].businessId == businessId) {
return businesses[i];
}
}
@@ -112,7 +136,7 @@ function getBusinessData(businessId) {
// ===========================================================================
function setAllBusinessDataIndexes() {
- for(let i in getServerData().businesses) {
+ for (let i in getServerData().businesses) {
getServerData().businesses[i].index = i;
}
}
diff --git a/scripts/client/camera.js b/scripts/client/camera.js
new file mode 100644
index 00000000..88e7649b
--- /dev/null
+++ b/scripts/client/camera.js
@@ -0,0 +1,39 @@
+// ===========================================================================
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
+// ===========================================================================
+// FILE: camera.js
+// DESC: Provides camera functions and usage
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+let cameraFadeEnabled = false;
+let cameraFadeIn = false;
+let cameraFadeStart = 0;
+let cameraFadeDuration = 0;
+let cameraFadeColour = 0;
+
+// ===========================================================================
+
+function processCameraFadeRendering() {
+ if (cameraFadeEnabled) {
+ let finishTime = cameraFadeStart + cameraFadeDuration;
+ if (sdl.ticks >= finishTime) {
+ cameraFadeEnabled = false;
+ cameraFadeDuration = 0;
+ cameraFadeStart = 0;
+ } else {
+ let currentTick = sdl.ticks - cameraFadeStart;
+ let progressPercent = Math.ceil(currentTick * 100 / cameraFadeDuration);
+ let rgbaArray = rgbaArrayFromToColour(cameraFadeColour);
+
+ let alpha = (cameraFadeIn) ? Math.ceil(255 / progressPercent) : Math.ceil(progressPercent / 255);
+
+ cameraFadeColour = toColour(rgbaArray[0], rgbaArray[1], rgbaArray[2], alpha);
+ graphics.drawRectangle(null, toVector2(0, 0), toVector2(game.width, game.height), cameraFadeColour, cameraFadeColour, cameraFadeColour, cameraFadeColour);
+ }
+ }
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/chat.js b/scripts/client/chat.js
new file mode 100644
index 00000000..c85140ce
--- /dev/null
+++ b/scripts/client/chat.js
@@ -0,0 +1,235 @@
+// ===========================================================================
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
+// ===========================================================================
+// FILE: chatbox.js
+// DESC: Provides extra chatbox features
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+// ===========================================================================
+
+let chatTimeStampsEnabled = false;
+let chatEmojiEnabled = false;
+
+let chatBoxHistory = [];
+let bottomMessageIndex = 0;
+let maxChatBoxHistory = 500;
+
+let scrollAmount = 1;
+let maxChatBoxLines = 6;
+
+let chatAutoHideDelay = 0;
+let chatLastUse = 0;
+
+let scrollUpKey = false;
+let scrollDownKey = false;
+
+// ===========================================================================
+
+function initChatBoxScript() {
+ logToConsole(LOG_DEBUG, "[AGRP.Chat]: Initializing chat script ...");
+ scrollUpKey = getKeyIdFromParams("pageup");
+ scrollDownKey = getKeyIdFromParams("pagedown");
+ bindChatBoxKeys();
+ logToConsole(LOG_INFO, "[AGRP.Chat]: Chat script initialized!");
+}
+
+// ===========================================================================
+
+function bindChatBoxKeys() {
+ bindKey(toInteger(scrollUpKey), KEYSTATE_DOWN, chatBoxScrollUp);
+ bindKey(toInteger(scrollDownKey), KEYSTATE_DOWN, chatBoxScrollDown);
+}
+
+// ===========================================================================
+
+function unBindChatBoxKeys() {
+ unbindKey(toInteger(scrollUpKey));
+ unbindKey(toInteger(scrollDownKey));
+}
+
+// ===========================================================================
+
+function receiveChatBoxMessageFromServer(messageString, colour, hour, minute, second) {
+ logToConsole(LOG_DEBUG, `[AGRP.Chat]: Received chatbox message from server: ${messageString}`);
+
+ // Just in case it's hidden by auto hide
+ //setChatWindowEnabled(true);
+
+ //let timeStamp = findResourceByName("agrp_time").exports.getCurrentUnixTimeStampSquirrel();
+
+ hour = fillLeadingZeros(hour, 2);
+ minute = fillLeadingZeros(minute, 2);
+ second = fillLeadingZeros(second, 2);
+
+ addToChatBoxHistory(messageString, colour, hour, minute, second);
+
+ //let unixTimeStampMS = new Date().getTime();
+ //let timeStampDate = new Date(unixTimeStampMS);
+ //let timeStampDate = new Date(timeStamp);
+ //let timeStampText = `${timeStampDate.getHours()}:${timeStampDate.getMinutes()}:${timeStampDate.getSeconds()}`;
+
+ let outputString = messageString;
+ if (chatTimeStampsEnabled == true) {
+ //timeStampString = `{TIMESTAMPCOLOUR}[${findResourceByName("agrp_time").exports.getTimeStampOutput(timeStamp)}]{MAINCOLOUR}`;
+ let timeStampString = `{TIMESTAMPCOLOUR}[${hour}:${minute}:${second}] `;
+ outputString = `${timeStampString}${messageString}`;
+ }
+
+ logToConsole(LOG_DEBUG, `[AGRP.Chat]: Changed colours in string: ${outputString}`);
+ outputString = replaceColoursInMessage(`${outputString}`);
+
+ if (chatEmojiEnabled == true) {
+ logToConsole(LOG_DEBUG, `[AGRP.Chat]: Enabled emoji in string: ${outputString}`);
+ outputString = replaceEmojiInMessage(outputString);
+ }
+
+ if (profanityFilterEnabled == true) {
+ logToConsole(LOG_DEBUG, `[AGRP.Chat]: Removed profanity in string: ${outputString}`);
+ outputString = replaceProfanityInMessage(outputString);
+ }
+
+ message(outputString, colour);
+ bottomMessageIndex = chatBoxHistory.length - 1;
+
+ chatLastUse = getCurrentUnixTimestamp();
+}
+
+// ===========================================================================
+
+function setChatScrollLines(amount) {
+ scrollAmount = amount;
+}
+
+// ===========================================================================
+
+function setChatTimeStampsState(state) {
+ chatTimeStampsEnabled = state;
+ updateChatBox();
+}
+
+// ===========================================================================
+
+function setChatEmojiState(state) {
+ chatEmojiEnabled = state;
+ updateChatBox();
+}
+
+// ===========================================================================
+
+function setChatAutoHideDelay(delay) {
+ chatAutoHideDelay = delay * 1000;
+}
+
+// ===========================================================================
+
+function addToChatBoxHistory(messageString, colour, hour, minute, second) {
+ chatBoxHistory.push([messageString, colour, hour, minute, second]);
+}
+
+// ===========================================================================
+
+function chatBoxScrollUp() {
+ if (bottomMessageIndex > maxChatBoxLines) {
+ bottomMessageIndex = bottomMessageIndex - scrollAmount;
+ updateChatBox();
+ }
+}
+
+// ===========================================================================
+
+function chatBoxScrollDown() {
+ if (bottomMessageIndex < chatBoxHistory.length - 1) {
+ bottomMessageIndex = bottomMessageIndex + scrollAmount;
+ updateChatBox();
+ }
+}
+
+// ===========================================================================
+
+function clearChatBox() {
+ for (let i = 0; i <= maxChatBoxLines; i++) {
+ message("", COLOUR_WHITE);
+ }
+}
+
+// ===========================================================================
+
+function updateChatBox() {
+ clearChatBox();
+ for (let i = bottomMessageIndex - maxChatBoxLines; i <= bottomMessageIndex; i++) {
+ 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]}`;
+ }
+
+ outputString = replaceColoursInMessage(outputString);
+
+ if (chatEmojiEnabled == true) {
+ outputString = replaceEmojiInMessage(outputString);
+ }
+
+ if (profanityFilterEnabled == true) {
+ outputString = replaceProfanityInMessage(outputString);
+ }
+
+ message(outputString, chatBoxHistory[i][1]);
+ } else {
+ message("", COLOUR_WHITE);
+ }
+ }
+ chatLastUse = getCurrentUnixTimestamp();
+}
+
+// ===========================================================================
+
+function processMouseWheelForChatBox(mouseId, deltaCoordinates, flipped) {
+ // There isn't a way to detect whether chat input is active, but mouse cursor is forced shown when typing so ¯\_(ツ)_/¯
+ if (!gui.cursorEnabled) {
+ return false;
+ }
+
+ if (!flipped) {
+ if (deltaCoordinates.y > 0) {
+ chatBoxScrollUp();
+ } else {
+ chatBoxScrollDown();
+ }
+ } else {
+ if (deltaCoordinates.y > 0) {
+ chatBoxScrollDown();
+ } else {
+ chatBoxScrollUp();
+ }
+ }
+}
+
+// ===========================================================================
+
+function checkChatAutoHide() {
+ return false;
+
+ // Make sure chat input isn't active
+ if (gui.cursorEnabled) {
+ return false;
+ }
+
+ // Don't process auto-hide if it's disabled
+ if (chatAutoHideDelay == 0) {
+ return false;
+ }
+
+ if (getCurrentUnixTimestamp() - chatLastUse >= chatAutoHideDelay) {
+ setChatWindowEnabled(false);
+ }
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/chatbox.js b/scripts/client/chatbox.js
deleted file mode 100644
index bc71ebf7..00000000
--- a/scripts/client/chatbox.js
+++ /dev/null
@@ -1,171 +0,0 @@
-// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
-// ===========================================================================
-// FILE: chatbox.js
-// DESC: Provides extra chatbox features
-// TYPE: Client (JavaScript)
-// ===========================================================================
-
-// ===========================================================================
-
-let chatBoxHistory = [];
-let bottomMessageIndex = 0;
-let maxChatBoxHistory = 500;
-
-let scrollAmount = 1;
-let maxChatBoxLines = 6;
-
-let chatAutoHideDelay = 0;
-let chatLastUse = 0;
-
-let scrollUpKey = false;
-let scrollDownKey = false;
-
-// ===========================================================================
-
-function initChatBoxScript() {
- logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Initializing chatbox script ...");
- scrollUpKey = getKeyIdFromParams("pageup");
- scrollDownKey = getKeyIdFromParams("pagedown");
- bindChatBoxKeys();
- logToConsole(LOG_DEBUG, "[VRR.ChatBox]: Chatbox script initialized!");
-}
-
-// ===========================================================================
-
-function bindChatBoxKeys() {
- bindKey(toInteger(scrollUpKey), KEYSTATE_DOWN, chatBoxScrollUp);
- bindKey(toInteger(scrollDownKey), KEYSTATE_DOWN, chatBoxScrollDown);
-}
-
-// ===========================================================================
-
-function unBindChatBoxKeys() {
- unbindKey(toInteger(scrollUpKey));
- unbindKey(toInteger(scrollDownKey));
-}
-
-// ===========================================================================
-
-function receiveChatBoxMessageFromServer(messageString, colour) {
- logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`);
-
- // Just in case it's hidden by auto hide
- //setChatWindowEnabled(true);
-
- let colouredString = replaceColoursInMessage(messageString);
-
- logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Changed colours in string: ${colouredString}`);
-
- addToChatBoxHistory(colouredString, colour);
- //if(bottomMessageIndex >= chatBoxHistory.length-1) {
- message(colouredString, colour);
- bottomMessageIndex = chatBoxHistory.length-1;
- //}
-
- chatLastUse = getCurrentUnixTimestamp();
-}
-
-// ===========================================================================
-
-function setChatScrollLines(amount) {
- scrollAmount = amount;
-}
-
-// ===========================================================================
-
-function setChatAutoHideDelay(delay) {
- chatAutoHideDelay = delay*1000;
-}
-
-// ===========================================================================
-
-function addToChatBoxHistory(messageString, colour) {
- chatBoxHistory.push([messageString, colour]);
-}
-
-// ===========================================================================
-
-function chatBoxScrollUp() {
- if(bottomMessageIndex > maxChatBoxLines) {
- bottomMessageIndex = bottomMessageIndex-scrollAmount;
- updateChatBox();
- }
-}
-
-// ===========================================================================
-
-function chatBoxScrollDown() {
- if(bottomMessageIndex < chatBoxHistory.length-1) {
- bottomMessageIndex = bottomMessageIndex+scrollAmount;
- updateChatBox();
- }
-}
-
-// ===========================================================================
-
-function clearChatBox() {
- for(let i = 0 ; i <= maxChatBoxLines ; i++) {
- message("", COLOUR_WHITE);
- }
-}
-
-// ===========================================================================
-
-function updateChatBox() {
- clearChatBox();
- for(let i = bottomMessageIndex-maxChatBoxLines ; i <= bottomMessageIndex ; i++) {
- if(typeof chatBoxHistory[i] != "undefined") {
- message(chatBoxHistory[i][0], chatBoxHistory[i][1]);
- } else {
- message("", COLOUR_WHITE);
- }
- }
- chatLastUse = getCurrentUnixTimestamp();
-}
-
-// ===========================================================================
-
-function processMouseWheelForChatBox(mouseId, deltaCoordinates, flipped) {
- // There isn't a way to detect whether chat input is active, but mouse cursor is forced shown when typing so ¯\_(ツ)_/¯
- if(!gui.cursorEnabled) {
- return false;
- }
-
- if(!flipped) {
- if(deltaCoordinates.y > 0) {
- chatBoxScrollUp();
- } else {
- chatBoxScrollDown();
- }
- } else {
- if(deltaCoordinates.y > 0) {
- chatBoxScrollDown();
- } else {
- chatBoxScrollUp();
- }
- }
-}
-
-// ===========================================================================
-
-function checkChatAutoHide() {
- return false;
-
- // Make sure chat input isn't active
- if(gui.cursorEnabled) {
- return false;
- }
-
- // Don't process auto-hide if it's disabled
- if(chatAutoHideDelay == 0) {
- return false;
- }
-
- if(getCurrentUnixTimestamp()-chatLastUse >= chatAutoHideDelay) {
- setChatWindowEnabled(false);
- }
-}
-
-// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/content.js b/scripts/client/content.js
index bcae54d0..f77e4304 100644
--- a/scripts/client/content.js
+++ b/scripts/client/content.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: content.js
// DESC: Provides connection to extra content resources
@@ -9,10 +10,10 @@
function getCustomImage(imageName) {
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
- if(contentResource != null) {
- if(contentResource.isStarted) {
+ if (contentResource != null) {
+ if (contentResource.isStarted) {
let image = contentResource.exports.getCustomImage(imageName);
- if(image != null) {
+ if (image != null) {
return image;
}
}
@@ -24,10 +25,10 @@ function getCustomImage(imageName) {
function getCustomFont(fontName) {
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
- if(contentResource != null) {
- if(contentResource.isStarted) {
+ if (contentResource != null) {
+ if (contentResource.isStarted) {
let font = contentResource.exports.getCustomFont(fontName);
- if(font != null) {
+ if (font != null) {
return font;
}
}
@@ -39,10 +40,10 @@ function getCustomFont(fontName) {
function getCustomAudio(audioName) {
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
- if(contentResource != null) {
- if(contentResource.isStarted) {
+ if (contentResource != null) {
+ if (contentResource.isStarted) {
let audioFile = contentResource.exports.getCustomAudio(audioName);
- if(audioFile != null) {
+ if (audioFile != null) {
return audioFile;
}
}
@@ -54,8 +55,8 @@ function getCustomAudio(audioName) {
function playCustomAudio(audioName, volume = 0.5, loop = false) {
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
- if(contentResource != null) {
- if(contentResource.isStarted) {
+ if (contentResource != null) {
+ if (contentResource.isStarted) {
contentResource.exports.playCustomAudio(audioName, volume, loop);
}
}
diff --git a/scripts/client/cursor.js b/scripts/client/cursor.js
new file mode 100644
index 00000000..f1b231fe
--- /dev/null
+++ b/scripts/client/cursor.js
@@ -0,0 +1,40 @@
+// ===========================================================================
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
+// ===========================================================================
+// FILE: cursor.js
+// DESC: Provides cursor functions and usage
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+let cursorImage = null;
+let cursorImagePath = "files/images/cursor.png";
+let cursorSize = toVector2(16.0, 24.0);
+
+// ===========================================================================
+
+function initCursorScript() {
+ logToConsole(LOG_DEBUG, "[AGRP.Cursor]: Initializing cursor script ...");
+ let cursorStream = openFile(cursorImagePath);
+ if (cursorStream != null) {
+ cursorImage = graphics.loadPNG(cursorStream);
+ cursorStream.close();
+ }
+
+ logToConsole(LOG_INFO, "[AGRP.Cursor]: Cursor script initialized!");
+}
+
+// ===========================================================================
+
+function processMouseCursorRendering() {
+ if (isGameFeatureSupported("mouseCursor")) {
+ return false;
+ }
+
+ if (gui.cursorEnabled) {
+ graphics.drawRectangle(cursorImage, gui.cursorPosition, cursorSize);
+ }
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/economy.js b/scripts/client/economy.js
new file mode 100644
index 00000000..9f5b54d2
--- /dev/null
+++ b/scripts/client/economy.js
@@ -0,0 +1,13 @@
+// ===========================================================================
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
+// ===========================================================================
+// FILE: economy.js
+// DESC: Provides economy functions
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/event.js b/scripts/client/event.js
index 26c75abe..056fc09d 100644
--- a/scripts/client/event.js
+++ b/scripts/client/event.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: event.js
// DESC: Provides handlers for built in GTAC and Asshat-Gaming created events
@@ -8,100 +9,111 @@
// ===========================================================================
function initEventScript() {
- logToConsole(LOG_DEBUG, "[VRR.Event]: Initializing event script ...");
- addCustomEvents();
+ logToConsole(LOG_DEBUG, "[AGRP.Event]: Initializing event script ...");
addAllEventHandlers();
- logToConsole(LOG_DEBUG, "[VRR.Event]: Event script initialized!");
-}
-
-// ===========================================================================
-
-function addCustomEvents() {
- addEvent("OnLocalPlayerEnterSphere", 1);
- addEvent("OnLocalPlayerExitSphere", 1);
- addEvent("OnLocalPlayerEnteredVehicle", 1);
- addEvent("OnLocalPlayerExitedVehicle", 1);
- addEvent("OnLocalPlayerSwitchWeapon", 2);
+ logToConsole(LOG_DEBUG, "[AGRP.Event]: Event script initialized!");
}
// ===========================================================================
function addAllEventHandlers() {
- bindEventHandler("OnResourceStart", thisResource, onResourceStart);
- bindEventHandler("OnResourceReady", thisResource, onResourceReady);
- bindEventHandler("OnResourceStop", thisResource, onResourceStop);
-
+ addEventHandler("OnResourceStart", onResourceStart);
+ addEventHandler("OnResourceReady", onResourceReady);
+ addEventHandler("OnResourceStop", onResourceStop);
addEventHandler("OnProcess", onProcess);
addEventHandler("OnKeyUp", onKeyUp);
addEventHandler("OnDrawnHUD", onDrawnHUD);
-
addEventHandler("OnPedWasted", onPedWasted);
-
addEventHandler("OnElementStreamIn", onElementStreamIn);
-
- addEventHandler("OnLocalPlayerEnteredVehicle", onLocalPlayerEnteredVehicle);
- addEventHandler("OnLocalPlayerExitedVehicle", onLocalPlayerExitedVehicle);
- addEventHandler("OnLocalPlayerEnterSphere", onLocalPlayerEnterSphere);
- addEventHandler("OnLocalPlayerExitSphere", onLocalPlayerExitSphere);
- addEventHandler("OnLocalPlayerSwitchWeapon", onLocalPlayerSwitchWeapon);
-
+ addEventHandler("OnPedChangeWeapon", onPedChangeWeapon);
addEventHandler("OnPedInflictDamage", onPedInflictDamage);
-
addEventHandler("OnLostFocus", onLostFocus);
addEventHandler("OnFocus", onFocus);
-
addEventHandler("OnCameraProcess", onCameraProcess);
-
addEventHandler("OnMouseWheel", onMouseWheel);
-
addEventHandler("OnEntityProcess", onEntityProcess);
+
+ if (findResourceByName("v-events") != null) {
+ if (findResourceByName("v-events").isStarted) {
+ addEventHandler("OnPedEnteredVehicleEx", onPedEnteredVehicle);
+ addEventHandler("OnPedExitedVehicleEx", onPedExitedVehicle);
+ addEventHandler("OnPedEnteredSphereEx", onPedEnteredSphere);
+ addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
+ }
+ }
+
+ if (getGame() == AGRP_GAME_MAFIA_ONE) {
+ addEventHandler("OnMapLoaded", onMapLoaded);
+ }
}
// ===========================================================================
function onResourceStart(event, resource) {
- sendResourceStartedSignalToServer();
- //garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60);
+ if (resource == findResourceByName("v-events")) {
+ // Remove and re-add events, in case v-events was loaded after agrp_main
+ removeEventHandler("OnPedEnteredVehicleEx");
+ removeEventHandler("OnPedExitedVehicleEx");
+ removeEventHandler("OnPedEnteredSphereEx");
+ removeEventHandler("OnPedExitedSphereEx");
+
+ addEventHandler("OnPedEnteredVehicleEx", onPedEnteredVehicle);
+ addEventHandler("OnPedExitedVehicleEx", onPedExitedVehicle);
+ addEventHandler("OnPedEnteredSphereEx", onPedEnteredSphere);
+ addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
+ }
+
+ if (resource == thisResource) {
+ logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Event] onResourceStart called - Sending signal to server`);
+ garbageCollectorInterval = setInterval(collectAllGarbage, 1000 * 60);
+ localPlayerMoneyInterval = setInterval(updateLocalPlayerMoney, 1000 * 5);
+ sendResourceStartedSignalToServer();
+ }
}
// ===========================================================================
function onResourceStop(event, resource) {
- sendResourceStoppedSignalToServer();
+ if (resource == thisResource) {
+ logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Event] onResourceStop called - Sending signal to server`);
+ sendResourceStoppedSignalToServer();
+ }
}
// ===========================================================================
function onResourceReady(event, resource) {
- sendResourceReadySignalToServer();
+ if (resource == thisResource) {
+ logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.Event] onResourceReady called - Sending signal to server`);
+ loadLocaleConfig();
+ sendResourceReadySignalToServer();
+ }
}
// ===========================================================================
function onProcess(event, deltaTime) {
- if(localPlayer == null) {
+ logToConsole(LOG_VERBOSE, `[AGRP.Event] onProcess`);
+ if (localPlayer == null) {
return false;
}
- if(!isSpawned) {
+ if (!isSpawned) {
return false;
}
processSync();
processLocalPlayerControlState();
processLocalPlayerVehicleControlState();
- processLocalPlayerSphereEntryExitHandling();
- processLocalPlayerVehicleEntryExitHandling();
- processJobRouteSphere();
forceLocalPlayerEquippedWeaponItem();
processWantedLevelReset();
processGameSpecifics();
processNearbyPickups();
processVehiclePurchasing();
processVehicleBurning();
+ processVehicleCruiseControl();
//checkChatBoxAutoHide(); // Will be uncommented on 1.4.0 GTAC update
//processVehicleFires();
-
}
// ===========================================================================
@@ -116,11 +128,14 @@ function onKeyUp(event, keyCode, scanCode, keyModifiers) {
// ===========================================================================
function onDrawnHUD(event) {
- if(!renderHUD) {
+ logToConsole(LOG_VERBOSE, `[AGRP.Event] HUD drawn`);
+ processMouseCursorRendering();
+
+ if (!renderHUD) {
return false;
}
- if(localPlayer == null) {
+ if (!localPlayer) {
return false;
}
@@ -137,7 +152,7 @@ function onDrawnHUD(event) {
// ===========================================================================
function onPedWasted(event, wastedPed, killerPed, weapon, pedPiece) {
- logToConsole(LOG_DEBUG, `[VRR.Event] Ped ${wastedPed.name} died`);
+ logToConsole(LOG_DEBUG, `[AGRP.Event] Ped ${wastedPed.name} died`);
wastedPed.clearWeapons();
}
@@ -149,45 +164,23 @@ function onElementStreamIn(event, element) {
// ===========================================================================
-function onLocalPlayerExitedVehicle(event, vehicle, seat) {
- logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited vehicle`);
- sendNetworkEventToServer("vrr.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
+function onPedExitedVehicle(event, ped, vehicle, seat) {
+ //logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`);
+ //sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
- if(inVehicleSeat) {
- parkedVehiclePosition = false;
- parkedVehicleHeading = false;
- }
-}
+ cruiseControlEnabled = false;
+ cruiseControlSpeed = 0.0;
-// ===========================================================================
-
-function onLocalPlayerEnteredVehicle(event, vehicle, seat) {
- logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered vehicle`);
-
- sendNetworkEventToServer("vrr.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
-
- //if(inVehicleSeat == 0) {
- //setVehicleEngine(vehicle, false);
- //if(!inVehicle.engine) {
- // parkedVehiclePosition = inVehicle.position;
- // parkedVehicleHeading = inVehicle.heading;
- //}
- //}
-}
-
-// ===========================================================================
-
-function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healthLoss, pedPiece) {
- //let damagerEntityString = (!isNull(damagedEntity)) ? `${damagerEntity.name} (${damagerEntity.name}, ${damagerEntity.type} - ${typeof damagerEntity})` : `Unknown ped`;
- //let damagedEntityString = (!isNull(damagedEntity)) ? `${damagedEntity.name} (${damagedEntity.name}, ${damagedEntity.type} - ${typeof damagedEntity})` : `Unknown ped`;
- //logToConsole(LOG_DEBUG, `[VRR.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`);
- if(!isNull(damagedEntity) && !isNull(damagerEntity)) {
- if(damagedEntity.isType(ELEMENT_PLAYER)) {
- if(damagedEntity == localPlayer) {
- //if(!weaponDamageEnabled[damagerEntity.name]) {
- preventDefaultEventAction(event);
- sendNetworkEventToServer("vrr.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss);
- //}
+ if (localPlayer != null) {
+ if (ped == localPlayer) {
+ if (areServerElementsSupported()) {
+ if (inVehicleSeat == 0) {
+ //setVehicleEngine(vehicle.id, false);
+ if (!inVehicle.engine) {
+ parkedVehiclePosition = false;
+ parkedVehicleHeading = false;
+ }
+ }
}
}
}
@@ -195,17 +188,74 @@ function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healt
// ===========================================================================
-function onLocalPlayerEnterSphere(event, sphere) {
- logToConsole(LOG_DEBUG, `[VRR.Event] Local player entered sphere`);
- if(sphere == jobRouteLocationSphere) {
+function onPedExitingVehicle(event, ped, vehicle, seat) {
+ //logToConsole(LOG_DEBUG, `[AGRP.Event] Local player exited vehicle`);
+ //sendNetworkEventToServer("agrp.onPlayerExitVehicle", getVehicleForNetworkEvent(vehicle), seat);
+
+ if (localPlayer != null) {
+ if (ped == localPlayer) {
+ cruiseControlEnabled = false;
+ cruiseControlSpeed = 0.0;
+ }
+ }
+}
+
+// ===========================================================================
+
+function onPedEnteredVehicle(event, ped, vehicle, seat) {
+ logToConsole(LOG_DEBUG, `[AGRP.Event] Ped entered vehicle`);
+ //sendNetworkEventToServer("agrp.onPlayerEnterVehicle", getVehicleForNetworkEvent(vehicle), seat);
+
+ cruiseControlEnabled = false;
+ cruiseControlSpeed = 0.0;
+
+ if (localPlayer != null) {
+ if (ped == localPlayer) {
+ if (areServerElementsSupported()) {
+ if (inVehicleSeat == 0) {
+ //parkedVehiclePosition = inVehicle.position;
+ //parkedVehicleHeading = inVehicle.heading;
+ if (doesEntityDataExist(vehicle, "agrp.server") == true) {
+ setVehicleEngine(vehicle.id, false);
+ setVehicleEngine(vehicle.id, getEntityData(vehicle, "agrp.engine"));
+ //setLocalPlayerControlState(false, false);
+ }
+ }
+ }
+ }
+ }
+}
+
+// ===========================================================================
+
+function onPedInflictDamage(event, damagedEntity, damagerEntity, weaponId, healthLoss, pedPiece) {
+ //let damagerEntityString = (!isNull(damagedEntity)) ? `${damagerEntity.name} (${damagerEntity.name}, ${damagerEntity.type} - ${typeof damagerEntity})` : `Unknown ped`;
+ //let damagedEntityString = (!isNull(damagedEntity)) ? `${damagedEntity.name} (${damagedEntity.name}, ${damagedEntity.type} - ${typeof damagedEntity})` : `Unknown ped`;
+ //logToConsole(LOG_DEBUG, `[AGRP.Event] ${damagerEntityString} damaged ${damagedEntityString}'s '${pedPiece} with weapon ${weaponId}`);
+ if (!isNull(damagedEntity) && !isNull(damagerEntity)) {
+ if (damagedEntity.isType(ELEMENT_PLAYER)) {
+ if (damagedEntity == localPlayer) {
+ if (!weaponDamageEnabled[damagerEntity.name]) {
+ preventDefaultEventAction(event);
+ }
+ sendNetworkEventToServer("agrp.weaponDamage", damagerEntity.name, weaponId, pedPiece, healthLoss);
+ }
+ }
+ }
+}
+
+// ===========================================================================
+
+function onPedEnteredSphere(event, ped, sphere) {
+ if (sphere == jobRouteLocationSphere) {
enteredJobRouteSphere();
}
}
// ===========================================================================
-function onLocalPlayerExitSphere(event, sphere) {
- logToConsole(LOG_DEBUG, `[VRR.Event] Local player exited sphere`);
+function onPedExitedSphere(event, ped, sphere) {
+
}
// ===========================================================================
@@ -222,7 +272,7 @@ function onFocus(event) {
// ===========================================================================
-function onLocalPlayerSwitchWeapon(oldWeapon, newWeapon) {
+function onPedChangeWeapon(event, ped, oldWeapon, newWeapon) {
}
@@ -241,13 +291,13 @@ function onMouseWheel(event, mouseId, deltaCoordinates, flipped) {
// ===========================================================================
function onEntityProcess(event, entity) {
- if(!isSpawned) {
- return false;
- }
- //if(entity.isType(ELEMENT_PED) && !entity.isType(ELEMENT_PLAYER)) {
- // processNPCMovement(entity);
- //}
+}
+
+// ===========================================================================
+
+function onMapLoaded(mapName) {
+ sendNetworkEventToServer("agrp.mapLoaded", mapName);
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gps.js b/scripts/client/gps.js
index ee6415e9..4e1e2c6c 100644
--- a/scripts/client/gps.js
+++ b/scripts/client/gps.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: gps.js
// DESC: Provides GPS functions and usage
@@ -16,9 +17,9 @@ let gpsBlipBlinkTimer = null;
// ===========================================================================
function showGPSLocation(position, colour) {
- logToConsole(LOG_DEBUG, `[VRR.GPS] Showing gps location`);
- if(getMultiplayerMod() == VRR_MPMOD_GTAC) {
- if(getGame() == VRR_GAME_GTA_SA) {
+ logToConsole(LOG_DEBUG, `[AGRP.GPS] Showing gps location`);
+ if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
+ if (getGame() == AGRP_GAME_GTA_SA) {
// Server-side spheres don't show in GTA SA for some reason.
gpsSphere = game.createPickup(1318, position, 1);
} else {
@@ -26,7 +27,7 @@ function showGPSLocation(position, colour) {
gpsSphere.colour = colour;
}
- if(gpsBlip != null) {
+ if (gpsBlip != null) {
destroyElement(gpsBlip);
}
@@ -40,16 +41,16 @@ function showGPSLocation(position, colour) {
function blinkGPSBlip(times, position, colour) {
gpsBlipBlinkTimes = times;
- gpsBlipBlinkTimer = setInterval(function() {
- if(gpsBlip != null) {
+ gpsBlipBlinkTimer = setInterval(function () {
+ if (gpsBlip != null) {
destroyElement(gpsBlip);
gpsBlip = null;
} else {
gpsBlip = game.createBlip(position, 0, 2, colour);
}
- if(gpsBlipBlinkAmount >= gpsBlipBlinkTimes) {
- if(gpsBlip != null) {
+ if (gpsBlipBlinkAmount >= gpsBlipBlinkTimes) {
+ if (gpsBlip != null) {
destroyElement(gpsBlip);
gpsBlip = null;
}
diff --git a/scripts/client/gui.js b/scripts/client/gui.js
index 853dcb58..2093a6d6 100644
--- a/scripts/client/gui.js
+++ b/scripts/client/gui.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: gui.js
// DESC: Provides GUI functionality and styles (using MexUI)
@@ -40,14 +41,14 @@ let creatingCharacter = false;
// ===========================================================================
function initGUIScript() {
- logToConsole(LOG_DEBUG, "[VRR.GUI]: Initializing GUI script ...");
- logToConsole(LOG_DEBUG, "[VRR.GUI]: GUI script initialized!");
+ logToConsole(LOG_DEBUG, "[AGRP.GUI]: Initializing GUI script ...");
+ logToConsole(LOG_DEBUG, "[AGRP.GUI]: GUI script initialized!");
}
// ===========================================================================
function initGUI() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Initializing GUI ...`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Initializing GUI ...`);
initLoginGUI();
initRegisterGUI();
@@ -65,21 +66,15 @@ function initGUI() {
closeAllWindows();
guiReady = true;
- logToConsole(LOG_DEBUG, `[VRR.GUI] All GUI created successfully!`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] All GUI created successfully!`);
- loadLocaleConfig();
- loadAllLocaleStrings();
-
- resetGUIStrings();
- resetLocaleChooserOptions();
-
- sendNetworkEventToServer("vrr.guiReady", true);
+ sendNetworkEventToServer("agrp.guiReady", true);
};
// ===========================================================================
function closeAllWindows() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Closing all GUI windows`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing all GUI windows`);
infoDialog.window.shown = false;
yesNoDialog.window.shown = false;
errorDialog.window.shown = false;
@@ -108,55 +103,55 @@ function closeAllWindows() {
// ===========================================================================
function isAnyGUIActive() {
- if(!guiReady) {
+ if (!guiReady) {
return false;
}
- if(infoDialog.window.shown == true) {
+ if (infoDialog.window.shown == true) {
return true;
}
- if(yesNoDialog.window.shown == true) {
+ if (yesNoDialog.window.shown == true) {
return true;
}
- if(errorDialog.window.shown == true) {
+ if (errorDialog.window.shown == true) {
return true;
}
- if(register.window.shown == true) {
+ if (register.window.shown == true) {
return true;
}
- if(login.window.shown == true) {
+ if (login.window.shown == true) {
return true;
}
- if(newCharacter.window.shown == true) {
+ if (newCharacter.window.shown == true) {
return true;
}
- if(characterSelect.window.shown == true) {
+ if (characterSelect.window.shown == true) {
return true;
}
- if(twoFactorAuth.window.shown == true) {
+ if (twoFactorAuth.window.shown == true) {
return true;
}
- if(listDialog.window.shown == true) {
+ if (listDialog.window.shown == true) {
return true;
}
- if(passwordReset.window.shown == true) {
+ if (passwordReset.window.shown == true) {
return true;
}
- if(passwordChange.window.shown == true) {
+ if (passwordChange.window.shown == true) {
return true;
}
- if(localeChooser.window.shown == true) {
+ if (localeChooser.window.shown == true) {
return true;
}
@@ -166,11 +161,11 @@ function isAnyGUIActive() {
// ===========================================================================
function setGUIColours(red1, green1, blue1, red2, green2, blue2, red3, green3, blue3) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Received new GUI colours from server: ${red1}, ${green1}, ${blue1} / ${red2}, ${green2}, ${blue2} / ${red3}, ${green3}, ${blue3}`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Received new GUI colours from server: ${red1}, ${green1}, ${blue1} / ${red2}, ${green2}, ${blue2} / ${red3}, ${green3}, ${blue3}`);
primaryColour = [red1, green1, blue1];
secondaryColour = [red2, green2, blue2];
primaryTextColour = [red3, green3, blue3];
- focusedColour = [red1+focusedColourOffset, green1+focusedColourOffset, blue1+focusedColourOffset];
+ focusedColour = [red1 + focusedColourOffset, green1 + focusedColourOffset, blue1 + focusedColourOffset];
initGUI();
}
@@ -186,41 +181,45 @@ function hideAllGUI() {
// ===========================================================================
function processGUIKeyPress(keyCode) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Processing key press: ${keyCode}`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Processing key press: ${keyCode}`);
- if(!isAnyGUIActive()) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] GUI is not active. Cancelling keypress processing.`);
+ if (!guiReady) {
return false;
}
- if(keyCode == SDLK_RETURN || keyCode == SDLK_RETURN2) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is submit (${guiSubmitKey})`);
- if(guiSubmitKey != false) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Calling submit key function`);
+ if (!isAnyGUIActive()) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] GUI is not active. Cancelling keypress processing.`);
+ return false;
+ }
+
+ if (keyCode == SDLK_RETURN || keyCode == SDLK_RETURN2) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is submit (${guiSubmitKey})`);
+ if (guiSubmitKey != false) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling submit key function`);
guiSubmitKey.call();
}
- } else if(keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is left (${guiLeftKey})`);
- if(guiLeftKey != false) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Calling left key function`);
+ } else if (keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is left (${guiLeftKey})`);
+ if (guiLeftKey != false) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling left key function`);
guiLeftKey.call();
}
- } else if(keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is right (${guiRightKey})`);
- if(guiRightKey != false) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Calling right key function`);
+ } else if (keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is right (${guiRightKey})`);
+ if (guiRightKey != false) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling right key function`);
guiRightKey.call();
}
- } else if(keyCode == getKeyIdFromParams("down") || keyCode == getKeyIdFromParams("s")) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is down (${guiDownKey})`);
- if(guiDownKey != false) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Calling down key function`);
+ } else if (keyCode == getKeyIdFromParams("down") || keyCode == getKeyIdFromParams("s")) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is down (${guiDownKey})`);
+ if (guiDownKey != false) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling down key function`);
guiDownKey.call();
}
- } else if(keyCode == getKeyIdFromParams("up") || keyCode == getKeyIdFromParams("w")) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Key press is up (${guiUpKey})`);
- if(guiUpKey != false) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Calling up key function`);
+ } else if (keyCode == getKeyIdFromParams("up") || keyCode == getKeyIdFromParams("w")) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Key press is up (${guiUpKey})`);
+ if (guiUpKey != false) {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Calling up key function`);
guiUpKey.call();
}
}
@@ -229,14 +228,18 @@ function processGUIKeyPress(keyCode) {
// ===========================================================================
function processToggleGUIKeyPress(keyCode) {
- if(keyCode == disableGUIKey) {
- sendNetworkEventToServer("vrr.toggleGUI");
+ if (keyCode == disableGUIKey) {
+ sendNetworkEventToServer("agrp.toggleGUI");
}
}
// ===========================================================================
function resetGUIStrings() {
+ if (!guiReady) {
+ return false;
+ }
+
// Login GUI
login.messageLabel.text = getLocaleString("GUILoginWindowLabelEnterPassword");
login.passwordInput.placeholder = getLocaleString("GUILoginWindowPasswordPlaceholder");
@@ -280,4 +283,16 @@ function resetGUIStrings() {
newCharacter.firstNameInput.placeholder = getLocaleString("GUINewCharacterFirstNamePlaceholder");
newCharacter.lastNameInput.placeholder = getLocaleString("GUINewCharacterLastNamePlaceholder");
newCharacter.createCharacterButton.text = toUpperCase(getLocaleString("GUINewCharacterSubmitButton"));
-}
\ No newline at end of file
+}
+
+// ===========================================================================
+
+function dimAllGUIElementsInWindow(guiObject) {
+ for (let i in guiObject) {
+ if (i != "window") {
+ guiObject[i].shown = false;
+ }
+ }
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/2fa.js b/scripts/client/gui/2fa.js
index 8bdebc81..0f26a31b 100644
--- a/scripts/client/gui/2fa.js
+++ b/scripts/client/gui/2fa.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: 2fa.js
// DESC: Provides two factor authentication GUI
@@ -20,8 +21,8 @@ let twoFactorAuth = {
// ===========================================================================
function initTwoFactorAuthenticationGUI() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Creating two factor auth GUI ...`);
- twoFactorAuth.window = mexui.window(game.width/2-150, game.height/2-129, 300, 258, 'LOGIN', {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating two factor auth GUI ...`);
+ twoFactorAuth.window = mexui.window(game.width / 2 - 150, game.height / 2 - 129, 300, 258, 'LOGIN', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
transitionTime: 500,
@@ -38,7 +39,7 @@ function initTwoFactorAuthenticationGUI() {
borderColour: toColour(0, 0, 0, 0),
},
});
- twoFactorAuth.window.titleBarIconSize = toVector2(0,0);
+ twoFactorAuth.window.titleBarIconSize = toVector2(0, 0);
twoFactorAuth.window.titleBarHeight = 0;
twoFactorAuth.qrCode = twoFactorAuth.window.image(100, 20, 100, 100, mainLogoPath, {
@@ -94,14 +95,14 @@ function initTwoFactorAuthenticationGUI() {
},
}, checkTwoFactorAuth);
- logToConsole(LOG_DEBUG, `[VRR.GUI] Created two factor auth GUI`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Created two factor auth GUI`);
}
// ===========================================================================
function showTwoFactorAuthGUI() {
closeAllWindows();
- logToConsole(LOG_DEBUG, `[VRR.GUI] Showing two-factor authentication window`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing two-factor authentication window`);
setChatWindowEnabled(false);
mexui.setInput(true);
twoFactorAuth.window.shown = true;
@@ -112,7 +113,7 @@ function showTwoFactorAuthGUI() {
// ===========================================================================
function twoFactorAuthFailed(errorMessage) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports two-factor authentication failed. Reason: ${errorMessage}`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports two-factor authentication failed. Reason: ${errorMessage}`);
twoFactorAuth.messageLabel.text = errorMessage;
twoFactorAuth.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
twoFactorAuth.codeInput.text = "";
@@ -121,15 +122,15 @@ function twoFactorAuthFailed(errorMessage) {
// ===========================================================================
function twoFactorAuthSuccess() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports two-factor authentication was successful`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports two-factor authentication was successful`);
closeAllWindows();
}
// ===========================================================================
function checkTwoFactorAuth() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Checking two-factor authentication with server ...`);
- sendNetworkEventToServer("vrr.2fa", twoFactorAuth.codeInput.lines[0]);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking two-factor authentication with server ...`);
+ sendNetworkEventToServer("agrp.2fa", twoFactorAuth.codeInput.lines[0]);
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/bizmgr.js b/scripts/client/gui/bizmgr.js
index bce4ce16..27c80221 100644
--- a/scripts/client/gui/bizmgr.js
+++ b/scripts/client/gui/bizmgr.js
@@ -1,8 +1,85 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: bizmgr.js
// DESC: Provides business manager GUI
// TYPE: Client (JavaScript)
+// ===========================================================================
+
+/*
+class BusinessManagerData {
+ constructor(businessIndex, name, locked, entranceFee, buyPrice, rentPrice, floorItems, storageItems) {
+ this.businessIndex = businessIndex;
+ this.name = name;
+ this.locked = locked;
+ this.entranceFee = entranceFee;
+ this.buyPrice = buyPrice;
+ this.rentPrice = rentPrice;
+ this.till = till;
+ this.ownerName = ownerName;
+ this.floorItems = floorItems;
+ this.storageItems = storageItems;
+ }
+}
+
+// ===========================================================================
+
+let businessManager = {
+ window: null,
+ generalTabButton: null,
+ floorItemsTab: null,
+ storageItemsTab: null,
+ orderItemsTab: null,
+ data: null,
+
+ // General Tab
+ businessName: null,
+ businessOwnerName: null,
+ businessEntranceFee: null,
+ businessBuyPrice: null,
+ businessRentPrice: null,
+
+};
+
+// ===========================================================================
+
+function initBusinessManagerGUI() {
+
+}
+
+// ===========================================================================
+
+function showBusinessManagerGUI() {
+
+}
+
+// ===========================================================================
+
+function hideBusinessManagerGUI() {
+
+}
+
+// ===========================================================================
+
+function updateBusinessManagerGUIStrings() {
+
+}
+
+// ===========================================================================
+
+function receiveBusinessManagerData(businessIndex, name, locked, entranceFee, buyPrice, rentPrice, floorItems, storageItems) {
+ let businessManagerData = new BusinessManagerData(businessIndex, name, locked, entranceFee, buyPrice, rentPrice, floorItems, storageItems);
+ businessManager.data = businessManagerData;
+ updateBusinessManagerGUIStrings();
+}
+
+// ===========================================================================
+
+function saveBusinessData() {
+ sendNetworkEventToServer("agrp.businessManagerSave", businessManager.data.businessIndex);
+}
+*/
+
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/changepass.js b/scripts/client/gui/changepass.js
index 39476dfd..2c9bb077 100644
--- a/scripts/client/gui/changepass.js
+++ b/scripts/client/gui/changepass.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: changepass.js
// DESC: Provides change password GUI
@@ -19,8 +20,8 @@ let passwordChange = {
// ===========================================================================
function initChangePasswordGUI() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Creating password change GUI ...`);
- passwordChange.window = mexui.window(game.width/2-130, game.height/2-125, 300, 250, 'Change Password', {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating password change GUI ...`);
+ passwordChange.window = mexui.window(game.width / 2 - 130, game.height / 2 - 125, 300, 250, 'Change Password', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
transitionTime: 500,
@@ -36,17 +37,17 @@ function initChangePasswordGUI() {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
}
});
- passwordChange.window.titleBarIconSize = toVector2(0,0);
+ passwordChange.window.titleBarIconSize = toVector2(0, 0);
passwordChange.window.titleBarHeight = 0;
passwordChange.window.titleBarShown = false;
- passwordChange.window.image(85, -10, 140, 140, mainLogoPath, {
+ passwordChange.window.image(100, 20, 75, 75, mainLogoPath, {
focused: {
borderColour: toColour(0, 0, 0, 0),
},
});
- passwordChange.messageLabel = passwordChange.window.text(20, 75, 260, 20, 'Enter a new password', {
+ passwordChange.messageLabel = passwordChange.window.text(20, 95, 260, 20, 'Enter a new password', {
main: {
textSize: 10.0,
textAlign: 0.5,
@@ -110,13 +111,13 @@ function initChangePasswordGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], buttonAlpha),
},
}, checkChangePassword);
- logToConsole(LOG_DEBUG, `[VRR.GUI] Created change password GUI`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Created change password GUI`);
}
// ===========================================================================
function passwordChangeFailed(errorMessage) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports change password failed. Reason: ${errorMessage}`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports change password failed. Reason: ${errorMessage}`);
passwordChange.messageLabel.text = errorMessage;
passwordChange.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
passwordChange.passwordInput.text = "";
@@ -127,14 +128,14 @@ function passwordChangeFailed(errorMessage) {
// ===========================================================================
function checkChangePassword() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Checking password change with server ...`);
- sendNetworkEventToServer("vrr.checkChangePassword", passwordChange.passwordInput.lines[0], passwordChange.confirmPasswordInput.lines[0]);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Checking password change with server ...`);
+ sendNetworkEventToServer("agrp.checkChangePassword", passwordChange.passwordInput.lines[0], passwordChange.confirmPasswordInput.lines[0]);
}
// ===========================================================================
function showChangePasswordGUI(errorMessage) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Showing change password window`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing change password window`);
closeAllWindows();
setChatWindowEnabled(false);
mexui.setInput(true);
@@ -143,13 +144,13 @@ function showChangePasswordGUI(errorMessage) {
mexui.focusedControl = passwordChange.passwordInput;
guiSubmitKey = checkChangePassword;
- showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), passwordChange.window.position.y+passwordChange.window.size.y+20));
+ showLocaleChooserGUI(new Vec2(getScreenWidth() / 2 - (localeChooser.window.size.x / 2), passwordChange.window.position.y + passwordChange.window.size.y + 20));
}
// ===========================================================================
function passwordChangeSuccess() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports password change was successful`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports password change was successful`);
guiSubmitKey = false;
closeAllWindows();
}
diff --git a/scripts/client/gui/charselect.js b/scripts/client/gui/charselect.js
index 434e3a91..846fb409 100644
--- a/scripts/client/gui/charselect.js
+++ b/scripts/client/gui/charselect.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: charselect.js
// DESC: Provides character select GUI
@@ -23,23 +24,23 @@ let characterSelect = {
// ===========================================================================
function initCharacterSelectGUI() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Creating character select GUI ...`);
- characterSelect.window = mexui.window(game.width/2-215, game.height/2-83, 430, 190, 'SELECT CHARACTER', {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating character select GUI ...`);
+ characterSelect.window = mexui.window(game.width / 2 - 215, game.height / 2 - 83, 430, 190, 'SELECT CHARACTER', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
},
- title: {
+ title: {
textSize: 12.0,
textFont: mainFont,
- textColour: toColour(0, 0, 0, 255),
- backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
- },
- icon: {
+ textColour: toColour(0, 0, 0, 255),
+ backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
+ },
+ icon: {
textSize: 10.0,
textFont: mainFont,
- textColour: toColour(0, 0, 0, 255),
- backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
- }
+ textColour: toColour(0, 0, 0, 255),
+ backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
+ }
});
characterSelect.window.titleBarIconSize = toVector2(0, 0);
characterSelect.window.titleBarIconShown = false;
@@ -150,18 +151,18 @@ function initCharacterSelectGUI() {
borderColour: toColour(0, 0, 0, 0),
}
});
- logToConsole(LOG_DEBUG, `[VRR.GUI] Created character select GUI`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Created character select GUI`);
}
// ===========================================================================
function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, skinId) {
closeAllWindows();
- logToConsole(LOG_DEBUG, `[VRR.GUI] Showing character selection window`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing character selection window`);
setChatWindowEnabled(false);
mexui.setInput(true);
characterSelect.nameText.text = `${firstName} ${lastName}`;
- characterSelect.cashText.text = `Money: $${cash}`;
+ characterSelect.cashText.text = `Money: ${getCurrencyString(cash)}`;
characterSelect.clanText.text = `Clan: ${clan}`;
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
characterSelect.skinImage = characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
@@ -171,53 +172,53 @@ function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, ski
guiLeftKey = selectPreviousCharacter;
guiRightKey = selectNextCharacter;
- showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), characterSelect.window.position.y+characterSelect.window.size.y+20));
+ showLocaleChooserGUI(new Vec2(getScreenWidth() / 2 - (localeChooser.window.size.x / 2), characterSelect.window.position.y + characterSelect.window.size.y + 20));
}
// ===========================================================================
function showNewCharacter() {
closeAllWindows();
- logToConsole(LOG_DEBUG, `[VRR.GUI] Showing new character dialog window`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing new character dialog window`);
showNewCharacterGUI();
}
// ===========================================================================
function selectNextCharacter() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Requesting next character info from server for character select window`);
- sendNetworkEventToServer("vrr.nextCharacter");
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting next character info from server for character select window`);
+ sendNetworkEventToServer("agrp.nextCharacter");
}
// ===========================================================================
function selectPreviousCharacter() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Requesting previous character info from server for character select window`);
- sendNetworkEventToServer("vrr.previousCharacter");
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Requesting previous character info from server for character select window`);
+ sendNetworkEventToServer("agrp.previousCharacter");
}
// ===========================================================================
function selectThisCharacter() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Tell server the current shown character was selected in character select window`);
- sendNetworkEventToServer("vrr.selectCharacter");
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Tell server the current shown character was selected in character select window`);
+ sendNetworkEventToServer("agrp.selectCharacter");
}
// ===========================================================================
function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, skinId) {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Updating character info with data from server`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Updating character info with data from server`);
setChatWindowEnabled(false);
characterSelect.window.shown = false;
characterSelect.nameText.text = `${firstName} ${lastName}`;
- characterSelect.cashText.text = `Money: $${cash}`;
+ characterSelect.cashText.text = `Money: ${getCurrencyString(cash)}`;
characterSelect.clanText.text = `Clan: ${clan}`;
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
- if(characterSelect.skinImage != null) {
+ if (characterSelect.skinImage != null) {
characterSelect.skinImage.remove();
}
- characterSelect.skinImage = (getGame() == VRR_GAME_GTA_III) ? characterSelect.window.image(310, 32, 100, 90, `files/images/skins/gta3/${getSkinImage(skinId)}.png`) : characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
+ characterSelect.skinImage = (getGame() == AGRP_GAME_GTA_III) ? characterSelect.window.image(310, 32, 100, 90, `files/images/skins/gta3/${getSkinImage(skinId)}.png`) : characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
characterSelect.window.shown = true;
@@ -229,18 +230,18 @@ function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, s
// ===========================================================================
function characterSelectSuccess() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports character selection was successful`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Server reports character selection was successful`);
closeAllWindows();
}
// ===========================================================================
function getSkinImage(skinId, gameId = getGame()) {
- if(skinId < 10) {
+ if (skinId < 10) {
return `Skin_00${skinId}.png`;
- } else if(skinId > 10 && skinId < 100) {
+ } else if (skinId > 10 && skinId < 100) {
return `Skin_0${skinId}.png`;
- } else if(skinId > 100) {
+ } else if (skinId > 100) {
return `Skin_${skinId}.png`;
}
}
diff --git a/scripts/client/gui/clanmgr.js b/scripts/client/gui/clanmgr.js
index 33348a65..05111540 100644
--- a/scripts/client/gui/clanmgr.js
+++ b/scripts/client/gui/clanmgr.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: clanmgr.js
// DESC: Provides clan manager GUI
@@ -9,12 +10,16 @@
let clanManager = {
window: null,
- generalTab: null,
- ranksTab: null,
- membersTab: null,
- vehiclesTab: null,
- businessesTab: null,
- housesTab: null,
+ generalTabButton: null,
+ ranksTabButton: null,
+ membersTabButton: null,
+ vehiclesTabButton: null,
+ businessesTabButton: null,
+ housesTabButton: null,
};
-// ===========================================================================
\ No newline at end of file
+// ===========================================================================
+
+function initClanManagerGUI() {
+
+}
\ No newline at end of file
diff --git a/scripts/client/gui/error.js b/scripts/client/gui/error.js
index 360afa9e..0926736a 100644
--- a/scripts/client/gui/error.js
+++ b/scripts/client/gui/error.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: error.js
// DESC: Provides error box GUI
@@ -16,8 +17,8 @@ let errorDialog = {
// ===========================================================================
function initErrorDialogGUI() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Creating error GUI ...`);
- errorDialog.window = mexui.window(getScreenWidth()/2-200, getScreenHeight()/2-70, 400, 140, 'ERROR', {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating error GUI ...`);
+ errorDialog.window = mexui.window(getScreenWidth() / 2 - 200, getScreenHeight() / 2 - 70, 400, 140, 'ERROR', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
transitionTime: 500,
@@ -58,14 +59,14 @@ function initErrorDialogGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
},
}, closeErrorDialog);
- logToConsole(LOG_DEBUG, `[VRR.GUI] Created error GUI ...`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Created error GUI ...`);
}
// ===========================================================================
function showErrorGUI(errorMessage, errorTitle, buttonText) {
closeAllWindows();
- logToConsole(LOG_DEBUG, `[VRR.GUI] Showing error window. Error: ${errorTitle} - ${errorMessage}`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing error window. Error: ${errorTitle} - ${errorMessage}`);
setChatWindowEnabled(false);
mexui.setInput(true);
errorDialog.messageLabel.text = errorMessage;
@@ -77,7 +78,7 @@ function showErrorGUI(errorMessage, errorTitle, buttonText) {
// ===========================================================================
function closeErrorDialog() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Closing error dialog`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing error dialog`);
errorDialog.window.shown = false;
mexui.setInput(false);
}
diff --git a/scripts/server/npc/biker.js b/scripts/client/gui/games/5-card-poker.js
similarity index 55%
rename from scripts/server/npc/biker.js
rename to scripts/client/gui/games/5-card-poker.js
index 42bd940b..d254829b 100644
--- a/scripts/server/npc/biker.js
+++ b/scripts/client/gui/games/5-card-poker.js
@@ -1,8 +1,9 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
-// FILE: biker.js
-// DESC: Provides biker NPC interaction and functionality
-// TYPE: Server (JavaScript)
+// FILE: 5cardpoker.js
+// DESC: Provides 5-card poker games GUI
+// TYPE: Client (JavaScript)
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/games/betting.js b/scripts/client/gui/games/betting.js
new file mode 100644
index 00000000..fcfad194
--- /dev/null
+++ b/scripts/client/gui/games/betting.js
@@ -0,0 +1,147 @@
+// ===========================================================================
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
+// ===========================================================================
+// FILE: betting.js
+// DESC: Provides betting GUI (used for multiple casino games)
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+let bettingGUI = {
+ window: null,
+ amountLabel: null,
+ fiveThousandLabel: null,
+ fiveThousandPlusButton: null,
+ fiveThousandMinusButton: null,
+ oneThousandLabel: null,
+ oneThousandPlusButton: null,
+ oneThousandMinusButton: null,
+ fiveHundredPlusButton: null,
+ fiveHundredMinusButton: null,
+ oneHundredLabel: null,
+ oneHundredPlusButton: null,
+ oneHundredMinusButton: null,
+ fiftyLabel: null,
+ fiftyPlusButton: null,
+ fiftyMinusButton: null,
+ twentyLabel: null,
+ twentyPlusButton: null,
+ twentyMinusButton: null,
+ tenLabel: null,
+ tenPlusButton: null,
+ tenMinusButton: null,
+ fiveLabel: null,
+ fivePlusButton: null,
+ fiveMinusButton: null,
+ oneLabel: null,
+ onePlusButton: null,
+ oneMinusButton: null,
+}
+
+// ===========================================================================
+
+function initBettingGUI() {
+ bettingGUI.window = mexui.window(getScreenWidth() / 2 - 125, getScreenHeight() / 2 - 250, 250, 500, 'BETTING', {
+ main: {
+ backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
+ transitionTime: 500,
+ },
+ title: {
+ textSize: 0.0,
+ textColour: toColour(0, 0, 0, 0),
+ },
+ icon: {
+ textSize: 0.0,
+ textColour: toColour(0, 0, 0, 0),
+ },
+ focused: {
+ borderColour: toColour(0, 0, 0, 0),
+ },
+ });
+ bettingGUI.window.titleBarIconSize = toVector2(0, 0);
+ bettingGUI.window.titleBarHeight = 0;
+ bettingGUI.window.titleBarShown = false;
+
+ bettingGUI.amountLabel = bettingGUI.window.text(10, 20, 230, 20, 'Amount: 0', {
+ main: {
+ textSize: 20.0,
+ textAlign: 0.5,
+ textColour: toColour(200, 200, 200, 255),
+ textFont: mainFont,
+ },
+ focused: {
+ borderColour: toColour(0, 0, 0, 0),
+ },
+ });
+
+ bettingGUI.oneLabel = bettingGUI.window.text(10, 50, 230, 20, '1', {
+ main: {
+ textSize: 10.0,
+ textAlign: 0.5,
+ textColour: toColour(200, 200, 200, 255),
+ textFont: mainFont,
+ },
+ focused: {
+ borderColour: toColour(0, 0, 0, 0),
+ },
+ });
+
+ bettingGUI.fiveLabel = bettingGUI.window.text(10, 65, 230, 20, '1', {
+ main: {
+ textSize: 10.0,
+ textAlign: 0.5,
+ textColour: toColour(200, 200, 200, 255),
+ textFont: mainFont,
+ },
+ focused: {
+ borderColour: toColour(0, 0, 0, 0),
+ },
+ });
+
+ bettingGUI.tenLabel = bettingGUI.window.text(10, 80, 230, 20, '1', {
+ main: {
+ textSize: 10.0,
+ textAlign: 0.5,
+ textColour: toColour(200, 200, 200, 255),
+ textFont: mainFont,
+ },
+ focused: {
+ borderColour: toColour(0, 0, 0, 0),
+ },
+ });
+
+ bettingGUI.fiftyLabel = bettingGUI.window.text(10, 95, 230, 20, '1', {
+ main: {
+ textSize: 10.0,
+ textAlign: 0.5,
+ textColour: toColour(200, 200, 200, 255),
+ textFont: mainFont,
+ },
+ focused: {
+ borderColour: toColour(0, 0, 0, 0),
+ },
+ });
+
+ bettingGUI.hundredLabel = bettingGUI.window.text(10, 95, 230, 20, '1', {
+ main: {
+ textSize: 10.0,
+ textAlign: 0.5,
+ textColour: toColour(200, 200, 200, 255),
+ textFont: mainFont,
+ },
+ focused: {
+ borderColour: toColour(0, 0, 0, 0),
+ },
+ });
+
+ bettingGUI.window.shown = false;
+}
+
+// ===========================================================================
+
+function showBettingGUI() {
+
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/games/blackjack.js b/scripts/client/gui/games/blackjack.js
new file mode 100644
index 00000000..ee0e7ad3
--- /dev/null
+++ b/scripts/client/gui/games/blackjack.js
@@ -0,0 +1,49 @@
+// ===========================================================================
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
+// ===========================================================================
+// FILE: blackjack.js
+// DESC: Provides blackjack game GUI
+// TYPE: Client (JavaScript)
+// ===========================================================================
+
+let blackJackGUI = {
+ window: null,
+ dealerHand: [],
+ playerHand: [],
+};
+
+// ===========================================================================
+
+let playerCards = [];
+let dealerCards = [];
+
+// ===========================================================================
+
+function initBlackJackGUI() {
+ // Render a blackjack game in MexUI
+ //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),
+ },
+ 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),
+ },
+ });
+ blackJackGUI.window.titleBarShown = false;
+
+ blackJackGUI.window.shown = false;
+
+ //logToConsole(LOG_DEBUG, `[AGRP.GUI] Created blackjack GUI`);
+}
+
+// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/housemgr.js b/scripts/client/gui/housemgr.js
index c9bb1c32..1c421d6e 100644
--- a/scripts/client/gui/housemgr.js
+++ b/scripts/client/gui/housemgr.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: housemgr.js
// DESC: Provides house manager GUI
diff --git a/scripts/client/gui/html/login.js b/scripts/client/gui/html/login.js
deleted file mode 100644
index 8b5ae2f8..00000000
--- a/scripts/client/gui/html/login.js
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
- Connected RP: Login
-
-
-
-
-
\ No newline at end of file
diff --git a/scripts/client/gui/info.js b/scripts/client/gui/info.js
index c6066df8..8be960d4 100644
--- a/scripts/client/gui/info.js
+++ b/scripts/client/gui/info.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: info.js
// DESC: Provides info dialog box GUI
@@ -16,8 +17,8 @@ let infoDialog = {
// ===========================================================================
function initInfoDialogGUI() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Creating info dialog GUI ...`);
- infoDialog.window = mexui.window(getScreenWidth()/2-200, getScreenHeight()/2-70, 400, 140, 'Information', {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating info dialog GUI ...`);
+ infoDialog.window = mexui.window(getScreenWidth() / 2 - 200, getScreenHeight() / 2 - 70, 400, 140, 'Information', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
},
@@ -57,13 +58,13 @@ function initInfoDialogGUI() {
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 255),
},
}, closeInfoDialog);
- logToConsole(LOG_DEBUG, `[VRR.GUI] Created info dialog GUI`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Created info dialog GUI`);
}
// ===========================================================================
function closeInfoDialog() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Closing info dialog`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing info dialog`);
infoDialog.window.shown = false;
mexui.setInput(false);
}
@@ -72,7 +73,7 @@ function closeInfoDialog() {
function showInfoGUI(infoMessage, infoTitle, buttonText) {
closeAllWindows();
- logToConsole(LOG_DEBUG, `[VRR.GUI] Showing info dialog window. Info: ${infoTitle} - ${infoMessage}`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing info dialog window. Info: ${infoTitle} - ${infoMessage}`);
mexui.setInput(true);
infoDialog.messageLabel.text = infoMessage;
infoDialog.okayButton.text = buttonText;
diff --git a/scripts/client/gui/list.js b/scripts/client/gui/list.js
index 00d94be9..4aef6fdd 100644
--- a/scripts/client/gui/list.js
+++ b/scripts/client/gui/list.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: list.js
// DESC: Provides simple list GUI
@@ -11,13 +12,15 @@ let listDialog = {
window: null,
messageLabel: null,
listGrid: null,
+
+ listRows: [],
};
// ===========================================================================
function initListGUI() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Creating list dialog GUI ...`);
- listDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 500, 'List', {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating list dialog GUI ...`);
+ listDialog.window = mexui.window(game.width / 2 - 200, game.height / 2 - 70, 400, 500, 'List', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
},
@@ -50,34 +53,34 @@ function initListGUI() {
listDialog.listGrid = listDialog.window.grid(5, 25, 390, 450, {
main: {
- backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
+ backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
},
column: {
- lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
+ lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
},
- header: {
- backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha-50),
- textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha),
+ header: {
+ backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha - 50),
+ textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha),
},
cell: {
- backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
- textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha),
+ backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
+ textColour: toColour(primaryTextColour[0], primaryTextColour[1], primaryTextColour[2], windowTitleAlpha),
},
row: {
- lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
+ lineColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
hover: {
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], 120),
}
}
});
- logToConsole(LOG_DEBUG, `[VRR.GUI] Created list dialog GUI`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Created list dialog GUI`);
}
// ===========================================================================
function showListGUI() {
closeAllWindows();
- logToConsole(LOG_DEBUG, `[VRR.GUI] Showing login window`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing list window`);
setChatWindowEnabled(false);
mexui.setInput(true);
listDialog.window.shown = true;
@@ -89,19 +92,56 @@ function showListGUI() {
// ===========================================================================
function checkListDialogSelection() {
+ if (!listDialog.listGrid.activeRow) {
+ return false;
+ }
+ sendNetworkEventToServer("agrp.list.select", listDialog.listGrid.activeRow.getEntryIndex());
}
// ===========================================================================
function selectPreviousListItem() {
+ if (!listDialog.listGrid.activeRow) {
+ return false;
+ }
+ let activeRowId = listDialog.listGrid.activeRow.getEntryIndex();
+ if (activeRowId <= 1) {
+ listDialog.listGrid.activeRow = 0;
+ } else {
+ listDialog.listGrid.activeRow = listDialog.listRows[activeRowId - 1];
+ }
+
+ //sendNetworkEventToServer("agrp.list.next", listDialog.listGrid.activeRow.getEntryIndex());
}
// ===========================================================================
function selectNextListItem() {
+ let activeRowId = listDialog.listGrid.activeRow.getEntryIndex();
+ if (activeRowId >= listDialog.listRows.length - 1) {
+ listDialog.listGrid.activeRow = 0;
+ } else {
+ listDialog.listGrid.activeRow = listDialog.listRows[activeRowId + 1];
+ }
+ //sendNetworkEventToServer("agrp.list.next", listDialog.listGrid.activeRow.getEntryIndex());
+}
+
+// ===========================================================================
+
+function clearListGUI() {
+ listDialog.listGrid.removeAllEntries();
+}
+
+// ===========================================================================
+
+function populateListGUI(listItems) {
+ for (let i in listItems) {
+ let row = listDialog.listGrid.row(listItems[i]);
+ listDialog.listRows.push(row);
+ }
}
// ===========================================================================
\ No newline at end of file
diff --git a/scripts/client/gui/localechooser.js b/scripts/client/gui/localechooser.js
index e0bdf063..dc7dcdb5 100644
--- a/scripts/client/gui/localechooser.js
+++ b/scripts/client/gui/localechooser.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: localechooser.js
// DESC: Provides locale chooser GUI
@@ -19,8 +20,8 @@ let flagImageGap = toVector2(5, 5);
// ===========================================================================
function initLocaleChooserGUI() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Creating locale chooser GUI ...`);
- localeChooser.window = mexui.window(game.width/2-200, game.height-150, 60, 60, 'Choose a language', {
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Creating locale chooser GUI ...`);
+ localeChooser.window = mexui.window(game.width / 2 - 200, game.height - 150, 60, 60, 'Choose a language', {
main: {
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], 0),
},
@@ -37,38 +38,48 @@ function initLocaleChooserGUI() {
});
localeChooser.window.titleBarShown = false;
- loadLocaleConfig();
+ localeChooser.window.shown = false;
- logToConsole(LOG_DEBUG, `[VRR.GUI] Created locale chooser GUI`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Created locale chooser GUI`);
}
// ===========================================================================
function closeLocaleChooserGUI() {
- logToConsole(LOG_DEBUG, `[VRR.GUI] Closing locale chooser window`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Closing locale chooser window`);
localeChooser.window.shown = false;
+ for (let i in localeChooser.flagImages) {
+ localeChooser.flagImages[i].shown = false;
+ }
mexui.setInput(false);
}
// ===========================================================================
function showLocaleChooserGUI(position = toVector2(0.0, 0.0)) {
- if(position.x != 0.0 && position.y != 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 {
- localeChooser.window.position = toVector2((getScreenWidth()/2)-(localeChooser.window.size.x/2), getScreenHeight()-100);
+ localeChooser.window.position = toVector2((getScreenWidth() / 2) - (localeChooser.window.size.x / 2), getScreenHeight() - 100);
}
//closeAllWindows();
- logToConsole(LOG_DEBUG, `[VRR.GUI] Showing locale chooser window`);
+ logToConsole(LOG_DEBUG, `[AGRP.GUI] Showing locale chooser window`);
mexui.setInput(true);
localeChooser.window.shown = true;
+
+ for (let i in localeChooser.flagImages) {
+ localeChooser.flagImages[i].shown = true;
+ }
}
// ===========================================================================
function toggleLocaleChooserGUI() {
- if(localeChooser.window.shown) {
+ if (localeChooser.window.shown) {
closeLocaleChooserGUI();
} else {
showLocaleChooserGUI();
@@ -78,36 +89,38 @@ function toggleLocaleChooserGUI() {
// ===========================================================================
function localeChooserSetLocale(localeId) {
- logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Asking server to change locale to ${localeId}`);
+ logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Asking server to change locale to ${localeId}`);
sendLocaleSelectToServer(localeId);
}
// ===========================================================================
function resetLocaleChooserOptions() {
- logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Resetting locale chooser options`);
+ logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Resetting locale chooser options`);
// let tempLocaleOptions = getServerData().localeOptions; // getAvailableLocaleOptions();
let tempLocaleOptions = getAvailableLocaleOptions();
- localeChooser.window.size = toVector2((tempLocaleOptions.length*(flagImageSize.x+flagImageGap.x))+flagImageGap.x, flagImageSize.y+flagImageGap.y*2);
- localeChooser.window.position = toVector2((getScreenWidth()/2)-(localeChooser.window.size.x/2), getScreenHeight()-100);
+ localeChooser.window.size = toVector2((tempLocaleOptions.length * (flagImageSize.x + flagImageGap.x)) + flagImageGap.x, flagImageSize.y + flagImageGap.y * 2);
+ localeChooser.window.position = toVector2((getScreenWidth() / 2) - (localeChooser.window.size.x / 2), getScreenHeight() - 100);
- for(let i in localeChooser.flagImages) {
+ for (let i in localeChooser.flagImages) {
localeChooser.flagImages[i].remove();
}
- for(let i in tempLocaleOptions) {
+ for (let i in tempLocaleOptions) {
let imagePath = `files/images/flags/${tempLocaleOptions[i].flagImageFile}`;
- localeChooser.flagImages[i] = localeChooser.window.image((i*(flagImageSize.x+flagImageGap.x))+flagImageGap.x, flagImageGap.y, flagImageSize.x, flagImageSize.y, imagePath, {
+ localeChooser.flagImages[i] = localeChooser.window.image((i * (flagImageSize.x + flagImageGap.x)) + flagImageGap.x, flagImageGap.y, flagImageSize.x, flagImageSize.y, imagePath, {
focused: {
borderColour: toColour(0, 0, 0, 0),
},
- }, function() {
+ }, function () {
localeChooserSetLocale(tempLocaleOptions[i].id);
});
- logToConsole(LOG_DEBUG|LOG_WARN, `[VRR.GUI] Created locale chooser option ${tempLocaleOptions[i].englishName} with image ${imagePath}`);
+ localeChooser.flagImages[i].shown = false;
+
+ logToConsole(LOG_DEBUG | LOG_WARN, `[AGRP.GUI] Created locale chooser option ${tempLocaleOptions[i].englishName} with image ${imagePath}`);
//localeChooser.activeRingImages.push(activeRingImage);
}
diff --git a/scripts/client/gui/login.js b/scripts/client/gui/login.js
index e33ef2c2..15e06828 100644
--- a/scripts/client/gui/login.js
+++ b/scripts/client/gui/login.js
@@ -1,6 +1,7 @@
// ===========================================================================
-// Vortrex's Roleplay Resource
-// https://github.com/VortrexFTW/gtac_roleplay
+// Asshat Gaming Roleplay
+// https://github.com/VortrexFTW/agrp_main
+// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: login.js
// DESC: Provides login GUI
@@ -20,7 +21,7 @@ let login = {
// ===========================================================================
let loginHTML =
-`
+ `
Asshat Gaming Roleplay: Login