This commit is contained in:
commit
1b6b825653
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
32
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report a bug related to the framework.
|
||||
title: "[addon name] - [short description]"
|
||||
labels: bug
|
||||
assignees: JSchmidt92
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Mission file**
|
||||
The mission where the issue occured.
|
||||
|
||||
**Log file**
|
||||
The log file generated by the game.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: Request - [short description]
|
||||
labels: ''
|
||||
assignees: JSchmidt92
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
**When merged this pull request will:**
|
||||
- Describe what this pull request will do
|
||||
- Each change in a separate line
|
||||
- Follow title standard `Module - Add|Fix|Improve|Change|Remove things`
|
33
.github/release_drafter.yml
vendored
Normal file
33
.github/release_drafter.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
branches:
|
||||
- master
|
||||
|
||||
name-template: "xpdb_v$NEXT_PATCH_VERSION"
|
||||
tag-template: "$NEXT_PATCH_VERSION"
|
||||
|
||||
categories:
|
||||
- title: "**ADDED:**"
|
||||
labels:
|
||||
- "feature"
|
||||
- title: "**FIXED:**"
|
||||
labels:
|
||||
- "bug fix"
|
||||
- title: "**IMPROVED:**"
|
||||
labels:
|
||||
- "enhancement"
|
||||
- title: "**CHANGED:**"
|
||||
labels:
|
||||
- "cleanup"
|
||||
|
||||
exclude-labels:
|
||||
- "ignore changelog"
|
||||
|
||||
change-template: "- $TITLE (#$NUMBER)"
|
||||
template: |
|
||||
## Change Log Summary
|
||||
|
||||
$CHANGES
|
||||
|
||||
replacers:
|
||||
# Category titles
|
||||
- search: '/\#\# (\*\*(ADDED|FIXED|IMPROVED|CHANGED):\*\*)/g'
|
||||
replace: "$1"
|
50
.github/workflows/build.yml
vendored
Normal file
50
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
paths-ignore:
|
||||
- ".github/**"
|
||||
- "addons/main/script_version.hpp"
|
||||
- "docs/**"
|
||||
- "tools/**"
|
||||
- "LICENSE"
|
||||
- "README.md"
|
||||
- "*.json"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Bump Version
|
||||
id: bump-version
|
||||
run: python3 tools/version_bumper.py increment_build push_commit
|
||||
|
||||
- name: Setup HEMTT
|
||||
uses: arma-actions/hemtt@v1
|
||||
|
||||
- name: Run HEMTT build
|
||||
run: hemtt release
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: 'stable'
|
||||
|
||||
- name: Initialize or Update Go module
|
||||
run: |
|
||||
if [ ! -f go.mod ]; then
|
||||
go mod init gitea.innovativedevsolutions.org/IDSolutions/xpdb
|
||||
fi
|
||||
go get code.gitea.io/sdk/gitea
|
||||
|
||||
- name: Run Release Action
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
VERSION: ${{ steps.bump-version.outputs.VERSION }}
|
||||
run: go run main.go
|
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
*.pbo
|
||||
.hemttout
|
||||
hemtt
|
||||
hemtt.exe
|
||||
*.biprivatekey
|
||||
*.7z
|
14
.hemtt/project.toml
Normal file
14
.hemtt/project.toml
Normal file
@ -0,0 +1,14 @@
|
||||
name = "eXtended Persistent DB"
|
||||
author = "J. Schmidt"
|
||||
prefix = "xpdb"
|
||||
mainprefix = "z"
|
||||
|
||||
[files]
|
||||
include = [
|
||||
"xpdb_version.json",
|
||||
"*.paa",
|
||||
"missionTemplate/**/*",
|
||||
]
|
||||
|
||||
[version]
|
||||
git_hash = 0 # Disabled
|
119
LICENSE
Normal file
119
LICENSE
Normal file
@ -0,0 +1,119 @@
|
||||
Copyright (c) {YEAR} {AUTHOR}
|
||||
|
||||
Brief summary of this Licence
|
||||
|
||||
PLEASE, NOTE THAT THIS SUMMARY HAS NO LEGAL EFFECT AND IS ONLY OF AN INFORMATORY NATURE DESIGNED FOR YOU TO GET THE BASIC INFORMATION ABOUT THE CONTENT OF THIS LICENCE. THE ONLY LEGALLY BINDING PROVISIONS ARE THOSE IN THE ORIGINAL AND FULL TEXT OF THIS LICENCE.
|
||||
|
||||
With this licence you are free to adapt (i.e. modify, rework or update) and share (i.e. copy, distribute or transmit) the material under the following conditions:
|
||||
|
||||
Attribution - You must attribute the material in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the material).
|
||||
Noncommercial - You may not use this material for any commercial purposes.
|
||||
Arma Only - You may not convert or adapt this material to be used in other games than Arma.
|
||||
Share Alike - If you adapt, or build upon this material, you may distribute the resulting material only under the same license.
|
||||
|
||||
Full version of licence
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Arma Public License - Share Alike ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
|
||||
Section 1 – Definitions
|
||||
|
||||
Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
|
||||
Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
|
||||
ArmaOnly means primarily intended for or directed towards the use in any of existing and future Arma games, including but not limited to Arma: Cold War Assault, Arma, Arma 2 and Arma 3 and its official sequels and expansion packs.
|
||||
Arma Public Share Alike Compatible License means a license listed at https://www.bohemia.net/community/licenses as essentially the equivalent of this Public License.
|
||||
Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
|
||||
Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
|
||||
Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
|
||||
Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
|
||||
Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
|
||||
Licensor means the individual(s) or entity(ies) granting rights under this Public License.
|
||||
NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
|
||||
Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
|
||||
Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
|
||||
You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
|
||||
|
||||
Section 2 – Scope
|
||||
|
||||
License grant
|
||||
Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
|
||||
reproduce and Share the Licensed Material, in whole or in part, for NonCommercial and ArmaOnly purposes only; and
|
||||
produce, reproduce, and Share Adapted Material for NonCommercial and ArmaOnly purposes only.
|
||||
Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
|
||||
Term. The term of this Public License is specified in Section 6(a).
|
||||
Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
|
||||
Downstream recipients.
|
||||
Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
|
||||
Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.
|
||||
No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
|
||||
No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(a)(i).
|
||||
Other rights
|
||||
Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
|
||||
Patent and trademark rights are not licensed under this Public License.
|
||||
To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial and ArmaOnly purposes.
|
||||
|
||||
Section 3 – License Conditions
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
|
||||
|
||||
Attribution
|
||||
|
||||
If You Share the Licensed Material (including in modified form), You must:
|
||||
retain the following if it is supplied by the Licensor with the Licensed Material:
|
||||
identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
|
||||
a copyright notice;
|
||||
a notice that refers to this Public License;
|
||||
a notice that refers to the disclaimer of warranties;
|
||||
a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
|
||||
indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
|
||||
indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
|
||||
You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
|
||||
If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(a) to the extent reasonably practicable.
|
||||
ShareAlike
|
||||
|
||||
In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
|
||||
The Adapter’s License You apply must be this Public License, or an Arma Public Share Alike Compatible License.
|
||||
You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
|
||||
You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
|
||||
|
||||
Section 4 – Sui Generis Database Rights
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
|
||||
|
||||
for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial and ArmaOnly purposes only;
|
||||
if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
|
||||
You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
|
||||
Section 5 – Disclaimer of Warranties and Limitation of Liability
|
||||
|
||||
Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
|
||||
To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
|
||||
The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
|
||||
|
||||
Section 6 – Term and Termination
|
||||
|
||||
This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
|
||||
|
||||
Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
|
||||
automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
|
||||
upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
|
||||
For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
|
||||
Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
|
||||
|
||||
Section 7 – Other Terms and Conditions
|
||||
|
||||
The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
|
||||
Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
|
||||
|
||||
Section 8 – Interpretation
|
||||
|
||||
For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
|
||||
To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
|
||||
No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
|
||||
Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
|
||||
|
||||
Bohemia Interactive Notices
|
||||
|
||||
Bohemia Interactive a.s. is not a party to this License, and makes no warranty whatsoever in connection with the Licensed Material. Bohemia Interactive a.s. will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, Bohemia Interactive a.s. may elect to apply the Public License to material it publishes and in those instances it becomes the "Licensor".
|
||||
Except for the limited purpose of indicating to the public that the Licensed Material is shared under this Public License, Bohemia Interactive a.s. does not authorize the use by either party of the trademarks "Arma", "Bohemia Interactive" or any related trademark or logo of Arma or Bohemia Interactive without the prior written consent of Bohemia Interactive a.s.
|
66
README.md
Normal file
66
README.md
Normal file
@ -0,0 +1,66 @@
|
||||
# eXtended Persistent DB
|
||||
|
||||

|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/jschmidt92/eXtendedPersistentDB/releases/latest">
|
||||
<img src="https://img.shields.io/github/v/release/jschmidt92/eXtendedPersistentDB?label=latest%20release" alt="latest-release">
|
||||
</a>
|
||||
<a href="https://github.com/jschmidt92/eXtendedPersistentDB/issues">
|
||||
<img src="https://img.shields.io/github/issues/jschmidt92/eXtendedPersistentDB" alt="open-issues">
|
||||
</a>
|
||||
<a href="https://github.com/jschmidt92/eXtendedPersistentDB/actions/workflows/build.yml">
|
||||
<img src="https://img.shields.io/github/actions/workflow/status/jschmidt92/eXtendedPersistentDB/build.yml?branch=master" alt="build-status">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## Description
|
||||
|
||||
eXtended Persistent DB is the mod version of [Arma Persistent Core System](https://github.com/NikolaiF90/ArmaPersistentCoreSystem)
|
||||
|
||||
## Features
|
||||
|
||||
- Persist vehicle position, rotation, crew, turret and etc.
|
||||
- Persist player units alongside team member.
|
||||
- Persist environment information like overcast, date and time.
|
||||
- Persist all map markers including player placed markers.
|
||||
- Configure mod to save according to your preferences
|
||||
|
||||
## Installation
|
||||
|
||||
- Download the latest release from the [releases](https://github.com/jschmidt92/eXtendedPersistentDB/releases) page.
|
||||
- Extract @xpdb from the zip file and paste it into your Arma 3 folder and activate it within the Arma 3 Launcher.
|
||||
|
||||
## Usage
|
||||
|
||||
- Open 3DEN Mission Editor.
|
||||
- If you already have an init.sqf and an initPlayerLocal.sqf, paste the following into the init.sqf <br/> `Scenario_Name = "NameOfYourScenario";` and then `[] call xpdb_db_fnc_init;` into the initPlayerLocal.sqf.
|
||||
- From here you are pretty much done. You don't need to edit anything else.
|
||||
- Start the mission and use mouse scroll wheel to reveal the save action.
|
||||
- If you want to implement your own save configuration check out the `missionTemplate` to see how it's done.
|
||||
|
||||
$${\color{red}Important: \space Please \space read \space this \space message \space carefully!}$$
|
||||
<br/>_eXtended Persistent DB_ saves/loads everything via `hashMaps`, for more info on `hashMaps` check out the [BIS Wiki](https://community.bistudio.com/wiki/HashMap)
|
||||
|
||||
## Contributing
|
||||
|
||||
- Fork the repository.
|
||||
- Create a branch for your changes.
|
||||
- Create a pull request.
|
||||
|
||||
## License
|
||||
|
||||
[](https://www.bohemia.net/community/licenses/arma-public-license-share-alike)
|
||||
|
||||
With this license you are free to adapt (i.e. modify, rework or update) and share (i.e. copy, distribute or transmit) the material under the following conditions:
|
||||
|
||||
- Attribution - You must attribute the material in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the material).
|
||||
- Noncommercial - You may not use this material for any commercial purposes.
|
||||
- Arma Only - You may not convert or adapt this material to be used in other games than Arma.
|
||||
- Share Alike - If you adapt, or build upon this material, you may distribute the resulting material only under the same license.
|
||||
|
||||
## Credits
|
||||
|
||||
- [NikolaiF90 (PrinceF90)](https://github.com/NikolaiF90)
|
||||
- [Sukhoi191](https://gitlab.com/sukhoi191)
|
||||
- [Jacob Schmidt](https://github.com/jschmidt92)
|
1
addons/core/$PBOPREFIX$
Normal file
1
addons/core/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\xpdb\addons\core
|
19
addons/core/CfgEventHandlers.hpp
Normal file
19
addons/core/CfgEventHandlers.hpp
Normal 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));
|
||||
};
|
||||
};
|
3
addons/core/XEH_PREP.hpp
Normal file
3
addons/core/XEH_PREP.hpp
Normal file
@ -0,0 +1,3 @@
|
||||
PREP(clearSave);
|
||||
PREP(loadData);
|
||||
PREP(saveData);
|
1
addons/core/XEH_postInit.sqf
Normal file
1
addons/core/XEH_postInit.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
1
addons/core/XEH_postInit_client.sqf
Normal file
1
addons/core/XEH_postInit_client.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
8
addons/core/XEH_preInit.sqf
Normal file
8
addons/core/XEH_preInit.sqf
Normal file
@ -0,0 +1,8 @@
|
||||
#include "script_component.hpp"
|
||||
ADDON = false;
|
||||
|
||||
PREP_RECOMPILE_START;
|
||||
#include "XEH_PREP.hpp"
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
ADDON = true;
|
1
addons/core/XEH_preInit_server.sqf
Normal file
1
addons/core/XEH_preInit_server.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
2
addons/core/XEH_preStart.sqf
Normal file
2
addons/core/XEH_preStart.sqf
Normal file
@ -0,0 +1,2 @@
|
||||
#include "script_component.hpp"
|
||||
#include "XEH_PREP.hpp"
|
16
addons/core/config.cpp
Normal file
16
addons/core/config.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"xpdb_main"};
|
||||
authors[] = {"J. Schmidt", "NikolaiF90"};
|
||||
author = "J. Schmidt";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
47
addons/core/functions/fnc_clearSave.sqf
Normal file
47
addons/core/functions/fnc_clearSave.sqf
Normal file
@ -0,0 +1,47 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_core_fnc_clearSave
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Remove all saved data for given slot.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: ID of Slot <SCALAR> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_core_fnc_clearSave
|
||||
* [1] call xpdb_core_fnc_clearSave
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_slot", 0, [0]]];
|
||||
|
||||
[EGVAR(db,debug), "xpdb_core_fnc_clearSave", "Clearing save...", true] call EFUNC(utils,debug);
|
||||
|
||||
if (isNil "_slot") then {
|
||||
[EGVAR(db,debug), "xpdb_core_fnc_clearSave", "Clearing all saves.", true] call EFUNC(utils,debug);
|
||||
{
|
||||
if (_x select [0, 16] == "xpdb_armadbcore.") then { missionProfileNamespace setVariable [_x, nil] };
|
||||
} forEach (allVariables missionProfileNamespace);
|
||||
} else {
|
||||
[EGVAR(db,debug), "xpdb_core_fnc_clearSave", format ["Clearing save for slot '%1'.", _slot], true] call EFUNC(utils,debug);
|
||||
{
|
||||
if (_x select [0, 17] == format ["xpdb_armadbcore.%1", _slot]) then { missionProfileNamespace setVariable [_x, nil] };
|
||||
} forEach (allVariables missionProfileNamespace);
|
||||
};
|
||||
|
||||
saveMissionProfileNamespace;
|
50
addons/core/functions/fnc_loadData.sqf
Normal file
50
addons/core/functions/fnc_loadData.sqf
Normal file
@ -0,0 +1,50 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_core_fnc_loadData
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Save data in missionProfileNamespace using specified key, value, and slot.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Name of key <STRING|ARRAY> (default: "")
|
||||
* - 0: Name of key <STRING>
|
||||
* - 1: Default Value if isNil key <ARRAY|STRING|SCALAR|BOOL>
|
||||
* 2: Slot number to save value to <SCALAR> (default: 0)
|
||||
*
|
||||
* Return Value:
|
||||
* The return value <ARRAY|STRING|SCALAR|BOOL|HASHMAP>
|
||||
*
|
||||
* Examples:
|
||||
* ["name", 1] call xpdb_core_fnc_loadData
|
||||
* [["name", name player], 1] call xpdb_core_fnc_loadData
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_key", "", [[], ""]], ["_slot", 0, [0]]];
|
||||
|
||||
private _return = [];
|
||||
|
||||
if (_key isEqualType "") then {
|
||||
private _result = format ["%1.%2.%3", EGVAR(db,prefix), _slot, _key];
|
||||
_return = missionProfileNamespace getVariable _result;
|
||||
};
|
||||
|
||||
if (_key isEqualType []) then {
|
||||
private _result = format ["%1.%2.%3", EGVAR(db,prefix), _slot, _key # 0];
|
||||
_return = missionProfileNamespace getVariable [_result, _key # 1];
|
||||
};
|
||||
|
||||
[EGVAR(db,debug), "xpdb_core_fnc_loadData", format ["Key loaded '%1'.", _key], true] call EFUNC(utils,debug);
|
||||
|
||||
_return;
|
53
addons/core/functions/fnc_saveData.sqf
Normal file
53
addons/core/functions/fnc_saveData.sqf
Normal file
@ -0,0 +1,53 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_core_fnc_saveData
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Save data in missionProfileNamespace using specified key, value, and slot.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Name of key <STRING> (default: "")
|
||||
* 1: Value to save in key <ARRAY|STRING|SCALAR|BOOL|HASHMAP> (default: "")
|
||||
* 2: Slot number to save value to <SCALAR> (default: 0)
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* ["name", name player, 1] call xpdb_core_fnc_saveData
|
||||
* ["rating", rating player, 2] call xpdb_core_fnc_saveData
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_key", "", [""]], ["_value", "", [[], 0, "", false, createHashMap]], ["_slot", 0, [0]]];
|
||||
|
||||
private _hashKey = format ["%1.%2.%3", EGVAR(db,prefix), _slot, _key];
|
||||
private _hashMap = createHashMap;
|
||||
|
||||
if (_value isEqualType createHashMap) then {
|
||||
_hashMap = _value;
|
||||
};
|
||||
|
||||
if (_value isEqualType []) then {
|
||||
_hashMap = createHashMapFromArray _value
|
||||
};
|
||||
|
||||
if (!(_value isEqualType createHashMap) && !(_value isEqualType []) && !(_value isEqualTo createHashMap)) then {
|
||||
_hashMap set [_key, _value];
|
||||
};
|
||||
|
||||
_hashMap set ["hashKey", _hashKey];
|
||||
|
||||
missionProfileNamespace setVariable [_hashKey, _hashMap];
|
||||
[EGVAR(db,debug), "xpdb_core_fnc_saveData", format ["Saved data to '%1'.", _hashKey], true] call EFUNC(utils,debug);
|
1
addons/core/functions/script_component.hpp
Normal file
1
addons/core/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "..\script_component.hpp"
|
15
addons/core/script_component.hpp
Normal file
15
addons/core/script_component.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#define COMPONENT core
|
||||
#define COMPONENT_BEAUTIFIED Core
|
||||
#include "..\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
#define DISABLE_COMPILE_CACHE
|
||||
|
||||
#ifdef DEBUG_ENABLED_CORE
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
#ifdef DEBUG_SETTINGS_CORE
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_CORE
|
||||
#endif
|
||||
|
||||
#include "..\main\script_macros.hpp"
|
1
addons/db/$PBOPREFIX$
Normal file
1
addons/db/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\xpdb\addons\db
|
19
addons/db/CfgEventHandlers.hpp
Normal file
19
addons/db/CfgEventHandlers.hpp
Normal 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));
|
||||
};
|
||||
};
|
10
addons/db/XEH_PREP.hpp
Normal file
10
addons/db/XEH_PREP.hpp
Normal file
@ -0,0 +1,10 @@
|
||||
PREP(config);
|
||||
PREP(deleteSlot);
|
||||
PREP(getSelectedList);
|
||||
PREP(init);
|
||||
PREP(loadFromSlot);
|
||||
PREP(makePersistent);
|
||||
PREP(openPersistentTab);
|
||||
PREP(saveTarget);
|
||||
PREP(saveToSlot);
|
||||
PREP(updatePersistentList);
|
1
addons/db/XEH_postInit.sqf
Normal file
1
addons/db/XEH_postInit.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
1
addons/db/XEH_postInit_client.sqf
Normal file
1
addons/db/XEH_postInit_client.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
8
addons/db/XEH_preInit.sqf
Normal file
8
addons/db/XEH_preInit.sqf
Normal file
@ -0,0 +1,8 @@
|
||||
#include "script_component.hpp"
|
||||
ADDON = false;
|
||||
|
||||
PREP_RECOMPILE_START;
|
||||
#include "XEH_PREP.hpp"
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
ADDON = true;
|
1
addons/db/XEH_preInit_server.sqf
Normal file
1
addons/db/XEH_preInit_server.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
2
addons/db/XEH_preStart.sqf
Normal file
2
addons/db/XEH_preStart.sqf
Normal file
@ -0,0 +1,2 @@
|
||||
#include "script_component.hpp"
|
||||
#include "XEH_PREP.hpp"
|
18
addons/db/config.cpp
Normal file
18
addons/db/config.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"xpdb_main"};
|
||||
authors[] = {"J. Schmidt", "NikolaiF90"};
|
||||
author = "J. Schmidt";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "ui\RscCommon.hpp"
|
||||
#include "ui\RscPersistentMenu.hpp"
|
48
addons/db/functions/fnc_config.sqf
Normal file
48
addons/db/functions/fnc_config.sqf
Normal file
@ -0,0 +1,48 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_db_fnc_config
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Configuration for XPDB_ARMADBCORE.
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_db_fnc_config
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
EGVAR(db,debug) = ["DEBUG_MODE", 0] call BFUNC(getParamValue);
|
||||
if (EGVAR(db,debug) == 1) then { EGVAR(db,debug) = true; } else { EGVAR(db,debug) = false; };
|
||||
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_config", format ["Configuring '%1'...", Scenario_Name], true] call EFUNC(utils,debug);
|
||||
|
||||
EGVAR(db,host) = player;
|
||||
EGVAR(db,prefix) = "XPDB_ARMAEXPDB";
|
||||
EGVAR(db,saveInterval) = 600;
|
||||
|
||||
EGVAR(db,conts) = [];
|
||||
EGVAR(db,slots) = [];
|
||||
EGVAR(db,vars) = [];
|
||||
EGVAR(db,vehs) = [];
|
||||
|
||||
EGVAR(db,native) = ["NATIVE_MODE", 1] call BFUNC(getParamValue);
|
||||
if (EGVAR(db,native) == 1) then { EGVAR(db,native) = true; } else { EGVAR(db,native) = false; };
|
||||
|
||||
EGVAR(db,configDone) = true;
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_config", format ["Finished configuring '%1'.", Scenario_Name], true] call EFUNC(utils,debug);
|
41
addons/db/functions/fnc_deleteSlot.sqf
Normal file
41
addons/db/functions/fnc_deleteSlot.sqf
Normal file
@ -0,0 +1,41 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_db_fnc_deleteSlot
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Delete selected item from a persistent list and update missionProfileNamespace.
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_db_fnc_deleteSlot
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
EGVAR(db,selectedList) = [EGVAR(db,listBox)] call DFUNC(getSelectedList);
|
||||
|
||||
if (EGVAR(db,selectedList) != 0) then {
|
||||
private _deletedItem = EGVAR(db,slots) deleteAt EGVAR(db,selectedList);
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_deleteSlot", format ["Deleted %1 from persistent list.", _deletedItem], false] call EFUNC(utils,debug);
|
||||
|
||||
[EGVAR(db,selectedList)] call EFUNC(core,clearSave);
|
||||
profileNamespace setVariable [QEGVAR(db,pListKey), EGVAR(db,slots)];
|
||||
[EGVAR(db,listBox)] call DFUNC(updatePersistentList);
|
||||
} else {
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_deleteSlot", "Can not delete empty slot.", false] call EFUNC(utils,debug);
|
||||
};
|
36
addons/db/functions/fnc_getSelectedList.sqf
Normal file
36
addons/db/functions/fnc_getSelectedList.sqf
Normal file
@ -0,0 +1,36 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_db_fnc_getSelectedList
|
||||
* Author: NikolaiF90, NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, NikolaiF90, 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]
|
||||
* Return the index of the currently selected item of the listbox with the idc.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The idc of the listbox <SCALAR> (default: 0)
|
||||
*
|
||||
* Return Value:
|
||||
* The return <SCALAR>
|
||||
*
|
||||
* Examples:
|
||||
* [1106] call xpdb_db_fnc_getSelectedList
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_idc", 0, [0]]];
|
||||
|
||||
_selected = lbCurSel _idc;
|
||||
|
||||
if (_selected == -1) then { _selected = 0 };
|
||||
|
||||
_selected;
|
43
addons/db/functions/fnc_init.sqf
Normal file
43
addons/db/functions/fnc_init.sqf
Normal file
@ -0,0 +1,43 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_db_fnc_init
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Initialize the framework.
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_db_fnc_init
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
[true, "xpdb_db_fnc_init", format ["Starting '%1'...", Scenario_Name], false] call EFUNC(utils,debug);
|
||||
|
||||
EGVAR(db,configDone) = false;
|
||||
[] call DFUNC(config);
|
||||
waitUntil { EGVAR(db,configDone) };
|
||||
|
||||
EGVAR(db,defaultSlots) = ["Empty Slot"];
|
||||
|
||||
// Keys
|
||||
EGVAR(db,pListKey) = Scenario_Name + "_pList";
|
||||
EGVAR(db,contIDKey) = "Save_CQueueID";
|
||||
EGVAR(db,vehIDKey) = "Save_VQueueID";
|
||||
|
||||
EGVAR(db,host) addAction ["<t color='#0089f2'>Persistent</t>", { [] call DFUNC(openPersistentTab); }];
|
38
addons/db/functions/fnc_loadFromSlot.sqf
Normal file
38
addons/db/functions/fnc_loadFromSlot.sqf
Normal file
@ -0,0 +1,38 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_db_fnc_loadFromSlot
|
||||
* Author: NikolaiF90, NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, NikolaiF90, 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]
|
||||
* Load save from slot.
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_db_fnc_loadFromSlot
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
EGVAR(db,selectedList) = [EGVAR(db,listBox)] call DFUNC(getSelectedList);
|
||||
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_loadFromSlot", "Loading progress...", false] call EFUNC(utils,debug);
|
||||
|
||||
if (EGVAR(db,selectedList) != 0) then {
|
||||
[EGVAR(db,selectedList)] call EFUNC(load,game);
|
||||
} else {
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_loadFromSlot", "Empty slot selected. Nothing to load from here.", false] call EFUNC(utils,debug);
|
||||
};
|
44
addons/db/functions/fnc_makePersistent.sqf
Normal file
44
addons/db/functions/fnc_makePersistent.sqf
Normal file
@ -0,0 +1,44 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_db_fnc_makePersistent
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Manage the persistence of an object.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object to persist <OBJECT> (default: 0)
|
||||
* 1: Array to store object <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [_container, EGVAR(db,db_containers)] call xpdb_db_fnc_makePersistent
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_object", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_array", [], [[]]]];
|
||||
|
||||
if (isNil "_object" || isNull _object) exitWith { [EGVAR(db,debug), "xpdb_db_fnc_makePersistent", "No object to make persistent.", true] call EFUNC(utils,debug); };
|
||||
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_makePersistent", format ["Processing '%1' persistence...", _object], true] call EFUNC(utils,debug);
|
||||
|
||||
private _objectID = _array find _object;
|
||||
|
||||
if (_objectID == -1) then {
|
||||
_array pushback _object;
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_makePersistent", format ["'%1' is now persistent.", _object], true] call EFUNC(utils,debug);
|
||||
} else {
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_makePersistent", format ["'%1' is already persistent.", _object], true] call EFUNC(utils,debug);
|
||||
};
|
49
addons/db/functions/fnc_openPersistentTab.sqf
Normal file
49
addons/db/functions/fnc_openPersistentTab.sqf
Normal file
@ -0,0 +1,49 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_db_fnc_openPersistentTab
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Opens and setup the persistent tab.
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_db_fnc_openPersistentTab
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
[EGVAR(db,debug), "openPersistentTab", format ["'%1' opened Persistent Tab.", EGVAR(db,host)], false] call xpdb_utils_fnc_debug;
|
||||
|
||||
createDialog "RscPersistentMenu";
|
||||
|
||||
// Tab ID
|
||||
EGVAR(db,listBox) = 1102;
|
||||
EGVAR(db,saveButton) = 1103;
|
||||
EGVAR(db,loadButton) = 1104;
|
||||
EGVAR(db,deleteButton) = 1105;
|
||||
EGVAR(db,scenarioNameText) = 1106;
|
||||
EGVAR(db,saveVehicleButton) = 1107;
|
||||
|
||||
// Update Scenario Name
|
||||
ctrlSetText [EGVAR(db,scenarioNameText), Scenario_Name];
|
||||
|
||||
// Update List Box
|
||||
[EGVAR(db,listBox)] call DFUNC(updatePersistentList);
|
||||
|
||||
// Tab Variables
|
||||
EGVAR(db,selectedList) = [EGVAR(db,listBox)] call DFUNC(getSelectedList);
|
54
addons/db/functions/fnc_saveTarget.sqf
Normal file
54
addons/db/functions/fnc_saveTarget.sqf
Normal file
@ -0,0 +1,54 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_db_fnc_saveTarget
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Check if the cursorTarget is a vehicle or container and add it to the save queue.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Type of target <SCALAR> (default: 0)
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_db_fnc_saveTarget
|
||||
* [1] call xpdb_db_fnc_saveTarget
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_typeOfTarget", nil, [0]]];
|
||||
|
||||
private _cursorTarget = cursorTarget;
|
||||
private _objectToSave = objNull;
|
||||
|
||||
switch (_typeOfTarget) do {
|
||||
case 0: {
|
||||
if (_cursorTarget isKindOf "Air" || _cursorTarget isKindOf "LandVehicle" || _cursorTarget isKindOf "Ship") then {
|
||||
_objectToSave = _cursorTarget;
|
||||
[_objectToSave] call EFUNC(generate,vehicleID);
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_saveTarget", format ["Added '%1' to save queue", _cursorTarget], true] call EFUNC(utils,debug);
|
||||
} else {
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_saveTarget", format ["Target '%1' is not a vehicle", _cursorTarget], true] call EFUNC(utils,debug);
|
||||
};
|
||||
};
|
||||
case 1: {
|
||||
_objectToSave = _cursorTarget;
|
||||
[_objectToSave] call EFUNC(generate,containerID);
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_saveTarget", format ["Added '%1' to save queue", _cursorTarget], true] call EFUNC(utils,debug);
|
||||
};
|
||||
default {
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_saveTarget", format ["Unknown type of target '%1'", _typeOfTarget], true] call EFUNC(utils,debug);
|
||||
};
|
||||
};
|
54
addons/db/functions/fnc_saveToSlot.sqf
Normal file
54
addons/db/functions/fnc_saveToSlot.sqf
Normal file
@ -0,0 +1,54 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_db_fnc_saveToSlot
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Save or update data for specified slot.
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_db_fnc_saveToSlot
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
EGVAR(db,selectedList) = [EGVAR(db,listBox)] call DFUNC(getSelectedList);
|
||||
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_saveToSlot", "Generating save...", false] call EFUNC(utils,debug);
|
||||
|
||||
private _saveDate = [] call EFUNC(generate,dateData);
|
||||
private _saveName = format ["'%1' saved on, '%2'", Scenario_Name, _saveDate];
|
||||
private _saveSlot = 0;
|
||||
|
||||
if (EGVAR(db,selectedList) == 0) then {
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_saveToSlot", "Creating a new save slot...", false] call EFUNC(utils,debug);
|
||||
EGVAR(db,slots) pushBack _saveName;
|
||||
_saveSlot = (count EGVAR(db,slots)) -1;
|
||||
} else {
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_saveToSlot", format ["Saving to slot '%1'", EGVAR(db,selectedList)], false] call EFUNC(utils,debug);
|
||||
EGVAR(db,slots) set [EGVAR(db,selectedList), _saveName];
|
||||
_saveSlot = EGVAR(db,selectedList);
|
||||
};
|
||||
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_saveToSlot", "Now saving...", false] call EFUNC(utils,debug);
|
||||
[_saveSlot] call EFUNC(save,game);
|
||||
|
||||
profileNamespace setVariable [QEGVAR(db,pListKey), EGVAR(db,slots)];
|
||||
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_saveToSlot", "Progress saved.", false] call EFUNC(utils,debug);
|
||||
[EGVAR(db,listBox)] call DFUNC(updatePersistentList);
|
56
addons/db/functions/fnc_updatePersistentList.sqf
Normal file
56
addons/db/functions/fnc_updatePersistentList.sqf
Normal file
@ -0,0 +1,56 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_db_fnc_updatePersistentList
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Update list with save slots.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: IDC of list box <SCALAR> (default: -1)
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_db_fnc_updatePersistentList
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_listID", -1, [0]]];
|
||||
|
||||
if !(_listID > -1) exitWith { [EGVAR(db,debug), "xpdb_db_fnc_updatePersistentList", format ["Invalid input for listID '%1'.", _listID], false] call EFUNC(utils,debug); };
|
||||
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_updatePersistentList", "Updating persistent slots...", true] call EFUNC(utils,debug);
|
||||
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_updatePersistentList", "Clearing slots...", false] call EFUNC(utils,debug);
|
||||
lbClear _listID;
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_updatePersistentList", "Cleared slots.", false] call EFUNC(utils,debug);
|
||||
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_updatePersistentList", "Loading slots from profileNamespace...", false] call EFUNC(utils,debug);
|
||||
private _slotArray = profileNamespace getVariable ["xpdb_db_pListKey", EGVAR(db,slots)];
|
||||
|
||||
if (isNil "_slotArray" || count _slotArray <= 1) then {
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_updatePersistentList", "No saves found, using default slot instead.", false] call EFUNC(utils,debug);
|
||||
EGVAR(db,slots) = EGVAR(db,defaultSlots);
|
||||
} else {
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_updatePersistentList", "Saves found. Now populating list with save slots.", false] call EFUNC(utils,debug);
|
||||
EGVAR(db,slots) = _slotArray;
|
||||
};
|
||||
|
||||
{
|
||||
lbAdd [_listID, _x];
|
||||
true
|
||||
} count (EGVAR(db,slots));
|
||||
|
||||
[EGVAR(db,debug), "xpdb_db_fnc_updatePersistentList", "Persistent tab updated.", true] call EFUNC(utils,debug);
|
1
addons/db/functions/script_component.hpp
Normal file
1
addons/db/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "..\script_component.hpp"
|
15
addons/db/script_component.hpp
Normal file
15
addons/db/script_component.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#define COMPONENT db
|
||||
#define COMPONENT_BEAUTIFIED DB
|
||||
#include "..\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
#define DISABLE_COMPILE_CACHE
|
||||
|
||||
#ifdef DEBUG_ENABLED_DB
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
#ifdef DEBUG_SETTINGS_DB
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_DB
|
||||
#endif
|
||||
|
||||
#include "..\main\script_macros.hpp"
|
289
addons/db/ui/RscCommon.hpp
Normal file
289
addons/db/ui/RscCommon.hpp
Normal file
@ -0,0 +1,289 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/// Styles
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Control types
|
||||
#define CT_STATIC 0
|
||||
#define CT_BUTTON 1
|
||||
#define CT_EDIT 2
|
||||
#define CT_SLIDER 3
|
||||
#define CT_COMBO 4
|
||||
#define CT_LISTBOX 5
|
||||
#define CT_TOOLBOX 6
|
||||
#define CT_CHECKBOXES 7
|
||||
#define CT_PROGRESS 8
|
||||
#define CT_HTML 9
|
||||
#define CT_STATIC_SKEW 10
|
||||
#define CT_ACTIVETEXT 11
|
||||
#define CT_TREE 12
|
||||
#define CT_STRUCTURED_TEXT 13
|
||||
#define CT_CONTEXT_MENU 14
|
||||
#define CT_CONTROLS_GROUP 15
|
||||
#define CT_SHORTCUTBUTTON 16
|
||||
#define CT_HITZONES 17
|
||||
#define CT_XKEYDESC 40
|
||||
#define CT_XBUTTON 41
|
||||
#define CT_XLISTBOX 42
|
||||
#define CT_XSLIDER 43
|
||||
#define CT_XCOMBO 44
|
||||
#define CT_ANIMATED_TEXTURE 45
|
||||
#define CT_OBJECT 80
|
||||
#define CT_OBJECT_ZOOM 81
|
||||
#define CT_OBJECT_CONTAINER 82
|
||||
#define CT_OBJECT_CONT_ANIM 83
|
||||
#define CT_LINEBREAK 98
|
||||
#define CT_USER 99
|
||||
#define CT_MAP 100
|
||||
#define CT_MAP_MAIN 101
|
||||
#define CT_LISTNBOX 102
|
||||
#define CT_ITEMSLOT 103
|
||||
#define CT_CHECKBOX 77
|
||||
|
||||
// Static styles
|
||||
#define ST_POS 0x0F
|
||||
#define ST_HPOS 0x03
|
||||
#define ST_VPOS 0x0C
|
||||
#define ST_LEFT 0x00
|
||||
#define ST_RIGHT 0x01
|
||||
#define ST_CENTER 0x02
|
||||
#define ST_DOWN 0x04
|
||||
#define ST_UP 0x08
|
||||
#define ST_VCENTER 0x0C
|
||||
|
||||
#define ST_TYPE 0xF0
|
||||
#define ST_SINGLE 0x00
|
||||
#define ST_MULTI 0x10
|
||||
#define ST_TITLE_BAR 0x20
|
||||
#define ST_PICTURE 0x30
|
||||
#define ST_FRAME 0x40
|
||||
#define ST_BACKGROUND 0x50
|
||||
#define ST_GROUP_BOX 0x60
|
||||
#define ST_GROUP_BOX2 0x70
|
||||
#define ST_HUD_BACKGROUND 0x80
|
||||
#define ST_TILE_PICTURE 0x90
|
||||
#define ST_WITH_RECT 0xA0
|
||||
#define ST_LINE 0xB0
|
||||
#define ST_UPPERCASE 0xC0
|
||||
#define ST_LOWERCASE 0xD0
|
||||
|
||||
#define ST_SHADOW 0x100
|
||||
#define ST_NO_RECT 0x200
|
||||
#define ST_KEEP_ASPECT_RATIO 0x800
|
||||
|
||||
// Slider styles
|
||||
#define SL_DIR 0x400
|
||||
#define SL_VERT 0
|
||||
#define SL_HORZ 0x400
|
||||
|
||||
#define SL_TEXTURES 0x10
|
||||
|
||||
// progress bar
|
||||
#define ST_VERTICAL 0x01
|
||||
#define ST_HORIZONTAL 0
|
||||
|
||||
// Listbox styles
|
||||
#define LB_TEXTURES 0x10
|
||||
#define LB_MULTI 0x20
|
||||
|
||||
// Tree styles
|
||||
#define TR_SHOWROOT 1
|
||||
#define TR_AUTOCOLLAPSE 2
|
||||
|
||||
#define GUI_GRID_CENTERLEFT_X GUI_GRID_X
|
||||
#define GUI_GRID_CENTERLEFT_Y GUI_GRID_CENTER_Y
|
||||
#define GUI_GRID_CENTERLEFT_W GUI_GRID_W
|
||||
#define GUI_GRID_CENTERLEFT_H GUI_GRID_H
|
||||
|
||||
#define GUI_GRID_TOPRIGHT_X (safeZoneX + safeZoneW - GUI_GRID_WAbs)
|
||||
#define GUI_GRID_TOPRIGHT_Y (safeZoneX)
|
||||
#define GUI_GRID_TOPRIGHT_W GUI_GRID_W
|
||||
#define GUI_GRID_TOPRIGHT_H GUI_GRID_H
|
||||
|
||||
#define GUI_GRID_CENTERRIGHT_X GUI_GRID_TOPRIGHT_X
|
||||
#define GUI_GRID_CENTERRIGHT_Y GUI_GRID_CENTER_Y
|
||||
#define GUI_GRID_CENTERRIGHT_W GUI_GRID_W
|
||||
#define GUI_GRID_CENTERRIGHT_H GUI_GRID_H
|
||||
|
||||
#define GUI_GRID_BOTTOMRIGHT_X GUI_GRID_TOPRIGHT_X
|
||||
#define GUI_GRID_BOTTOMRIGHT_Y GUI_GRID_Y
|
||||
#define GUI_GRID_BOTTOMRIGHT_W GUI_GRID_W
|
||||
#define GUI_GRID_BOTTOMRIGHT_H GUI_GRID_H
|
||||
|
||||
// Default text sizes
|
||||
#define GUI_TEXT_SIZE_SMALL (GUI_GRID_H * 0.8)
|
||||
#define GUI_TEXT_SIZE_MEDIUM (GUI_GRID_H * 1)
|
||||
#define GUI_TEXT_SIZE_LARGE (GUI_GRID_H * 1.2)
|
||||
|
||||
// Pixel grid
|
||||
#define pixelScale 0.50
|
||||
#define GRID_W (pixelW * pixelGrid * pixelScale)
|
||||
#define GRID_H (pixelH * pixelGrid * pixelScale)
|
||||
|
||||
class ScrollBar;
|
||||
class RscObject;
|
||||
class RscText;
|
||||
class RscTextSmall;
|
||||
class RscTitle;
|
||||
class RscProgress;
|
||||
class RscProgressNotFreeze;
|
||||
class RscPicture;
|
||||
class RscLadderPicture;
|
||||
class RscPictureKeepAspect;
|
||||
class RscHTML;
|
||||
class RscButton;
|
||||
class RscShortcutButton;
|
||||
class RscButtonSmall;
|
||||
class RscEdit;
|
||||
class RscCombo;
|
||||
class RscListBox;
|
||||
class RscListNBox;
|
||||
class RscXListBox;
|
||||
class RscTree;
|
||||
class RscSlider;
|
||||
class RscSliderH;
|
||||
class RscXSliderH;
|
||||
class RscActiveText;
|
||||
class RscStructuredText;
|
||||
class RscControlsGroup;
|
||||
class RscToolbox;
|
||||
class RscMapControl;
|
||||
class RscCheckBox;
|
||||
class RscFrame;
|
||||
class ctrlDefault;
|
||||
class ctrlControlsGroup;
|
||||
class ctrlDefaultText;
|
||||
class ctrlDefaultButton;
|
||||
class RscBackgroundStripeTop;
|
||||
class RscBackgroundStripeBottom;
|
||||
class RscIGText;
|
||||
class RscIGProgress;
|
||||
class RscListBoxKeys;
|
||||
class RscControlsGroupNoScrollbars;
|
||||
class RscControlsGroupNoHScrollbars;
|
||||
class RscControlsGroupNoVScrollbars;
|
||||
class RscLine;
|
||||
class RscActivePicture;
|
||||
class RscButtonTextOnly;
|
||||
class RscShortcutButtonMain;
|
||||
class RscButtonEditor;
|
||||
class RscIGUIShortcutButton;
|
||||
class RscGearShortcutButton;
|
||||
class RscButtonMenu;
|
||||
class RscButtonMenuOK;
|
||||
class RscButtonMenuCancel;
|
||||
class RscButtonMenuSteam;
|
||||
class RscLoadingText;
|
||||
class RscIGUIListBox;
|
||||
class RscIGUIListNBox;
|
||||
class RscBackground;
|
||||
class RscBackgroundGUI;
|
||||
class RscBackgroundGUILeft;
|
||||
class RscBackgroundGUIRight;
|
||||
class RscBackgroundGUIBottom;
|
||||
class RscBackgroundGUITop;
|
||||
class RscBackgroundGUIDark;
|
||||
class RscBackgroundLogo;
|
||||
class RscMapControlEmpty;
|
||||
class RscVignette;
|
||||
class CA_Mainback;
|
||||
class CA_Back;
|
||||
class CA_Title_Back;
|
||||
class CA_Black_Back;
|
||||
class CA_Title;
|
||||
class CA_Logo;
|
||||
class CA_Logo_Small;
|
||||
class CA_RscButton;
|
||||
class CA_RscButton_dialog;
|
||||
class CA_Ok;
|
||||
class CA_Ok_image;
|
||||
class CA_Ok_image2;
|
||||
class CA_Ok_text;
|
||||
class ctrlCheckbox;
|
||||
class ctrlCheckboxBaseline;
|
||||
class ctrlStatic;
|
||||
class ctrlControlsGroupNoScrollbars;
|
||||
class ctrlStructuredText;
|
||||
class RscTextMulti;
|
||||
class RscTreeSearch;
|
||||
class RscVideo;
|
||||
class RscVideoKeepAspect;
|
||||
class RscActivePictureKeepAspect;
|
||||
class RscEditMulti;
|
||||
class RscMapSignalBackground;
|
||||
class RscMapSignalPicture;
|
||||
class RscMapSignalText;
|
||||
class RscColorPicker;
|
||||
class RscInterlacingScreen;
|
||||
class RscFeedback;
|
||||
class RscTrafficLight;
|
||||
class RscButtonSearch;
|
||||
class RscIGUIText;
|
||||
class RscOpticsText;
|
||||
class RscOpticsValue;
|
||||
class RscIGUIValue;
|
||||
class RscButtonMenuMain;
|
||||
class RscButtonTestCentered;
|
||||
class RscDisplaySingleMission_ChallengeOverviewGroup;
|
||||
class RscDisplayDebriefing_RscTextMultiline;
|
||||
class RscDisplayDebriefing_ListGroup;
|
||||
class RscButtonArsenal;
|
||||
class RscTextNoShadow;
|
||||
class RscButtonNoColor;
|
||||
class RscToolboxButton;
|
||||
class ctrlStaticPicture;
|
||||
class ctrlStaticPictureKeepAspect;
|
||||
class ctrlStaticPictureTile;
|
||||
class ctrlStaticFrame;
|
||||
class ctrlStaticLine;
|
||||
class ctrlStaticMulti;
|
||||
class ctrlStaticBackground;
|
||||
class ctrlStaticOverlay;
|
||||
class ctrlStaticTitle;
|
||||
class ctrlStaticFooter;
|
||||
class ctrlStaticBackgroundDisable;
|
||||
class ctrlStaticBackgroundDisableTiles;
|
||||
class ctrlButton;
|
||||
class ctrlButtonPicture;
|
||||
class ctrlButtonPictureKeepAspect;
|
||||
class ctrlButtonOK;
|
||||
class ctrlButtonCancel;
|
||||
class ctrlButtonClose;
|
||||
class ctrlButtonToolbar;
|
||||
class ctrlButtonSearch;
|
||||
class ctrlButtonExpandAll;
|
||||
class ctrlButtonCollapseAll;
|
||||
class ctrlButtonFilter;
|
||||
class ctrlEdit;
|
||||
class ctrlEditMulti;
|
||||
class ctrlSliderV;
|
||||
class ctrlSliderH;
|
||||
class ctrlCombo;
|
||||
class ctrlComboToolbar;
|
||||
class ctrlListbox;
|
||||
class ctrlToolbox;
|
||||
class ctrlToolboxPicture;
|
||||
class ctrlToolboxPictureKeepAspect;
|
||||
class ctrlCheckboxes;
|
||||
class ctrlCheckboxesCheckbox;
|
||||
class ctrlProgress;
|
||||
class ctrlHTML;
|
||||
class ctrlActiveText;
|
||||
class ctrlActivePicture;
|
||||
class ctrlActivePictureKeepAspect;
|
||||
class ctrlTree;
|
||||
class ctrlControlsGroupNoHScrollbars;
|
||||
class ctrlControlsGroupNoVScrollbars;
|
||||
class ctrlShortcutButton;
|
||||
class ctrlShortcutButtonOK;
|
||||
class ctrlShortcutButtonCancel;
|
||||
class ctrlShortcutButtonSteam;
|
||||
class ctrlXListbox;
|
||||
class ctrlXSliderV;
|
||||
class ctrlXSliderH;
|
||||
class ctrlMenu;
|
||||
class ctrlMenuStrip;
|
||||
class ctrlMap;
|
||||
class ctrlMapEmpty;
|
||||
class ctrlMapMain;
|
||||
class ctrlListNBox;
|
||||
class ctrlCheckboxToolbar;
|
116
addons/db/ui/RscPersistentMenu.hpp
Normal file
116
addons/db/ui/RscPersistentMenu.hpp
Normal file
@ -0,0 +1,116 @@
|
||||
class RscPersistentMenu {
|
||||
idd = 1100;
|
||||
|
||||
class controls {
|
||||
////////////////////////////////////////////////////////
|
||||
// GUI EDITOR OUTPUT START (by Nikolai, v1.063, #Hotoqu)
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
class RscText_1000: RscText {
|
||||
idc = 1101;
|
||||
|
||||
x = "0.005 * safezoneW + safezoneX";
|
||||
y = "0.00500001 * safezoneH + safezoneY";
|
||||
w = "0.299062 * safezoneW";
|
||||
h = "0.44 * safezoneH";
|
||||
colorBackground[] = {0.071,0.239,0.11,1};
|
||||
};
|
||||
class listBox_saveList: RscListBox {
|
||||
idc = 1102;
|
||||
|
||||
x = "0.0153125 * safezoneW + safezoneX";
|
||||
y = "0.071 * safezoneH + safezoneY";
|
||||
w = "0.195937 * safezoneW";
|
||||
h = "0.341 * safezoneH";
|
||||
colorBackground[] = {0.235,0.388,0.306,1};
|
||||
};
|
||||
class button_save: RscButton {
|
||||
idc = 1103;
|
||||
action = "[] call xpdb_db_fnc_saveToSlot";
|
||||
|
||||
text = "Save"; //--- ToDo: Localize;
|
||||
x = "0.216406 * safezoneW + safezoneX";
|
||||
y = "0.071 * safezoneH + safezoneY";
|
||||
w = "0.0721875 * safezoneW";
|
||||
h = "0.033 * safezoneH";
|
||||
colorBackground[] = {0.235,0.388,0.306,1};
|
||||
tooltip = "Save progress to selected slot"; //--- ToDo: Localize;
|
||||
};
|
||||
class button_load: RscButton {
|
||||
idc = 1104;
|
||||
action = "[] call xpdb_db_fnc_loadFromSlot";
|
||||
|
||||
text = "Load"; //--- ToDo: Localize;
|
||||
x = "0.216406 * safezoneW + safezoneX";
|
||||
y = "0.115 * safezoneH + safezoneY";
|
||||
w = "0.0721875 * safezoneW";
|
||||
h = "0.033 * safezoneH";
|
||||
colorBackground[] = {0.235,0.388,0.306,1};
|
||||
tooltip = "Load progress from selected slot"; //--- ToDo: Localize;
|
||||
};
|
||||
class button_delete: RscButton {
|
||||
idc = 1105;
|
||||
action = "[] call xpdb_db_fnc_deleteSlot";
|
||||
|
||||
text = "Delete"; //--- ToDo: Localize;
|
||||
x = "0.216406 * safezoneW + safezoneX";
|
||||
y = "0.379 * safezoneH + safezoneY";
|
||||
w = "0.0721875 * safezoneW";
|
||||
h = "0.033 * safezoneH";
|
||||
colorBackground[] = {0.569,0.059,0.059,1};
|
||||
tooltip = "Delete selected slot"; //--- ToDo: Localize;
|
||||
};
|
||||
class text_scenarioName: RscText {
|
||||
idc = 1106;
|
||||
|
||||
text = "Scenario Name"; //--- ToDo: Localize;
|
||||
x = "0.0153125 * safezoneW + safezoneX";
|
||||
y = "0.027 * safezoneH + safezoneY";
|
||||
w = "0.273281 * safezoneW";
|
||||
h = "0.033 * safezoneH";
|
||||
colorBackground[] = {0.235,0.388,0.306,1};
|
||||
};
|
||||
class button_saveVehicle: RscButton {
|
||||
idc = 1107;
|
||||
action = "[0] call xpdb_db_fnc_saveTarget";
|
||||
|
||||
text = "Save Vehicle"; //--- ToDo: Localize;
|
||||
x = "0.216406 * safezoneW + safezoneX";
|
||||
y = "0.159 * safezoneH + safezoneY";
|
||||
w = "0.0721875 * safezoneW";
|
||||
h = "0.033 * safezoneH";
|
||||
colorBackground[] = {0.141,0.38,0.184,1};
|
||||
tooltip = "Save the vehicle you're looking at"; //--- ToDo: Localize;
|
||||
};
|
||||
class button_saveContainer: RscButton {
|
||||
idc = 1108;
|
||||
action = "[1] call xpdb_db_fnc_saveTarget";
|
||||
|
||||
text = "Save Container"; //--- ToDo: Localize;
|
||||
x = "0.216406 * safezoneW + safezoneX";
|
||||
y = "0.203 * safezoneH + safezoneY";
|
||||
w = "0.0721875 * safezoneW";
|
||||
h = "0.033 * safezoneH";
|
||||
colorBackground[] = {0.141,0.38,0.184,1};
|
||||
tooltip = "Caution! Must point at container first."; //--- ToDo: Localize;
|
||||
};
|
||||
////////////////////////////////////////////////////////
|
||||
// GUI EDITOR OUTPUT END
|
||||
////////////////////////////////////////////////////////
|
||||
/* #Hotoqu
|
||||
$[
|
||||
1.063,
|
||||
["RscPersistentMenu",[[0,0,1,1],0.025,0.04,"GUI_GRID"],0,0,0],
|
||||
[1000,"RscText_1000",[1,"",["0.005 * safezoneW + safezoneX","0.00500001 * safezoneH + safezoneY","0.299062 * safezoneW","0.44 * safezoneH"],[-1,-1,-1,-1],[0.071,0.239,0.11,1],[-1,-1,-1,-1],"","-1"],["idc = 1101;"]],
|
||||
[1001,"listBox_saveList: RscListBox",[1,"",["0.0153125 * safezoneW + safezoneX","0.071 * safezoneH + safezoneY","0.195937 * safezoneW","0.341 * safezoneH"],[-1,-1,-1,-1],[0.235,0.388,0.306,1],[-1,-1,-1,-1],"","-1"],["idc = 1102;"]],
|
||||
[1600,"button_save",[1,"Save",["0.216406 * safezoneW + safezoneX","0.071 * safezoneH + safezoneY","0.0721875 * safezoneW","0.033 * safezoneH"],[-1,-1,-1,-1],[0.235,0.388,0.306,1],[-1,-1,-1,-1],"Save progress to selected slot","-1"],["idc = 1103;","action = |[] call F90_fnc_saveToSlot|;"]],
|
||||
[1601,"button_load",[1,"Load",["0.216406 * safezoneW + safezoneX","0.115 * safezoneH + safezoneY","0.0721875 * safezoneW","0.033 * safezoneH"],[-1,-1,-1,-1],[0.235,0.388,0.306,1],[-1,-1,-1,-1],"Load progress from selected slot","-1"],["idc = 1104;","action = |[] call F90_fnc_loadFromSlot|;"]],
|
||||
[1602,"button_delete",[1,"Delete",["0.216406 * safezoneW + safezoneX","0.379 * safezoneH + safezoneY","0.0721875 * safezoneW","0.033 * safezoneH"],[-1,-1,-1,-1],[0.569,0.059,0.059,1],[-1,-1,-1,-1],"Delete selected slot","-1"],["idc = 1105;","action = |[] call F90_fnc_deleteSlot|;"]],
|
||||
[1002,"text_scenarioName",[1,"Scenario Name",["0.0153125 * safezoneW + safezoneX","0.027 * safezoneH + safezoneY","0.273281 * safezoneW","0.033 * safezoneH"],[-1,-1,-1,-1],[0.235,0.388,0.306,1],[-1,-1,-1,-1],"","-1"],["idc = 1106;"]],
|
||||
[1603,"button_saveVehicle",[1,"Save Vehicle",["0.216406 * safezoneW + safezoneX","0.159 * safezoneH + safezoneY","0.0721875 * safezoneW","0.033 * safezoneH"],[-1,-1,-1,-1],[0.141,0.38,0.184,1],[-1,-1,-1,-1],"Save the vehicle you're looking at","-1"],["idc = 1107;","action = |[] call F90_fnc_saveTarget|;"]],
|
||||
[1604,"button_saveContainer",[1,"Save Container",["0.216406 * safezoneW + safezoneX","0.203 * safezoneH + safezoneY","0.0721875 * safezoneW","0.033 * safezoneH"],[-1,-1,-1,-1],[0.141,0.38,0.184,1],[-1,-1,-1,-1],"Caution! Must point at container first.","-1"],["idc = 1108;","action = |[] call F90_fnc_saveTargetContainer|;"]],
|
||||
[1605,"",[1,"Save Unit",["0.216406 * safezoneW + safezoneX","0.247 * safezoneH + safezoneY","0.0721875 * safezoneW","0.033 * safezoneH"],[-1,-1,-1,-1],[0.141,0.38,0.184,1],[-1,-1,-1,-1],"Save the unit you're looking at.","-1"],["idc = 1108;","action = |[] call F90_fnc_saveTargetContainer|;"]]
|
||||
]
|
||||
*/
|
||||
};
|
||||
};
|
1
addons/generate/$PBOPREFIX$
Normal file
1
addons/generate/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\xpdb\addons\generate
|
19
addons/generate/CfgEventHandlers.hpp
Normal file
19
addons/generate/CfgEventHandlers.hpp
Normal 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));
|
||||
};
|
||||
};
|
12
addons/generate/XEH_PREP.hpp
Normal file
12
addons/generate/XEH_PREP.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
PREP(cargoData);
|
||||
PREP(containerID);
|
||||
PREP(dateData);
|
||||
PREP(groupData);
|
||||
PREP(groupOrders);
|
||||
PREP(orders);
|
||||
PREP(posDirData);
|
||||
PREP(skills);
|
||||
PREP(turretData);
|
||||
PREP(unitData);
|
||||
PREP(variables);
|
||||
PREP(vehicleID);
|
1
addons/generate/XEH_postInit.sqf
Normal file
1
addons/generate/XEH_postInit.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
1
addons/generate/XEH_postInit_client.sqf
Normal file
1
addons/generate/XEH_postInit_client.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
8
addons/generate/XEH_preInit.sqf
Normal file
8
addons/generate/XEH_preInit.sqf
Normal file
@ -0,0 +1,8 @@
|
||||
#include "script_component.hpp"
|
||||
ADDON = false;
|
||||
|
||||
PREP_RECOMPILE_START;
|
||||
#include "XEH_PREP.hpp"
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
ADDON = true;
|
1
addons/generate/XEH_preInit_server.sqf
Normal file
1
addons/generate/XEH_preInit_server.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
2
addons/generate/XEH_preStart.sqf
Normal file
2
addons/generate/XEH_preStart.sqf
Normal file
@ -0,0 +1,2 @@
|
||||
#include "script_component.hpp"
|
||||
#include "XEH_PREP.hpp"
|
16
addons/generate/config.cpp
Normal file
16
addons/generate/config.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"xpdb_main"};
|
||||
authors[] = {"J. Schmidt", "NikolaiF90"};
|
||||
author = "J. Schmidt";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
52
addons/generate/functions/fnc_cargoData.sqf
Normal file
52
addons/generate/functions/fnc_cargoData.sqf
Normal file
@ -0,0 +1,52 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_cargoData
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Generate cargo data for a container.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Container object <OBJECT> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* The return <ARRAY>
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_generate_fnc_cargoData
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_container", nil, [objNull, 0, [], sideUnknown, grpNull, ""]]];
|
||||
|
||||
if (isNil "_container" || isNull _container) exitWith {[EGVAR(db,debug), "xpdb_generate_fnc_cargoData", "No entity to generate cargo data for.", true] call EFUNC(utils,debug); };
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_cargoData", format ["Generating cargo data for container '%1'.", _container], false] call EFUNC(utils,debug);
|
||||
|
||||
private _itemsArray = ["items", getItemCargo _container];
|
||||
private _magazinesArray = ["magazines", magazinesAmmoCargo _container];
|
||||
private _weaponsArray = ["weapons", weaponsItemsCargo _container];
|
||||
private _containersArray = ["containers", [_container] call EFUNC(helpers,getContainers)];
|
||||
private _backpacksArray = ["backpacks", [_container] call EFUNC(helpers,getBackpacks)];
|
||||
|
||||
private _cargo = [
|
||||
_itemsArray,
|
||||
_magazinesArray,
|
||||
_weaponsArray,
|
||||
_containersArray,
|
||||
_backpacksArray
|
||||
];
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_cargoData", format ["Cargo data for container %1 successfully generated.", _container], false] call EFUNC(utils,debug);
|
||||
|
||||
_cargo;
|
51
addons/generate/functions/fnc_containerID.sqf
Normal file
51
addons/generate/functions/fnc_containerID.sqf
Normal file
@ -0,0 +1,51 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_containerID
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Generate unique ID for a container and store it, or retrieve the unique ID of an existing container.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Entity object <OBJECT> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* The return <SCALAR>
|
||||
*
|
||||
* Examples:
|
||||
* [cont1] call xpdb_generate_fnc_containerID
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_container", nil, [objNull, 0, [], sideUnknown, grpNull, ""]]];
|
||||
|
||||
private _containerID = 0;
|
||||
|
||||
if (isNil "_container" || isNull _container) exitWith {[EGVAR(db,debug), "xpdb_generate_fnc_containerID", "No container to generate ID for.", true] call EFUNC(utils,debug); };
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_containerID", format ["Generating ID for container '%1'...", _container], false] call EFUNC(utils,debug);
|
||||
|
||||
private _containerIndex = (EGVAR(db,conts)) find _container;
|
||||
|
||||
if (_containerIndex == -1) then {
|
||||
_containerID = count (EGVAR(db,conts));
|
||||
_container setVariable [EGVAR(db,contIDKey), _containerID];
|
||||
(EGVAR(db,conts)) pushback _container;
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_containerID", format ["ID for container '%1' has been successfully generated.", _container], false] call EFUNC(utils,debug);
|
||||
} else {
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_containerID", format ["Vehicle '%1' already had an existing ID.", _container], false] call EFUNC(utils,debug);
|
||||
_containerID = ((EGVAR(db,conts)) # _containerIndex) getVariable EGVAR(db,contIDKey);
|
||||
};
|
||||
|
||||
_containerID;
|
46
addons/generate/functions/fnc_dateData.sqf
Normal file
46
addons/generate/functions/fnc_dateData.sqf
Normal file
@ -0,0 +1,46 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_dateData
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Generate a string Date and Time using format [hh:mm dd/mm/yy].
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* The return <STRING>
|
||||
*
|
||||
* Examples:
|
||||
* [] call xpdb_generate_fnc_dateData
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_dateData", "Generating date and time string...", false] call EFUNC(utils,debug);
|
||||
|
||||
private _return = "";
|
||||
private _time = systemTime;
|
||||
private _hour = _time # 3;
|
||||
private _minute = _time # 4;
|
||||
private _month = _time # 1;
|
||||
private _day = _time # 2;
|
||||
private _year = _time # 0;
|
||||
|
||||
private _string = format ["%1:%2 %3/%4/%5", _hour, _minute, _month, _day, _year];
|
||||
|
||||
EGVAR(db,saveTime) = _string;
|
||||
_return = _string;
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_dateData", "Date and time string generated.", false] call EFUNC(utils,debug);
|
||||
_return;
|
51
addons/generate/functions/fnc_groupData.sqf
Normal file
51
addons/generate/functions/fnc_groupData.sqf
Normal file
@ -0,0 +1,51 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_groupData
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Generate unit data for a group.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Entity object <OBJECT> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* The return <ARRAY>
|
||||
*
|
||||
* Examples:
|
||||
* [leaderUnit] call xpdb_generate_fnc_groupData
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
|
||||
params [["_leader", objNull, [objNull]]];
|
||||
|
||||
if (isNull _leader) exitWith {
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_groupData", "No entity to generate group data for.", true] call EFUNC(utils,debug);
|
||||
createHashMap
|
||||
};
|
||||
|
||||
private _groupArray = units group _leader;
|
||||
private _groupData = createHashMap;
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_groupData", format ["Generating group data for leader '%1'...", _leader], false] call EFUNC(utils,debug);
|
||||
|
||||
{
|
||||
if (_x != _leader && alive _x) then {
|
||||
_groupData set [format ["unit.%1", _forEachIndex], ([_x, false] call DFUNC(unitData))];
|
||||
};
|
||||
} forEach _groupArray;
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_groupData", format ["Group data for leader '%1' has been successfully generated.", _leader], false] call EFUNC(utils,debug);
|
||||
|
||||
_groupData
|
40
addons/generate/functions/fnc_groupOrders.sqf
Normal file
40
addons/generate/functions/fnc_groupOrders.sqf
Normal file
@ -0,0 +1,40 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_groupOrders
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_leader"];
|
||||
|
||||
private _group = group _leader;
|
||||
|
||||
private _groupOrdersArray = [];
|
||||
|
||||
_groupOrdersArray pushBack ["combatMode", combatMode _group];
|
||||
_groupOrdersArray pushBack ["formation", formation _group];
|
||||
_groupOrdersArray pushBack ["speedMode", speedMode _group];
|
||||
|
||||
_groupOrdersArray;
|
37
addons/generate/functions/fnc_orders.sqf
Normal file
37
addons/generate/functions/fnc_orders.sqf
Normal file
@ -0,0 +1,37 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_orders
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
private _ordersArray = [];
|
||||
|
||||
_ordersArray pushBack ["behaviour", behaviour _unit];
|
||||
_ordersArray pushBack ["unitPos", unitPos _unit];
|
||||
|
||||
_ordersArray;
|
42
addons/generate/functions/fnc_posDirData.sqf
Normal file
42
addons/generate/functions/fnc_posDirData.sqf
Normal file
@ -0,0 +1,42 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_posDirData
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Generate position and direction for an entity.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Entity object <OBJECT> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* The return <ARRAY>
|
||||
*
|
||||
* Examples:
|
||||
* [leaderUnit] call xpdb_generate_fnc_posDirData
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]]];
|
||||
|
||||
if (isNil "_entity" || isNull _entity) exitWith {[EGVAR(db,debug), "xpdb_generate_fnc_posDirData", "No entity to generate position and direction array for.", true] call EFUNC(utils,debug); };
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_posDir", format ["Generating position and direction array for entity '%1'...", _entity], false] call EFUNC(utils,debug);
|
||||
|
||||
private _pos = getPosATL _entity;
|
||||
private _dir = getDir _entity;
|
||||
private _returnData = [_pos, _dir];
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_posDir", format ["Position and direction array for entity '%1' has been successfully generated.", _entity], false] call EFUNC(utils,debug);
|
||||
|
||||
_returnData;
|
49
addons/generate/functions/fnc_skills.sqf
Normal file
49
addons/generate/functions/fnc_skills.sqf
Normal file
@ -0,0 +1,49 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_skills
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
private _skillsArray = [];
|
||||
|
||||
{
|
||||
_skillsArray pushBack [_x, _unit skill _x];
|
||||
true
|
||||
} count [
|
||||
"aimingAccuracy",
|
||||
"aimingShake",
|
||||
"aimingSpeed",
|
||||
"commanding",
|
||||
"courage",
|
||||
"general",
|
||||
"reloadSpeed",
|
||||
"spotDistance",
|
||||
"spotTime"
|
||||
];
|
||||
|
||||
_skillsArray;
|
38
addons/generate/functions/fnc_turretData.sqf
Normal file
38
addons/generate/functions/fnc_turretData.sqf
Normal file
@ -0,0 +1,38 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_turretData
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Generate turret data for a vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Entity object <OBJECT> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* The return <ARRAY>
|
||||
*
|
||||
* Examples:
|
||||
* [veh1] call xpdb_generate_fnc_turretData
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_vehicle"];
|
||||
|
||||
private _turretsArray = [];
|
||||
|
||||
{
|
||||
_turretsArray pushBack _x;
|
||||
} forEach (magazinesAllTurrets _vehicle);
|
||||
|
||||
_turretsArray;
|
86
addons/generate/functions/fnc_unitData.sqf
Normal file
86
addons/generate/functions/fnc_unitData.sqf
Normal file
@ -0,0 +1,86 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_unitData
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Generate unit data and return it.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit object <OBJECT> (default: nil)
|
||||
* 1: Leader <BOOL> (default: false)
|
||||
*
|
||||
* Return Value:
|
||||
* The return <OBJECT>
|
||||
*
|
||||
* Examples:
|
||||
* [_unit, false] call xpdb_generate_fnc_unitData
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_unit", objNull, [objNull]], ["_isLeader", false, [false]]];
|
||||
|
||||
if (isNull _unit) exitWith {
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_unitData", "No unit to generate data for.", true] call EFUNC(utils,debug);
|
||||
createHashMap
|
||||
};
|
||||
|
||||
private _unitData = createHashMap;
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_unitData", format ["Generating data for '%1' (isLeader = '%2')...", _unit, _isLeader], false] call EFUNC(utils,debug);
|
||||
|
||||
_unitData set ["assignedTeam", assignedTeam _unit];
|
||||
_unitData set ["class", typeOf _unit];
|
||||
_unitData set ["damages", getAllHitPointsDamage _unit];
|
||||
_unitData set ["face", face _unit];
|
||||
_unitData set ["fatigue", getFatigue _unit];
|
||||
_unitData set ["formDir", formationDirection _unit];
|
||||
_unitData set ["generalDamage", damage _unit];
|
||||
_unitData set ["loadout", getUnitLoadout _unit];
|
||||
_unitData set ["name", (name _unit) splitString " "];
|
||||
_unitData set ["orders", [_unit] call DFUNC(orders)];
|
||||
_unitData set ["pitch", pitch _unit];
|
||||
_unitData set ["posDir", [_unit] call DFUNC(posDirData)];
|
||||
_unitData set ["rating", rating _unit];
|
||||
_unitData set ["side", side _unit];
|
||||
_unitData set ["skills", [_unit] call DFUNC(skills)];
|
||||
_unitData set ["speaker", speaker _unit];
|
||||
_unitData set ["stamina", getStamina _unit];
|
||||
_unitData set ["variables", [_unit] call DFUNC(variables)];
|
||||
|
||||
if (vehicle _unit != _unit) then {
|
||||
private _vehicle = vehicle _unit;
|
||||
private _vehicleCrew = fullCrew vehicle _unit;
|
||||
private _vehicleData = createHashMap;
|
||||
|
||||
{
|
||||
_x params ["_assignedUnit", "_role", "_cargoIndex", "_turretPath", "_personTurret"];
|
||||
|
||||
if (_unit == _assignedUnit) exitWith {
|
||||
_vehicleData set ["role", [_role, _cargoIndex, _turretPath, _personTurret]];
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_unitData", format ["Vehicle role data for '%1' generated: '%2'", _unit, _vehicleData get "role"], false] call EFUNC(utils,debug);
|
||||
};
|
||||
} forEach _vehicleCrew;
|
||||
|
||||
_vehicleData set ["id", [_vehicle] call DFUNC(vehicleID)];
|
||||
_unitData set ["vehicle", _vehicleData];
|
||||
};
|
||||
|
||||
if (_isLeader) then {
|
||||
_unitData set ["group", [_unit] call DFUNC(groupData)];
|
||||
_unitData set ["groupOrders", [_unit] call DFUNC(groupOrders)];
|
||||
};
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_unitData", format ["Data for '%1' (isLeader = '%2') has been successfully generated.", _unit, _isLeader], false] call EFUNC(utils,debug);
|
||||
|
||||
_unitData
|
42
addons/generate/functions/fnc_variables.sqf
Normal file
42
addons/generate/functions/fnc_variables.sqf
Normal file
@ -0,0 +1,42 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_variables
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
private _varsArray = [];
|
||||
|
||||
{
|
||||
private _splittedKey = _x splitString '_';
|
||||
|
||||
if (_splittedKey # 0 != 'cba' && _splittedKey # 0 != 'ace') then {
|
||||
_varsArray pushBack [_x, _unit getVariable _x];
|
||||
};
|
||||
} forEach (allVariables _unit);
|
||||
|
||||
_varsArray;
|
51
addons/generate/functions/fnc_vehicleID.sqf
Normal file
51
addons/generate/functions/fnc_vehicleID.sqf
Normal file
@ -0,0 +1,51 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_generate_fnc_vehicleID
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Generate unique ID for a vehicle and store it, or retrieve the unique ID of an existing vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Entity object <OBJECT> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* The return <SCALAR>
|
||||
*
|
||||
* Examples:
|
||||
* [veh1] call xpdb_generate_fnc_vehicleID
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [["_vehicle", nil, [objNull, 0, [], sideUnknown, grpNull, ""]]];
|
||||
|
||||
private _vehicleID = 0;
|
||||
|
||||
if (isNil "_vehicle" || isNull _vehicle) exitWith {[EGVAR(db,debug), "xpdb_generate_fnc_vehicleID", "No vehicle to generate ID for.", true] call EFUNC(utils,debug); };
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_vehicleID", format ["Generating ID for vehicle '%1'...", _vehicle], false] call EFUNC(utils,debug);
|
||||
|
||||
private _vehicleIndex = (EGVAR(db,vehs)) find _vehicle;
|
||||
|
||||
if (_vehicleIndex == -1) then {
|
||||
_vehicleID = count (EGVAR(db,vehs));
|
||||
_vehicle setVariable [EGVAR(db,vehIDKey), _vehicleID];
|
||||
(EGVAR(db,vehs)) pushback _vehicle;
|
||||
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_vehicleID", format ["ID for vehicle '%1' has been successfully generated.", _vehicle], false] call EFUNC(utils,debug);
|
||||
} else {
|
||||
[EGVAR(db,debug), "xpdb_generate_fnc_vehicleID", format ["Vehicle '%1' already had an existing ID.", _vehicle], false] call EFUNC(utils,debug);
|
||||
_vehicleID = ((EGVAR(db,vehs)) # _vehicleIndex) getVariable EGVAR(db,vehIDKey);
|
||||
};
|
||||
|
||||
_vehicleID;
|
1
addons/generate/functions/script_component.hpp
Normal file
1
addons/generate/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "..\script_component.hpp"
|
15
addons/generate/script_component.hpp
Normal file
15
addons/generate/script_component.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#define COMPONENT generate
|
||||
#define COMPONENT_BEAUTIFIED Generate
|
||||
#include "..\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
#define DISABLE_COMPILE_CACHE
|
||||
|
||||
#ifdef DEBUG_ENABLED_GENERATE
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
#ifdef DEBUG_SETTINGS_GENERATE
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_GENERATE
|
||||
#endif
|
||||
|
||||
#include "..\main\script_macros.hpp"
|
1
addons/helpers/$PBOPREFIX$
Normal file
1
addons/helpers/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\xpdb\addons\helpers
|
19
addons/helpers/CfgEventHandlers.hpp
Normal file
19
addons/helpers/CfgEventHandlers.hpp
Normal 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));
|
||||
};
|
||||
};
|
19
addons/helpers/XEH_PREP.hpp
Normal file
19
addons/helpers/XEH_PREP.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
PREP(addAllCargo);
|
||||
PREP(addBackpacks);
|
||||
PREP(addContainers);
|
||||
PREP(addGroupUnits);
|
||||
PREP(addMagazines);
|
||||
PREP(addWeapons);
|
||||
PREP(createUnit);
|
||||
PREP(findAssignedVeh);
|
||||
PREP(getBackpacks);
|
||||
PREP(getContainers);
|
||||
PREP(isContainerEmpty);
|
||||
PREP(joinGroup);
|
||||
PREP(removeGroupUnits);
|
||||
PREP(restoreName);
|
||||
PREP(setGroupOrders);
|
||||
PREP(setOrders);
|
||||
PREP(setRating);
|
||||
PREP(setSkills);
|
||||
PREP(setVariables);
|
1
addons/helpers/XEH_postInit.sqf
Normal file
1
addons/helpers/XEH_postInit.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
1
addons/helpers/XEH_postInit_client.sqf
Normal file
1
addons/helpers/XEH_postInit_client.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
8
addons/helpers/XEH_preInit.sqf
Normal file
8
addons/helpers/XEH_preInit.sqf
Normal file
@ -0,0 +1,8 @@
|
||||
#include "script_component.hpp"
|
||||
ADDON = false;
|
||||
|
||||
PREP_RECOMPILE_START;
|
||||
#include "XEH_PREP.hpp"
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
ADDON = true;
|
1
addons/helpers/XEH_preInit_server.sqf
Normal file
1
addons/helpers/XEH_preInit_server.sqf
Normal file
@ -0,0 +1 @@
|
||||
#include "script_component.hpp"
|
2
addons/helpers/XEH_preStart.sqf
Normal file
2
addons/helpers/XEH_preStart.sqf
Normal file
@ -0,0 +1,2 @@
|
||||
#include "script_component.hpp"
|
||||
#include "XEH_PREP.hpp"
|
16
addons/helpers/config.cpp
Normal file
16
addons/helpers/config.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"xpdb_main"};
|
||||
authors[] = {"J. Schmidt", "NikolaiF90"};
|
||||
author = "J. Schmidt";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
38
addons/helpers/functions/fnc_addAllCargo.sqf
Normal file
38
addons/helpers/functions/fnc_addAllCargo.sqf
Normal file
@ -0,0 +1,38 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_addAllCargo
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Adds all cargo to a container.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Container object <OBJECT> (default: nil)
|
||||
* 1: Types of cargo items to add to container <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [_container, _cargo] call xpdb_helpers_fnc_addAllCargo
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_container", "_cargoArray", "_fnc_addToCargo"];
|
||||
|
||||
{
|
||||
private _name = _x;
|
||||
private _count = (_cargoArray # 1) # _forEachIndex;
|
||||
[_container, _name, _count] call _fnc_addToCargo;
|
||||
true
|
||||
} count (_cargoArray # 0);
|
51
addons/helpers/functions/fnc_addBackpacks.sqf
Normal file
51
addons/helpers/functions/fnc_addBackpacks.sqf
Normal file
@ -0,0 +1,51 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_addBackpacks
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Adds backpacks to a container.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Container object <OBJECT> (default: nil)
|
||||
* 1: Types of backpacks items to add to container <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [_container, _backpacks] call xpdb_helpers_fnc_addBackpacks
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_container", "_backpacksArray"];
|
||||
|
||||
{
|
||||
private _key = _x # 0;
|
||||
private _value = _x # 1;
|
||||
|
||||
switch (_key) do {
|
||||
case "class": { _class = _value; };
|
||||
case "cargo": { _cargo = _value; };
|
||||
};
|
||||
|
||||
_container addBackpackCargo [_class, 1];
|
||||
|
||||
{
|
||||
if (typeOf _x == _class && [_x] call DFUNC(isContainerEmpty)) exitWith {
|
||||
[_x, _cargo] call EFUNC(utils,applyCargoData);
|
||||
};
|
||||
true
|
||||
} count (everyBackpack _container);
|
||||
true
|
||||
} count (_backpacksArray);
|
52
addons/helpers/functions/fnc_addContainers.sqf
Normal file
52
addons/helpers/functions/fnc_addContainers.sqf
Normal file
@ -0,0 +1,52 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_addContainers
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Adds containers to a container.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Container object <OBJECT> (default: nil)
|
||||
* 1: Types of cantainers to add to container <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [_container, _containers] call xpdb_helpers_fnc_addContainers
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_container", "_containersArray"];
|
||||
|
||||
{
|
||||
private _key = _x # 0;
|
||||
private _value = _x # 1;
|
||||
|
||||
switch (_key) do {
|
||||
case "class": { private _class = _value; };
|
||||
case "cargo": { private _cargo = _value; };
|
||||
};
|
||||
|
||||
{
|
||||
private _currentClass = _x # 0;
|
||||
private _currentInstance = _x # 1;
|
||||
|
||||
if (_currentClass == _class && [_currentInstance] call DFUNC(isContainerEmpty)) exitWith {
|
||||
[_currentInstance, _cargo] call EFUNC(utils,applyCargoData);
|
||||
};
|
||||
true
|
||||
} count (everyContainer _container);
|
||||
true
|
||||
} count (_containersArray);
|
36
addons/helpers/functions/fnc_addGroupUnits.sqf
Normal file
36
addons/helpers/functions/fnc_addGroupUnits.sqf
Normal file
@ -0,0 +1,36 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_addGroupUnits
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_leader", "_group"];
|
||||
|
||||
{
|
||||
private _key = _x;
|
||||
private _value = _group get _key;
|
||||
[_value, _leader] spawn EFUNC(load,groupData);
|
||||
} forEach _group;
|
39
addons/helpers/functions/fnc_addMagazines.sqf
Normal file
39
addons/helpers/functions/fnc_addMagazines.sqf
Normal file
@ -0,0 +1,39 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_addMagazines
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Adds magazines to a container.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Container object <OBJECT> (default: nil)
|
||||
* 1: Types of magazines items to add to container <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [_container, _magazines] call xpdb_helpers_fnc_addMagazines
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_container", "_magazinesArray"];
|
||||
|
||||
{
|
||||
private _name = _x # 0;
|
||||
private _ammo = _x # 1;
|
||||
|
||||
_container addMagazineAmmoCargo [_name, 1, _ammo];
|
||||
true
|
||||
} count (_magazinesArray);
|
36
addons/helpers/functions/fnc_addWeapons.sqf
Normal file
36
addons/helpers/functions/fnc_addWeapons.sqf
Normal file
@ -0,0 +1,36 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_addWeapons
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* Adds weapons to a container.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Container object <OBJECT> (default: nil)
|
||||
* 1: Types of weapons to add to container <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* [_container, _weapons] call xpdb_helpers_fnc_addWeapons
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_container", "_weaponsArray"];
|
||||
|
||||
{
|
||||
_container addWeaponWithAttachmentsCargo [_x, 1];
|
||||
true
|
||||
} count (_weaponsArray);
|
36
addons/helpers/functions/fnc_createUnit.sqf
Normal file
36
addons/helpers/functions/fnc_createUnit.sqf
Normal file
@ -0,0 +1,36 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_createUnit
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit", "_class", "_side"];
|
||||
|
||||
if (isNil { _unit }) then {
|
||||
_unit = (createGroup _side) createUnit [_class, [0, 0, 0], [], 0, "FORM"];
|
||||
};
|
||||
|
||||
_unit;
|
39
addons/helpers/functions/fnc_findAssignedVeh.sqf
Normal file
39
addons/helpers/functions/fnc_findAssignedVeh.sqf
Normal file
@ -0,0 +1,39 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_findAssignedVeh
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_id"];
|
||||
private _instance = objNull;
|
||||
|
||||
{
|
||||
private _vehID = _x getVariable EGVAR(db,vehIDKey);
|
||||
if (_vehID == _id) then { _instance = _x; };
|
||||
true
|
||||
} count (EGVAR(db,vehs));
|
||||
|
||||
_instance;
|
47
addons/helpers/functions/fnc_getBackpacks.sqf
Normal file
47
addons/helpers/functions/fnc_getBackpacks.sqf
Normal file
@ -0,0 +1,47 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_getBackpacks
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_container"];
|
||||
|
||||
private _backpacksArray = [];
|
||||
|
||||
{
|
||||
private _class = typeOf _x;
|
||||
private _cargo = [_x] call EFUNC(generate,cargoData);
|
||||
|
||||
private _currentBackpackArray = [];
|
||||
|
||||
_currentBackpackArray pushBack ["class", _class];
|
||||
_currentBackpackArray pushBack ["cargo", _cargo];
|
||||
|
||||
_backpacksArray pushBack _currentBackpackArray;
|
||||
true
|
||||
} count (everyBackpack _container);
|
||||
|
||||
_backpacksArray;
|
48
addons/helpers/functions/fnc_getContainers.sqf
Normal file
48
addons/helpers/functions/fnc_getContainers.sqf
Normal file
@ -0,0 +1,48 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_getContainers
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_container"];
|
||||
|
||||
private _containersArray = [];
|
||||
|
||||
{
|
||||
private _class = _x # 0;
|
||||
private _instance = _x # 1;
|
||||
private _cargo = [_instance] call EFUNC(generate,cargoData);
|
||||
|
||||
private _currentContainerArray = [];
|
||||
|
||||
_currentContainerArray pushBack ["class", _class];
|
||||
_currentContainerArray pushBack ["cargo", _cargo];
|
||||
|
||||
_containersArray pushBack _currentContainerArray;
|
||||
true
|
||||
} count (everyContainer _container);
|
||||
|
||||
_containersArray;
|
37
addons/helpers/functions/fnc_isContainerEmpty.sqf
Normal file
37
addons/helpers/functions/fnc_isContainerEmpty.sqf
Normal file
@ -0,0 +1,37 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_isContainerEmpty
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_container"];
|
||||
|
||||
if (!(magazineCargo _container isEqualTo [])) exitWith { false };
|
||||
if (!(weaponCargo _container isEqualTo [])) exitWith { false };
|
||||
if (!(itemCargo _container isEqualTo [])) exitWith { false };
|
||||
if (!(backpackCargo _container isEqualTo [])) exitWith { false };
|
||||
|
||||
true;
|
34
addons/helpers/functions/fnc_joinGroup.sqf
Normal file
34
addons/helpers/functions/fnc_joinGroup.sqf
Normal file
@ -0,0 +1,34 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_joinGroup
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit", "_leader"];
|
||||
|
||||
if (!(isNil "_leader")) then {
|
||||
[_unit] joinSilent _leader;
|
||||
};
|
37
addons/helpers/functions/fnc_removeGroupUnits.sqf
Normal file
37
addons/helpers/functions/fnc_removeGroupUnits.sqf
Normal file
@ -0,0 +1,37 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_removeGroupUnits
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
{
|
||||
if (_unit != _x) then {
|
||||
deleteVehicle _x;
|
||||
};
|
||||
true
|
||||
} count (units _unit);
|
45
addons/helpers/functions/fnc_restoreName.sqf
Normal file
45
addons/helpers/functions/fnc_restoreName.sqf
Normal file
@ -0,0 +1,45 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_restoreName
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit", "_nameArray"];
|
||||
|
||||
private _firstName = "";
|
||||
private _surname = "";
|
||||
private _joinedNames = "";
|
||||
|
||||
if (count _nameArray == 1) then {
|
||||
_surname = _nameArray # 0;
|
||||
_joinedNames = _surname;
|
||||
} else {
|
||||
_firstName = _nameArray # 0;
|
||||
_surname = _nameArray # 1;
|
||||
_joinedNames = format ["%1 %2", _firstName, _surname];
|
||||
};
|
||||
|
||||
_unit setName [_joinedNames, _firstName, _surname];
|
46
addons/helpers/functions/fnc_setGroupOrders.sqf
Normal file
46
addons/helpers/functions/fnc_setGroupOrders.sqf
Normal file
@ -0,0 +1,46 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_setGroupOrders
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit", "_groupOrdersArray"];
|
||||
|
||||
private _group = group _unit;
|
||||
|
||||
if (leader _group == _unit) then {
|
||||
{
|
||||
private _key = _x # 0;
|
||||
private _value = _x # 1;
|
||||
|
||||
switch (_key) do {
|
||||
case "combatMode": { _group setCombatMode _value; };
|
||||
case "formation": { _group setFormation _value; };
|
||||
case "speedMode": { _group setSpeedMode _value; };
|
||||
};
|
||||
true
|
||||
} count (_groupOrdersArray);
|
||||
};
|
42
addons/helpers/functions/fnc_setOrders.sqf
Normal file
42
addons/helpers/functions/fnc_setOrders.sqf
Normal file
@ -0,0 +1,42 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_setOrders
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit", "_ordersArray"];
|
||||
|
||||
{
|
||||
private _key = _x # 0;
|
||||
private _value = _x # 1;
|
||||
|
||||
switch (_key) do {
|
||||
case "behaviour": { _unit setBehaviour _value; };
|
||||
case "unitPos": { _unit setUnitPos _value; };
|
||||
};
|
||||
|
||||
true
|
||||
} count (_ordersArray);
|
36
addons/helpers/functions/fnc_setRating.sqf
Normal file
36
addons/helpers/functions/fnc_setRating.sqf
Normal file
@ -0,0 +1,36 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_setRating
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit", "_rating"];
|
||||
|
||||
if (rating _unit > _rating) then {
|
||||
_unit addRating -(rating _unit - _rating);
|
||||
} else {
|
||||
_unit addRating (_rating - rating _unit);
|
||||
};
|
38
addons/helpers/functions/fnc_setSkills.sqf
Normal file
38
addons/helpers/functions/fnc_setSkills.sqf
Normal file
@ -0,0 +1,38 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_setSkills
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit", "_skillsArray"];
|
||||
|
||||
{
|
||||
private _key = _x # 0;
|
||||
private _value = _x # 1;
|
||||
|
||||
_unit setSkill [_key, _value];
|
||||
true
|
||||
} count (_skillsArray);
|
47
addons/helpers/functions/fnc_setVariables.sqf
Normal file
47
addons/helpers/functions/fnc_setVariables.sqf
Normal file
@ -0,0 +1,47 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
/*
|
||||
* Function: xpdb_helpers_fnc_setVariables
|
||||
* Author: NikolaiF90, J.Schmidt
|
||||
* Edit: 07.27.2024
|
||||
* Copyright © 2024 NikolaiF90, 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]
|
||||
* N/A
|
||||
*
|
||||
* Arguments:
|
||||
* N/A
|
||||
*
|
||||
* Return Value:
|
||||
* N/A
|
||||
*
|
||||
* Examples:
|
||||
* N/A
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params ["_unit", "_varsArray"];
|
||||
|
||||
{
|
||||
_unit setVariable [_x, nil];
|
||||
true
|
||||
} count (allVariables _unit);
|
||||
|
||||
{
|
||||
private _key = _x # 0;
|
||||
private _value = _x # 1;
|
||||
|
||||
if (isNil "_value") then {
|
||||
_unit setVariable [_key, nil];
|
||||
} else {
|
||||
_unit setVariable [_key, _value];
|
||||
};
|
||||
true
|
||||
} count (_varsArray);
|
1
addons/helpers/functions/script_component.hpp
Normal file
1
addons/helpers/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "..\script_component.hpp"
|
15
addons/helpers/script_component.hpp
Normal file
15
addons/helpers/script_component.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#define COMPONENT helpers
|
||||
#define COMPONENT_BEAUTIFIED Helpers
|
||||
#include "..\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
#define DISABLE_COMPILE_CACHE
|
||||
|
||||
#ifdef DEBUG_ENABLED_HELPERS
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
#ifdef DEBUG_SETTINGS_HELPERS
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_HELPERS
|
||||
#endif
|
||||
|
||||
#include "..\main\script_macros.hpp"
|
1
addons/load/$PBOPREFIX$
Normal file
1
addons/load/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\xpdb\addons\load
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user