Compare commits

...

79 Commits

Author SHA1 Message Date
github-actions
71438fe393 v1.0.0 Build 32 2025-06-15 16:58:29 +00:00
Jacob Schmidt
39d080fca5 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 41s
2025-06-15 11:56:18 -05:00
Jacob Schmidt
b5bd3c6cb8 feat: Add core functionality for player and vehicle state management 2025-06-15 11:56:13 -05:00
github-actions
209b243620 v1.0.0 Build 31 2025-05-30 10:19:05 +00:00
Jacob Schmidt
73086cfe97 fix: Correct return value in createOrg function to true
All checks were successful
Build / Build (push) Successful in 1m12s
2025-05-30 05:18:10 -05:00
github-actions
a106fef2fd v1.0.0 Build 30 2025-05-26 05:47:43 +00:00
Jacob Schmidt
0858d9a173 feat: Implement basic mission management framework
All checks were successful
Build / Build (push) Successful in 28s
This commit introduces a basic framework for mission management.

- Includes `CfgMissions.hpp` in `config.cpp`.
- Adds `missionManager` to `XEH_PREP.hpp` for event handling preparation.
- Adds a placeholder call to `FUNC(missionManager)` in `XEH_postInit.sqf` with a TODO comment for future implementation.
2025-05-26 00:47:24 -05:00
github-actions
9f672e1795 v1.0.0 Build 29 2025-05-25 21:03:22 +00:00
Jacob Schmidt
9936d6ddc3 feat: Enhance module documentation and features
All checks were successful
Build / Build (push) Successful in 28s
This commit updates the documentation for several Forge modules, adding comprehensive details about their functionalities, user interfaces, and integration with other systems. Key enhancements include:

- Expanded descriptions for the Admin, Arsenal, Bank, Garage, Interaction, Locker, Medical, Organization, Service, Store, and other modules.
- Added new features such as financial operations, user interface improvements, and integration with organization systems.
- Improved clarity on usage instructions and configuration options across modules.

These changes aim to provide better guidance for users and developers interacting with the Forge client system.
2025-05-25 16:03:03 -05:00
github-actions
dfaddaa279 v1.0.0 Build 28 2025-05-25 19:22:22 +00:00
Jacob Schmidt
2b5648b303 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 27s
2025-05-25 14:22:15 -05:00
Jacob Schmidt
3ba3fe82d2 fix: Add missing comma in fnc_hostage.sqf
This commit fixes a missing comma in the `fnc_hostage.sqf` file. The comma was missing between the `_cbrnZone` and `_equipmentRewards` parameters, which could have caused issues with task execution.
2025-05-25 14:22:12 -05:00
github-actions
201371a411 v1.0.0 Build 27 2025-05-25 19:20:55 +00:00
Jacob Schmidt
635460f9d8 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
Some checks failed
Build / Build (push) Failing after 11s
2025-05-25 14:20:40 -05:00
Jacob Schmidt
86ae5c4248 feat: Implement task rewards and penalties
This commit introduces a new task reward and penalty system.

The following changes were made:

- Added `handleTaskRewards` to `XEH_PREP.hpp` for pre-processing.
- Added parameters for equipment, supply, weapon, vehicle, and special rewards to the task definition functions (`fnc_defuse.sqf`, `fnc_destroy.sqf`, `fnc_attack.sqf`, `fnc_hvt.sqf`, `fnc_delivery.sqf`, `fnc_defend.sqf`, `fnc_hostage.sqf`).
- Modified task completion logic to handle rewards and penalties using the new `handleTaskRewards` function.
- Replaced direct reputation and fund modifications with the new reward system.
- Updated documentation to reflect the new reward parameters.
2025-05-25 14:20:36 -05:00
github-actions
be8e19a1a7 v1.0.0 Build 26 2025-05-25 18:28:49 +00:00
Jacob Schmidt
58eb7bf841 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 27s
2025-05-25 13:28:42 -05:00
Jacob Schmidt
3ab612fad1 feat: Implement defend task type
This commit introduces a new "defend" task type.

The following changes were made:

- Added `defend` and `defendModule` to `XEH_PREP.hpp` for pre-processing.
- Implemented `defend` case in `fnc_handler.sqf` to handle defend tasks.
- Added `spawnEnemyWave` to `XEH_PREP.hpp` for pre-processing.
2025-05-25 13:28:38 -05:00
github-actions
d171b02d65 v1.0.0 Build 25 2025-05-25 17:36:44 +00:00
Jacob Schmidt
4c9c2bd755 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 27s
2025-05-25 12:36:37 -05:00
Jacob Schmidt
0cbe027b3b Fix: Correct typo in cargo damage handler
This commit corrects a typo in the cargo damage handler within `fnc_makeCargo.sqf`. The event handler name was misspelled as "Dammaged" instead of "Damaged". This has been corrected to ensure the event handler functions as intended. Additionally, the hint message displayed when cargo is severely damaged also had the same typo, which has been corrected.
2025-05-25 12:36:33 -05:00
github-actions
48c45731b7 v1.0.0 Build 24 2025-05-25 17:33:54 +00:00
Jacob Schmidt
40eccaed69 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
Some checks failed
Build / Build (push) Failing after 11s
2025-05-25 12:33:40 -05:00
Jacob Schmidt
c822d4e601 feat: Implement cargo delivery task type and improve task assignment
This commit introduces a new "delivery" task type and enhances the task assignment process for various entities.

The following changes were made:

- Added `delivery` and `deliveryModule` to `XEH_PREP.hpp` for pre-processing.
- Added `GVAR(allCargo)` to `XEH_preInit.sqf` to track cargo objects.
- Implemented `delivery` case in `fnc_handler.sqf` to handle delivery tasks.
- Added `makeCargo` to `XEH_PREP.hpp` for pre-processing.
- Refactored `fnc_makeShooter.sqf`, `fnc_makeObject.sqf`, `fnc_makeTarget.sqf`, `fnc_makeHVT.sqf`, `fnc_makeHostage.sqf`, and `fnc_makeIED.sqf` to:
  - Update descriptions to reflect assignment rather than registration.
  - Add error handling for null entities and missing task IDs.
  - Add diag_log messages for debugging.
  - Standardize parameter handling.
2025-05-25 12:33:36 -05:00
github-actions
af39d7e528 v1.0.0 Build 23 2025-05-25 16:30:44 +00:00
Jacob Schmidt
d474b3676a Refactor: Standardize function descriptions and variable handling
All checks were successful
Build / Build (push) Successful in 28s
This commit refactors several client-side functions to improve code consistency and readability.

- Standardizes function descriptions by removing redundant "Function: forge_client..." prefixes and "[Description]" sections, focusing on concise descriptions of the function's purpose.
- Updates variable handling in arsenal functions to use GVAR and EGVARS for default values, improving consistency and reducing code duplication.
- Removes the bank init function as it is no longer needed.
- Adds a done variable to the preinit file.
2025-05-25 11:30:26 -05:00
github-actions
4c33bd9175 v1.0.0 Build 22 2025-05-11 06:20:17 +00:00
Jacob Schmidt
f8391463b2 feat: Implement timesheets and pending payments in bank UI
All checks were successful
Build / Build (push) Successful in 28s
This commit introduces the timesheet submission feature and displays pending payments in the bank UI.

The following changes were made:

- Added a "Submit Timesheet" action tile to the bank UI.
- Implemented the `handleTimesheet` function in `script.js` to handle timesheet submissions.
- Updated the UI to display pending payments based on player rating and a server-side multiplier.
- Modified server-side event handling to process timesheet submissions and calculate payments.
- Added a refresh timer to update player data every 30 seconds.
- Updated the player load event to include the player's rating.
2025-05-11 01:19:44 -05:00
github-actions
94684cb120 v1.0.0 Build 21 2025-05-10 22:52:17 +00:00
Jacob Schmidt
dc17412660 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 27s
2025-05-10 17:52:12 -05:00
Jacob Schmidt
ef3c080556 fix: Comment out OpenDevConsole action in fnc_openBank.sqf
This commit disables the OpenDevConsole action in the bank's open function to prevent unintended access during normal operations. The change enhances security and maintains a cleaner user experience.
2025-05-10 17:52:02 -05:00
github-actions
53905e9b69 v1.0.0 Build 20 2025-05-10 22:51:16 +00:00
Jacob Schmidt
0ed1bc3a19 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 26s
2025-05-10 17:50:36 -05:00
Jacob Schmidt
90476345db feat: Enhance admin and bank systems with event handling and UI improvements
This commit introduces significant updates to the admin and bank systems, focusing on improved event handling and user interface enhancements. Key changes include:

- Refactored event handling for player data requests, paygrade updates, and message broadcasting in the admin panel.
- Implemented new event types for handling player funds and transaction history in the bank system.
- Updated JavaScript functions for better interaction with the web-based UI, including dynamic data requests and improved user feedback.
- Removed deprecated functions and streamlined code for better maintainability.

These enhancements aim to provide a more efficient and user-friendly experience for administrators and players alike.
2025-05-10 17:50:11 -05:00
github-actions
65d9154c09 v1.0.0 Build 19 2025-05-05 01:03:05 +00:00
Jacob Schmidt
1828673c6b Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 28s
2025-05-04 20:02:50 -05:00
Jacob Schmidt
643276d4ff 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.
2025-05-04 20:02:46 -05:00
github-actions
3c3ee3f94f v1.0.0 Build 18 2025-05-04 01:13:24 +00:00
Jacob Schmidt
490ac1d363 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 27s
2025-05-03 20:13:16 -05:00
Jacob Schmidt
e2ece3fde7 feat: Style rank and side badges
This commit introduces styling for side badges and updates the styling for rank badges. It applies padding, border-radius, font-size, and text-transform properties to both badge types, ensuring visual consistency.
2025-05-03 20:13:12 -05:00
github-actions
e2444bd70d v1.0.0 Build 17 2025-05-04 00:33:29 +00:00
Jacob Schmidt
771b5f1c32 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 30s
2025-05-03 19:33:15 -05:00
Jacob Schmidt
55f60dc71f feat: Revamp admin panel, store, and arsenal systems
This commit introduces significant changes to the admin panel, store, and arsenal systems, focusing on improved functionality, UI enhancements, and code optimization.

**Admin Panel:**
- Migrated to a web-based UI for improved user experience and maintainability.
- Implemented dynamic player listing with filtering and search capabilities.
- Added functionality for managing player paygrades, sending messages, and transferring funds.
- Integrated server-side events for handling admin actions.

**Store:**
- Added `handleDelivery` event handler.
- Streamlined product selection and purchase processes.
- Improved handling of organization funds and player balances.
- Refactored code for better readability and maintainability.

**Arsenal:**
- Enhanced initialization process with improved data validation.
- Optimized item unlocking logic.

These changes aim to provide a more robust, user-friendly, and efficient experience for both administrators and players.
2025-05-03 19:33:10 -05:00
github-actions
b8f2b17d11 v1.0.0 Build 16 2025-04-19 20:06:59 +00:00
Jacob Schmidt
61abcf5200 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 27s
2025-04-19 15:06:51 -05:00
Jacob Schmidt
c4f7f9b04c fix: Update alignment in transaction and memo item styles
This commit modifies the CSS for transaction and memo items by changing the alignment from center to left. This adjustment aims to enhance the layout and improve the overall user experience.
2025-04-19 15:06:47 -05:00
github-actions
15b15bcf5d v1.0.0 Build 15 2025-04-19 19:51:27 +00:00
Jacob Schmidt
8e23fdb2e2 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 27s
2025-04-19 14:51:14 -05:00
Jacob Schmidt
9ad0ab9820 feat: Enhance UI and functionality across multiple addons
This commit introduces several improvements to the UI and functionality of various addons, including:

- **Admin Panel:** Updated header statistics layout and added payday functionality with rank-based amounts. Enhanced styling for better user experience.
- **Bank Addon:** Improved balance display with updated styling and structure for better readability.
- **Garage Addon:** Refined vehicle and maintenance statistics display with enhanced UI elements.
- **Locker Addon:** Updated storage and item statistics layout for improved clarity and usability.
- **Organization Addon:** Enhanced organization statistics display and improved transaction handling with better sorting and formatting.
- **Store Addon:** Updated payment method selection and improved overall styling for a more cohesive look.

These changes aim to provide a more intuitive and visually appealing user experience across the platform.
2025-04-19 14:51:11 -05:00
github-actions
9bbb033437 v1.0.0 Build 14 2025-04-19 16:13:13 +00:00
Jacob Schmidt
69f8f037df refactor: Remove tasks.json and update documentation in store functions
All checks were successful
Build / Build (push) Successful in 28s
This commit removes the `tasks.json` file from the `.vscode` directory. Additionally, it enhances the documentation in `fnc_buyItem.sqf` and `fnc_buyVehicle.sqf` by providing clearer descriptions of item and vehicle types. The `fnc_handlePurchase.sqf` has also been updated to improve variable scoping for better code clarity.
2025-04-19 11:12:53 -05:00
github-actions
e2a8517268 v1.0.0 Build 13 2025-04-05 21:57:40 +00:00
Jacob Schmidt
c17e7921b3 fix: Use EFUNC for org store verification in handlePurchase
All checks were successful
Build / Build (push) Successful in 27s
This commit fixes an issue in `fnc_handlePurchase.sqf` where the organization store was being accessed directly from the mission namespace. This has been updated to use the `EFUNC(org,verifyOrgStore)` function to ensure proper verification and access to the organization store. This change improves code maintainability and reduces the risk of errors due to incorrect store access.
2025-04-05 16:57:29 -05:00
github-actions
8b1b5153be v1.0.0 Build 12 2025-04-05 21:52:02 +00:00
Jacob Schmidt
c7c85a00e1 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 28s
2025-04-05 16:51:58 -05:00
Jacob Schmidt
21beefe668 feat: Enhance documentation and update variable names
This commit introduces several enhancements to the Forge client, including improved documentation for the Garage and Locker modules, updates to variable names for consistency, and additions to the .gitignore file.

The following changes were made:

- **Garage and Locker Modules:** Added comprehensive README.md files to the Garage and Locker modules, providing overviews, dependency information, author details, feature descriptions, event handler usage, debugging instructions, and version information.
- **Variable Name Consistency:** Updated variable names in `fnc_playerDBSave.sqf` and `fnc_firstLogin.sqf` to use the `FORGE_PayGrade` constant instead of `Paygrade` for consistency with the Forge naming conventions.
- **.gitignore:** Added `/api` to the .gitignore file to exclude the Forge API directory from version control.
2025-04-05 16:51:53 -05:00
github-actions
afb0df341a v1.0.0 Build 11 2025-04-05 21:12:47 +00:00
Jacob Schmidt
44625a8677 feat: Refactor and document client-side functions
All checks were successful
Build / Build (push) Successful in 27s
This commit refactors and adds documentation to several client-side functions across various addons, including:

- **Task Addon:** Added function headers and descriptions to task-related functions (fnc_destroy, fnc_attack, fnc_defuse, fnc_hostage, fnc_makeIED, fnc_hvt, fnc_heartBeat, fnc_makeTarget, fnc_makeHVT, fnc_makeHostage, fnc_makeObject, fnc_makeShooter, fnc_attackModule, fnc_destroyModule, fnc_hvtModule, fnc_hostageModule, fnc_defuseModule, fnc_protectedModule, fnc_hostagesModule, fnc_explosivesModule, fnc_shootersModule).
- **Org Addon:** Updated author and added function headers/descriptions to organization-related functions (fnc_initOrgStore, fnc_requestServerDB, fnc_addAsset, fnc_addReputation, fnc_create, fnc_removeAsset, fnc_addFunds, fnc_leave, fnc_addMember, fnc_disband, fnc_verifyOrgStore, fnc_handleOrgLoad).
- **Garage Addon:** Added function headers and descriptions to garage-related functions (fnc_openGarage, fnc_fetchNearby, fnc_initGarage, fnc_fetchGarage, fnc_storeVehicle).
- **Locker Addon:** Added function headers and descriptions to locker-related functions (fnc_openLocker, fnc_fetchPlayer, fnc_initLocker, fnc_fetchLocker).
- **Phone Addon:** Added function headers, descriptions, and examples to phone-related functions (fnc_initAction, fnc_showEmail, fnc_showMessage, fnc_delEmail, fnc_delMsg, fnc_showMessageInput, fnc_addContact, fnc_initPhone, fnc_addMsg, fnc_addEmail, fnc_newEmail, fnc_initVar, fnc_addOfflineEmail, fnc_addOfflineMsg, fnc_sendMsg, fnc_sendEmail, fnc_showContact, fnc_newMsg, fnc_dateToHhMm, fnc_initAddAction, fnc_openPhone, fnc_viewSettings, fnc_viewMessages, fnc_viewContacts, fnc_viewEmail, fnc_showDialpad, fnc_showSafari).
- **Admin Addon:** Added function headers and descriptions to admin-related functions (fnc_adminMessage, fnc_printAddonName, fnc_initAdmin, fnc_openAdmin, fnc_adminPromote).
- **Store Addon:** Added function headers and descriptions to store-related functions (fnc_openStore, fnc_initStore, fnc_selectProduct, fnc_changeFilter, fnc_changePayment, fnc_handlePurchase).
- **Medical Addon:** Added function headers, descriptions, and examples to medical-related functions (fnc_saveDroppedWeapons, fnc_moveInventory, fnc_onRespawn, fnc_onKilled, fnc_initMedical, fnc_deductMedicalCost, fnc_heartBeat).
- **Misc Addon:** Added function headers, descriptions, and examples to misc-related functions (fnc_formatNumber, fnc_isAssignableBinocular, fnc_isWeaponType, fnc_cargoToPairs, fnc_serializeString, fnc_deserializeString, fnc_getSystemTime).
- **Init Addon:** Updated author and removed unnecessary copyright information from init-related functions (fnc_initPlayer, fnc_playerDBSave, fnc_playerSaveLoop, fnc_playerDBLoad, fnc_handlePlayerLoad).
- **Money Addon:** Removed unnecessary copyright information from money-related functions (fnc_takeCash, fnc_giveCash, fnc_giveCashSubmit).
- **Interaction Addon:** Removed unnecessary copyright information from interaction-related functions (fnc_initInteraction, fnc_openInteraction, fnc_interactionAction).
- **Ambient Addon:** Removed unnecessary copyright information from ambient-related functions (fnc_ambientSound).
- **Arsenal Addon:** Added function headers, descriptions, and examples to arsenal-related functions (fnc_openArmory, fnc_saveUnlocks, fnc_updateUnlocks, fnc_openGarage, fnc_addGarageVehicle, fnc_addVirtualVehicles, fnc_addVirtualVehicles).
- **Dialogue Addon:** Added function headers and descriptions to dialogue-related functions (fnc_selectAI, fnc_selectDialogue).
- **Service Addon:** Added function headers and descriptions to service-related functions (fnc_initService).
- **Bank Addon:** Added function headers and descriptions to bank-related functions (fnc_initBank, fnc_refresh, fnc_openBank).

These changes improve code readability, maintainability, and provide better context for developers working with these functions. The author field was updated to `IDSolutions` where appropriate.
2025-04-05 16:12:32 -05:00
Jacob Schmidt
2c79c3d442 Removed sqf_validator.py 2025-04-05 14:30:18 -05:00
github-actions
6bc6d458ed v1.0.0 Build 10 2025-04-05 19:24:41 +00:00
Jacob Schmidt
16f086d091 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 26s
2025-04-05 14:24:37 -05:00
Jacob Schmidt
a384881a01 Fix: Update interaction conditions to use companyShareholders
This commit fixes an issue where interaction conditions were incorrectly using `companyGenerals` instead of `companyShareholders`. This change ensures that the correct group of players can interact with company assets like the CPOF, garage, and locker.

The following changes were made:

*   Updated `fnc_initInteraction.sqf` to use `companyShareholders` in the interaction conditions for CPOF and garage access.
*   Updated `CfgVehicles.hpp` to use `companyShareholders` in the interaction conditions for company garage and locker access.
2025-04-05 14:24:34 -05:00
github-actions
f0337ca2ad v1.0.0 Build 9 2025-04-05 19:17:15 +00:00
Jacob Schmidt
c87deec60b Refactor: Organization Funds, Reputation, Tasks, and Player Saving
All checks were successful
Build / Build (push) Successful in 26s
This commit refactors how organization funds and reputation are handled, updates task completion logic to use the new organization functions, and modifies player saving to include organization data. Additionally, it introduces string serialization/deserialization and fixes a player save loop.

*   **Organization Funds and Reputation:** Replaces direct server calls for handling funds and reputation with calls to the new organization functions (`EFUNC(org,addFunds)` and `EFUNC(org,addReputation)`). This centralizes fund and reputation management within the organization store.
*   **Task Completion Logic:** Updates task completion functions (`fnc_destroy.sqf`, `fnc_attack.sqf`, `fnc_hostage.sqf`, `fnc_hvt.sqf`, `fnc_defuse.sqf`) to use the new organization functions for adding funds and reputation upon task success or failure. Also adds notifications to inform the player of reputation and fund changes.
*   **Player Saving:** Modifies the player saving function (`fnc_playerDBSave.sqf`) to include the player's organization ID in the saved data.
*   **String Serialization/Deserialization:** Adds `serializeString` and `deserializeString` PREP macros to `XEH_PREP.hpp` and uses them in `fnc_handleOrgLoad.sqf` and `fnc_create.sqf` to handle special characters in organization and member names.
*   **Player Save Loop Fix:** Removes unnecessary brackets from the `call FUNC(playerDBSave)` in `fnc_playerSaveLoop.sqf`.
*   **Organization Purchase Verification:** Adds organization ownership verification to `fnc_handlePurchase.sqf` to ensure only the owner can make purchases using organization funds.
*   **Player Initialization:** Updates `fnc_initPlayer.sqf` to retrieve and set the player's organization upon initialization.
2025-04-05 14:16:24 -05:00
github-actions
f209a86fe7 v1.0.0 Build 8 2025-03-30 22:16:31 +00:00
Jacob Schmidt
31402b40db Refactor: Organization Store CRUD Operations and Function Simplification
All checks were successful
Build / Build (push) Successful in 27s
This commit refactors the organization store to utilize the new CRUD (Create, Read, Update, Delete) operations and simplifies several organization-related functions.

*   **Organization Store CRUD Operations:** Implements a new interface for the organization store, providing methods for creating, reading, updating, and deleting organization data. This includes methods for adding and removing assets, managing funds and reputation, and handling member operations. The store now interfaces with the ArmaDragonflyClient database for persistence.
*   **Function Simplification:** Simplifies several organization functions by leveraging the new CRUD operations within the organization store. This reduces code duplication and improves readability. Specifically:
    *   `fnc_addAsset.sqf`: Simplified to use the `addAsset` method.
    *   `fnc_removeAsset.sqf`: Simplified to use the `removeAsset` method.
    *   `fnc_create.sqf`: Simplified to use the `createOrg` method.
    *   `fnc_leave.sqf`: Simplified to use the `leaveOrg` method.
    *   `fnc_disband.sqf`: Simplified to use the `deleteOrg` method.
    *   `fnc_addFunds.sqf`: Simplified to use the `updateFunds` method.
    *   `fnc_addReputation.sqf`: Simplified to use the `updateReputation` method.
    *   `fnc_verifyOrgStore.sqf`: Improved to ensure the store is initialized.
*   **XEH Updates:** Updated `XEH_PREP.hpp` files to reflect the changes in function calls.
*   **Locker Fix:** Fixed an issue in `fnc_equipGear.sqf` where the `isNull` check was incorrect for certain gear types.
2025-03-30 17:15:02 -05:00
github-actions
fc236ad4e6 v1.0.0 Build 7 2025-03-28 15:00:57 +00:00
Jacob Schmidt
796ed59c16 Refactor: Organization Store Initialization and Key Handling
All checks were successful
Build / Build (push) Successful in 27s
This commit refactors the organization store initialization and improves key handling within the organization store.

*   **Organization Store Initialization:** Changes the way the organization store interface is initialized by using `createHashMapObject` with a single declaration.
*   **Key Handling:** Improves the error message when an organization key is not found during the leave function, providing more context.
2025-03-28 10:00:46 -05:00
github-actions
1b7875e813 v1.0.0 Build 6 2025-03-28 14:52:01 +00:00
Jacob Schmidt
cf9bf922f1 Refactor: Organization Store and Leave Function Updates
Some checks failed
Build / Build (push) Failing after 11s
This commit refactors the organization store initialization and the leave function.

*   **Organization Store:** Changes the way the organization store is initialized by using a declaration array.
*   **Leave Function:** Improves the leave function by correcting a conditional statement to ensure proper handling of organization keys.
2025-03-28 09:51:48 -05:00
github-actions
63df0b75dc v1.0.0 Build 5 2025-03-28 14:46:55 +00:00
Jacob Schmidt
84cac71212 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
Some checks failed
Build / Build (push) Failing after 11s
2025-03-28 09:46:31 -05:00
Jacob Schmidt
613f05d52a Refactor: Database and Client Updates
This commit introduces several changes related to database interactions and client-side functionality:

*   **Database Response Handling:** Implements a mechanism to handle responses from server requests, specifically for database operations. This includes setting up a callback system to process results based on request IDs.
*   **Store Functionality:** Corrects a typo in the `fnc_buyItem.sqf` script, changing `EFUNC(armory,addArmoryItem)` to `EFUNC(arsenal,addArmoryItem)`.
*   **Inventory Management:** Improves the `fnc_moveInventory.sqf` script by correcting a conditional statement to ensure proper handling of inventory items.
*   **Configuration Updates:** Updates the mod configuration (`CfgMods.hpp`) to use the correct path for the mod picture.
*   **Client Initialization:** Adds a client registration call to the server during client post-initialization (`XEH_postInit_client.sqf`).
*   **Workflow Update:** Updates the build workflow to use the latest Ubuntu runner.
*   **Database Preparation:** Removes unnecessary preparations from `XEH_postInit.sqf` and `XEH_PREP.hpp`.
2025-03-28 09:46:24 -05:00
081a3cdae5 Update .github/workflows/build.yml 2025-02-22 13:54:58 -06:00
github-actions
5579850b9d v1.0.0 Build 4 2025-01-05 23:00:27 +00:00
Jacob Schmidt
39c8648bd6 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 53s
2025-01-05 17:00:09 -06:00
Jacob Schmidt
db9a0b8fd8 Added Editor Task Modules 2025-01-05 17:00:03 -06:00
github-actions
821eea45a9 v1.0.0 Build 3 2025-01-05 01:46:41 +00:00
Jacob Schmidt
0f3e76a212 Added Game Mode Types
All checks were successful
Build / Build (push) Successful in 54s
2025-01-04 19:46:30 -06:00
294 changed files with 14350 additions and 1935 deletions

View File

@ -16,7 +16,7 @@ on:
jobs: jobs:
build: build:
name: Build name: Build
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- name: Checkout Source Code - name: Checkout Source Code
uses: actions/checkout@v4 uses: actions/checkout@v4

2
.gitignore vendored
View File

@ -404,6 +404,8 @@ hemtt
hemtt.exe hemtt.exe
*.biprivatekey *.biprivatekey
# Forge API
/api
# Added by cargo # Added by cargo

View File

@ -0,0 +1,23 @@
name: ctrlWebBrowserAction
description: Executes an action on a web browser control
groups:
- GUI Control
syntax:
- call: !Binary [control, action]
ret:
- Nothing
- Nothing
params:
- name: control
type: Control
- name: action
type: String
argument_loc: Local
effect_loc: Local
since:
arma_3:
major: 2
minor: 2
examples:
- <sqf>_control ctrlWebBrowserAction ["ExecJS", "document.getElementById('test').innerHTML = 'Hello World!'"];</sqf>
- <sqf>_control ctrlWebBrowserAction ["LoadURL", "https://community.bistudio.com"];</sqf>

103
addons/admin/README.md Normal file
View File

@ -0,0 +1,103 @@
# Forge Admin Module
## Overview
The Admin module provides comprehensive administrative functionality for the Forge client system. It includes features for user management, financial operations, messaging, and administrative controls through both traditional and web-based interfaces.
## Dependencies
- forge_client_main
## Authors
- J. Schmidt
- Creedcoder
- IDSolutions
## Features
### Administrative Functions
1. **Admin Initialization** (`fnc_initAdmin.sqf`)
- Initializes the admin system
- Sets up necessary permissions and configurations
2. **Admin Interface**
- **Traditional UI** (`fnc_openAdmin.sqf`)
- Opens the administrative user interface
- Provides access to administrative controls
- **Web-based UI** (`RscWebAdmin.hpp`)
- Modern web interface for administrative tasks
- Real-time player statistics and management
3. **User Management**
- **Promotion** (`fnc_adminPromote.sqf`)
- Handles user promotion to administrative roles
- **Transfer** (`fnc_adminTransfer.sqf`)
- Manages administrative role transfers
- **Refresh** (`fnc_adminRefresh.sqf`)
- Updates administrative permissions and states
4. **Financial Operations**
- **Payday System**
- Distributes funds based on player ranks
- Configurable paygrade amounts
- **Money Management**
- Advance funds to players
- Deduct funds from players
- Global money distribution
- Company account balance tracking
5. **Communication**
- **Admin Messages** (`fnc_adminMessage.sqf`)
- Handles administrative messaging system
- **Broadcast System**
- Send messages to all players
- Targeted player messaging
### User Interface Components
1. **Traditional UI** (`RscAdmin.hpp`)
- Player list management
- Rank selection and promotion
- Financial operations
- Messaging system
2. **Web Interface** (`ui/_site/`)
- Modern, responsive design
- Real-time statistics
- Player management
- Financial operations
- Messaging system
## Event Handlers
The module uses several event handlers for initialization and execution:
- `XEH_preInit.sqf`: Pre-initialization setup
- `XEH_postInit.sqf`: Post-initialization tasks
- `XEH_preStart.sqf`: Pre-start configuration
## Usage
To use the admin module:
1. Ensure the module is properly loaded in your mission
2. Access administrative functions through either:
- Traditional UI: Use the provided dialog interface
- Web Interface: Access through the modern web-based panel
3. Use appropriate administrative commands based on your role
## Debugging
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
```cpp
#define DEBUG_MODE_FULL
```
## Version Information
Version information is managed through the main Forge client system configuration.
## Security
The module includes built-in security features:
- Admin authentication
- Permission-based access control
- Secure financial transactions
- Protected administrative functions
## Technical Details
- Supports both traditional Arma 3 UI and modern web interface
- Real-time data updates
- Configurable paygrade system
- Comprehensive player management
- Secure financial operations

View File

@ -1,7 +1,5 @@
PREP(adminMessage);
PREP(adminPromote);
PREP(adminRefresh); PREP(adminRefresh);
PREP(adminTransfer); PREP(handleTransfer);
PREP(initAdmin);
PREP(openAdmin); PREP(openAdmin);
PREP(printAddonName); PREP(sendMessage);
PREP(updatePaygrade);

View File

@ -1 +1,93 @@
#include "script_component.hpp" #include "script_component.hpp"
[QGVAR(handleEvents), {
params ["_control", "_isConfirmDialog", "_message"];
diag_log format ["[FORGE::Client::Admin::XEH_postInit] Received event: %1", _message];
_message = fromJSON _message;
private _event = _message get "event";
private _data = _message get "data";
switch (_event) do {
case "REQUEST::PLAYER::DATA": {
private _playerData = createHashMap;
private _playerList = [];
{
private _player = _x;
private _uid = getPlayerUID _player;
private _name = name _player;
private _paygrade = GETVAR(_player,FORGE_PayGrade,QUOTE(E1)); //TODO: Implement paygrade from server
private _funds = GETVAR(_player,FORGE_Bank,0); //TODO: Implement funds from server
private _playerInfo = createHashMapFromArray [
["uid", _uid],
["name", _name],
["paygrade", _paygrade],
["funds", _funds],
["side", str (side _player)]
];
_playerList pushBack _playerInfo;
} forEach allPlayers;
_playerData set ["players", _playerList];
_control ctrlWebBrowserAction ["ExecJS", format ["handlePlayerDataRequest(%1)", (toJSON _playerList)]];
};
case "REQUEST::PAYGRADE::DATA": {
private _payGrades = (missionConfigFile >> "CfgPaygrades" >> "payGrades") call BIS_fnc_getCfgData;
private _paygradeData = createHashMap;
private _paygradeList = [];
{
private _paygradeInfo = createHashMapFromArray [
["paygrade", _x select 0],
["bonus", _x select 1]
];
_paygradeList pushBack _paygradeInfo;
} forEach _payGrades;
_paygradeData set ["paygrades", _paygradeList];
_control ctrlWebBrowserAction ["ExecJS", format ["handlePaygradeDataRequest(%1)", (toJSON _paygradeList)]];
};
case "BROADCAST::MESSAGE": {
_data params ["_uid", "_message"];
if ((isNil "_message") || {_message isEqualTo ""}) exitWith { systemChat "Message cannot be empty!"; };
["forge_server_admin_handleEvents", ["ADMIN::SEND::MESSAGE", [_uid, _message]]] call CFUNC(serverEvent);
};
case "SEND::MESSAGE": {
_data params ["_uid", "_message"];
if ((isNil "_uid") || {_uid isEqualTo ""}) exitWith { systemChat "You did not select a player!"; };
["forge_server_admin_handleEvents", ["ADMIN::SEND::MESSAGE", [_uid, _message]]] call CFUNC(serverEvent);
};
case "UPDATE::PAYGRADE": {
_data params ["_uid", "_paygrade"];
if ((isNil "_uid") || {_uid isEqualTo ""}) exitWith { systemChat "You did not select a player!"; };
["forge_server_admin_handleEvents", ["ADMIN::UPDATE::PAYGRADE", [_uid, _paygrade]]] call CFUNC(serverEvent);
};
case "HANDLE::TRANSFER": {
_data params ["_condition", "_amount", "_uid"];
["forge_server_admin_handleEvents", ["ADMIN::TRANSFER", [_condition, _amount, _uid]]] call CFUNC(serverEvent);
};
case "ADVANCE::ALL": {
_data params ["_amount"];
["forge_server_admin_handleEvents", ["ADMIN::ADVANCE::ALL", [_amount]]] call CFUNC(serverEvent);
};
case "HANDLE::PAYDAY": {
["forge_server_admin_handleEvents", ["ADMIN::PAYDAY"]] call CFUNC(serverEvent);
};
default {
diag_log format ["[FORGE::Client::Admin::XEH_postInit] Unhandled event: %1", _event];
};
};
}] call CFUNC(addEventHandler);

View File

@ -16,3 +16,4 @@ class CfgPatches {
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "ui\RscCommon.hpp" #include "ui\RscCommon.hpp"
#include "ui\RscAdmin.hpp" #include "ui\RscAdmin.hpp"
#include "ui\RscWebAdmin.hpp"

View File

@ -1,30 +0,0 @@
#include "..\script_component.hpp"
private ["_data", "_dialog", "_list", "_target", "_targetValue", "_textBox", "_textMessage"];
_dialog = findDisplay 202303;
_list = _dialog displayCtrl 2023001;
_textBox = _dialog displayCtrl 2023006;
_targetValue = lbCurSel _list;
_data = _list lbData _targetValue;
if ((isNil {_data})) exitWith { hintSilent "You did not select a player!" };
{
if (str (name (_x)) == str _data) then {
_target = _x;
};
} forEach playableUnits;
hintSilent format ["Player Selected. You have selected %1", _target];
if (isNil "_target") then {
hintSilent "Please Select an Active Player First!"
} else {
_textMessage = ctrlText _textBox;
[_target, _textMessage] remoteExec ["forge_server_misc_fnc_textMessage", 2];
// [format ["Message sent to %1: <br/>%2", _target, _textMessage], "blue-grey", 3] call EFUNC(misc,notify);
};
["dummy"] call FUNC(adminRefresh);

View File

@ -1,31 +0,0 @@
#include "..\script_component.hpp"
params [["_condition", "", [""]]];
private ["_data", "_data2", "_dialog", "_list", "_list2", "_paygrade", "_rankValue", "_target", "_targetValue"];
_dialog = findDisplay 202303;
_list = _dialog displayCtrl 2023001;
_list2 = _dialog displayCtrl 2023003;
_targetValue = lbCurSel _list;
_rankValue = lbCurSel _list2;
_data = _list lbData _targetValue;
_data2 = call compile format ["%1", (_list2 lbData _rankValue)];
_paygrade = _data2 select 0;
if ((isNil {_data})) exitWith { hintSilent "You did not select a player!" };
{
if (str (name (_x)) == str _data) then {
_target = _x;
};
} forEach playableUnits;
switch (_condition) do {
case ("promote"): {
SETPVAR(_target,PayGrade,_paygrade)
};
case ("demote"): {
SETPVAR(_target,PayGrade,_paygrade)
};
};
["dummy"] call FUNC(adminRefresh);

View File

@ -1,52 +1,36 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
params [["_condition", "", [""]], ["_amount", 0, [0]]]; /*
* Author: IDSolutions
* Refreshes the admin interface
*
* Arguments:
* 0: Dummy <ANY> - Optional parameter, not used (for compatibility with event handlers)
*
* Return Value:
* None
*
* Examples:
* [] call forge_client_admin_fnc_adminRefresh;
* ["dummy"] call forge_client_admin_fnc_adminRefresh;
*
* Public: No
*/
private _newFunds = 0;
private _dialog = findDisplay 202303; private _dialog = findDisplay 202303;
private _list = _dialog displayCtrl 2023001; private _list = _dialog displayCtrl 2023001;
switch (_condition) do {
case ("deduct"): {
_newFunds = companyFunds - _amount;
ctrlSetText [2023002, format ["$%1", (_newFunds call EFUNC(misc,formatNumber))]];
};
case ("advance"): {
_newFunds = companyFunds + _amount;
ctrlSetText [2023002, format ["$%1", (_newFunds call EFUNC(misc,formatNumber))]];
};
default {
lbClear _list; lbClear _list;
{ {
if (str (side _x) == str (playerSide)) then { if (str (side _x) == str (playerSide)) then {
private _name = name (_x); private _name = name (_x);
private _defaultPaygrade = "E1"; private _paygrade = GETVAR(_x,FORGE_PayGrade,QUOTE(E1));
private _paygrade = GETVAR(_x,PayGrade,_defaultPaygrade);
private _index = _list lbAdd format["%1 - %2", _name, _paygrade]; private _index = _list lbAdd format["%1 - %2", _name, _paygrade];
_list lbSetData [_index, name (_x)]; _list lbSetData [_index, getPlayerUID _x];
}; };
} forEach playableUnits; } forEach allPlayers;
lbSetCurSel [2023001, 0];
ctrlSetText [2023005, ""];
ctrlSetText [2023006, ""];
};
};
lbClear _list;
{
if (str (side _x) == str (playerSide)) then {
private _name = name (_x);
private _defaultPaygrade = "E1";
private _paygrade = GETVAR(_x,PayGrade,_defaultPaygrade);
private _index = _list lbAdd format["%1 - %2", _name, _paygrade];
_list lbSetData [_index, name (_x)];
};
} forEach playableUnits;
lbSetCurSel [2023001, 0]; lbSetCurSel [2023001, 0];
ctrlSetText [2023005, ""]; ctrlSetText [2023005, ""];

View File

@ -1,92 +0,0 @@
#include "..\script_component.hpp"
params [["_condition", "", [""]]];
private _dialog = findDisplay 202303;
private _list = _dialog displayCtrl 2023001;
private _targetValue = lbCurSel _list;
private _data = _list lbData _targetValue;
private _amount = round (parseNumber (ctrlText 2023005));
if ((isNil {_data})) exitWith { hint "You did not select a player!" };
{
if (str (name (_x)) == str _data) then {
private _target = _x;
};
} count playableUnits;
switch (_condition) do {
case ("advance"): {
private _bank = GETVAR(_target,FORGE_Bank,0);
private _newBalance = _bank + _amount;
if (_amount > companyFunds) exitWith { ["Not enough money in the company's account!", "warning", 3] call EFUNC(misc,notify) };
SETPVAR(_target,FORGE_Bank,_newBalance);
["deduct", _amount] call FUNC(adminRefresh);
["deduct", _amount] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
};
case ("advanceAll"): {
private _count = count playableUnits;
if ((10000 * _count) > companyFunds) exitWith { ["Not enough money in the company's account!", "warning", 3] call EFUNC(misc,notify) };
{
private _bank = GETVAR(_x,Cash_Bank,0);
private _newBalance = _bank + 10000;
SETPVAR(_x,Cash_Bank,_newBalance);
} count playableUnits;
["deduct", (10000 * _count)] call FUNC(adminRefresh);
["deduct", (10000 * _count)] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
};
case ("deduct"): {
private _bank = GETVAR(_target,FORGE_Bank,0);
private _newBalance = _bank - _amount;
if (_amount > _bank) exitWith { ["Not enough money in the player's account!", "warning", 3] call EFUNC(misc,notify) };
SETPVAR(_target,FORGE_Bank,_newBalance);
["advance", _amount] call FUNC(adminRefresh);
["advance", _amount] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
};
case ("payday"): {
private _totalPayment = 0;
private _paymentToDo = [];
private _payGrades = (missionConfigFile >> "CfgPaygrades" >> "payGrades") call BIS_fnc_getCfgData;
{
private _player = _x;
private _payGrade = GETVAR(_player,PayGrade,nil);
{
_x params ["_payGradeIndex", "_payGradeBonus"];
if ((_x select 0) == _payGrade) then {
_paymentToDo pushBack [_player, _payGradeBonus];
_totalPayment = _totalPayment + _payGradeBonus;
};
} forEach _payGrades;
} count playableUnits;
if (_totalPayment > companyFunds) exitWith { ["Not enough money in the company's account!", "warning", 3] call EFUNC(misc,notify) };
{
_x params ["_player", "_bonus"];
private _bank = GETVAR(_player,FORGE_Bank,0);
private _newBalance = _bank + _bonus;
SETPVAR(_player,FORGE_Bank,_newBalance);
} count _paymentToDo;
["deduct", _totalPayment] call FUNC(adminRefresh);
["deduct", _totalPayment] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
};
};
ctrlSetText [2023005, ""];

View File

@ -0,0 +1,32 @@
#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Handles fund transfers
*
* Arguments:
* 0: Condition <STRING> - The type of transfer to perform ("advance", "deduct", "advanceAll", "payday")
*
* Return Value:
* None
*
* Examples:
* ["advance"] call forge_client_admin_fnc_handleTransfer;
* ["payday"] call forge_client_admin_fnc_handleTransfer;
*
* Public: No - Called from admin dialog controls
*/
params [["_condition", "", [""]]];
private _dialog = findDisplay 202303;
private _list = _dialog displayCtrl 2023001;
private _index = lbCurSel _list;
private _uid = _list lbData _index;
private _amount = round (parseNumber (ctrlText 2023005));
if ({_condition in ["advance", "deduct"]} && ((isNil "_uid") || { _uid isEqualTo "" })) exitWith { hint "You did not select a player!"; };
["forge_server_admin_handleEvents", ["ADMIN::TRANSFER", [_condition, _amount, _uid]]] call CFUNC(serverEvent);
ctrlSetText [2023005, ""];

View File

@ -1,18 +0,0 @@
#include "..\script_component.hpp"
{
private _configName = configName(_x);
private _className = (missionConfigFile >> "CfgCpofs" >> "cpofs" >> _configName >> "className") call BFUNC(getCfgData);
private _pos = (missionConfigFile >> "CfgCpofs" >> "cpofs" >> _configName >> "pos") call BFUNC(getCfgData);
private _dir = (missionConfigFile >> "CfgCpofs" >> "cpofs" >> _configName >> "dir") call BFUNC(getCfgData);
private _cpof = createSimpleObject [_className, [0, 0, 0]];
_cpof setPosATL _pos;
_cpof setDir _dir;
_cpof allowDamage false;
_cpof setVariable ["isCPOF", true, true];
diag_log text format ["[FORGE Admin] ClassName: '%1' Pos: '%2' Dir: '%3'", _className, _pos, _dir];
} forEach ("true" configClasses (missionConfigFile >> "CfgCpofs" >> "cpofs"));

View File

@ -1,5 +1,36 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/*
* Author: IDSolutions
* Opens the admin dialog.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call forge_client_admin_fnc_openAdmin;
*
* Public: Yes
*/
private _productVersion = productVersion;
private _steamBranchName = _productVersion select 8;
private _payGrades = (missionConfigFile >> "CfgPaygrades" >> "payGrades") call BFUNC(getCfgData);
if (_steamBranchName == "profiling") then {
private _display = (findDisplay 46) createDisplay "RscWebAdmin";
private _ctrl = _display displayCtrl 2025;
_ctrl ctrlAddEventHandler ["JSDialog", {
params ["_control", "_isConfirmDialog", "_message"];
[QGVAR(handleEvents), [_control, _isConfirmDialog, _message]] call CFUNC(localEvent);
}];
_ctrl ctrlWebBrowserAction ["LoadFile", QUOTE(PATHTOF(ui\_site\index.html))];
} else {
disableSerialization; disableSerialization;
createDialog "RscAdmin"; createDialog "RscAdmin";
@ -8,19 +39,18 @@ private _list = _dialog displayCtrl 2023001;
private _list2 = _dialog displayCtrl 2023003; private _list2 = _dialog displayCtrl 2023003;
{ {
if (str (side _x) == str (playerSide)) then { if (str (side _x) == str (playerSide) && isPlayer _x) then {
private _name = name (_x); private _name = name (_x);
private _payGrade = GETVAR(_x,paygrade,nil); private _uid = getPlayerUID _x;
private _payGrade = GETVAR(_x,FORGE_PayGrade,QUOTE(E1));
private _index = _list lbAdd format["%1 - %2", _name, _payGrade]; private _index = _list lbAdd format["%1 - %2", _name, _payGrade];
_list lbSetData [_index, _name]; _list lbSetData [_index, _uid];
}; };
} count (allPlayers); } count (allPlayers);
lbSetCurSel [2023001, 0]; lbSetCurSel [2023001, 0];
private _payGrades = (missionConfigFile >> "CfgPaygrades" >> "payGrades") call BFUNC(getCfgData);
{ {
private _index = _list2 lbAdd format ["%1 - $%2", (_x select 0), ((_x select 1) call EFUNC(misc,formatNumber))]; private _index = _list2 lbAdd format ["%1 - $%2", (_x select 0), ((_x select 1) call EFUNC(misc,formatNumber))];
@ -29,3 +59,4 @@ private _payGrades = (missionConfigFile >> "CfgPaygrades" >> "payGrades") call B
lbSetCurSel [2023003, 0]; lbSetCurSel [2023003, 0];
ctrlSetText [2023002, format ["$%1", (companyFunds call EFUNC(misc,formatNumber))]]; ctrlSetText [2023002, format ["$%1", (companyFunds call EFUNC(misc,formatNumber))]];
};

View File

@ -1,3 +0,0 @@
#include "..\script_component.hpp"
systemChat format ["Thank you for using the %1", 'ADDON'];

View File

@ -0,0 +1,30 @@
#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Sends a message to a selected player
*
* Arguments:
* None
*
* Return Value:
* None
*
* Examples:
* [] call forge_client_admin_fnc_sendMessage;
*
* Public: No - Called from admin dialog controls
*/
private _dialog = findDisplay 202303;
private _list = _dialog displayCtrl 2023001;
private _control = _dialog displayCtrl 2023006;
private _index = lbCurSel _list;
private _uid = _list lbData _index;
private _message = ctrlText _control;
if ((isNil "_uid") || {_uid isEqualTo ""}) exitWith { hintSilent "You did not select a player!"; };
["forge_server_admin_handleEvents", ["ADMIN::SEND::MESSAGE", [_uid, _message]]] call CFUNC(serverEvent);
["dummy"] call FUNC(adminRefresh);

View File

@ -0,0 +1,32 @@
#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Updates a player's paygrade
*
* Arguments:
* None
*
* Return Value:
* None
*
* Examples:
* [] call forge_client_admin_fnc_updatePaygrade;
*
* Public: No - Called from admin dialog controls
*/
private _dialog = findDisplay 202303;
private _list = _dialog displayCtrl 2023001;
private _list2 = _dialog displayCtrl 2023003;
private _targetIndex = lbCurSel _list;
private _rankIndex = lbCurSel _list2;
private _uid = _list lbData _targetIndex;
private _rankData = call compile format ["%1", (_list2 lbData _rankIndex)];
private _paygrade = _rankData select 0;
if ((isNil "_uid") || {_uid isEqualTo ""}) exitWith { hintSilent "You did not select a player!" };
["forge_server_admin_handleEvents", ["ADMIN::UPDATE::PAYGRADE", [_uid, _paygrade]]] call CFUNC(serverEvent);
["dummy"] call FUNC(adminRefresh);

View File

@ -83,7 +83,7 @@ class RscAdmin {
class RscAdminPromote: RscButton { class RscAdminPromote: RscButton {
idc = -1; idc = -1;
colorText[] = {1,1,1,1}; colorText[] = {1,1,1,1};
onButtonClick = "['promote'] call forge_client_admin_fnc_adminPromote;"; onButtonClick = "[] call forge_client_admin_fnc_updatePaygrade;";
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
text = "Promote"; text = "Promote";
x = "0.675 * safezoneW + safezoneX"; x = "0.675 * safezoneW + safezoneX";
@ -163,7 +163,7 @@ class RscAdmin {
class RscAdminSend: RscButton { class RscAdminSend: RscButton {
idc = -1; idc = -1;
colorText[] = {1,1,1,1}; colorText[] = {1,1,1,1};
onButtonClick = "[] call forge_client_admin_fnc_adminMessage;"; onButtonClick = "[] call forge_client_admin_fnc_sendMessage;";
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
text = "Send Message"; text = "Send Message";
x = "0.6125 * safezoneW + safezoneX"; x = "0.6125 * safezoneW + safezoneX";

View File

@ -0,0 +1,17 @@
class RscWebAdmin {
idd = 20250502;
fadein = 0;
fadeout = 0;
duration = 1e+011;
class controls {
class Background: RscText {
type = 106;
idc = 2025;
x = "safeZoneY * (pixelW/pixelH) * 2.975";
y = "safeZoneY + (safeZoneH * 0.05)";
w = "safeZoneW * (pixelW/pixelH) * 1.17";
h = "safeZoneH * 0.875";
};
};
};

View File

@ -0,0 +1,163 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!--
Dynamic Resource Loading
The following script loads CSS and JavaScript files dynamically using the A3API
This approach is used instead of static HTML imports to work with Arma 3's file system
-->
<script>
Promise.all([
// Load CSS file
A3API.RequestFile("z\\forge_client\\addons\\admin\\ui\\_site\\styles.css"),
// Load JavaScript file
A3API.RequestFile("z\\forge_client\\addons\\admin\\ui\\_site\\script.js")
]).then(([css, js]) => {
// Apply CSS
const style = document.createElement('style');
style.textContent = css;
document.head.appendChild(style);
// Load and execute JavaScript
const script = document.createElement('script');
script.text = js;
document.head.appendChild(script);
// Initialize the admin interface
initializeAdmin();
});
</script>
</head>
<body>
<!--
Header Section
Contains the main title and server statistics
-->
<header>
<div class="header-content">
<h1>Admin Panel</h1>
<!-- Server Statistics Display -->
<div class="admin-stats">
<div class="stat-item">
<div class="stat-info">
<span class="stat-label">Online Players</span>
<span class="stat-value" id="playerCount">0</span>
</div>
</div>
<div class="stat-divider"></div>
<div class="stat-item">
<div class="stat-info">
<span class="stat-label">Staff Online</span>
<span class="stat-value" id="staffCount">0</span>
</div>
</div>
</div>
</div>
</header>
<!--
Main Content Area
Contains all admin functionality sections
-->
<main class="container">
<div class="sections-grid">
<!--
Admin Action Sections
Left column with various global admin actions
-->
<div class="action-sections">
<!-- Global Payday Action -->
<div class="admin-section">
<h2>Global Actions</h2>
<div class="form-group">
<label for="paydayAmount">Payday</label>
<p class="payday-description">Players will receive money based on their rank</p>
</div>
<button class="submit-btn" onclick="Payday()">Payday</button>
</div>
<!-- Give All Money Action -->
<div class="admin-section">
<h2>Give All Money</h2>
<div class="form-group">
<label for="giveAllAmount">Amount to Give</label>
<input type="number" id="giveAllAmount" min="0" placeholder="Enter amount to give to all players...">
</div>
<button class="submit-btn" onclick="giveAllMoney()">Give to All</button>
</div>
<!-- Broadcast Message System -->
<div class="admin-section">
<h2>Broadcast Message</h2>
<div class="form-group">
<label for="broadcastMessage">Message</label>
<input type="text" id="broadcastMessage" placeholder="Enter message to broadcast...">
</div>
<button class="submit-btn" onclick="broadcastMessage()">Send to All</button>
</div>
</div>
<!--
Player List Section
Right column showing all players with filtering options
-->
<div class="admin-section player-list-section">
<!-- Search and Filter Controls -->
<div class="search-bar">
<input type="text" id="playerSearch" class="search-input" placeholder="Search players...">
<div class="filter-bar">
<button class="filter-btn active" data-filter="all">All</button>
<button class="filter-btn" data-filter="staff">Staff</button>
<button class="filter-btn" data-filter="blufor">BLUFOR</button>
<button class="filter-btn" data-filter="opfor">OPFOR</button>
<button class="filter-btn" data-filter="independent">Independent</button>
<button class="filter-btn" data-filter="civilian">Civilian</button>
</div>
</div>
<!-- Dynamic Player List Container -->
<div class="player-list" id="playerList">
<!-- Players will be populated dynamically via JavaScript -->
</div>
</div>
</div>
</main>
<!--
Modal Dialogs
Hidden by default, shown when specific actions are triggered
-->
<!-- Message Modal - For sending messages to individual players -->
<div id="messageModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2>Send Message</h2>
<button class="close-modal" onclick="closeMessageModal()">&times;</button>
</div>
<div class="form-group">
<label for="messageInput">Message to <span id="messagePlayerName"></span></label>
<input type="text" id="messageInput" placeholder="Enter your message...">
</div>
<button class="submit-btn" onclick="sendPlayerMessage()">Send Message</button>
</div>
</div>
<!-- Money Modal - For modifying player funds -->
<div id="moneyModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2>Modify Money</h2>
<button class="close-modal" onclick="closeMoneyModal()">&times;</button>
</div>
<div class="form-group">
<label for="moneyAmount">Amount</label>
<input type="number" id="moneyAmount" placeholder="Enter amount...">
</div>
<div class="player-actions">
<button class="action-btn promote-btn" onclick="giveMoney()">Give Money</button>
<button class="action-btn demote-btn" onclick="takeMoney()">Take Money</button>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,488 @@
/**
* Admin Panel Management Script
* This script handles the admin panel functionality for the Arma 3 game interface.
* It provides player management, money operations, messaging, and other admin functions.
*/
//=============================================================================
// #region DATA STRUCTURES AND VARIABLES
//=============================================================================
/**
* Admin data structure - will be populated from the game
* Contains player information and payday amount configuration
*/
let adminData = {
players: [], // List of all players with their details
paydayAmounts: {} // Map of paygrade to bonus amount
};
/**
* Currently selected player ID for operations that require a player selection
* @type {string|null}
*/
let selectedPlayerId = null;
// #endregion
//=============================================================================
// #region INITIALIZATION AND DATA REQUESTS
//=============================================================================
/**
* Initialize the admin panel
* Sets up the UI, requests initial data from the game engine
*/
function initializeAdmin() {
updateStats();
setupFilterListeners();
requestPlayerData();
requestPaygradeData();
}
/**
* Request player data from the game engine
* Sends an event to fetch current player information
*/
function requestPlayerData() {
const message = {
event: "REQUEST::PLAYER::DATA",
data: {}
};
// Send request to the game engine
A3API.SendAlert(JSON.stringify(message));
}
/**
* Request paygrade data from the game engine
* Sends an event to fetch current paygrade configuration
*/
function requestPaygradeData() {
const message = {
event: "REQUEST::PAYGRADE::DATA",
data: {}
};
// Send request to the game engine
A3API.SendAlert(JSON.stringify(message));
}
/**
* Set up a timer to periodically refresh player data
* Ensures the UI is updated with the latest information
*/
function setupRefreshTimer() {
setInterval(requestPlayerData, 30000); // Refresh every 30 seconds
}
// #endregion
//=============================================================================
// #region DATA HANDLERS
//=============================================================================
/**
* Handle paygrade data received from the game engine
* Processes the paygrade list and updates the UI accordingly
*
* @param {Array} paygradeList - List of paygrade objects with paygrade and bonus properties
*/
function handlePaygradeDataRequest(paygradeList) {
try {
// Convert the paygrade list to a map for easier lookup
const paygradeMap = {};
paygradeList.forEach(item => {
paygradeMap[item.paygrade] = item.bonus;
});
adminData.paydayAmounts = paygradeMap;
// Update the player list if we already have player data
if (adminData.players.length > 0) {
updatePlayerList();
}
console.log("Paygrade data updated successfully");
} catch (error) {
console.error("Error updating paygrade data:", error);
}
}
/**
* Handle player data received from the game engine
* Updates the admin panel with current player information
*
* @param {Array} playerList - List of player objects with their details
*/
function handlePlayerDataRequest(playerList) {
adminData.players = playerList;
updateStats();
updatePlayerList();
}
// #endregion
//=============================================================================
// #region UI UPDATES AND DISPLAY
//=============================================================================
/**
* Update header statistics
* Shows counts of online players and staff
*/
function updateStats() {
const onlinePlayers = adminData.players.length;
const onlineStaff = adminData.players.filter(p => p.paygrade !== "E1").length;
document.getElementById('playerCount').textContent = onlinePlayers;
document.getElementById('staffCount').textContent = onlineStaff;
}
/**
* Set up filter button listeners
* Configures the filter buttons and search functionality
*/
function setupFilterListeners() {
const filterButtons = document.querySelectorAll('.filter-btn');
// Set up filter button click handlers
filterButtons.forEach(button => {
button.addEventListener('click', () => {
filterButtons.forEach(btn => btn.classList.remove('active'));
button.classList.add('active');
filterPlayers(button.dataset.filter);
});
});
// Set up search functionality
const searchInput = document.getElementById('playerSearch');
searchInput.addEventListener('input', () => {
const activeFilter = document.querySelector('.filter-btn.active').dataset.filter;
filterPlayers(activeFilter, searchInput.value);
});
}
/**
* Filter players based on category and search term
*
* @param {string} filter - The filter category (all, staff, blufor, etc.)
* @param {string} searchTerm - Optional search term to filter by name
*/
function filterPlayers(filter, searchTerm = '') {
let filteredPlayers = adminData.players;
// Apply category filter
if (filter === 'staff') {
filteredPlayers = filteredPlayers.filter(p => p.paygrade !== "E1");
} else if (filter === 'blufor') {
filteredPlayers = filteredPlayers.filter(p => p.side === "WEST");
} else if (filter === 'opfor') {
filteredPlayers = filteredPlayers.filter(p => p.side === "EAST");
} else if (filter === 'independent') {
filteredPlayers = filteredPlayers.filter(p => p.side === "GUER");
} else if (filter === 'civilian') {
filteredPlayers = filteredPlayers.filter(p => p.side === "CIV");
}
// Apply search filter
if (searchTerm) {
const term = searchTerm.toLowerCase();
filteredPlayers = filteredPlayers.filter(p =>
p.name.toLowerCase().includes(term)
);
}
updatePlayerList(filteredPlayers);
}
/**
* Update the player list display
* Renders the filtered player list with all relevant information
*
* @param {Array} players - List of player objects to display, defaults to all players
*/
function updatePlayerList(players = adminData.players) {
const playerList = document.getElementById('playerList');
playerList.innerHTML = players.map(player => {
const paydayAmount = adminData.paydayAmounts[player.paygrade] || 1000;
const rankClass = getRankClass(player.paygrade);
return `
<div class="player-item" data-id="${player.uid}">
<div class="player-info">
<span class="player-name">${player.name}</span>
<span class="player-rank rank-${rankClass}">${player.paygrade}</span>
<span class="player-money">${parseInt(player.funds).toLocaleString()}</span>
<span class="player-payday">Payday: ${paydayAmount.toLocaleString()}</span>
<span class="player-side side-${player.side.toLowerCase()}">${player.side}</span>
</div>
<div class="player-actions">
<button class="action-btn promote-btn" onclick="updatePaygrade('${player.uid}', true)">
Promote
</button>
<button class="action-btn demote-btn" onclick="updatePaygrade('${player.uid}', false)">
Demote
</button>
<button class="action-btn message-btn" onclick="openMessageModal('${player.uid}', '${player.name}')">Message</button>
<button class="action-btn" onclick="openMoneyModal('${player.uid}')">Modify Money</button>
</div>
</div>
`}).join('');
}
/**
* Helper function to determine rank class based on paygrade
* Used for styling different ranks with appropriate CSS classes
*
* @param {string} paygrade - The player's paygrade code
* @returns {string} CSS class name for the rank
*/
function getRankClass(paygrade) {
if (paygrade.startsWith('E')) {
return 'enlisted';
} else if (paygrade.startsWith('WO')) {
return 'warrant';
} else if (paygrade.startsWith('O') ||
paygrade.startsWith('1') ||
paygrade.startsWith('2') ||
paygrade.startsWith('C') ||
paygrade.startsWith('M')) {
return 'officer';
} else {
return 'enlisted'; // Default
}
}
// #endregion
//=============================================================================
// #region RANK MANAGEMENT
//=============================================================================
/**
* Update a player's paygrade (promote or demote)
*
* @param {string} uid - Player's unique identifier
* @param {boolean} isPromotion - True for promotion, false for demotion
*/
function updatePaygrade(uid, isPromotion) {
const player = adminData.players.find(p => p.uid === uid);
if (!player) return;
// Use the paygrades from the configuration
const paygrades = Object.keys(adminData.paydayAmounts);
paygrades.sort((a, b) => adminData.paydayAmounts[a] - adminData.paydayAmounts[b]); // Sort by payment amount
const currentIndex = paygrades.indexOf(player.paygrade);
let newPaygrade;
if (isPromotion && currentIndex < paygrades.length - 1) {
newPaygrade = paygrades[currentIndex + 1];
} else if (!isPromotion && currentIndex > 0) {
newPaygrade = paygrades[currentIndex - 1];
} else {
return; // Can't promote/demote further
}
const message = {
event: "UPDATE::PAYGRADE",
data: [uid, newPaygrade]
};
A3API.SendAlert(JSON.stringify(message));
// Optimistic update
player.paygrade = newPaygrade;
updatePlayerList();
}
// #endregion
//=============================================================================
// #region MONEY MANAGEMENT
//=============================================================================
/**
* Open the money modification modal for a player
*
* @param {string} uid - Player's unique identifier
*/
function openMoneyModal(uid) {
selectedPlayerId = uid;
const modal = document.getElementById('moneyModal');
modal.style.display = 'block';
}
/**
* Close the money modification modal
*/
function closeMoneyModal() {
const modal = document.getElementById('moneyModal');
modal.style.display = 'none';
document.getElementById('moneyAmount').value = '';
selectedPlayerId = null;
}
/**
* Give money to the selected player
*/
function giveMoney() {
const amount = parseInt(document.getElementById('moneyAmount').value);
if (amount && selectedPlayerId) {
handleTransferFunds("advance", amount, selectedPlayerId);
closeMoneyModal();
}
}
/**
* Give money to all players
*/
function giveAllMoney() {
const amount = parseInt(document.getElementById('giveAllAmount').value);
const message = {
event: "ADVANCE::ALL",
data: [amount]
}
A3API.SendAlert(JSON.stringify(message));
// Request updated player data after giving money to all players
setTimeout(requestPlayerData, 500); // Short delay to allow server processing
}
/**
* Take money from the selected player
*/
function takeMoney() {
const amount = parseInt(document.getElementById('moneyAmount').value);
if (amount && selectedPlayerId) {
handleTransferFunds("deduct", amount, selectedPlayerId);
closeMoneyModal();
}
}
/**
* Handle funds transfer for a player
*
* @param {string} condition - "advance" to give money, "deduct" to take money
* @param {number} amount - Amount of money to transfer
* @param {string} uid - Player's unique identifier
*/
function handleTransferFunds(condition, amount, uid) {
const message = {
event: "HANDLE::TRANSFER",
data: [condition, amount, uid]
};
A3API.SendAlert(JSON.stringify(message));
// Optimistic update
const player = adminData.players.find(p => p.uid === uid);
if (player) {
if (condition === "advance") {
player.funds = parseInt(player.funds) + amount;
} else if (condition === "deduct") {
player.funds = Math.max(0, parseInt(player.funds) - amount);
}
updatePlayerList();
}
}
// #endregion
//=============================================================================
// #region MESSAGE SYSTEM
//=============================================================================
/**
* Open the message modal for a player
*
* @param {string} uid - Player's unique identifier
* @param {string} playerName - Player's name for display
*/
function openMessageModal(uid, playerName) {
selectedPlayerId = uid;
const modal = document.getElementById('messageModal');
document.getElementById('messagePlayerName').textContent = playerName;
modal.style.display = 'block';
}
/**
* Close the message modal
*/
function closeMessageModal() {
const modal = document.getElementById('messageModal');
modal.style.display = 'none';
document.getElementById('messageInput').value = '';
selectedPlayerId = null;
}
/**
* Send a message to the selected player
*/
function sendPlayerMessage() {
const message = document.getElementById('messageInput').value;
if (message && selectedPlayerId) {
const messageData = {
event: "SEND::MESSAGE",
data: [selectedPlayerId, message]
};
A3API.SendAlert(JSON.stringify(messageData));
closeMessageModal();
}
}
/**
* Broadcast a message to all players
*/
function broadcastMessage() {
const message = document.getElementById('broadcastMessage').value;
if (message) {
const messageData = {
event: "BROADCAST::MESSAGE",
data: ["", message]
};
A3API.SendAlert(JSON.stringify(messageData));
document.getElementById('broadcastMessage').value = '';
}
}
// #endregion
//=============================================================================
// #region GLOBAL ACTIONS
//=============================================================================
/**
* Trigger a payday for all players
*/
function Payday() {
const message = {
event: "HANDLE::PAYDAY",
data: []
};
A3API.SendAlert(JSON.stringify(message));
// Request updated player data after payday
setTimeout(requestPlayerData, 500); // Short delay to allow server processing
}
// #endregion
//=============================================================================
// #region EVENT LISTENERS
//=============================================================================
/**
* Initialize when DOM is loaded
*/
document.addEventListener('DOMContentLoaded', () => {
initializeAdmin();
setupRefreshTimer();
});
// #endregion

View File

@ -0,0 +1,646 @@
/* =============================================================================
BASE STYLES AND VARIABLES
============================================================================= */
/* Reset styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* Color variables and theme configuration */
:root {
/* Primary colors */
--primary-color: #3b82f6;
--primary-hover: #2563eb;
--secondary-color: #1e293b;
/* Background colors */
--background-color: #f1f5f9;
--card-background: #ffffff;
--header-bg: #1e293b;
--tile-hover: #f8fafc;
/* Text colors */
--text-primary: #0f172a;
--text-secondary: #475569;
--header-text: #f8fafc;
/* Status colors */
--success-color: #16a34a;
--success-hover: #15803d;
--error-color: #dc2626;
--error-hover: #b91c1c;
--warning-color: #f59e0b;
--warning-hover: #d97706;
/* Utility colors */
--border-color: #e2e8f0;
--shadow-color: rgba(0, 0, 0, 0.1);
}
/* Base body styles */
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
line-height: 1.6;
background-color: var(--background-color);
color: var(--text-primary);
}
/* =============================================================================
LAYOUT COMPONENTS
============================================================================= */
/* Main container */
.container {
max-width: 1280px;
margin: 0 auto;
padding: 0 1rem;
margin-bottom: 1.5rem;
}
/* Header styles */
header {
background-color: var(--header-bg);
color: var(--header-text);
padding: 1rem 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
& .header-content {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1280px;
margin: 0 auto;
padding: 0 1rem;
}
& h1 {
font-size: 1.75rem;
font-weight: 600;
letter-spacing: -0.025em;
}
}
/* Admin stats in header */
.admin-stats {
display: flex;
align-items: center;
margin-left: auto;
background: rgba(255, 255, 255, 0.05);
border-radius: 8px;
border: 1px solid rgba(255, 255, 255, 0.1);
& .stat-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem 0.75rem;
border-radius: 6px;
transition: all 0.2s ease-in-out;
min-width: 140px;
&:hover {
background: rgba(255, 255, 255, 0.1);
}
}
& .stat-icon {
display: flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
font-size: 1rem;
}
& .stat-info {
display: flex;
flex-direction: column;
gap: 0.125rem;
}
& .stat-label {
font-size: 0.75rem;
color: rgba(255, 255, 255, 0.7);
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.025em;
}
& .stat-value {
font-size: 0.875rem;
font-weight: 600;
color: var(--header-text);
}
& .stat-divider {
width: 1px;
height: 24px;
background: rgba(255, 255, 255, 0.1);
margin: 0 0.25rem;
}
}
/* Grid layout for sections */
.sections-grid {
display: grid;
grid-template-columns: 1fr;
gap: 1.5rem;
}
.action-sections {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1.5rem;
margin-top: 1.5rem;
}
/* =============================================================================
ADMIN SECTION COMPONENTS
============================================================================= */
/* Admin section cards */
.admin-section {
background-color: var(--card-background);
border-radius: 12px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
padding: 1.5rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
border: none;
transition: all 0.3s ease-in-out;
height: auto;
max-height: calc(100vw / 3);
&:hover {
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
transform: translateY(-4px);
}
&:active {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
&.square-ratio {
aspect-ratio: 1 / 1;
}
}
/* Player list section */
.player-list-section {
grid-column: span 1;
height: auto;
max-height: calc(100vw / 3);
}
.player-list {
list-style: none;
overflow-y: auto;
flex: 1;
padding-right: 0.5rem;
margin-right: -0.5rem;
/* Customize scrollbar for webkit browsers */
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-track {
background: transparent;
margin: 0.5rem;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.1);
border-radius: 3px;
&:hover {
background-color: rgba(0, 0, 0, 0.2);
}
}
}
/* Player item in the list */
.player-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
background-color: var(--card-background);
border-radius: 8px;
transition: all 0.2s ease-in-out;
border: none;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
margin-bottom: 0.5rem;
&:last-child {
margin-bottom: 0;
}
&:hover {
background-color: var(--tile-hover);
box-shadow: 0 4px 6px var(--shadow-color);
transform: translateY(-2px);
}
& .player-info {
display: flex;
align-items: center;
gap: 1rem;
flex: 1;
}
& .player-name {
font-weight: 600;
color: var(--text-primary);
}
& .player-money {
font-size: 0.875rem;
color: var(--success-color);
font-weight: 500;
}
& .player-actions {
display: flex;
gap: 0.5rem;
}
}
/* Player role badges */
.player-role {
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.025em;
}
.role-admin {
background-color: var(--error-color);
color: white;
}
.role-mod {
background-color: var(--warning-color);
color: white;
}
.role-player {
background-color: var(--success-color);
color: white;
}
/* =============================================================================
BUTTONS AND INTERACTIVE ELEMENTS
============================================================================= */
/* Action buttons */
.action-btn {
padding: 0.5rem 1rem;
border-radius: 6px;
font-size: 0.875rem;
font-weight: 500;
transition: all 0.2s ease;
border: none;
cursor: pointer;
}
.promote-btn {
background-color: #22c55e;
color: white;
&:hover {
background-color: #16a34a;
}
}
.demote-btn {
background-color: #ef4444;
color: white;
&:hover {
background-color: #dc2626;
}
}
.message-btn {
background-color: #3b82f6;
color: white;
&:hover {
background-color: #2563eb;
}
}
/* Search and filter components */
.search-bar {
display: flex;
flex-direction: column;
gap: 1rem;
margin-bottom: 1.5rem;
}
.search-input {
padding: 0.75rem 1rem;
border: 1px solid var(--border-color);
border-radius: 8px;
font-size: 1rem;
color: var(--text-primary);
background-color: var(--card-background);
transition: all 0.2s ease-in-out;
&:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
&:hover {
border-color: var(--primary-color);
}
}
.filter-bar {
display: flex;
gap: 0.5rem;
}
.filter-btn {
padding: 0.5rem 0.75rem;
border: 1px solid var(--border-color);
border-radius: 6px;
cursor: pointer;
background-color: var(--card-background);
color: var(--text-secondary);
font-weight: 500;
font-size: 0.875rem;
transition: all 0.2s ease-in-out;
&:hover {
border-color: var(--primary-color);
color: var(--primary-color);
}
&.active {
background-color: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
}
/* =============================================================================
FORMS AND INPUTS
============================================================================= */
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-bottom: 1rem;
& label {
font-weight: 500;
color: var(--text-secondary);
font-size: 0.875rem;
}
& input {
padding: 0.75rem 1rem;
border: 1px solid var(--border-color);
border-radius: 8px;
font-size: 1rem;
color: var(--text-primary);
background-color: var(--card-background);
transition: all 0.2s ease-in-out;
&:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
&:hover {
border-color: var(--primary-color);
}
}
}
.submit-btn {
background-color: var(--primary-color);
color: white;
padding: 0.75rem 1.5rem;
border: none;
border-radius: 8px;
cursor: pointer;
font-weight: 500;
font-size: 1rem;
transition: all 0.2s ease-in-out;
opacity: 0.9;
margin-top: auto;
&:hover {
background-color: var(--primary-hover);
opacity: 1;
transform: translateY(-2px);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
&:active {
transform: translateY(0);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
}
/* =============================================================================
MODALS
============================================================================= */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
}
.modal-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: var(--card-background);
padding: 1.5rem;
border-radius: 12px;
min-width: 400px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border: 1px solid var(--border-color);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
& h2 {
font-size: 1.25rem;
color: var(--text-primary);
font-weight: 600;
}
}
.close-modal {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: var(--text-secondary);
transition: color 0.2s ease-in-out;
&:hover {
color: var(--text-primary);
}
}
/* =============================================================================
BADGES AND STATUS INDICATORS
============================================================================= */
.badge {
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.025em;
}
/* Rank & Side badges */
.player-rank,
.player-side {
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.025em;
}
/* Rank styling based on type */
.rank-enlisted {
background-color: #e2e8f0;
color: #475569;
}
.rank-warrant {
background-color: #bfdbfe;
color: #1e40af;
}
.rank-officer {
background-color: #3b82f6;
color: #ffffff;
}
/* Side indicators */
.side-west {
background-color: #3b82f6;
color: white;
}
.side-east {
background-color: #ef4444;
color: white;
}
.side-guer {
background-color: #22c55e;
color: white;
}
.side-civ {
background-color: #a855f7;
color: white;
}
/* Player payday indicator */
.player-payday {
font-size: 0.75rem;
color: var(--success-color);
font-weight: 500;
background-color: rgba(22, 163, 74, 0.1);
padding: 0.25rem 0.5rem;
border-radius: 4px;
margin-left: 0.5rem;
}
/* Description text */
.payday-description {
font-size: 0.875rem;
color: var(--text-secondary);
margin: 0.5rem 0;
}
/* =============================================================================
RESPONSIVE ADJUSTMENTS
============================================================================= */
/* Adjustments for smaller screens */
@media (max-width: 768px) {
.action-sections {
grid-template-columns: 1fr;
}
.player-item {
flex-direction: column;
align-items: flex-start;
& .player-info {
margin-bottom: 1rem;
flex-wrap: wrap;
}
& .player-actions {
width: 100%;
justify-content: space-between;
}
}
.filter-bar {
overflow-x: auto;
padding-bottom: 0.5rem;
}
.modal-content {
min-width: 90%;
max-width: 90%;
}
}
/* Adjustments for very small screens */
@media (max-width: 480px) {
.admin-stats {
flex-direction: column;
& .stat-divider {
width: 80%;
height: 1px;
margin: 0.25rem 0;
}
}
.action-btn {
padding: 0.5rem;
font-size: 0.75rem;
}
}

74
addons/ambient/README.md Normal file
View File

@ -0,0 +1,74 @@
# Forge Ambient Module
## Overview
The Ambient module provides environmental sound management for the Forge client system. It enables the creation and management of ambient sound effects in the game environment, enhancing the immersive experience for players.
## Dependencies
- forge_client_main
## Authors
- J. Schmidt
- Creedcoder
- IDSolutions
## Features
### Sound Management
1. **Ambient Sound System** (`fnc_ambientSound.sqf`)
- Creates and manages sound sources in the game world
- Handles sound effect playback and cleanup
- Supports timed and continuous sound effects
2. **Sound Source Features**
- Dynamic sound source creation
- Position-based sound placement
- Automatic cleanup of sound sources
- Support for various sound types and durations
3. **Sound Control**
- Lifecycle management of sound sources
- Automatic cleanup when source is destroyed
- Configurable sound duration
- Position tracking for moving sound sources
## Event Handlers
The module uses several event handlers for initialization and execution:
- `XEH_preInit.sqf`: Pre-initialization setup
- `XEH_postInit.sqf`: Post-initialization tasks
- `XEH_preStart.sqf`: Pre-start configuration
- `XEH_postInit_client.sqf`: Client-specific post-initialization
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
## Usage
To use the ambient module:
1. Ensure the module is properly loaded in your mission
2. Create sound sources using the ambient sound function:
```sqf
[source, "sfx_sound_name"] spawn forge_client_ambient_fnc_ambientSound
```
3. Optionally specify a duration for temporary sounds:
```sqf
[source, "sfx_sound_name", duration] spawn forge_client_ambient_fnc_ambientSound
```
## Parameters
The ambient sound function accepts the following parameters:
1. `source`: The object or position where the sound will be played
2. `sfx`: The name of the sound effect to play
3. `time` (optional): Duration in seconds before the sound is removed
## Debugging
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
```cpp
#define DEBUG_MODE_FULL
```
## Version Information
Version information is managed through the main Forge client system configuration.
## Technical Details
- Supports both object-attached and position-based sound sources
- Automatic cleanup of sound sources when source is destroyed
- Configurable sound duration for temporary effects
- Efficient sound source management
- Client-side sound processing

View File

@ -1,19 +1,8 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
* Function: forge_client_ambient_fnc_ambientSound * Author: IDSolutions
* Author: J.Schmidt * Create a sound source and play an ambient sfx sound
* Edit: 07.15.2024
* Copyright © 2024 J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivative 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Create a sound source and play an ambient sfx sound.
* *
* Arguments: * Arguments:
* 0: The sound source <OBJECT> * 0: The sound source <OBJECT>

119
addons/arsenal/README.md Normal file
View File

@ -0,0 +1,119 @@
# Forge Arsenal Module
## Overview
The Arsenal module provides a comprehensive weapon and vehicle management system for the Forge client. It includes features for managing armory items, vehicle garages, and unlock systems, with support for both traditional and virtual arsenals.
## Dependencies
- forge_client_main
## Authors
- J. Schmidt
- Creedcoder
- IDSolutions
## Features
### Armory Management
1. **Armory Initialization** (`fnc_initArsenal.sqf`)
- Initializes the arsenal system
- Sets up necessary configurations and permissions
- Configures default armory and garage data
- Supports both traditional and virtual arsenal types
2. **Armory Interface** (`fnc_openArmory.sqf`)
- Opens the armory user interface
- Provides access to weapon and equipment management
- Supports both traditional and ACE arsenal interfaces
3. **Item Management**
- **Add Armory Items** (`fnc_addArmoryItem.sqf`)
- Handles adding new items to the armory
- Supports multiple item types:
- Facewear (goggles, masks)
- Headgear (helmets, caps)
- HMD (night vision devices)
- Items (tools, medical supplies)
- Uniforms
- Vests
- Weapons
- Magazines
- Backpacks
- **Save Unlocks** (`fnc_saveUnlocks.sqf`)
- Manages the persistence of unlocked items
- Integrates with player database system
- **Update Unlocks** (`fnc_updateUnlocks.sqf`)
- Updates the unlock status of items
- Maintains synchronization between client and server
### Vehicle Management
1. **Garage System**
- **Open Garage** (`fnc_openGarage.sqf`)
- Provides access to the vehicle garage interface
- Categorizes vehicles by type
- **Add Garage Vehicle** (`fnc_addGarageVehicle.sqf`)
- Handles adding new vehicles to the garage
- Supports vehicle categories:
- Cars
- Armored vehicles
- Helicopters
- Planes
- Naval vessels
- Static weapons
- **Add Virtual Vehicles** (`fnc_addVirtualVehicles.sqf`)
- Manages virtual vehicle entries in the garage
- Automatically categorizes vehicles by type
- Maintains vehicle model information
## Event Handlers
The module uses several event handlers for initialization and execution:
- `XEH_preInit.sqf`: Pre-initialization setup
- `XEH_postInit.sqf`: Post-initialization tasks
- `XEH_preStart.sqf`: Pre-start configuration
- `XEH_postInit_client.sqf`: Client-specific post-initialization
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
## Usage
To use the arsenal module:
1. Ensure the module is properly loaded in your mission
2. Access the armory through the provided UI for weapon management
3. Use the garage interface for vehicle management
4. Manage unlocks and permissions through the appropriate functions
## Item Types
The module supports various item categories:
- Weapons (Primary, Secondary, Handgun)
- Magazines
- Items (Tools, Medical, etc.)
- Uniforms
- Vests
- Backpacks
- Facewear
- Headgear
- HMD (Night Vision)
## Vehicle Categories
Vehicles are organized into the following categories:
1. Cars (Light vehicles, transport)
2. Armor (Tanks, APCs)
3. Helicopters (All rotary-wing aircraft)
4. Planes (Fixed-wing aircraft)
5. Naval (Boats, ships)
6. Static (Weapons, emplacements)
## Debugging
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
```cpp
#define DEBUG_MODE_FULL
```
## Version Information
Version information is managed through the main Forge client system configuration.
## Technical Details
- Supports both traditional Arma 3 arsenal and ACE arsenal systems
- Automatic vehicle categorization based on class inheritance
- Persistent unlock system with database integration
- Efficient item and vehicle management
- Client-server synchronization for unlocks
- Integration with the locker system for item storage
- Support for virtual and physical vehicle spawning

View File

@ -1,10 +1,10 @@
#include "script_component.hpp" #include "script_component.hpp"
[{ [{
GETVAR(player,value_loadDone,false) GETVAR(player,EGVAR(player,done),false)
}, { }, {
private _armory_unlocks = player getVariable ["Armory_Unlocks", [[],[],[],[]]]; private _armory_unlocks = GETVAR(player,Armory_Unlocks,GVAR(default_armory));
private _garage_unlocks = player getVariable ["Garage_Unlocks", [[],[],[],[],[],[]]]; private _garage_unlocks = GETVAR(player,Garage_Unlocks,GVAR(default_garage));
[_armory_unlocks, _garage_unlocks] call FUNC(initArsenal); [_armory_unlocks, _garage_unlocks] call FUNC(initArsenal);
}] call CFUNC(waitUntilAndExecute); }] call CFUNC(waitUntilAndExecute);

View File

@ -7,6 +7,16 @@ PREP_RECOMPILE_END;
GVAR(armory_unlocks) = []; GVAR(armory_unlocks) = [];
GVAR(garage_unlocks) = []; GVAR(garage_unlocks) = [];
GVAR(car_unlocks) = [];
GVAR(armor_unlocks) = [];
GVAR(heli_unlocks) = [];
GVAR(plane_unlocks) = [];
GVAR(naval_unlocks) = [];
GVAR(static_unlocks) = [];
GVAR(default_armory) = [[],[],[],[]];
GVAR(default_garage) = [[],[],[],[],[],[]];
GVAR(pdb_mode) = "PDB_MODE" call BFUNC(getParamValue); GVAR(pdb_mode) = "PDB_MODE" call BFUNC(getParamValue);
GVAR(armory_type) = "ARS_TYPE" call BFUNC(getParamValue); GVAR(armory_type) = "ARS_TYPE" call BFUNC(getParamValue);
GVAR(gear_box) = "ReammoBox_F" createVehicleLocal [0, 0, -999]; GVAR(gear_box) = "ReammoBox_F" createVehicleLocal [0, 0, -999];

View File

@ -3,31 +3,39 @@
/* /*
* Author: IDSolutions * Author: IDSolutions
* Adds item to player's armory unlocks and updates virtual arsenal * Adds item to player's armory unlocks and updates virtual arsenal
*
* Arguments:
* 0: Classname of item to add <STRING>
* 1: Type of item to add <STRING>
*
* Return Value:
* None
*
* Examples:
* ["B_AssaultPack_rgr", "backpack"] call forge_client_arsenal_fnc_addArmoryItem
*
* Public: Yes
*/ */
params [["_class", "", [""]], ["_type", "", [""]]]; params [["_class", "", [""]], ["_type", "", [""]]];
private _default = [[],[],[],[]]; private _armory_unlocks = GETVAR(player,Armory_Unlocks,GVAR(default_armory));
// private _armory_unlocks = player getVariable ["Armory_Unlocks", _default];
private _armory_unlocks = GETVAR(player,Armory_Unlocks,_default);
private _typeToNumber = switch (_type) do { private _typeToNumber = switch (_type) do {
case "backpack": {3}; case "facewear";
case "facewear": {0}; case "headgear";
case "headgear": {0}; case "hmd";
case "hmd": {0}; case "item";
case "item": {0}; case "uniform";
case "magazine": {2};
case "uniform": {0};
case "vest": {0}; case "vest": {0};
case "weapon": {1}; case "weapon": {1};
case "magazine": {2};
case "backpack": {3};
default {0}; default {0};
}; };
private _index = (_armory_unlocks select _typeToNumber) pushBackUnique _class; private _index = (_armory_unlocks select _typeToNumber) pushBackUnique _class;
if (_index > -1) then { if (_index > -1) then {
// player setVariable ["Armory_Unlocks", _armory_unlocks, true];
SETPVAR(player,Armory_Unlocks,_armory_unlocks); SETPVAR(player,Armory_Unlocks,_armory_unlocks);
if (GVAR(armory_type) == 0) then { if (GVAR(armory_type) == 0) then {
@ -36,7 +44,6 @@ if (_index > -1) then {
[GVAR(gear_box), [_class]] call AFUNC(arsenal,addVirtualItems); [GVAR(gear_box), [_class]] call AFUNC(arsenal,addVirtualItems);
}; };
TRACE_2("Item added to armory",_class,_type);
true true
} else { } else {
false false

View File

@ -3,15 +3,23 @@
/* /*
* Author: IDSolutions * Author: IDSolutions
* Adds vehicle to player's garage unlocks and updates virtual garage * Adds vehicle to player's garage unlocks and updates virtual garage
*
* Arguments:
* 0: Classname of vehicle to add <STRING>
* 1: Type of vehicle to add <STRING>
*
* Return Value:
* None
*
* Examples:
* ["B_T_LSV_01_unarmed_F", "car"] call forge_client_arsenal_fnc_addGarageVehicle
*
* Public: Yes
*/ */
params [["_class", "", [""]], ["_type", "", [""]]]; params [["_class", "", [""]], ["_type", "", [""]]];
private _default = [[],[],[],[],[],[]]; private _garage_unlocks = GETVAR(player,Garage_Unlocks,GVAR(default_garage));
// private _garage_unlocks = player getVariable ["Garage_Unlocks", _default];
private _garage_unlocks = GETVAR(player,Garage_Unlocks,_default);
private _typeToNumber = switch (_type) do { private _typeToNumber = switch (_type) do {
case "car": {0}; case "car": {0};
case "armor": {1}; case "armor": {1};
@ -25,11 +33,9 @@ private _typeToNumber = switch (_type) do {
private _index = (_garage_unlocks select _typeToNumber) pushBackUnique _class; private _index = (_garage_unlocks select _typeToNumber) pushBackUnique _class;
if (_index > -1) then { if (_index > -1) then {
// player setVariable ["Garage_Unlocks", _garage_unlocks, true];
SETPVAR(player,Garage_Unlocks,_garage_unlocks); SETPVAR(player,Garage_Unlocks,_garage_unlocks);
[[_class]] call FUNC(addVirtualVehicles); [[_class]] call FUNC(addVirtualVehicles);
TRACE_2("Vehicle added to garage",_class,_type);
true true
} else { } else {
false false

View File

@ -6,20 +6,20 @@
* *
* Arguments: * Arguments:
* 0: Vehicles <ARRAY> - Array of vehicle classnames * 0: Vehicles <ARRAY> - Array of vehicle classnames
*
* Return Value:
* None
*
* Examples:
* ["B_T_LSV_01_unarmed_F", "car"] call forge_client_arsenal_fnc_addVirtualVehicles
*
* Public: Yes
*/ */
params [["_vehicles", [], [[]]]]; params [["_vehicles", [], [[]]]];
private _default = [[],[],[],[],[],[]]; private _garage_unlocks = GETVAR(player,Garage_Unlocks,GVAR(default_garage));
// private _garage_unlocks = player getVariable ["Garage_Unlocks", _default]; _garage_unlocks params ["_cars", "_armor", "_helis", "_planes", "_naval", "_static"];
private _garage_unlocks = GETVAR(player,Garage_Unlocks,_default);
private _cars = _garage_unlocks select 0;
private _armor = _garage_unlocks select 1;
private _helis = _garage_unlocks select 2;
private _planes = _garage_unlocks select 3;
private _naval = _garage_unlocks select 4;
private _static = _garage_unlocks select 5;
{ {
switch true do { switch true do {
@ -27,31 +27,14 @@ private _static = _garage_unlocks select 5;
if ((_x isKindOf "Tank") || (_x isKindOf "Wheeled_APC_F")) exitWith {}; if ((_x isKindOf "Tank") || (_x isKindOf "Wheeled_APC_F")) exitWith {};
_cars pushBackUnique _x; _cars pushBackUnique _x;
}; };
case (_x isKindOf "Tank"): { case (_x isKindOf "Tank"): { _armor pushBackUnique _x; };
_armor pushBackUnique _x; case (_x isKindOf "Helicopter"): { _helis pushBackUnique _x; };
}; case (_x isKindOf "Plane"): { _planes pushBackUnique _x; };
case (_x isKindOf "Helicopter"): { case (_x isKindOf "Ship"): { _naval pushBackUnique _x; };
_helis pushBackUnique _x; case (_x isKindOf "Static"): { _static pushBackUnique _x; };
};
case (_x isKindOf "Plane"): {
_planes pushBackUnique _x;
};
case (_x isKindOf "Ship"): {
_naval pushBackUnique _x;
};
case (_x isKindOf "Static"): {
_static pushBackUnique _x;
};
}; };
} forEach _vehicles; } forEach _vehicles;
GVAR(car_unlocks) = [];
GVAR(armor_unlocks) = [];
GVAR(heli_unlocks) = [];
GVAR(plane_unlocks) = [];
GVAR(naval_unlocks) = [];
GVAR(static_unlocks) = [];
{ {
GVAR(car_unlocks) append [getText(configFile >> "CfgVehicles" >> _x >> "model"),[configFile >> "CfgVehicles" >> _x]]; GVAR(car_unlocks) append [getText(configFile >> "CfgVehicles" >> _x >> "model"),[configFile >> "CfgVehicles" >> _x]];
} forEach _cars; } forEach _cars;
@ -75,5 +58,3 @@ GVAR(static_unlocks) = [];
{ {
GVAR(static_unlocks) append [getText(configFile >> "CfgVehicles" >> _x >> "model"),[configFile >> "CfgVehicles" >> _x]]; GVAR(static_unlocks) append [getText(configFile >> "CfgVehicles" >> _x >> "model"),[configFile >> "CfgVehicles" >> _x]];
} forEach _static; } forEach _static;
TRACE_1("Virtual vehicles updated",count _vehicles);

View File

@ -1,9 +1,24 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/*
* Author: IDSolutions
* Initializes the arsenal system with armory and garage data
*
* Arguments:
* 0: Armory data <ARRAY> - [items, weapons, magazines, backpacks]
* 1: Garage data <ARRAY> - [cars, armor, helicopters, planes, naval, static]
*
* Return Value:
* BOOLEAN - true if initialization successful, false if invalid data
*
* Example:
* [[_items, _weapons, _magazines, _backpacks], [_cars, _armor, _helis, _planes, _naval, _statics]] call forge_client_arsenal_fnc_initArsenal
*/
params [["_armory_data", [], [[]]], ["_garage_data", [], [[]]]]; params [["_armory_data", [], [[]]], ["_garage_data", [], [[]]]];
if (count _armory_data isEqualTo [""]) then { _armory_data = [[],[],[],[]] }; if (!(_armory_data isEqualTypeArray GVAR(default_armory)) || (count _armory_data != 4)) then { _armory_data = GVAR(default_armory); };
if (count _garage_data isEqualTo [""]) then { _garage_data = [[],[],[],[],[],[]] }; if (!(_garage_data isEqualTypeArray GVAR(default_garage)) || (count _garage_data != 6)) then { _garage_data = GVAR(default_garage); };
if (GVAR(armory_type) == 0) then { if (GVAR(armory_type) == 0) then {
{ {
[GVAR(gear_box), _x, false, true, 1, _forEachIndex] call BFUNC(addVirtualItemCargo); [GVAR(gear_box), _x, false, true, 1, _forEachIndex] call BFUNC(addVirtualItemCargo);
@ -14,23 +29,24 @@ if (GVAR(armory_type) == 0) then {
} forEach _armory_data; } forEach _armory_data;
}; };
_armory_data params [["_items", [], [[]]], ["_weapons", [], [[]]], ["_magazines", [], [[]]], ["_backpacks", [], [[]]]];
_garage_data params [["_cars", [], [[]]], ["_armor", [], [[]]], ["_helis", [], [[]]], ["_planes", [], [[]]], ["_naval", [], [[]]], ["_statics", [], [[]]]];
GVAR(armory_unlocks) = _armory_data; GVAR(armory_unlocks) = _armory_data;
GVAR(garage_unlocks) = _garage_data; GVAR(garage_unlocks) = _garage_data;
GVAR(item_unlocks) = _armory_data select 0; GVAR(item_unlocks) = _items;
GVAR(weapon_unlocks) = _armory_data select 1; GVAR(weapon_unlocks) = _weapons;
GVAR(magazine_unlocks) = _armory_data select 2; GVAR(magazine_unlocks) = _magazines;
GVAR(backpack_unlocks) = _armory_data select 3; GVAR(backpack_unlocks) = _backpacks;
GVAR(car_unlocks) = _garage_data select 0; GVAR(car_unlocks) = _cars;
GVAR(armor_unlocks) = _garage_data select 1; GVAR(armor_unlocks) = _armor;
GVAR(heli_unlocks) = _garage_data select 2; GVAR(heli_unlocks) = _helis;
GVAR(plane_unlocks) = _garage_data select 3; GVAR(plane_unlocks) = _planes;
GVAR(naval_unlocks) = _garage_data select 4; GVAR(naval_unlocks) = _naval;
GVAR(static_unlocks) = _garage_data select 5; GVAR(static_unlocks) = _statics;
{ {
[_x] call FUNC(addVirtualVehicles); [_x] call FUNC(addVirtualVehicles);
} forEach GVAR(garage_unlocks); } forEach GVAR(garage_unlocks);
TRACE_2("Arsenal System Initialized with defaults",count GVAR(armory_unlocks),count GVAR(garage_unlocks));

View File

@ -1,5 +1,21 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/*
* Author: IDSolutions
* Opens the virtual arsenal
*
* Arguments:
* None
*
* Return Value:
* None
*
* Examples:
* None
*
* Public: Yes
*/
if (GVAR(armory_type) == 0) then { if (GVAR(armory_type) == 0) then {
["Open", [false, GVAR(gear_box), player]] call BFUNC(arsenal); ["Open", [false, GVAR(gear_box), player]] call BFUNC(arsenal);
} else { } else {

View File

@ -1,5 +1,21 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/*
* Author: IDSolutions
* Opens the virtual garage
*
* Arguments:
* None
*
* Return Value:
* None
*
* Examples:
* None
*
* Public: Yes
*/
_locations = (missionConfigFile >> "CfgGarages" >> "locations") call BFUNC(getCfgData); _locations = (missionConfigFile >> "CfgGarages" >> "locations") call BFUNC(getCfgData);
{ {
GVAR(vehSpawnPos) = (_x select 1) getPos [5, (_x select 2)]; GVAR(vehSpawnPos) = (_x select 1) getPos [5, (_x select 2)];

View File

@ -10,28 +10,26 @@
* Return Value: * Return Value:
* None * None
* *
* Example: * Examples:
* ["armory"] call forge_client_arsenal_fnc_saveArsenalUnlocks * ["armory"] call forge_client_arsenal_fnc_saveUnlocks
*
* Public: Yes
*/ */
params [["_type", "", [""]]]; params [["_type", "", [""]]];
switch (_type) do { switch (_type) do {
case "armory": { case "armory": {
private _default_armory_data = [[],[],[],[]]; private _armory_data = GETVAR(player,Armory_Unlocks,GVAR(default_armory));
// private _armory_data = player getVariable ["Armory_Unlocks", [[],[],[],[]]];
private _armory_data = GETVAR(player,Armory_Unlocks,_default_armory_data);
switch (GVAR(pdb_mode)) do { switch (GVAR(pdb_mode)) do {
case 0: { case 0: {
// profileNamespace setVariable ["Armory_Unlocks", _armory_data];
SETVAR(profileNamespace,Armory_Unlocks,_armory_data); SETVAR(profileNamespace,Armory_Unlocks,_armory_data);
}; };
case 1: { case 1: {
["hsetid", getPlayerUID player, "armory_unlocks", -1, _armory_data, "", false] remoteExec ["dragonfly_db_fnc_addTask", 2, false]; ["hsetid", getPlayerUID player, "armory_unlocks", -1, _armory_data, "", false] remoteExec ["dragonfly_db_fnc_addTask", 2, false];
}; };
default { default {
// profileNamespace setVariable ["Armory_Unlocks", _armory_data];
SETVAR(profileNamespace,Armory_Unlocks,_armory_data); SETVAR(profileNamespace,Armory_Unlocks,_armory_data);
}; };
}; };
@ -40,20 +38,16 @@ switch (_type) do {
}; };
case "garage": { case "garage": {
private _default_garage_data = [[],[],[],[],[],[]]; private _garage_data = GETVAR(player,Garage_Unlocks,GVAR(default_garage));
// private _garage_data = player getVariable ["Garage_Unlocks", [[],[],[],[],[],[]]];
private _garage_data = GETVAR(player,Garage_Unlocks,_default_garage_data);
switch (GVAR(pdb_mode)) do { switch (GVAR(pdb_mode)) do {
case 0: { case 0: {
// profileNamespace setVariable ["Garage_Unlocks", _garage_data];
SETVAR(profileNamespace,Garage_Unlocks,_garage_data); SETVAR(profileNamespace,Garage_Unlocks,_garage_data);
}; };
case 1: { case 1: {
["hsetid", getPlayerUID player, "garage_unlocks", -1, _garage_data, "", false] remoteExec ["dragonfly_db_fnc_addTask", 2, false]; ["hsetid", getPlayerUID player, "garage_unlocks", -1, _garage_data, "", false] remoteExec ["dragonfly_db_fnc_addTask", 2, false];
}; };
default { default {
// profileNamespace setVariable ["Garage_Unlocks", _garage_data];
SETVAR(profileNamespace,Garage_Unlocks,_garage_data); SETVAR(profileNamespace,Garage_Unlocks,_garage_data);
}; };
}; };
@ -61,5 +55,3 @@ switch (_type) do {
[_type, _garage_data] call FUNC(updateUnlocks); [_type, _garage_data] call FUNC(updateUnlocks);
}; };
}; };
TRACE_2("Arsenal Unlocks saved",_type,GVAR(pdb_mode));

View File

@ -8,34 +8,37 @@
* 0: Type <STRING> ("armory" or "garage") * 0: Type <STRING> ("armory" or "garage")
* 1: Data <ARRAY> (Array of unlocks) * 1: Data <ARRAY> (Array of unlocks)
* *
* Example: * Return Value:
* None
*
* Examples:
* ["armory", _armory_unlocks] call forge_client_arsenal_fnc_updateUnlocks * ["armory", _armory_unlocks] call forge_client_arsenal_fnc_updateUnlocks
*
* Public: Yes
*/ */
params [["_type", "", [""]], ["_data", [], [[]]]]; params [["_type", "", [""]], ["_data", [], [[]]]];
switch (_type) do { switch (_type) do {
case "armory": { case "armory": {
_data params ["_items", "_weapons", "_magazines", "_backpacks"];
GVAR(armory_unlocks) = _data; GVAR(armory_unlocks) = _data;
GVAR(item_unlocks) = _items;
GVAR(item_unlocks) = _data select 0; GVAR(weapon_unlocks) = _weapons;
GVAR(weapon_unlocks) = _data select 1; GVAR(magazine_unlocks) = _magazines;
GVAR(magazine_unlocks) = _data select 2; GVAR(backpack_unlocks) = _backpacks;
GVAR(backpack_unlocks) = _data select 3;
TRACE_1("Armory unlocks updated",count GVAR(armory_unlocks));
}; };
case "garage": { case "garage": {
_data params ["_cars", "_armor", "_helis", "_planes", "_naval", "_static"];
GVAR(garage_unlocks) = _data; GVAR(garage_unlocks) = _data;
GVAR(car_unlocks) = _cars;
GVAR(car_unlocks) = _data select 0; GVAR(armor_unlocks) = _armor;
GVAR(armor_unlocks) = _data select 1; GVAR(heli_unlocks) = _helis;
GVAR(heli_unlocks) = _data select 2; GVAR(plane_unlocks) = _planes;
GVAR(plane_unlocks) = _data select 3; GVAR(naval_unlocks) = _naval;
GVAR(naval_unlocks) = _data select 4; GVAR(static_unlocks) = _static;
GVAR(static_unlocks) = _data select 5;
TRACE_1("Garage unlocks updated",count GVAR(garage_unlocks));
}; };
}; };

123
addons/bank/README.md Normal file
View File

@ -0,0 +1,123 @@
# Forge Bank Module
## Overview
The Bank module provides a comprehensive banking system for the Forge client. It includes features for managing player finances, transfers, and timesheet functionality, with a modern web-based interface for seamless user experience.
## Dependencies
- forge_client_main
## Authors
- J. Schmidt
- Creedcoder
- IDSolutions
## Features
### Banking System
1. **Bank Initialization** (`fnc_initBank.sqf`)
- Initializes the banking system
- Sets up necessary configurations and account structures
- Configures player account data and balances
- Handles server-side synchronization
2. **Bank Interface** (`fnc_openBank.sqf`)
- Opens the banking user interface
- Provides access to all banking functions
- Modern web-based UI with real-time updates
- Responsive design for optimal user experience
3. **Transaction Management**
- **Deposit** (`fnc_deposit.sqf`)
- Handles money deposits into bank accounts
- Validates transaction amounts
- Updates account balances in real-time
- **Withdraw** (`fnc_withdraw.sqf`)
- Manages money withdrawals from bank accounts
- Ensures sufficient funds
- Updates wallet balance immediately
- **Transfer** (`fnc_transfer.sqf`)
- Handles money transfers between players
- Validates recipient and amount
- Supports both account-to-account and wallet transfers
- **Submit** (`fnc_submit.sqf`)
- Processes transaction submissions
- Handles timesheet submissions
- Manages pending payments
- **Refresh** (`fnc_refresh.sqf`)
- Updates account information and balances
- Synchronizes with server data
- Updates UI elements
### User Interface
The module includes a modern web-based interface with:
1. **Account Overview**
- Current wallet balance
- Bank account balance
- Pending payments
- Transaction history
2. **Transaction Features**
- Transfer between wallet and account
- Player-to-player transfers
- Timesheet submission
- Transaction history view
3. **UI Components**
- Real-time balance updates
- Transaction notifications
- Input validation
- Error handling
- Responsive design
### Timesheet System
1. **Rating Integration**
- Tracks player rating
- Calculates pending payments
- Automatic payment processing
- Rating reset after submission
2. **Payment Processing**
- Automatic calculation based on rating
- Configurable payment multiplier
- Pending payment tracking
- Instant payment processing
## Event Handlers
The module uses several event handlers for initialization and execution:
- `XEH_preInit.sqf`: Pre-initialization setup
- `XEH_postInit.sqf`: Post-initialization tasks
- `XEH_preStart.sqf`: Pre-start configuration
- `XEH_postInit_client.sqf`: Client-specific post-initialization
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
## Usage
To use the bank module:
1. Ensure the module is properly loaded in your mission
2. Access the bank through the provided UI
3. Perform transactions using the appropriate functions:
- Transfer money between wallet and account
- Send money to other players
- Submit timesheets for payment
- View transaction history
4. Monitor account status and transactions in real-time
## Debugging
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
```cpp
#define DEBUG_MODE_FULL
```
## Version Information
Version information is managed through the main Forge client system configuration.
## Technical Details
- Web-based interface using HTML5, CSS3, and JavaScript
- Real-time data synchronization with server
- Secure transaction processing
- Client-server event system
- Persistent data storage
- Rating-based payment system
- Transaction history tracking
- Input validation and error handling
- Responsive UI design
- Cross-browser compatibility

View File

@ -1,5 +1,4 @@
PREP(deposit); PREP(deposit);
PREP(initBank);
PREP(openBank); PREP(openBank);
PREP(refresh); PREP(refresh);
PREP(submit); PREP(submit);

View File

@ -1 +1,12 @@
#include "script_component.hpp" #include "script_component.hpp"
[{
GETVAR(player,value_loadDone,false)
}, {
private _bank = GETVAR(player,FORGE_Bank,0);
private _cash = GETVAR(player,FORGE_Cash,0);
private _rating = GETVAR(player,FORGE_Rating,0);
private _uid = getPlayerUID player;
["forge_server_bank_handleEvents", ["BANK::HANDLE::PLAYER::LOAD", [_uid, _bank, _cash, _rating]]] call CFUNC(serverEvent);
}] call CFUNC(waitUntilAndExecute);

View File

@ -1 +1,97 @@
#include "script_component.hpp" #include "script_component.hpp"
[QGVAR(handleEvents), {
params ["_control", "_isConfirmDialog", "_message"];
diag_log text format ["[FORGE::Client::Bank::XEH_postInit::handleEvents] Received event: '%1'", _message];
_message = fromJSON _message;
private _event = _message get "event";
private _data = _message get "data";
switch (_event) do {
case "REQUEST::PLAYER::DATA": {
private _playerData = createHashMap;
private _playerList = [];
{
private _uid = getPlayerUID _x;
private _name = name _x;
private _funds = GETVAR(_x,FORGE_Bank,0); //TODO: Implement funds from server
private _cash = GETVAR(_x,FORGE_Cash,0); //TODO: Implement cash from server
private _playerInfo = createHashMapFromArray [
["uid", _uid],
["name", _name],
["funds", _funds],
["cash", _cash]
];
_playerList pushBack _playerInfo;
} forEach allPlayers;
_playerData set ["players", _playerList];
_control ctrlWebBrowserAction ["ExecJS", format ["handlePlayerDataRequest(%1)", (toJSON _playerList)]];
};
case "REQUEST::PLAYER::FUNDS": {
private _playerData = createHashMap;
private _balance = GETVAR(player,FORGE_Bank,0); //TODO: Implement balance from server
private _cash = GETVAR(player,FORGE_Cash,0); //TODO: Implement cash from server
private _payMultiplier = "MULTIPLYR" call BFUNC(getParamValue);
private _rating = rating player; //TODO: Implement rating from server
private _pending = _rating * _payMultiplier; //TODO: Implement pending from server
private _playerData = createHashMapFromArray [
["balance", _balance],
["cash", _cash],
["pending", _pending]
];
_control ctrlWebBrowserAction ["ExecJS", format ["handlePlayerFundsRequest(%1)", (toJSON _playerData)]];
};
case "REQUEST::TRANSACTION::HISTORY": {
private _history = []; //TODO: Implement history from server
private _historyData = createHashMapFromArray [["history", _history]];
_control ctrlWebBrowserAction ["ExecJS", format ["handleTransactionHistoryRequest(%1)", (toJSON _historyData)]];
};
case "DEPOSIT::FUNDS": {
_data params [["_amount", 0, [0]]];
if (_amount <= 0) exitWith { systemChat "Invalid amount, must be greater than 0!"; false };
["forge_server_bank_handleEvents", ["BANK::DEPOSIT", [getPlayerUID player, _amount]]] call CFUNC(serverEvent);
true
};
case "SUBMIT::TIMESHEET": {
private _rating = rating player;
private _uid = getPlayerUID player;
["forge_server_bank_handleEvents", ["BANK::SUBMIT::TIMESHEET", [_uid, _rating]]] call CFUNC(serverEvent);
player addRating -_rating;
true
};
case "TRANSFER::FUNDS": {
_data params [["_uid", "", [""]], ["_amount", 0, [0]]];
if ({_uid isEqualTo ""} || _amount <= 0) exitWith { systemChat "Invalid UID or amount, UID cannot be empty and amount must be greater than 0!"; false };
["forge_server_bank_handleEvents", ["BANK::TRANSFER", [getPlayerUID player, _uid, _amount]]] call CFUNC(serverEvent);
true
};
case "WITHDRAW::FUNDS": {
_data params [["_amount", 0, [0]]];
if (_amount <= 0) exitWith { systemChat "Invalid amount, amount must be greater than 0!"; false };
["forge_server_bank_handleEvents", ["BANK::WITHDRAW", [getPlayerUID player, _amount]]] call CFUNC(serverEvent);
true
};
default {
diag_log format ["[FORGE::Client::Bank::XEH_postInit::handleEvents] Unhandled event: %1", _event];
};
};
}] call CFUNC(addEventHandler);

View File

@ -16,3 +16,4 @@ class CfgPatches {
#include "CfgEventHandlers.hpp" #include "CfgEventHandlers.hpp"
#include "ui\BaseControls.hpp" #include "ui\BaseControls.hpp"
#include "ui\RscBankDialog.hpp" #include "ui\RscBankDialog.hpp"
#include "ui\RscWebBank.hpp"

View File

@ -1,23 +1,34 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/*
* Author: IDSolutions
* Deposits money into the bank.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call forge_client_bank_fnc_deposit;
*
* Public: Yes
*/
private _amount = parseNumber (ctrlText IDC_AMOUNTINPUT); private _amount = parseNumber (ctrlText IDC_AMOUNTINPUT);
// private _bank = player getVariable ["FORGE_Bank", 0];
// private _cash = player getVariable ["FORGE_Cash", 0];
private _bank = GETVAR(player,FORGE_Bank,0);
private _cash = GETVAR(player,FORGE_Cash,0);
if (_amount > 0 && _amount <= _cash) then { private _messageData = createHashMapFromArray [
_cash = _cash - _amount; ["event", "DEPOSIT::FUNDS"],
_bank = _bank + _amount; ["data", createHashMapFromArray [
["amount", _amount]
]]
];
// player setVariable ["FORGE_Bank", _bank, true]; private _response = ["forge_client_bank_handleEvents", (toJSON _messageData)] call CFUNC(localEvent);
// player setVariable ["FORGE_Cash", _cash, true];
SETPVAR(player,FORGE_Bank,_bank);
SETPVAR(player,FORGE_Cash,_cash);
// [] call forge_client_bank_fnc_refresh; if (_response) then {
[] call FUNC(refresh); [format ["Deposited $%1", _amount], "info", 3, "right"] call EFUNC(misc,notify);
hint "Money deposited successfully";
} else { } else {
hint "Invalid amount"; [format ["Deposit failed"], "warning", 3, "right"] call EFUNC(misc,notify);
}; };

View File

@ -1,30 +0,0 @@
#include "..\script_component.hpp"
{
private _configName = configName(_x);
private _className = (missionConfigFile >> "CfgBanks" >> "banks" >> _configName >> "className") call BFUNC(getCfgData);
private _pos = (missionConfigFile >> "CfgBanks" >> "banks" >> _configName >> "pos") call BFUNC(getCfgData);
private _dir = (missionConfigFile >> "CfgBanks" >> "banks" >> _configName >> "dir") call BFUNC(getCfgData);
private _type = (missionConfigFile >> "CfgBanks" >> "banks" >> _configName >> "type") call BFUNC(getCfgData);
if (_type == "object") then {
private _bank = createSimpleObject [_className, [0, 0, 0]];
_bank setPosATL _pos;
_bank setDir _dir;
_bank allowDamage false;
_bank setVariable ["isBank", true, true];
} else {
private _group = createGroup civilian;
private _bank = _group createUnit [_className, [0, 0, 0], [], 0, "NONE"];
_bank disableAI "MOVE";
_bank setPosATL _pos;
_bank setDir _dir;
_bank allowDamage false;
_bank setVariable ["isBank", true, true];
_bank setVariable ["BIS_enableRandomization", false];
};
diag_log text format ["[FORGE Bank] ClassName: '%1' Pos: '%2' Dir: '%3'", _className, _pos, _dir];
} forEach ("true" configClasses (missionConfigFile >> "CfgBanks" >> "banks"));

View File

@ -1,16 +1,46 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
// private _bank = player getVariable ["FORGE_Bank", 0]; /*
// private _cash = player getVariable ["FORGE_Cash", 0]; * Author: IDSolutions
private _bank = GETVAR(player,FORGE_Bank,0); * Opens the bank dialog.
private _cash = GETVAR(player,FORGE_Cash,0); *
private _payMultiplier = "MULTIPLYR" call BFUNC(getParamValue); * Arguments:
private _plyscore = rating player; * None
private _pending = _plyscore * _payMultiplier; *
* Return Value:
* None
*
* Example:
* [] call forge_client_bank_fnc_openBank;
*
* Public: Yes
*/
private _productVersion = productVersion;
private _steamBranchName = _productVersion select 8;
private _payMultiplier = "MULTIPLYR" call BFUNC(getParamValue);
if (_steamBranchName == "profiling") then {
private _display = (findDisplay 46) createDisplay "RscWebBank";
private _ctrl = _display displayCtrl 2025;
_ctrl ctrlAddEventHandler ["JSDialog", {
params ["_control", "_isConfirmDialog", "_message"];
[QGVAR(handleEvents), [_control, _isConfirmDialog, _message]] call CFUNC(localEvent);
}];
_ctrl ctrlWebBrowserAction ["LoadFile", QUOTE(PATHTOF(ui\_site\index.html))];
// _ctrl ctrlWebBrowserAction ["OpenDevConsole"];
} else {
disableSerialization; disableSerialization;
createDialog "RscBankDialog"; createDialog "RscBankDialog";
private _uid = getPlayerUID player;
private _bank = GETVAR(player,FORGE_Bank,0); //TODO: Implement balance from server
private _cash = GETVAR(player,FORGE_Cash,0); //TODO: Implement cash from server
private _plyscore = rating player;
private _pending = _plyscore * _payMultiplier;
private _formattedBank = _bank call EFUNC(misc,formatNumber); private _formattedBank = _bank call EFUNC(misc,formatNumber);
private _formattedCash = _cash call EFUNC(misc,formatNumber); private _formattedCash = _cash call EFUNC(misc,formatNumber);
private _formattedPending = _pending call EFUNC(misc,formatNumber); private _formattedPending = _pending call EFUNC(misc,formatNumber);
@ -27,3 +57,4 @@ ctrlSetText [IDC_TIMESHEETTEXT, "Ready for Timesheet"];
lbSetCurSel [IDC_PLAYERINPUT, 0]; lbSetCurSel [IDC_PLAYERINPUT, 0];
ctrlSetText [IDC_AMOUNTINPUT, ""]; ctrlSetText [IDC_AMOUNTINPUT, ""];
};

View File

@ -1,9 +1,24 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
// private _bank = player getVariable ["FORGE_Bank", 0]; /*
// private _cash = player getVariable ["FORGE_Cash", 0]; * Author: IDSolutions
private _bank = GETVAR(player,FORGE_Bank,0); * Refreshes the bank dialog.
private _cash = GETVAR(player,FORGE_Cash,0); *
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call forge_client_bank_fnc_refresh;
*
* Public: Yes
*/
private _bank = GETVAR(player,FORGE_Bank,0); //TODO: Implement balance from server
private _cash = GETVAR(player,FORGE_Cash,0); //TODO: Implement cash from server
private _payMultiplier = "MULTIPLYR" call BFUNC(getParamValue); private _payMultiplier = "MULTIPLYR" call BFUNC(getParamValue);
private _plyscore = rating player; private _plyscore = rating player;
private _pending = _plyscore * _payMultiplier; private _pending = _plyscore * _payMultiplier;

View File

@ -1,23 +1,39 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
// private _bank = player getVariable ["FORGE_Bank", 0]; /*
private _bank = GETVAR(player,FORGE_Bank,0); * Author: IDSolutions
* Submits the timesheet
*
* Arguments:
* None
*
* Return Value:
* None
*
* Examples:
* None
*
* Public: Yes
*/
private _payMultiplyer = "MULTIPLYR" call BFUNC(getParamValue); private _payMultiplyer = "MULTIPLYR" call BFUNC(getParamValue);
private _plyscore = rating player; private _plyscore = rating player; //TODO: Implement rating from server
private _multiplyer = _plyscore * _payMultiplyer; private _multiplyer = _plyscore * _payMultiplyer;
_bank = _bank + _multiplyer; _bank = _bank + _multiplyer;
player addRating - _plyscore;
// player setVariable ["FORGE_Bank", _bank];
// player setVariable ["FORGE_Rating", 0];
SETPVAR(player,FORGE_Bank,_bank);
SETPVAR(player,FORGE_Rating,0);
// [] call forge_client_bank_fnc_refresh;
[] call FUNC(refresh);
private _formattedRating = _bank call EFUNC(misc,formatNumber); private _formattedRating = _bank call EFUNC(misc,formatNumber);
private _messageData = createHashMapFromArray [
["event", "SUBMIT::TIMESHEET"],
["data", []]
];
// hint format ["Timesheet submitted! Received $%1 bonus based on rating of %2", _formattedRating, _plyscore]; private _response = ["forge_client_bank_handleEvents", (toJSON _messageData)] call CFUNC(localEvent);
[format ["Timesheet submitted! Received $%1 based on rating of %2", _formattedRating, _plyscore], "info", 3, "right"] call EFUNC(misc,notify);
if (_response) then {
[format ["Submitted timesheet! Received $%1 based on rating of %2", _formattedRating, _plyscore], "info", 3, "right"] call EFUNC(misc,notify);
} else {
[format ["Timesheet submission failed"], "warning", 3, "right"] call EFUNC(misc,notify);
};
[] call FUNC(refresh);

View File

@ -1,32 +1,43 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/*
* Author: IDSolutions
* Transfers money to a player
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call forge_client_bank_fnc_transfer;
*
* Public: Yes
*/
private _display = findDisplay IDD_BANKDIALOG; private _display = findDisplay IDD_BANKDIALOG;
private _input = _display displayCtrl IDC_AMOUNTINPUT; private _input = _display displayCtrl IDC_AMOUNTINPUT;
private _dropdown = _display displayCtrl IDC_PLAYERINPUT; private _dropdown = _display displayCtrl IDC_PLAYERINPUT;
private _amount = parseNumber (ctrlText _input); private _amount = parseNumber (ctrlText _input);
private _selectedTarget = lbCurSel _dropdown; private _selectedTarget = lbCurSel _dropdown;
private _selectedTargetData = _dropdown lbData _selectedTarget; private _selectedTargetData = _dropdown lbData _selectedTarget;
private _target = objectFromNetId _selectedTargetData; private _target = objectFromNetId _selectedTargetData;
private _uid = getPlayerUID _target;
// private _bank = player getVariable ["FORGE_Bank", 0]; private _messageData = createHashMapFromArray [
// private _targetBank = _target getVariable ["FORGE_Bank", 0]; ["event", "TRANSFER::FUNDS"],
private _bank = GETVAR(player,FORGE_Bank,0); ["data", createHashMapFromArray [
private _targetBank = GETVAR(_target,FORGE_Bank,0); ["uid", _uid],
["amount", _amount]
]]
];
if (!isNull _target && _amount > 0 && _amount <= _bank) then { private _response = [QGVAR(handleEvents), (toJSON _messageData)] call CFUNC(localEvent);
_targetBank = _targetBank + _amount;
// _target setVariable ["FORGE_Bank", _targetBank, true];
SETPVAR(_target,FORGE_Bank,_targetBank);
_bank = _bank - _amount; if (_response) then {
// player setVariable ["FORGE_Bank", _bank, true];
SETPVAR(player,FORGE_Bank,_bank);
// [] call forge_client_bank_fnc_refresh;
[] call FUNC(refresh);
// hint format ["Transferred $%1", _amount];
[format ["Transferred $%1", _amount], "info", 3, "right"] call EFUNC(misc,notify); [format ["Transferred $%1", _amount], "info", 3, "right"] call EFUNC(misc,notify);
} else { } else {
// hint "Invalid transfer details"; [format ["Transfer failed"], "warning", 3, "right"] call EFUNC(misc,notify);
[format ["Invalid transfer details"], "warning", 3, "right"] call EFUNC(misc,notify);
}; };

View File

@ -1,28 +1,36 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/*
* Author: IDSolutions
* Withdraws money from the bank
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call forge_client_bank_fnc_withdraw;
*
* Public: Yes
*/
private _display = findDisplay IDD_BANKDIALOG; private _display = findDisplay IDD_BANKDIALOG;
private _input = _display displayCtrl IDC_AMOUNTINPUT; private _input = _display displayCtrl IDC_AMOUNTINPUT;
private _amount = parseNumber (ctrlText _input); private _amount = parseNumber (ctrlText _input);
// private _bank = player getVariable ["FORGE_Bank", 0]; private _messageData = createHashMapFromArray [
// private _cash = player getVariable ["FORGE_Cash", 0]; ["event", "WITHDRAW::FUNDS"],
private _bank = GETVAR(player,FORGE_Bank,0); ["data", createHashMapFromArray [
private _cash = GETVAR(player,FORGE_Cash,0); ["amount", _amount]
]]
];
if (_amount > 0 && _amount <= _bank) then { private _response = ["forge_client_bank_handleEvents", (toJSON _messageData)] call CFUNC(localEvent);
_bank = _bank - _amount;
_cash = _cash + _amount;
// player setVariable ["FORGE_Bank", _bank, true]; if (_response) then {
// player setVariable ["FORGE_Cash", _cash, true]; [format ["Withdrawn $%1", _amount], "info", 3, "right"] call EFUNC(misc,notify);
SETPVAR(player,FORGE_Bank,_bank);
SETPVAR(player,FORGE_Cash,_cash);
// [] call forge_client_bank_fnc_refresh;
[] call FUNC(refresh);
// hint "Money withdrawn successfully";
[format ["Money withdrawn successfully"], "info", 3, "right"] call EFUNC(misc,notify);
} else { } else {
// hint "Invalid amount"; [format ["Withdrawal failed"], "warning", 3, "right"] call EFUNC(misc,notify);
[format ["Invalid amount"], "warning", 3, "right"] call EFUNC(misc,notify);
}; };

View File

@ -4,9 +4,6 @@
<Key ID="STR_forge_client_bank_Amount"> <Key ID="STR_forge_client_bank_Amount">
<English>Amount</English> <English>Amount</English>
</Key> </Key>
<Key ID="STR_forge_client_bank_Close">
<English>Close</English>
</Key>
<Key ID="STR_forge_client_bank_Deposit"> <Key ID="STR_forge_client_bank_Deposit">
<English>Deposit</English> <English>Deposit</English>
</Key> </Key>

View File

@ -0,0 +1,17 @@
class RscWebBank {
idd = 20250502;
fadein = 0;
fadeout = 0;
duration = 1e+011;
class controls {
class Background: RscText {
type = 106;
idc = 2025;
x = "safeZoneY * (pixelW/pixelH) * 2.975";
y = "safeZoneY + (safeZoneH * 0.05)";
w = "safeZoneW * (pixelW/pixelH) * 1.17";
h = "safeZoneH * 0.875";
};
};
};

View File

@ -0,0 +1,111 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!--
Dynamic Resource Loading
The following script loads CSS and JavaScript files dynamically using the A3API
This approach is used instead of static HTML imports to work with Arma 3's file system
-->
<script>
Promise.all([
// Load CSS file
A3API.RequestFile("z\\forge_client\\addons\\bank\\ui\\_site\\styles.css"),
// Load JavaScript file
A3API.RequestFile("z\\forge_client\\addons\\bank\\ui\\_site\\script.js")
]).then(([css, js]) => {
// Apply CSS
const style = document.createElement('style');
style.textContent = css;
document.head.appendChild(style);
// Load and execute JavaScript
const script = document.createElement('script');
script.text = js;
document.head.appendChild(script);
// Initialize the bank interface
initializeBank();
});
</script>
</head>
<body>
<header>
<div class="header-content">
<h1>Federal Deposit Insurance Corporation</h1>
<div class="balance-display">
<div class="balance-item">
<div class="balance-info">
<span class="balance-label">Wallet Balance</span>
<span class="balance-amount" id="walletBalance">$0</span>
</div>
</div>
<div class="balance-divider"></div>
<div class="balance-item">
<div class="balance-info">
<span class="balance-label">Account Balance</span>
<span class="balance-amount" id="accountBalance">$0</span>
</div>
</div>
</div>
</div>
</header>
<main class="container">
<div class="actions-grid">
<!-- Transfer Between Accounts -->
<div class="action-tile">
<h2>Transfer Money</h2>
<div class="form-group">
<label for="transferType">Transfer From</label>
<select id="transferType" required>
<option value="to_wallet">Account to Wallet</option>
<option value="to_account">Wallet to Account</option>
</select>
</div>
<div class="form-group">
<label for="transferAmount">Amount</label>
<input type="number" id="transferAmount" min="1" step="1" required>
</div>
<button type="button" class="submit-btn" onclick="handleTransfer()">Transfer</button>
</div>
<!-- Transfer to Player -->
<div class="action-tile">
<h2>Transfer to Player</h2>
<div class="form-group">
<label for="playerSelect">Player</label>
<select id="playerSelect" required>
<option value="" disabled selected>Select Player</option>
</select>
</div>
<div class="form-group">
<label for="playerTransferAmount">Amount</label>
<input type="number" id="playerTransferAmount" min="1" step="1" required>
</div>
<button type="button" class="submit-btn" onclick="handlePlayerTransfer()">Send Money</button>
</div>
<!-- Submit Timesheet -->
<div class="action-tile">
<h2>Submit Timesheet</h2>
<div class="pending-amount">
<div class="amount-label">Pending Payment</div>
<div class="amount-value" id="pending">$0</div>
</div>
<button type="button" class="submit-btn" onclick="handleTimesheet()">Submit Timesheet</button>
</div>
</div>
<!-- Transaction History -->
<section class="history-section">
<h2>Transaction History</h2>
<ul class="history-list" id="transactionHistory">
<!-- Transactions will be added here dynamically -->
</ul>
</section>
</main>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

View File

@ -0,0 +1,305 @@
/**
* Bank Management Script
* This script handles the bank interface functionality for the Arma 3 game interface.
* It provides wallet/account management, transfers, and transaction history.
*/
//=============================================================================
// #region DATA STRUCTURES AND VARIABLES
//=============================================================================
/**
* Bank state - will be populated from game events
*/
let bankState = {
wallet: 0,
account: 0,
pending: 0,
players: [],
transactions: []
};
// #endregion
//=============================================================================
// #region INITIALIZATION AND DATA REQUESTS
//=============================================================================
/**
* Initialize the bank interface
* Sets up the UI and requests initial data from the game engine
*/
function initializeBank() {
// Request initial data from the game
requestPlayerFunds();
requestPlayerData();
requestTransactionHistory();
}
/**
* Request player funds data from the game engine
*/
function requestPlayerFunds() {
const message = {
event: "REQUEST::PLAYER::FUNDS",
data: {}
};
A3API.SendAlert(JSON.stringify(message));
}
/**
* Request player data from the game engine
*/
function requestPlayerData() {
const message = {
event: "REQUEST::PLAYER::DATA",
data: {}
};
A3API.SendAlert(JSON.stringify(message));
}
/**
* Request transaction history from the game engine
*/
function requestTransactionHistory() {
const message = {
event: "REQUEST::TRANSACTION::HISTORY",
data: {}
};
A3API.SendAlert(JSON.stringify(message));
}
/**
* Set up a timer to refresh player data every 30 seconds
* Ensures the UI is updated with the latest information
*/
function setupRefreshTimer() {
setInterval(requestPlayerData, 30000); // Refresh every 30 seconds
}
// #endregion
//=============================================================================
// #region DATA HANDLERS
//=============================================================================
/**
* Handle player data received from the game engine
* @param {Array} data - List of player objects
*/
function handlePlayerDataRequest(data) {
bankState.players = data;
populatePlayerList();
}
/**
* Handle player funds data received from the game engine
* @param {Object} data - Object containing cash and balance
*/
function handlePlayerFundsRequest(data) {
console.log('Received funds data:', data);
// Parse the data if it's a string
if (typeof data === 'string') {
try {
data = JSON.parse(data);
} catch (e) {
console.error('Failed to parse data:', e);
return;
}
}
// Ensure we have valid numbers, default to 0 if null
bankState.wallet = data.cash !== null ? Number(data.cash) : 0;
bankState.account = data.balance !== null ? Number(data.balance) : 0;
bankState.pending = data.pending !== null ? Number(data.pending) : 0;
updateBalanceDisplays();
}
/**
* Handle transaction history data received from the game engine
* @param {Object} data - Object containing transaction history
*/
function handleTransactionHistoryRequest(data) {
console.log('Received transaction history:', data);
// Parse the data if it's a string
if (typeof data === 'string') {
try {
data = JSON.parse(data);
} catch (e) {
console.error('Failed to parse transaction history:', e);
return;
}
}
// Initialize empty array if history is null
bankState.transactions = [];
updateTransactionHistory();
}
// #endregion
//=============================================================================
// #region UI UPDATES AND DISPLAY
//=============================================================================
/**
* Update balance displays in the header
*/
function updateBalanceDisplays() {
const walletElement = document.getElementById('walletBalance');
const accountElement = document.getElementById('accountBalance');
const pendingElement = document.getElementById('pending');
if (walletElement && accountElement && pendingElement) {
walletElement.textContent = `$${(bankState.wallet || 0).toLocaleString()}`;
accountElement.textContent = `$${(bankState.account || 0).toLocaleString()}`;
pendingElement.textContent = `$${(bankState.pending || 0).toLocaleString()}`;
}
}
/**
* Populate the player selection dropdown
*/
function populatePlayerList() {
const playerSelect = document.getElementById('playerSelect');
playerSelect.innerHTML = '<option value="" disabled selected>Select Player</option>';
bankState.players.forEach(player => {
const option = document.createElement('option');
option.value = player.uid;
option.textContent = player.name;
playerSelect.appendChild(option);
});
}
/**
* Update the transaction history display
*/
function updateTransactionHistory() {
const historyList = document.getElementById('transactionHistory');
if (!historyList) return;
historyList.innerHTML = '';
if (!Array.isArray(bankState.transactions)) {
console.error('Transaction history is not an array:', bankState.transactions);
return;
}
if (bankState.transactions.length === 0) {
const li = document.createElement('li');
li.className = 'history-item empty';
li.textContent = 'No transactions yet';
historyList.appendChild(li);
return;
}
bankState.transactions.forEach(transaction => {
if (!transaction) return;
const li = document.createElement('li');
li.className = 'history-item';
const isNegative = ['transfer_out', 'to_wallet'].includes(transaction.type);
const amountClass = isNegative ? 'amount-negative' : 'amount-positive';
const amountPrefix = isNegative ? '-' : '+';
const amount = Math.abs(Number(transaction.amount) || 0);
li.innerHTML = `
<span class="transaction-type">${formatTransactionType(transaction.type)}</span>
<span class="transaction-details">${transaction.details || ''}</span>
<span class="amount ${amountClass}">${amountPrefix}$${amount.toLocaleString()}</span>
`;
historyList.appendChild(li);
});
}
/**
* Format transaction type for display
* @param {string} type - Transaction type code
* @returns {string} Formatted transaction type
*/
function formatTransactionType(type) {
const types = {
'to_wallet': 'To Wallet',
'to_account': 'To Account',
'transfer_out': 'Transfer Out',
'transfer_in': 'Transfer In',
'timesheet': 'Timesheet'
};
return types[type] || type;
}
// #endregion
//=============================================================================
// #region ACTION HANDLERS
//=============================================================================
/**
* Handle transfer between wallet and account
*/
function handleTransfer() {
const amount = parseInt(document.getElementById('transferAmount').value);
const transferType = document.getElementById('transferType').value;
const event = transferType === 'to_wallet' ? 'WITHDRAW::FUNDS' : 'DEPOSIT::FUNDS';
const message = {
event: event,
data: [amount]
};
A3API.SendAlert(JSON.stringify(message));
document.getElementById('transferAmount').value = '';
setTimeout(requestPlayerFunds, 500);
}
/**
* Handle transfer to another player
*/
function handlePlayerTransfer() {
const amount = parseInt(document.getElementById('playerTransferAmount').value);
const playerUid = document.getElementById('playerSelect').value;
const message = {
event: 'TRANSFER::FUNDS',
data: [amount, playerUid]
};
A3API.SendAlert(JSON.stringify(message));
document.getElementById('playerTransferAmount').value = '';
setTimeout(requestPlayerFunds, 500);
}
/**
* Handle timesheet submission
*/
function handleTimesheet() {
const message = {
event: 'SUBMIT::TIMESHEET',
data: {}
};
A3API.SendAlert(JSON.stringify(message));
setTimeout(requestPlayerFunds, 500);
}
// #endregion
//=============================================================================
// #region INITIALIZATION
//=============================================================================
/**
* Initialize when DOM is loaded
*/
document.addEventListener('DOMContentLoaded', () => {
initializeBank()
setupRefreshTimer();
});
// #endregion

View File

@ -0,0 +1,336 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--primary-color: #3b82f6;
--primary-hover: #2563eb;
--secondary-color: #1e293b;
--background-color: #f1f5f9;
--card-background: #ffffff;
--text-primary: #0f172a;
--text-secondary: #475569;
--border-color: #e2e8f0;
--success-color: #16a34a;
--success-hover: #15803d;
--header-bg: #1e293b;
--header-text: #f8fafc;
--error-color: #dc2626;
--error-hover: #b91c1c;
--tile-hover: #f8fafc;
--shadow-color: rgba(0, 0, 0, 0.1);
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
line-height: 1.6;
background-color: var(--background-color);
color: var(--text-primary);
}
header {
background-color: var(--header-bg);
color: var(--header-text);
padding: 1rem 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
h1 {
font-size: 1.75rem;
font-weight: 600;
letter-spacing: -0.025em;
}
.header-content {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1280px;
margin: 0 auto;
padding: 0 1rem;
.balance-display {
display: flex;
align-items: center;
margin-left: auto;
background: rgba(255, 255, 255, 0.05);
border-radius: 8px;
border: 1px solid rgba(255, 255, 255, 0.1);
.balance-divider {
width: 1px;
height: 24px;
background: rgba(255, 255, 255, 0.1);
margin: 0 0.25rem;
}
.balance-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem 0.75rem;
border-radius: 6px;
transition: all 0.2s ease-in-out;
min-width: 140px;
&:hover {
background: rgba(255, 255, 255, 0.1);
}
.balance-info {
display: flex;
flex-direction: column;
gap: 0.125rem;
.balance-label {
font-size: 0.75rem;
color: rgba(255, 255, 255, 0.7);
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.025em;
}
.balance-amount {
font-size: 0.875rem;
font-weight: 600;
color: var(--header-text);
}
}
}
}
}
}
.container {
max-width: 1280px;
margin: 0 auto;
padding: 0 1rem;
}
.actions-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1.5rem;
margin-top: 1.5rem;
.action-tile {
background-color: var(--card-background);
border-radius: 12px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease-in-out;
border: none;
padding: 1.5rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
aspect-ratio: 1 / 1;
&:hover {
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
transform: translateY(-4px);
}
&:active {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h2 {
font-size: 1.25rem;
color: var(--text-primary);
font-weight: 600;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-bottom: 1rem;
label {
font-weight: 500;
color: var(--text-secondary);
font-size: 0.875rem;
}
input,
select {
padding: 0.75rem 1rem;
border: 1px solid var(--border-color);
border-radius: 8px;
font-size: 1rem;
color: var(--text-primary);
background-color: var(--card-background);
transition: all 0.2s ease-in-out;
&:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
&:hover {
border-color: var(--primary-color);
}
}
}
.pending-amount {
background: rgba(59, 130, 246, 0.1);
padding: 1rem;
border-radius: 8px;
text-align: center;
.amount-label {
font-size: 0.875rem;
color: var(--text-secondary);
margin-bottom: 0.5rem;
}
.amount-value {
font-size: 2rem;
font-weight: 600;
color: var(--primary-color);
}
}
.submit-btn {
background-color: var(--primary-color);
color: white;
border: none;
border-radius: 8px;
padding: 0.75rem 1.5rem;
font-size: 1rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease-in-out;
opacity: 0.9;
margin-top: auto;
&:hover {
background-color: var(--primary-hover);
opacity: 1;
transform: translateY(-2px);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
&:active {
transform: translateY(0);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
}
}
}
.history-section {
background-color: var(--card-background);
border-radius: 12px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease-in-out;
border: none;
padding: 1.5rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
height: auto;
max-height: calc(100vw / 3);
margin-top: 1.5rem;
&:hover {
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
transform: translateY(-4px);
}
&:active {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h2 {
font-size: 1.25rem;
color: var(--text-primary);
font-weight: 600;
margin-bottom: 0.5rem;
}
.history-list {
list-style: none;
overflow-y: auto;
flex: 1;
padding-right: 0.5rem;
margin-right: -0.5rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-track {
background: transparent;
margin: 0.5rem;
}
&::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.1);
border-radius: 3px;
&:hover {
background-color: rgba(0, 0, 0, 0.2);
}
}
.history-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
background-color: var(--card-background);
border-radius: 8px;
transition: all 0.2s ease-in-out;
border: none;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
.transaction-type {
font-weight: 500;
color: var(--text-primary);
}
.transaction-details {
color: var(--text-secondary);
font-size: 0.875rem;
}
.amount {
&.amount-positive {
color: var(--success-color);
font-weight: 500;
}
&.amount-negative {
color: var(--error-color);
font-weight: 500;
}
}
&:last-child {
margin-bottom: 0;
}
&:hover {
background-color: var(--tile-hover);
box-shadow: 0 4px 6px var(--shadow-color);
transform: translateY(-2px);
}
&:active {
transform: translateY(0);
box-shadow: 0 2px 4px var(--shadow-color);
}
}
}
}

114
addons/briefing/README.md Normal file
View File

@ -0,0 +1,114 @@
# Forge Briefing Module
## Overview
The Briefing module provides a comprehensive presentation and lecture system for the Forge client. It includes features for creating interactive slideshows, managing presentations, and delivering lectures with synchronized audio and visual elements.
## Dependencies
- forge_client_main
## Authors
- J. Schmidt
- Creedcoder
- IDSolutions
## Features
### Presentation System
1. **Slide Show Management** (`fnc_initSlideShow.sqf`)
- Initializes interactive slide shows
- Configures display screens and controllers
- Sets up image sequences and timing
- Manages presentation flow and transitions
2. **Presentation Controls**
- **Start Slide Show** (`fnc_startSlideShow.sqf`)
- Initiates the presentation sequence
- Synchronizes audio and visual elements
- Manages presentation state
- **Next Image** (`fnc_nextImage.sqf`)
- Advances to the next slide
- Updates display screens
- Maintains presentation state
- **Previous Image** (`fnc_prevImage.sqf`)
- Returns to the previous slide
- Updates display screens
- Maintains presentation state
- **End Slide Show** (`fnc_endSlideShow.sqf`)
- Terminates the presentation
- Cleans up resources
- Resets presentation state
3. **Lecture System**
- **Spawn Lecture** (`fnc_spawnLecture.sqf`)
- Initiates AI-driven lectures
- Manages speaker animations
- Controls presentation timing
- **Spawn Presentation** (`fnc_spawnPresentation.sqf`)
- Creates automated presentations
- Manages slide timing
- Controls visual transitions
### Presentation Features
1. **Interactive Controls**
- Manual slide navigation
- Auto-scroll capability
- Presentation state management
- Speaker control integration
2. **Visual Elements**
- Multiple display screen support
- Synchronized image transitions
- Customizable timing
- Power-of-2 image optimization
3. **Audio Integration**
- Speaker synchronization
- Topic-based conversations
- Sentence-specific playback
- Multi-speaker support
## Event Handlers
The module uses several event handlers for initialization and execution:
- `XEH_preInit.sqf`: Pre-initialization setup
- `XEH_postInit.sqf`: Post-initialization tasks
- `XEH_preStart.sqf`: Pre-start configuration
- `XEH_postInit_client.sqf`: Client-specific post-initialization
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
## Usage
To use the briefing module:
1. Ensure the module is properly loaded in your mission
2. Set up presentation screens and controllers
3. Configure slide shows or lectures:
```sqf
// Initialize a slide show
[Screen01, [Controller01], ["images/folder/image.paa"]] call forge_client_briefing_fnc_initSlideShow;
// Start a lecture
[player, "topic", "sentence"] call forge_client_briefing_fnc_spawnLecture;
// Create a presentation
[screen, [["texture.paa", 5]]] call forge_client_briefing_fnc_spawnPresentation;
```
4. Control the presentation using the provided functions
## Debugging
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
```cpp
#define DEBUG_MODE_FULL
```
## Version Information
Version information is managed through the main Forge client system configuration.
## Technical Details
- Support for multiple display screens
- Synchronized audio-visual presentations
- Interactive control system
- AI-driven lecture capabilities
- Power-of-2 image optimization
- State management for presentations
- Multi-speaker support
- Customizable timing controls
- Resource cleanup on completion
- Error handling and validation

View File

@ -1,14 +1,19 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
Author: PDT for J. Schmidt * Author: IDSolutions
ends the slide show * Ends the slide show
*
Arguments: * Arguments:
0: _controller <OBJECT> - object that controls the slide show * 0: Controller <OBJECT> - object that controls the slide show
*
Return Value: * Return Value:
<BOOL> - true if the slide show was ended; false if not * Boolean - true if the slide show was ended; false if not
*
* Example:
* [controller] call ace_briefing_fnc_endSlideShow
*
* Public: No
*/ */
params [["_controller", objNull]]; params [["_controller", objNull]];

View File

@ -1,23 +1,25 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
Author: PDT for J. Schmidt * Author: IDSolutions
sets up a slide show * Sets up a slide show
*
Arguments: * Arguments:
0: _screen <ARRAY> - array of objects to display images on * 0: _screen <ARRAY> - array of objects to display images on
1: _controllers <ARRAY> - array of objects to use are controlers * 1: _controllers <ARRAY> - array of objects to use are controlers
2: _images <ARRAY> - array of image paths; images should be powers of 2 * 2: _images <ARRAY> - array of image paths; images should be powers of 2
3: _autoScroll <BOOL> - should the image auto-scroll * 3: _autoScroll <BOOL> - should the image auto-scroll
4: _units <ARRAY> - unit(s) that should speak * 4: _units <ARRAY> - unit(s) that should speak
5: _topic <STRING> - conversation topic * 5: _topic <STRING> - conversation topic
6: _sentence <STRING> - conversation sentence, "" = play all * 6: _sentence <STRING> - conversation sentence, "" = play all
*
Return Value: * Return Value:
<BOOL> - true if slide show was setup; false if not * <BOOL> - true if slide show was setup; false if not
*
Example: * Example:
[Screen01, [Controler01], ["images/folder/image.paa"]] call forge_client_briefing_fnc_initSlideShow; * [Screen01, [Controler01], ["images/folder/image.paa"]] call forge_client_briefing_fnc_initSlideShow;
*
* Public: No
*/ */
params [["_screens", []], ["_controllers", []], ["_images", []], ["_autoScroll", false], ["_units", []], ["_topic", ""], ["_sentence", ""]]; params [["_screens", []], ["_controllers", []], ["_images", []], ["_autoScroll", false], ["_units", []], ["_topic", ""], ["_sentence", ""]];

View File

@ -1,14 +1,19 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
Author: PDT for J. Schmidt * Author: IDSolutions
displays the next image * Displays the next image
*
Arguments: * Arguments:
0: _controller <OBJECT> - object that controls the slide show * 0: _controller <OBJECT> - object that controls the slide show
*
Return Value: * Return Value:
<BOOL> - true if the next image was displayed; false if not * 0: _return <BOOL> - true if the next image was displayed; false if not
*
* Example:
* [controller] call ace_briefing_fnc_nextImage
*
* Public: No
*/ */
params [["_controller", objNull]]; params [["_controller", objNull]];

View File

@ -1,14 +1,19 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
Author: PDT for J. Schmidt * Author: IDSolutions
displays the previous image * Displays the previous image
*
Arguments: * Arguments:
0: _controller <OBJECT> - object that controls the slide show * 0: _controller <OBJECT> - object that controls the slide show
*
Return Value: * Return Value:
<BOOL> - true if the previous image was displayed; false if not * 0: _return <BOOL> - true if the previous image was displayed; false if not
*
* Example:
* [controller] call forge_briefing_fnc_prevImage
*
* Public: No
*/ */
params [["_controller", objNull]]; params [["_controller", objNull]];

View File

@ -1,21 +1,25 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
Name: forge_client_briefing_fnc_spawnLecture * Author: IDSolutions
Date: 8/6/2022 * AI plays a given sentence/conversation
Version: 1.0 *
Author: J. Schmidt * Arguments:
* 0: Unit that is playing the given sentence/conversation <OBJECT>
Description: * 1: Topic that is being talked about <STRING>
AI plays a given sentence/conversation. * 2: Sentence partaining to the topic at hand <STRING>
*
Parameter(s): * Return Value:
0: Unit that is playing the given sentence/conversation. <OBJECT> * None
1: Topic that is being talked about. <STRING> *
2: Sentence partaining to the topic at hand. <STRING> * Example:
* [player, "topic", "sentence"] call forge_client_briefing_fnc_spawnLecture
*
* Public: No
*/ */
params ["_unit", "_topic", "_sentence"]; params ["_unit", "_topic", "_sentence"];
FORGE_Briefing_inProgress = true; FORGE_Briefing_inProgress = true;
publicVariable "FORGE_Briefing_inProgress"; publicVariable "FORGE_Briefing_inProgress";

View File

@ -1,19 +1,22 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
Name: forge_client_briefing_fnc_spawnLecture * Author: IDSolutions
Date: 8/6/2022 * Object displays a slideshow presentation
Version: 1.0 *
Author: J. Schmidt * Arguments:
* 0: Object that will display the presentation <OBJECT>
Description: * 1: Slides that will be used for the presentation <ARRAY>
Object displays a slideshow presentation. * - 0: Texture used for the Slide <STRING>
* - 1: Amount of Time the Slide will display <NUMBER>
Parameter(s): *
0: Object that will display the presentation. <OBJECT> * Return Value:
1: Slides that will be used for the presentation. <ARRAY> * None
1-0: Texture used for the Slide. <STRING> *
1-1: Amount of Time the Slide will display. <NUMBER> * Example:
* [screen, [["texture.paa", 5]]] call forge_client_briefing_fnc_spawnLecture
*
* Public: No
*/ */
params ["_object", "_slides"]; params ["_object", "_slides"];

View File

@ -1,14 +1,19 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
Author: PDT for J. Schmidt * Author: IDSolutions
starts the slideshow * Starts the slideshow
*
Arguments: * Arguments:
0: _controller <OBJECT> - object that controls the slide show * 0: Controller <OBJECT> - object that controls the slide show
*
Return Value: * Return Value:
<BOOL> - true if slide show was started * Boolean - true if slide show was started
*
* Example:
* [controller] call ace_fnc_startSlideShow
*
* Public: No
*/ */
params [["_controller", objNull], ["_units", []], ["_topic", ""], ["_sentence", ""]]; params [["_controller", objNull], ["_units", []], ["_topic", ""], ["_sentence", ""]];

View File

@ -0,0 +1 @@
z\forge_client\addons\common

View File

@ -0,0 +1,19 @@
class Extended_PreStart_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preStart));
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
serverInit = QUOTE(call COMPILE_FILE(XEH_preInit_server));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
clientInit = QUOTE(call COMPILE_FILE(XEH_postInit_client));
};
};

View File

@ -0,0 +1,3 @@
PREP(actorStateGet);
PREP(actorStateSet);
PREP(getPlayer);

View File

@ -0,0 +1 @@
#include "script_component.hpp"

View File

@ -0,0 +1 @@
#include "script_component.hpp"

View File

@ -0,0 +1,8 @@
#include "script_component.hpp"
ADDON = false;
PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
ADDON = true;

View File

@ -0,0 +1 @@
#include "script_component.hpp"

View File

@ -0,0 +1,2 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"

16
addons/common/config.cpp Normal file
View File

@ -0,0 +1,16 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"forge_client_main"};
authors[] = {"J. Schmidt", "Creedcoder"};
author = "IDSolutions";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"

View File

@ -0,0 +1,43 @@
#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Gets the current state of a player
*
* Arguments:
* 0: Player <OBJECT>
*
* Return Value:
* Player State <HASHMAP>
*
* Example:
* _state = [player] call forge_client_common_fnc_actorStateGet
*
* Public: No
*/
params [["_player", objNull, [objNull]]];
private _loadout = getUnitLoadout _player;
private _pos = getPosASL _player;
private _dir = getDir _player;
private _stance = stance _player;
private _phone = GETVAR(_player,FORGE_Phone,QUOTE(000-000-0000));
private _email = GETVAR(_player,FORGE_Email,QUOTE(player@example.com));
private _bank = GETVAR(_player,FORGE_Bank,0);
private _cash = GETVAR(_player,FORGE_Cash,0);
private _state = lifeState _player;
private _hash = createHashMap;
_hash set ["loadout", _loadout];
_hash set ["position", _pos];
_hash set ["direction", _dir];
_hash set ["stance", _stance];
_hash set ["phone", _phone];
_hash set ["email", _email];
_hash set ["bank", _bank];
_hash set ["cash", _cash];
_hash set ["state", _state];
_hash

View File

@ -0,0 +1,65 @@
#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Sets the state of a player
*
* Arguments:
* 0: Player <OBJECT>
* 1: Data <STRING>
*
* Return Value:
* Unit State <HASHMAP>
*
* Example:
* [player, _data] call forge_client_common_fnc_actorStateSet
*
* Public: No
*/
params [["_player", objNull, [objNull]], ["_data", "", [""]]];
private _hash = createHashMap;
if (isNull _player || _data isEqualTo "") exitWith {
diag_log text format ["[FORGE:Player:Actor] Invalid player or data: %1", _player];
};
(parseSimpleArray _data) params ["_uid", "_loadout", "_pos", "_dir", "_stance", "_email", "_phone", "_bank", "_cash", "_state"];
_player setUnitLoadout _loadout;
if !(isNil "_pos") then {
_player setPosASL _pos;
private _pAlt = ((getPosATLVisual player) select 2);
private _pVelZ = ((velocity player) select 2);
if (_pAlt > 5 && _pVelZ < 0) then {
player setVelocity [0, 0, 0];
player setPosATL [((getPosATLVisual player) select 0), ((getPosATLVisual player) select 1), 1];
hint "You logged off mid air. You were moved to a safe position on the ground.";
};
};
if !(isNil "_dir") then {
_player setDir _dir;
};
_player playAction _stance;
SETPVAR(_player,FORGE_Phone,_phone);
SETPVAR(_player,FORGE_Email,_email);
SETPVAR(_player,FORGE_Bank,_bank);
SETPVAR(_player,FORGE_Cash,_cash);
SETPVAR(_player,FORGE_State,_state);
_hash set ["uid", _uid];
_hash set ["loadout", _loadout];
_hash set ["position", _pos];
_hash set ["direction", _dir];
_hash set ["stance", _stance];
_hash set ["phone", _phone];
_hash set ["email", _email];
_hash set ["bank", _bank];
_hash set ["cash", _cash];
_hash set ["state", _state];
_hash

View File

@ -0,0 +1,27 @@
#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Gets a player object by UID.
*
* Arguments:
* 0: Player UID <STRING>
*
* Return Value:
* Player object or objNull if not found <OBJECT>
*
* Example:
* ["76561198012345678"] call forge_client_common_fnc_getPlayer
*
* Public: Yes
*/
params ["_uid"];
private _player = objNull;
{
if ((getPlayerUID _x) isEqualTo _uid) exitWith { _player = _x; };
} forEach allPlayers;
_player

View File

@ -0,0 +1,16 @@
#define COMPONENT common
#define COMPONENT_BEAUTIFIED Common
#include "\z\forge_client\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
#ifdef DEBUG_ENABLED_COMMON
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_COMMON
#define DEBUG_SETTINGS DEBUG_SETTINGS_COMMON
#endif
#include "\z\forge_client\addons\main\script_macros.hpp"

BIN
addons/db.7z Normal file

Binary file not shown.

125
addons/db/README.md Normal file
View File

@ -0,0 +1,125 @@
# Forge Database Module
## Overview
The Database module provides a comprehensive data persistence system for the Forge client. It includes features for managing player data, organization information, and game state persistence using the ArmaDragonflyClient database system.
## Dependencies
- forge_client_main
- ArmaDragonflyClient
## Authors
- J. Schmidt
- Creedcoder
- IDSolutions
## Features
### Database System
1. **Server Communication** (`fnc_requestServerDB.sqf`)
- Handles client-server database communication
- Manages asynchronous database operations
- Provides callback support for data retrieval
- Ensures data consistency across clients
2. **Data Management**
- **Player Data**
- Armory unlocks
- Garage unlocks
- Locker contents
- Vehicle inventory
- Financial information
- Contact details
- Organization membership
- Player statistics
- Equipment loadouts
- Position and state
- **Organization Data**
- Member information
- Asset tracking
- Financial records
- Reputation system
- Activity logs
- Creation timestamps
- Modification history
3. **Persistence Features**
- Automatic data saving
- Periodic state synchronization
- Data validation and sanitization
- Error recovery mechanisms
- Transaction logging
- Data versioning
### Data Operations
1. **Storage Operations**
- Hash-based storage (HSET)
- Bulk data operations
- Atomic transactions
- Data serialization
- String normalization
2. **Retrieval Operations**
- Hash-based retrieval (HGET)
- Bulk data loading
- Data deserialization
- Error handling
- Default value management
3. **Synchronization**
- Client-server sync
- Real-time updates
- Conflict resolution
- State verification
- Data integrity checks
## Event Handlers
The module uses several event handlers for initialization and execution:
- `XEH_preInit.sqf`: Pre-initialization setup
- `XEH_postInit.sqf`: Post-initialization tasks
- `XEH_preStart.sqf`: Pre-start configuration
- `XEH_postInit_client.sqf`: Client-specific post-initialization
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
## Usage
To use the database module:
1. Ensure the module is properly loaded in your mission
2. Initialize database connections
3. Perform database operations:
```sqf
// Request data from server
["hgetall", "Hello World!", {
systemChat format ["Message: %1", _this];
}] call forge_db_fnc_requestServerDB;
// Save player data
[] call forge_client_init_fnc_playerDBSave;
// Load player data
[] call forge_client_init_fnc_playerDBLoad;
```
4. Handle database callbacks and responses
## Debugging
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
```cpp
#define DEBUG_MODE_FULL
```
## Version Information
Version information is managed through the main Forge client system configuration.
## Technical Details
- Asynchronous database operations
- Callback-based response handling
- Data serialization and normalization
- Error handling and recovery
- Transaction logging
- State management
- Data validation
- Conflict resolution
- Real-time synchronization
- Bulk operation support
- Atomic transactions
- Data versioning
- Integrity verification

View File

@ -1,3 +1 @@
PREP(saveToMission); PREP(requestServerDB);
PREP(saveToProfile);
PREP(saveToTempDB);

View File

@ -1,3 +1 @@
#include "script_component.hpp" #include "script_component.hpp"
GVAR(tempDB) = [];

View File

@ -1 +1,3 @@
#include "script_component.hpp" #include "script_component.hpp"
["forge_db_registerClient", [getPlayerUID player, clientOwner]] call CBA_fnc_serverEvent;

View File

@ -5,4 +5,18 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp" #include "XEH_PREP.hpp"
PREP_RECOMPILE_END; PREP_RECOMPILE_END;
// Handle responses from server requests
["forge_db_response", {
params ["_targetUID", "_requestType", "_result", "_requestID"];
if (_targetUID isEqualTo getPlayerUID player) then {
if (!isNil QGVAR(pendingCallbacks)) then {
private _callback = GVAR(pendingCallbacks) getOrDefault [_requestID, {}];
GVAR(pendingCallbacks) deleteAt _requestID;
[_result, _requestType] call _callback;
};
};
}] call CBA_fnc_addEventHandler;
ADDON = true; ADDON = true;

Binary file not shown.

View File

@ -0,0 +1,37 @@
#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Sends database requests to the server using CBA events
*
* Arguments:
* 0: _type - Type of database operation <STRING>
* 1: _data - Data for the operation <ANY>
* 2: _callback - Function to call when data is returned <CODE>
*
* Return Value:
* Request ID <STRING>
*
* Example:
* ["hgetall", "Hello World!", { systemChat format ["Message: %1", _this]; }] call forge_db_fnc_requestServerDB;
*
* Public: Yes
*/
params [
["_type", "", [""]],
["_data", nil, [createHashMap, [], "", 0, true, objNull]],
["_callback", {}, [{}]]
];
private _requestID = format ["%1_%2", diag_tickTime, random 1000];
if (isNil QGVAR(pendingCallbacks)) then {
GVAR(pendingCallbacks) = createHashMap;
};
GVAR(pendingCallbacks) set [_requestID, _callback];
["forge_db_request", [getPlayerUID player, _type, _data, _requestID]] call CBA_fnc_serverEvent;
_requestID

View File

@ -1,111 +0,0 @@
#include "..\script_component.hpp"
/*
* Function: forge_client_db_fnc_saveToMission
* Author: J.Schmidt
* Edit: 07.23.2024
* Copyright © 2024 J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivative 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Store mission and player data in Mission Namespace.
*
* Arguments:
* N/A
*
* Return Value:
* N/A
*
* Examples:
* [] call forge_client_db_fnc_saveToMission;
*
* Public: Yes
*/
if (isNil "companyFunds") then { companyFunds = 0 };
if (isNil "companyRating") then { companyRating = 0 };
if (isNil "companyGenerals") then { companyGenerals = [] };
if (isNil "companyGarageUnlocks") then { companyGarageUnlocks = [] };
if (isNil EGVAR(arsenal,armory_unlocks)) then { EGVAR(arsenal,armory_unlocks) = [[],[],[],[]] };
if (isNil EGVAR(arsenal,garage_unlocks)) then { EGVAR(arsenal,garage_unlocks) = [[],[],[],[],[],[]] };
private _vdata = [];
private _pdata = [];
private _cdata = [
["key", "CompanyState"],
["funds", [companyFunds]],
["rating", [companyRating]],
["operations", [companyGenerals]],
["garage_unlocks", [companyGarageUnlocks]]
];
private _vehicles = nearestObjects [player, ["LandVehicle"], 50] apply {
createHashMapFromArray [
["vehicle", _x],
["class", [typeOf _x]],
["position", [getPosATL _x]],
["direction", [getDir _x]],
["health", [damage _x]]
];
};
{
if (alive _x) then {
_vdata pushBackUnique _x;
};
} forEach _vehicles;
{
private _data = [
["key", getPlayerUID player],
// ["armory_unlocks", [forge_client_armory_arsenalUnlocks]],
// ["garage_unlocks", [forge_client_armory_garageUnlocks]],
["armory_unlocks", [EGVAR(arsenal,armory_unlocks)]],
["garage_unlocks", [EGVAR(arsenal,garage_unlocks)]],
// ["locker", [player getVariable ["Locker", []]]],
// ["garage", [player getVariable ["Garage", []]]],
["locker", [GETVAR(player,FORGE_Locker,[])]],
["garage", [GETVAR(player,FORGE_Garage,[])]],
// ["cash", [player getVariable ["FORGE_Cash", 0]]],
// ["bank", [player getVariable ["FORGE_Bank", 0]]],
["cash", [GETVAR(player,FORGE_Cash,0)]],
["bank", [GETVAR(player,FORGE_Bank,0)]],
// ["number", [player getVariable ["FORGE_Phone_Number", "unknown"]]],
// ["email", [player getVariable ["FORGE_Email", "unknown@spearnet.mil"]]],
["number", [GETVAR(player,FORGE_Phone_Number,"unknown")]],
["email", [GETVAR(player,FORGE_Email,"unknown@spearnet.mil")]],
// ["paygrade", [player getVariable ["Paygrade", "E1"]]],
["paygrade", [GETVAR(player,FORGE_Paygrade,"E1")]],
["reputation", [rating player]],
["loadout", [getUnitLoadout player]],
// ["holster", [player getVariable ["FORGE_Holster_Weapon", true]]],
["holster", [GETVAR(player,FORGE_Holster_Weapon,true)]],
["position", [getPosASLVisual player]],
["direction", [getDirVisual player]]
];
if (isNull objectParent player) then {
_data pushBack "currentWeapon";
_data pushBack [currentMuzzle player];
_data pushBack "stance";
_data pushBack [stance player];
};
_pdata pushBackUnique _data;
} forEach playableUnits;
private _cHashMap = createHashMapFromArray _cdata;
private _pHashMap = createHashMapFromArray _pdata;
private _vHashMap = createHashMapFromArray _vdata;
// missionProfileNamespace setVariable ["FORGE_MissionData", _cHashMap];
// missionProfileNamespace setVariable ["FORGE_PlayerData", _pHashMap];
// missionProfileNamespace setVariable ["FORGE_VehicleData", _vHashMap];
SETPVAR(missionNamespace,FORGE_MissionData,_cHashMap);
SETPVAR(missionNamespace,FORGE_PlayerData,_pHashMap);
SETPVAR(missionNamespace,FORGE_VehicleData,_vHashMap);

View File

@ -1,69 +0,0 @@
#include "..\script_component.hpp"
/*
* Function: forge_client_db_fnc_saveToProfile
* Author: J.Schmidt
* Edit: 07.23.2024
* Copyright © 2024 J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivative 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Store player data in Profile Namespace.
*
* Arguments:
* N/A
*
* Return Value:
* N/A
*
* Examples:
* [] call forge_client_db_fnc_saveToProfile;
*
* Public: Yes
*/
// if (isNil "forge_client_armory_arsenalUnlocks") then { forge_client_armory_arsenalUnlocks = [] };
// if (isNil "forge_client_armory_garageUnlocks") then { forge_client_armory_garageUnlocks = [] };
if (isNil EGVAR(arsenal,armory_unlocks)) then { EGVAR(arsenal,armory_unlocks) = [[],[],[],[]] };
if (isNil EGVAR(arsenal,garage_unlocks)) then { EGVAR(arsenal,garage_unlocks) = [[],[],[],[],[],[]] };
private _data = [
["key", getPlayerUID player],
["armory_unlocks", [EGVAR(arsenal,armory_unlocks)]],
["garage_unlocks", [EGVAR(arsenal,garage_unlocks)]],
// ["locker", [player getVariable ["Locker", []]]],
// ["garage", [player getVariable ["Garage", []]]],
["locker", [GETVAR(player,FORGE_Locker,[])]],
["garage", [GETVAR(player,FORGE_Garage,[])]],
// ["cash", [player getVariable ["FORGE_Cash", 0]]],
// ["bank", [player getVariable ["FORGE_Bank", 0]]],
["cash", [GETVAR(player,FORGE_Cash,0)]],
["bank", [GETVAR(player,FORGE_Bank,0)]],
// ["number", [player getVariable ["FORGE_Phone_Number", "unknown"]]],
// ["email", [player getVariable ["FORGE_Email", "unknown@spearnet.mil"]]],
["number", [GETVAR(player,FORGE_PhoneNumber,"unknown")]],
["email", [GETVAR(player,FORGE_Email,"unknown@spearnet.mil")]],
// ["paygrade", [player getVariable ["Paygrade", "E1"]]],
["paygrade", [GETVAR(player,FORGE_Paygrade,"E1")]],
["reputation", [rating player]],
["loadout", [getUnitLoadout player]],
// ["holster", [player getVariable ["FORGE_Holster_Weapon", true]]],
["holster", [GETVAR(player,FORGE_Holster_Weapon,true)]],
["position", [getPosASLVisual player]],
["direction", [getDirVisual player]]
];
if (isNull objectParent player) then {
_data pushBack ["currentWeapon", [currentMuzzle player]];
_data pushBack ["stance", [stance player]];
};
private _hashMap = createHashMapFromArray _data;
// profileNamespace setVariable ["FORGE_PlayerData", _hashMap];
SETVAR(profileNamespace,FORGE_PlayerData,_hashMap);

View File

@ -1,51 +0,0 @@
#include "..\script_component.hpp"
/*
* Function: forge_client_db_fnc_saveToTempDB
* Author: J.Schmidt
* Edit: 07.23.2024
* Copyright © 2024 J.Schmidt, All rights reserved
*
* Do not edit without permission!
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivative 4.0 International License.
* To view a copy of this license, vist https://creativecommons.org/licenses/by-nc-nd/4.0/ or send a letter to Creative Commons,
* PO Box 1866, Mountain View, CA 94042
*
* [Description]
* Store data in Temp DB.
*
* Arguments:
* 0: Name of Event <STRING>
* 1: Name of DB <STRING>
* 2: UID of Player <STRING>
* 3: Name of Key <STRING>
* 4: Value to store in key <ARRAY|STRING|NUMBER|BOOL>
*
* Return Value:
* N/A
*
* Examples:
* ["playerStatus", "players", "76561198027566824", "status", "available"] call forge_client_db_fnc_saveToTempDB;
*
* Public: Yes
*/
params [["_event", "", [""]], ["_db", "", [""]], ["_uid", "", [""]], ["_key", "", [""]], ["_value", "", [[], 0, "", false]]];
if (isNil "_event") exitWith { ["No Event provided"] call BFUNC(log); };
if (isNil "_db") exitWith { ["No DB provided"] call BFUNC(log); };
if (isNil "_uid") exitWith { ["No UID provided"] call BFUNC(log); };
if (isNil "_key") exitWith { ["No key provided"] call BFUNC(log); };
if (isNil "_value") exitWith { ["No Value provided"] call BFUNC(log); };
["Received event: %1", _this] call BFUNC(logFormat);
private _response = [GVAR(tempDB), [_db, _uid, _key], _value] call BFUNC(dbValueSet);
if !(_response) then {
["Failed to set Key '%1' for UID '%2' with '%3' to DB", _key, _uid, _value] call BFUNC(logFormat);
} else {
SETPVAR(missionNamespace,FORGE_TempDb,GVAR(tempDB));
["Successfully set key '%1' for UID '%2' with '%3'", _key, _uid, _value] call BFUNC(logFormat);
};

90
addons/dialogue/README.md Normal file
View File

@ -0,0 +1,90 @@
# Forge Dialogue Module
## Overview
The Dialogue module provides a comprehensive AI conversation system for the Forge client. It enables dynamic interactions between players and AI units, supporting topic-based conversations, sentence management, and AI behavior control.
## Dependencies
- forge_client_main
## Authors
- J. Schmidt
- Creedcoder
- IDSolutions
## Features
### AI Dialogue System
1. **AI Selection** (`fnc_selectAI.sqf`)
- Manages AI unit selection for dialogue
- Controls AI behavior during conversations
- Handles unit state management
- Disables AI actions during dialogue
2. **Dialogue Management** (`fnc_selectDialogue.sqf`)
- Topic-based conversation system
- Sentence management and playback
- AI unit synchronization
- Conversation flow control
3. **Conversation Features**
- **Topic Management**
- Dynamic topic selection
- Context-aware conversations
- Topic-based responses
- Conversation branching
- **Sentence Control**
- Sentence playback
- Timing management
- Response coordination
- Conversation state tracking
- **AI Behavior**
- Animation control
- Movement management
- State synchronization
- Interaction handling
## Event Handlers
The module uses several event handlers for initialization and execution:
- `XEH_preInit.sqf`: Pre-initialization setup
- `XEH_postInit.sqf`: Post-initialization tasks
- `XEH_preStart.sqf`: Pre-start configuration
- `XEH_postInit_client.sqf`: Client-specific post-initialization
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
## Usage
To use the dialogue module:
1. Ensure the module is properly loaded in your mission
2. Select AI units for dialogue:
```sqf
// Select AI units for dialogue
[units group player] call forge_client_dialogue_fnc_selectAI;
// Select specific dialogue for AI
[units, [["topic", "sentence"]]] call forge_client_dialogue_fnc_selectDialogue;
```
3. Manage conversation flow and AI behavior
## Debugging
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
```cpp
#define DEBUG_MODE_FULL
```
## Version Information
Version information is managed through the main Forge client system configuration.
## Technical Details
- Topic-based conversation system
- AI behavior control
- Sentence management
- State synchronization
- Animation handling
- Movement control
- Interaction management
- Conversation flow control
- Response coordination
- Error handling
- Debug support
- Event system integration

View File

@ -1,16 +1,19 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
Name: forge_client_dialogue_fnc_selectAI * Author: IDSolutions
Date: 8/6/2022 * Selects AI for dialogue
Version: 1.0 *
Author: J. Schmidt * Arguments:
* 0: _units - Array of AI units <ARRAY>
Description: *
Select AI for dialogue. * Return Value:
* None
Arguments: *
0: OBJECT - The AI unit * Example:
* [units group player] call FUNC(selectAI);
*
* Public: No
*/ */
params [["_units", [], [[]]]]; params [["_units", [], [[]]]];

View File

@ -1,17 +1,18 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/* /*
Name: forge_client_dialogue_fnc_selectDialogue * Function: forge_client_dialogue_fnc_selectDialogue
Date: 8/6/2022 * Author: IDSolutions
Version: 1.0 *
Author: J. Schmidt * Description:
* Selects dialogue for AI
Description: *
Create dialogue for AI unit. * Arguments:
* 0: _units - Array of AI units <ARRAY>
Arguments: * 1: _dialogue - Array of dialogue <ARRAY>
0: OBJECT - The AI unit *
1: STRING - The dialogue * Return Value:
* None
*/ */
params [["_units", [], [[]]], ["_dialogue", [], [[]]]]; params [["_units", [], [[]]], ["_dialogue", [], [[]]]];

View File

@ -1,4 +1,132 @@
forge_garage # Forge Garage Module
==========
A player garage addon that provides personal storage functionality. Players can store and retrieve their vehicles securely using individual garages. This addon handles the storage and management of player vehicles in a safe and organized way. ## Overview
The Garage module provides a comprehensive vehicle management system for the Forge client. It includes features for storing, spawning, and managing vehicles in a garage environment, with support for various vehicle types and states.
## Dependencies
- forge_client_main
## Authors
- J. Schmidt
- Creedcoder
- IDSolutions
## Features
### Garage System
1. **Garage Initialization** (`fnc_initGarage.sqf`)
- Initializes the garage system
- Sets up vehicle storage and management
- Configures garage locations and spawn points
- Manages vehicle state persistence
2. **Vehicle Management**
- **Spawn Vehicle** (`fnc_spawnVehicle.sqf`)
- Handles vehicle spawning from garage
- Manages spawn locations and orientations
- Preserves vehicle type information
- Updates garage inventory
- **Store Vehicle** (`fnc_storeVehicle.sqf`)
- Manages vehicle storage in garage
- Handles vehicle cleanup
- Updates garage inventory
- Preserves vehicle data
- **Fetch Garage** (`fnc_fetchGarage.sqf`)
- Retrieves garage vehicle information
- Updates garage interface
- Manages vehicle listings
- Handles vehicle categorization
- **Fetch Nearby** (`fnc_fetchNearby.sqf`)
- Locates and manages nearby vehicles
- Validates vehicle ownership
- Handles vehicle state checks
- Updates interface with nearby vehicles
3. **Vehicle Categories**
- Cars (Light vehicles, transport)
- Armor (Tanks, APCs)
- Helicopters (All rotary-wing aircraft)
- Planes (Fixed-wing aircraft)
- Naval (Boats, ships)
- Static (Weapons, emplacements)
4. **Vehicle States**
- Available
- In Use
- Maintenance
- Damaged
- Fuel Status
- Condition Tracking
### User Interface
1. **Garage Dialog**
- Vehicle listing and management
- Category filtering
- Status indicators
- Action buttons (Spawn/Store)
- Vehicle details display
2. **Vehicle Information**
- Vehicle name and type
- Status indicators
- Fuel level
- Damage state
- Maintenance status
- Last used timestamp
3. **Controls**
- Category filters
- Vehicle actions
- Status management
- Quick access buttons
## Event Handlers
The module uses several event handlers for initialization and execution:
- `XEH_preInit.sqf`: Pre-initialization setup
- `XEH_postInit.sqf`: Post-initialization tasks
- `XEH_preStart.sqf`: Pre-start configuration
- `XEH_postInit_client.sqf`: Client-specific post-initialization
- `XEH_preInit_server.sqf`: Server-specific pre-initialization
## Usage
To use the garage module:
1. Ensure the module is properly loaded in your mission
2. Access the garage through the provided UI
3. Manage vehicles using the appropriate functions:
```sqf
// Open garage interface
[] call forge_client_garage_fnc_openGarage;
// Store a vehicle
[] call forge_client_garage_fnc_storeVehicle;
// Spawn a vehicle
[] call forge_client_garage_fnc_spawnVehicle;
```
4. Monitor vehicle status and location
## Debugging
Debug mode can be enabled by uncommenting the following in `script_component.hpp`:
```cpp
#define DEBUG_MODE_FULL
```
## Version Information
Version information is managed through the main Forge client system configuration.
## Technical Details
- Vehicle state persistence
- Category-based organization
- Status tracking system
- Location management
- Spawn point configuration
- Vehicle cleanup handling
- Interface synchronization
- Event system integration
- Error handling
- Debug support
- Data validation
- State management

View File

@ -1 +1,48 @@
#include "script_component.hpp" #include "script_component.hpp"
[QGVAR(handleEvents), {
params ["_control", "_isConfirmDialog", "_message"];
diag_log text format ["[FORGE::Client::Garage::XEH_postInit] Received event: '%1'", _message];
_message = fromJSON _message;
private _event = _message get "event";
private _data = _message get "data";
private _vehicles = GETVAR(player,FORGE_Garage,[]); //TODO: Implement garage from server
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 text format ["[FORGE::Client::Garage::XEH_postInit] Unknown event: '%1'", _event];
};
};
}] call CFUNC(addEventHandler);

View File

@ -1,8 +1,23 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/*
* Author: IDSolutions
* Fetches the vehicles in the garage
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* None
*
* Public: No
*/
private _display = findDisplay IDD_GARAGEDIALOG; private _display = findDisplay IDD_GARAGEDIALOG;
private _garageList = _display displayCtrl IDC_GARAGEVEHICLELIST; private _garageList = _display displayCtrl IDC_GARAGEVEHICLELIST;
// private _storedVehicles = player getVariable ["FORGE_Garage", []];
private _storedVehicles = GETVAR(player,FORGE_Garage,[]); private _storedVehicles = GETVAR(player,FORGE_Garage,[]);
lbClear _garageList; lbClear _garageList;

View File

@ -1,5 +1,21 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/*
* Author: IDSolutions
* Fetches the nearby vehicles
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* None
*
* Public: No
*/
private _display = findDisplay IDD_GARAGEDIALOG; private _display = findDisplay IDD_GARAGEDIALOG;
private _vehicleList = _display displayCtrl IDC_VEHICLELIST; private _vehicleList = _display displayCtrl IDC_VEHICLELIST;

View File

@ -1,5 +1,21 @@
#include "..\script_component.hpp" #include "..\script_component.hpp"
/*
* Author: IDSolutions
* Initializes the garages
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* None
*
* Public: No
*/
{ {
private _configName = configName(_x); private _configName = configName(_x);
private _className = (missionConfigFile >> "CfgGarages" >> "garages" >> _configName >> "className") call BFUNC(getCfgData); private _className = (missionConfigFile >> "CfgGarages" >> "garages" >> _configName >> "className") call BFUNC(getCfgData);

Some files were not shown because too many files have changed in this diff Show More