client/addons/misc/README.md
Jacob Schmidt 9936d6ddc3
All checks were successful
Build / Build (push) Successful in 28s
feat: Enhance module documentation and features
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

132 lines
3.5 KiB
Markdown

# Forge Misc Module
## Overview
The Misc module provides a collection of utility functions and features for the Forge client. It includes a notification system, string handling, number formatting, and various helper functions used throughout the client.
## Dependencies
- forge_client_main
## Authors
- J. Schmidt
- Creedcoder
- IDSolutions
## Features
### Notification System
1. **Notification Display** (`fnc_notify.sqf`)
- Creates customizable notifications
- Supports multiple notification types:
- Error (red)
- Warning (amber)
- Success (green)
- Info (blue)
- Custom colors
- Configurable display options:
- Text content
- Display duration
- Display side (left/right)
- Animation speed
- Material Design color scheme
- Sound effects
- Stacking support
- Fade animations
### String Handling
1. **String Serialization** (`fnc_serializeString.sqf`)
- Converts strings to serialized format
- Handles special characters
- Supports data transfer
2. **String Deserialization** (`fnc_deserializeString.sqf`)
- Converts serialized strings back to original format
- Restores special characters
- Processes received data
### Number Formatting
1. **Number Format** (`fnc_formatNumber.sqf`)
- Formats numbers for display
- Adds thousand separators
- Handles decimal places
- Currency formatting support
### Utility Functions
1. **System Time** (`fnc_getSystemTime.sqf`)
- Gets current system time
- Timestamp generation
- Time-based operations
2. **Equipment Checks**
- **Binocular Check** (`fnc_isAssignableBinocular.sqf`)
- Validates binocular equipment
- Checks compatibility
- Equipment type verification
- **Weapon Type Check** (`fnc_isWeaponType.sqf`)
- Validates weapon types
- Equipment categorization
- Type verification
3. **Cargo Management** (`fnc_cargoToPairs.sqf`)
- Converts cargo to paired format
- Inventory management
- Equipment organization
## 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 misc module functions:
```sqf
// Create a notification
["Hello World!", "default", 3, "right"] call forge_client_misc_fnc_notify;
// Format a number
[1000000] call forge_client_misc_fnc_formatNumber; // Returns "1,000,000"
// Get system time
[] call forge_client_misc_fnc_getSystemTime;
// Check weapon type
["arifle_MX_F"] call forge_client_misc_fnc_isWeaponType;
```
## Configuration
The module can be configured through the main Forge client configuration:
```cpp
// Notification colors (Material Design)
#define COLOR_RED [0.957, 0.263, 0.212, 1]
#define COLOR_GREEN [0.298, 0.686, 0.314, 1]
#define COLOR_BLUE [0.129, 0.588, 0.953, 1]
#define COLOR_AMBER [1, 0.757, 0.027, 1]
// Notification settings
#define NOTIFICATION_DEFAULT_DURATION 3
#define NOTIFICATION_MAX_STACK 3
#define NOTIFICATION_MARGIN 0.01
```
## 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
- Material Design color scheme
- Responsive notification system
- String serialization/deserialization
- Number formatting utilities
- Equipment validation
- Time management
- Cargo handling
- Event system integration
- Error handling
- User feedback
- Cross-module compatibility