feat: Implement garage system and update client branding
This commit introduces a garage system to the client and updates the client's branding assets. The garage system allows players to store and retrieve vehicles. It includes the following features: - Event handling for garage requests, vehicle storage, and vehicle retrieval. - Communication with a web browser control to display garage data. - Data serialization and deserialization using JSON. The client branding has been updated with new icons and a modified `mod.cpp` file. The changes include: - Updated icons for the client. - Modified `mod.cpp` to reflect the new branding, including the mod name, picture, and DLC color.
This commit is contained in:
parent
490ac1d363
commit
643276d4ff
@ -1 +1,48 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
[QGVAR(handleEvents), {
|
||||||
|
params ["_control", "_isConfirmDialog", "_message"];
|
||||||
|
|
||||||
|
diag_log format ["[FORGE: Garage] Received event: %1", _message];
|
||||||
|
|
||||||
|
_message = fromJSON _message;
|
||||||
|
private _event = _message get "event";
|
||||||
|
private _data = _message get "data";
|
||||||
|
|
||||||
|
private _vehicles = GETVAR(player,FORGE_Garage,[]);
|
||||||
|
|
||||||
|
switch (_event) do {
|
||||||
|
case "REQUEST_GARAGE_DATA": {
|
||||||
|
private _garageData = createHashMap;
|
||||||
|
private _vehicleList = [];
|
||||||
|
|
||||||
|
{
|
||||||
|
private _vehicle = _x;
|
||||||
|
if (isNull _vehicle || { !alive _vehicle }) exitWith {};
|
||||||
|
|
||||||
|
private _vehicleInfo = createHashMapFromArray [
|
||||||
|
["classname", typeOf _vehicle],
|
||||||
|
["damage", damage _vehicle],
|
||||||
|
["fuel", fuel _vehicle],
|
||||||
|
["hitpoints", getAllHitPointsDamage _vehicle]
|
||||||
|
];
|
||||||
|
|
||||||
|
_vehicleList pushBack _vehicleInfo;
|
||||||
|
} forEach _vehicles;
|
||||||
|
|
||||||
|
_garageData set ["vehicles", _vehicleList];
|
||||||
|
_control ctrlWebBrowserAction ["ExecJS", format ["handleGarageDataRequest(%1)", (toJSON _vehicleList)]];
|
||||||
|
};
|
||||||
|
case "STORE_VEHICLE": {
|
||||||
|
// Logic to store vehicle in garage
|
||||||
|
// This would typically involve saving the vehicle's state to a database or similar
|
||||||
|
};
|
||||||
|
case "RETRIEVE_VEHICLE": {
|
||||||
|
// Logic to retrieve vehicle from garage
|
||||||
|
// This would typically involve loading the vehicle's state from a database or similar
|
||||||
|
};
|
||||||
|
default {
|
||||||
|
diag_log format ["[FORGE: Garage] Unknown event: %1", _event];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}] call CFUNC(addEventHandler);
|
BIN
icon_128_ca.paa
BIN
icon_128_ca.paa
Binary file not shown.
Binary file not shown.
BIN
icon_64_ca.paa
BIN
icon_64_ca.paa
Binary file not shown.
6
mod.cpp
6
mod.cpp
@ -1,12 +1,14 @@
|
|||||||
|
dir = "@forge_client";
|
||||||
name = "FORGE Client";
|
name = "FORGE Client";
|
||||||
author = "IDSolutions";
|
author = "IDSolutions";
|
||||||
picture = "title_co.paa";
|
picture = "title_ca.paa";
|
||||||
logoSmall = "icon_64_ca.paa";
|
logoSmall = "icon_64_ca.paa";
|
||||||
logo = "icon_128_ca.paa";
|
logo = "icon_128_ca.paa";
|
||||||
logoOver = "icon_128_highlight_ca.paa";
|
logoOver = "icon_128_highlight_ca.paa";
|
||||||
tooltip = "IDS";
|
tooltip = "IDS";
|
||||||
tooltipOwned = "IDS Owned";
|
tooltipOwned = "IDS Owned";
|
||||||
overview = "FORGE Client - Official Modification";
|
overview = "FORGE Client - Official Modification";
|
||||||
description = "IDS Client - Version 1.0.0";
|
description = "FORGE Client - Version 1.0.0";
|
||||||
action = "https://innovativedevsolutions.org";
|
action = "https://innovativedevsolutions.org";
|
||||||
actionName = "Website";
|
actionName = "Website";
|
||||||
|
dlcColor[] = {0.45, 0.47, 0.41, 1};
|
BIN
title_ca.paa
Normal file
BIN
title_ca.paa
Normal file
Binary file not shown.
BIN
title_co.paa
BIN
title_co.paa
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user