diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a267189..882dece 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,50 +3,64 @@ name: CI on: push: branches: - - master + - master pull_request: jobs: validate: runs-on: ubuntu-latest steps: - - name: Checkout the source code - uses: actions/checkout@master - - name: Validate SQF - run: python3 tools/sqf_validator.py - - name: Validate Config - run: python3 tools/config_style_checker.py - - name: Check for BOM - uses: arma-actions/bom-check@master + - name: Checkout the source code + uses: actions/checkout@master + - name: Validate SQF + run: python3 tools/sqf_validator.py + - name: Validate Config + run: python3 tools/config_style_checker.py + - name: Check for BOM + uses: arma-actions/bom-check@master lint: runs-on: ubuntu-latest steps: - - name: Checkout the source code - uses: actions/checkout@master - - name: Lint (sqflint) - uses: jokoho48/sqflint@master - continue-on-error: true # No failure due to many false-positives - - uses: actions/upload-artifact@master - with: - name: 'sqfLint Log' - path: 'sqf.log' - - name: Validate SQFLinter Logs - run: python3 tools/sqf_linter_LogChecker.py + - name: Checkout the source code + uses: actions/checkout@master + - name: Lint (sqflint) + uses: jokoho48/sqflint@master + continue-on-error: true # No failure due to many false-positives + - uses: actions/upload-artifact@master + with: + name: "sqfLint Log" + path: "sqf.log" + - name: Validate SQFLinter Logs + run: python3 tools/sqf_linter_LogChecker.py stringtables: runs-on: ubuntu-latest steps: - - name: Install Python packages - run: | - pip3 install wheel - pip3 install setuptools - pip3 install pygithub - pip3 install pygithub3 - - name: Checkout the source code - uses: actions/checkout@master - - name: Update Translation issue - if: github.repository == 'diwako/diwako_dui' && github.ref == 'refs/heads/master' && ! contains(github.event.head_commit.message, '[ci skip]') - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: python3 tools/stringtableDeploy.py + - name: Install Python packages + run: | + pip3 install wheel + pip3 install setuptools + pip3 install pygithub + pip3 install pygithub3 + - name: Checkout the source code + uses: actions/checkout@master + - name: Update Translation issue + if: github.repository == 'diwako/diwako_dui' && github.ref == 'refs/heads/master' && ! contains(github.event.head_commit.message, '[ci skip]') + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: python3 tools/stringtableDeploy.py + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Setup HEMTT + uses: arma-actions/hemtt@v1 + - name: Run HEMTT build + run: hemtt release + # - name: Upload Release + # uses: actions/upload-artifact@v4 + # with: + # name: my-mod-latest + # path: release/my-mod-latest.zip diff --git a/.gitignore b/.gitignore index 66018f5..dd63d41 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ hemtt\.exe armake2\.exe +.hemttout/ keys/ releases/ *.pbo @@ -17,3 +18,5 @@ keys/* *.sqfc *.bat *.dll + +.vscode/* \ No newline at end of file diff --git a/.hemtt/hooks/pre_release/set_version.rhai b/.hemtt/hooks/pre_release/set_version.rhai new file mode 100644 index 0000000..4032563 --- /dev/null +++ b/.hemtt/hooks/pre_release/set_version.rhai @@ -0,0 +1,14 @@ +// Read the current contents of the mod.cpp +// file from the project source +let version = HEMTT_DIRECTORY + .join("mod.cpp") + .open_file() + .read(); +// Replace the placeholder version with the actual version +version.replace("{version}", HEMTT.project().version().to_string_short()); +// Write the new contents to the build output +// create_file will overwrite the file if it exists +HEMTT_OUTPUT + .join("mod.cpp") + .create_file() + .write(version); \ No newline at end of file diff --git a/.hemtt/project.toml b/.hemtt/project.toml new file mode 100644 index 0000000..3aabb4a --- /dev/null +++ b/.hemtt/project.toml @@ -0,0 +1,43 @@ +name = "DUI Squad Radar" +prefix = "diwako_dui" +author = "Diwako" +mainprefix = "z" + +[version] +path = "addons/main/script_version.hpp" +git_hash = 0 + +[files] +include = [ + "mod.cpp", + "authors.txt", + "license.txt", + "logolarge.paa", + "logosmall.paa" +] +exclude = [ + "*.psd", + "*.png", + "*.tga" +] + +[hemtt.launch.default] +workshop = [ + "450814997", # CBA_A3's Workshop ID + "463939057" # ACE3 +] +parameters = [ + "-skipIntro", # These parameters are passed to the Arma 3 executable + "-noSplash", # They do not need to be added to your list + "-showScriptErrors", # You can add additional parameters here + "-debug", + "-world=empty", + "-filePatching", + "C:\\Users\\diwako\\Documents\\Arma 3\\missions\\dui.VR\\mission.sqm", # Launch into existing Editor Mission - \\ needed +] + +[hemtt.signing] +authority = "diwako_dui" + +[hemtt.release] +folder = "diwako_dui" diff --git a/README.md b/README.md index 5a57235..2cb0946 100644 --- a/README.md +++ b/README.md @@ -3,76 +3,108 @@ ## A UI showing unit positions and names of units in your squad ## Summary + This mod shows a compass in the bottom middle of your screen and a list of people in your current squad. It is made with SQF commands which recently have been added to Arma3 and were not available back in the days of Arma2 or early Arma3. Meaning no weird workarounds with map elements are needed anymore which just eat more frames. A strong point of this UI is its customizability and its many features are all settable with CBA settings. ## Requirements + - CBA ## Supported mods + - ACE 3 - ACRE - TFAR (Both versions) ## Features -#### Scaling + +#### Scaling + Rescale the UI elements in CBA settings, text can be rescaled on its own as well! -#### Font +#### Font + Choose which font is used in the UI -#### Icon Styles +#### Icon Styles + Choose which icon style should be used -#### Color Schemes +#### Color Schemes + Choose the colors that are used throughout the UI -#### Compass Styles +#### Compass Styles + Choose how your compass should look like -#### Choose which UI elements should be shown +#### Choose which UI elements should be shown + Enable or disable the Compass or Namelist on the fly, both or individually. Keybind to hide the UI is included -#### Show the Bearing On Top Of The Compass +#### Show the Bearing On Top Of The Compass + Or don’t, you choose. Also possible to show milradians! -#### Adjustable Compass Range +#### Adjustable Compass Range + Change the range of the compass on the fly either via CBA settings or keybindings -#### Compass Refresh Rate +#### Compass Refresh Rate + Do not want to update the compass every frame? Choose the refresh rate of it! -#### Compass Unit Occlusion +#### Compass Unit Occlusion + Time to get lost in the jungle again! -#### Namelist Text Size +#### Namelist Text Size + Change the size of the text of the squad name list. Smaller means more units will fit into one column! -#### Buddy System +#### Buddy System + Designate someone in your squad as your buddy, they will get their own icon so you will always find each other -#### Show Unit Ranks +#### Show Unit Ranks + SQL just died? No problem, Keybind included to see who is the next in rank -#### Make your own styles +#### Make your own styles + Color, icon and compass styles on mission level are supported! ## Special Variables + DUI has a special variable mission makers can use. + ### diwako_dui_special_track + Array of objects in `missionNamepace`. Every unit or vehicle in this array will be tracked on compass. Be aware that this might be a performance issue if too many objects are added. Be also aware that you do not add a unit that is already in your squad, or else you have 2 icons for that unit. # Reporting bugs + Create a fitting title beginning with the tag word "BUG". In general, be as specific as possible when reporting bugs, it is good to tell how to reproduce it, so it gets fixed faster. # Requesting Features + For requesting features create a new issue with the tag word "FEATURE" at the beginning of the title. Feature requests can range from new styles to whole new functionality. The feasibility of those requests will be analysed inside the feature request itself # Pull requests + Tell in detail what your PR will change, why it should be added and what benefits you think it will bring. PRs can be from new styles, bug fixes to whole new functionality. The changes will be reviewed within the PR. +# Building + +Use the [latest version of Hemtt](https://github.com/BrettMayson/HEMTT/releases/tag/v1.10.2) to build this project. +After installing Hemtt, you can build this project using `hemtt dev` or `hemtt build`. + +To test your changes and such, you can launch Arma directly using `hemtt launch`. + # Additional + [Playable version (DEV)](https://steamcommunity.com/sharedfiles/filedetails/?id=1617125729) (You can build from source as well)\ [Playable version (STABLE)](https://steamcommunity.com/sharedfiles/filedetails/?id=1638341685)\ [BI Thread](https://forums.bohemia.net/forums/topic/221597-dui-squad-radar/) diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 946379b..260d6e6 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -8,7 +8,7 @@ #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD #define VERSION_PLUGIN MAJOR.MINOR.PATCHLVL.BUILD -#define REQUIRED_VERSION 2.04 +#define REQUIRED_VERSION 2.14 #ifdef COMPONENT_BEAUTIFIED #define COMPONENT_NAME QUOTE(DUI - COMPONENT_BEAUTIFIED) diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index 8d6d931..9896a31 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 1 -#define MINOR 9 -#define PATCHLVL 3 -#define BUILD 1 +#define MINOR 10 +#define PATCHLVL 0 +#define BUILD 0 diff --git a/hemtt.toml b/hemtt.toml deleted file mode 100644 index 1e8121d..0000000 --- a/hemtt.toml +++ /dev/null @@ -1,48 +0,0 @@ -name = "DUI Squad Radar" -prefix = "diwako_dui" -author = "Diwako" -files = [ - "mod.cpp" -] -exclude = [ - "*.psd", - "*.png", - "*.tga" -] -# prebuild = ["!compile_scripts"] -# postbuild = ["!sign","!copy","!remove_compiled_scripts"] - -releasebuild = [ - "@zip @{{prefix}}" -] - -[scripts.copy] -foreach = true -only_release = false -steps = [ - "COPY {{target}} D:\\SteamLibrary\\steamapps\\common\\\"Arma 3\"\\@diwako_dui\\addons\\", - "COPY {{target}}.diwako_dui.bisign D:\\SteamLibrary\\steamapps\\common\\\"Arma 3\"\\@diwako_dui\\addons\\" -] - -[scripts.sign] -foreach = true -only_release = false -steps = [ - "G:\\\"Program Files (x86)\"\\Steam\\steamapps\\common\\\"Arma 3 Tools\"\\DSSignFile\\DSSignFile.exe diwako_dui.biprivatekey {{target}}" -] - -[scripts.compile_scripts] -steps_windows = [ - "echo 'Compile Arma Scripts'", - "ArmaScriptCompiler" -] -only_release = false -show_output = true - -[scripts.remove_compiled_scripts] -steps_windows = [ - "echo 'remove Compiled Scripts'", - "powershell -Command Remove-Item './addons/*' -Recurse -Include *.sqfc" -] -only_release = false -show_output = true diff --git a/include/a3/ui_f/hpp/defineDIKCodes.inc b/include/a3/ui_f/hpp/defineDIKCodes.inc new file mode 100644 index 0000000..eb914f9 --- /dev/null +++ b/include/a3/ui_f/hpp/defineDIKCodes.inc @@ -0,0 +1,189 @@ +#ifndef DIK_ESCAPE + +/**************************************************************************** + * + * DirectInput keyboard scan codes + * + ****************************************************************************/ + +#define DIK_ESCAPE 0x01 +#define DIK_1 0x02 +#define DIK_2 0x03 +#define DIK_3 0x04 +#define DIK_4 0x05 +#define DIK_5 0x06 +#define DIK_6 0x07 +#define DIK_7 0x08 +#define DIK_8 0x09 +#define DIK_9 0x0A +#define DIK_0 0x0B +#define DIK_MINUS 0x0C /* - on main keyboard */ +#define DIK_EQUALS 0x0D +#define DIK_BACK 0x0E /* backspace */ +#define DIK_TAB 0x0F +#define DIK_Q 0x10 +#define DIK_W 0x11 +#define DIK_E 0x12 +#define DIK_R 0x13 +#define DIK_T 0x14 +#define DIK_Y 0x15 +#define DIK_U 0x16 +#define DIK_I 0x17 +#define DIK_O 0x18 +#define DIK_P 0x19 +#define DIK_LBRACKET 0x1A +#define DIK_RBRACKET 0x1B +#define DIK_RETURN 0x1C /* Enter on main keyboard */ +#define DIK_LCONTROL 0x1D +#define DIK_A 0x1E +#define DIK_S 0x1F +#define DIK_D 0x20 +#define DIK_F 0x21 +#define DIK_G 0x22 +#define DIK_H 0x23 +#define DIK_J 0x24 +#define DIK_K 0x25 +#define DIK_L 0x26 +#define DIK_SEMICOLON 0x27 +#define DIK_APOSTROPHE 0x28 +#define DIK_GRAVE 0x29 /* accent grave */ +#define DIK_LSHIFT 0x2A +#define DIK_BACKSLASH 0x2B +#define DIK_Z 0x2C +#define DIK_X 0x2D +#define DIK_C 0x2E +#define DIK_V 0x2F +#define DIK_B 0x30 +#define DIK_N 0x31 +#define DIK_M 0x32 +#define DIK_COMMA 0x33 +#define DIK_PERIOD 0x34 /* . on main keyboard */ +#define DIK_SLASH 0x35 /* / on main keyboard */ +#define DIK_RSHIFT 0x36 +#define DIK_MULTIPLY 0x37 /* * on numeric keypad */ +#define DIK_LMENU 0x38 /* left Alt */ +#define DIK_SPACE 0x39 +#define DIK_CAPITAL 0x3A +#define DIK_F1 0x3B +#define DIK_F2 0x3C +#define DIK_F3 0x3D +#define DIK_F4 0x3E +#define DIK_F5 0x3F +#define DIK_F6 0x40 +#define DIK_F7 0x41 +#define DIK_F8 0x42 +#define DIK_F9 0x43 +#define DIK_F10 0x44 +#define DIK_NUMLOCK 0x45 +#define DIK_SCROLL 0x46 /* Scroll Lock */ +#define DIK_NUMPAD7 0x47 +#define DIK_NUMPAD8 0x48 +#define DIK_NUMPAD9 0x49 +#define DIK_SUBTRACT 0x4A /* - on numeric keypad */ +#define DIK_NUMPAD4 0x4B +#define DIK_NUMPAD5 0x4C +#define DIK_NUMPAD6 0x4D +#define DIK_ADD 0x4E /* + on numeric keypad */ +#define DIK_NUMPAD1 0x4F +#define DIK_NUMPAD2 0x50 +#define DIK_NUMPAD3 0x51 +#define DIK_NUMPAD0 0x52 +#define DIK_DECIMAL 0x53 /* . on numeric keypad */ +#define DIK_OEM_102 0x56 /* < > | on UK/Germany keyboards */ +#define DIK_F11 0x57 +#define DIK_F12 0x58 + +#define DIK_F13 0x64 /* (NEC PC98) */ +#define DIK_F14 0x65 /* (NEC PC98) */ +#define DIK_F15 0x66 /* (NEC PC98) */ + +#define DIK_KANA 0x70 /* (Japanese keyboard) */ +#define DIK_ABNT_C1 0x73 /* / ? on Portugese (Brazilian) keyboards */ +#define DIK_CONVERT 0x79 /* (Japanese keyboard) */ +#define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */ +#define DIK_YEN 0x7D /* (Japanese keyboard) */ +#define DIK_ABNT_C2 0x7E /* Numpad . on Portugese (Brazilian) keyboards */ +#define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */ +#define DIK_PREVTRACK 0x90 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */ +#define DIK_AT 0x91 /* (NEC PC98) */ +#define DIK_COLON 0x92 /* (NEC PC98) */ +#define DIK_UNDERLINE 0x93 /* (NEC PC98) */ +#define DIK_KANJI 0x94 /* (Japanese keyboard) */ +#define DIK_STOP 0x95 /* (NEC PC98) */ +#define DIK_AX 0x96 /* (Japan AX) */ +#define DIK_UNLABELED 0x97 /* (J3100) */ +#define DIK_NEXTTRACK 0x99 /* Next Track */ +#define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */ +#define DIK_RCONTROL 0x9D +#define DIK_MUTE 0xA0 /* Mute */ +#define DIK_CALCULATOR 0xA1 /* Calculator */ +#define DIK_PLAYPAUSE 0xA2 /* Play / Pause */ +#define DIK_MEDIASTOP 0xA4 /* Media Stop */ +#define DIK_VOLUMEDOWN 0xAE /* Volume - */ +#define DIK_VOLUMEUP 0xB0 /* Volume + */ +#define DIK_WEBHOME 0xB2 /* Web home */ +#define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */ +#define DIK_DIVIDE 0xB5 /* / on numeric keypad */ +#define DIK_SYSRQ 0xB7 +#define DIK_RMENU 0xB8 /* right Alt */ +#define DIK_PAUSE 0xC5 /* Pause */ +#define DIK_HOME 0xC7 /* Home on arrow keypad */ +#define DIK_UP 0xC8 /* UpArrow on arrow keypad */ +#define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */ +#define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */ +#define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */ +#define DIK_END 0xCF /* End on arrow keypad */ +#define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */ +#define DIK_NEXT 0xD1 /* PgDn on arrow keypad */ +#define DIK_INSERT 0xD2 /* Insert on arrow keypad */ +#define DIK_DELETE 0xD3 /* Delete on arrow keypad */ +#define DIK_LWIN 0xDB /* Left Windows key */ +#define DIK_RWIN 0xDC /* Right Windows key */ +#define DIK_APPS 0xDD /* AppMenu key */ +#define DIK_POWER 0xDE /* System Power */ +#define DIK_SLEEP 0xDF /* System Sleep */ +#define DIK_WAKE 0xE3 /* System Wake */ +#define DIK_WEBSEARCH 0xE5 /* Web Search */ +#define DIK_WEBFAVORITES 0xE6 /* Web Favorites */ +#define DIK_WEBREFRESH 0xE7 /* Web Refresh */ +#define DIK_WEBSTOP 0xE8 /* Web Stop */ +#define DIK_WEBFORWARD 0xE9 /* Web Forward */ +#define DIK_WEBBACK 0xEA /* Web Back */ +#define DIK_MYCOMPUTER 0xEB /* My Computer */ +#define DIK_MAIL 0xEC /* Mail */ +#define DIK_MEDIASELECT 0xED /* Media Select */ + +/* + * Alternate names for keys, to facilitate transition from DOS. + */ +#define DIK_BACKSPACE DIK_BACK /* backspace */ +#define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */ +#define DIK_LALT DIK_LMENU /* left Alt */ +#define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */ +#define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */ +#define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */ +#define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */ +#define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */ +#define DIK_RALT DIK_RMENU /* right Alt */ +#define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */ +#define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */ +#define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */ +#define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */ +#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */ +#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */ + +/* + * Alternate names for keys originally not used on US keyboards. + */ +#define DIK_CIRCUMFLEX DIK_PREVTRACK /* Japanese keyboard */ + + +/* + * Combination keys + */ +#define INPUT_CTRL_OFFSET 512 +#define INPUT_SHIFT_OFFSET 1024 +#define INPUT_ALT_OFFSET 2048 + + +#endif /* DIK_ESCAPE */ diff --git a/include/x/cba/addons/main/script_macros_common.hpp b/include/x/cba/addons/main/script_macros_common.hpp index 67a066a..2683f3b 100644 --- a/include/x/cba/addons/main/script_macros_common.hpp +++ b/include/x/cba/addons/main/script_macros_common.hpp @@ -1,7 +1,9 @@ /* Header: script_macros_common.hpp + Description: A general set of useful macro functions for use by CBA itself or by any module that uses CBA. + Authors: Sickboy and Spooner */ @@ -12,11 +14,13 @@ - Simplify (shorten) the amount of characters required for repetitive tasks - Provide a solid structure that can be dynamic and easy editable (Which sometimes means we cannot adhere to Aim #1 ;-) An example is the path that is built from defines. Some available in this file, others in mods and addons. - Follows Standard: + + Follows Standard: Object variables: PREFIX_COMPONENT Main-object variables: PREFIX_main Paths: MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\SCRIPTNAME.sqf e.g: x\six\addons\sys_menu\fDate.sqf + Usage: define PREFIX and COMPONENT, then include this file (Note, you could have a main addon for your mod, define the PREFIX in a macros.hpp, @@ -24,6 +28,11 @@ Then in your addons, add a component.hpp, define the COMPONENT, and include your mod's script_macros.hpp In your scripts you can then include the addon's component.hpp with relative path) + + use in subcomponents (subconfigs) + define SUBCOMPONENT and include parent component's script_component.hpp + currently only supported by SUBADDON, additional macros may be added in the future + TODO: - Try only to use 1 string type " vs ' - Evaluate double functions, and simplification @@ -49,27 +58,37 @@ #define ADDON DOUBLES(PREFIX,COMPONENT) #define MAIN_ADDON DOUBLES(PREFIX,main) +#ifdef SUBCOMPONENT + #define SUBADDON DOUBLES(ADDON,SUBCOMPONENT) +#endif + /* ------------------------------------------- Macro: VERSION_CONFIG Define CBA Versioning System config entries. + VERSION should be a floating-point number (1 separator). VERSION_STR is a string representation of the version. VERSION_AR is an array representation of the version. + VERSION must always be defined, otherwise it is 0. VERSION_STR and VERSION_AR default to VERSION if undefined. + Parameters: None + Example: (begin example) #define VERSION 1.0 #define VERSION_STR 1.0.1 #define VERSION_AR 1,0,1 + class CfgPatches { class MyMod_main { VERSION_CONFIG; }; }; (end) + Author: ?, Jonpas ------------------------------------------- */ @@ -96,11 +115,14 @@ Group: Debugging /* ------------------------------------------- Macros: DEBUG_MODE_x Managing debugging based on debug level. + According to the *highest* level of debugging that has been defined *before* script_macros_common.hpp is included, only the appropriate debugging commands will be functional. With no level explicitely defined, assume DEBUG_MODE_NORMAL. + DEBUG_MODE_FULL - Full debugging output. DEBUG_MODE_NORMAL - All debugging except and (Default setting if none specified). DEBUG_MODE_MINIMAL - Only and enabled. + Examples: In order to turn on full debugging for a single file, (begin example) @@ -108,6 +130,7 @@ Macros: DEBUG_MODE_x #define DEBUG_MODE_FULL #include "script_component.hpp" (end) + In order to force minimal debugging for a single component, (begin example) // Top of addons\\script_component.hpp @@ -123,6 +146,7 @@ Macros: DEBUG_MODE_x #endif #include "script_macros.hpp" (end) + In order to turn on full debugging for a whole addon, (begin example) // Top of addons\main\script_macros.hpp @@ -131,6 +155,7 @@ Macros: DEBUG_MODE_x #endif #include "\x\cba\addons\main\script_macros_common.hpp" (end) + Author: Spooner ------------------------------------------- */ @@ -164,13 +189,17 @@ Macros: DEBUG_MODE_x /* ------------------------------------------- Macro: LOG() Log a debug message into the RPT log. + Only run if is defined. + Parameters: MESSAGE - Message to record + Example: (begin example) LOG("Initiated clog-dancing simulator."); (end) + Author: Spooner ------------------------------------------- */ @@ -203,12 +232,15 @@ Macro: LOG() /* ------------------------------------------- Macro: INFO() Record a message without file and line number in the RPT log. + Parameters: MESSAGE - Message to record + Example: (begin example) INFO("Mod X is loaded, do Y"); (end) + Author: commy2 ------------------------------------------- */ @@ -225,13 +257,17 @@ Macro: INFO() /* ------------------------------------------- Macro: WARNING() Record a non-critical error in the RPT log. + Only run if or higher is defined. + Parameters: MESSAGE - Message to record + Example: (begin example) WARNING("This function has been deprecated. Please don't use it in future!"); (end) + Author: Spooner ------------------------------------------- */ @@ -264,12 +300,15 @@ Macro: WARNING() /* ------------------------------------------- Macro: ERROR() Record a critical error in the RPT log. + Parameters: MESSAGE - Message to record + Example: (begin example) ERROR("value of frog not found in config ...yada...yada..."); (end) + Author: Spooner ------------------------------------------- */ @@ -286,13 +325,17 @@ Macro: ERROR() /* ------------------------------------------- Macro: ERROR_MSG() Record a critical error in the RPT log and display on screen error message. + Newlines (\n) in the MESSAGE will be put on separate lines. + Parameters: MESSAGE - Message to record + Example: (begin example) ERROR_MSG("value of frog not found in config ...yada...yada..."); (end) + Author: commy2 ------------------------------------------- */ @@ -309,15 +352,19 @@ Macro: ERROR_MSG() /* ------------------------------------------- Macro: ERROR_WITH_TITLE() Record a critical error in the RPT log. + The title can be specified (in the heading is always just "ERROR") Newlines (\n) in the MESSAGE will be put on separate lines. + Parameters: TITLE - Title of error message MESSAGE - Body of error message + Example: (begin example) ERROR_WITH_TITLE("Value not found","Value of frog not found in config ...yada...yada..."); (end) + Author: Spooner ------------------------------------------- */ @@ -334,13 +381,16 @@ Macro: ERROR_WITH_TITLE() /* ------------------------------------------- Macro: MESSAGE_WITH_TITLE() Record a single line in the RPT log. + Parameters: TITLE - Title of log message MESSAGE - Body of message + Example: (begin example) MESSAGE_WITH_TITLE("Value found","Value of frog found in config "); (end) + Author: Killswitch ------------------------------------------- */ @@ -350,9 +400,11 @@ Macro: MESSAGE_WITH_TITLE() Macro: RETDEF() If a variable is undefined, return the default value. Otherwise, return the variable itself. + Parameters: VARIABLE - the variable to check DEFAULT_VALUE - the default value to use if variable is undefined + Example: (begin example) // _var is undefined @@ -369,13 +421,16 @@ Macro: RETDEF() Macro: RETNIL() If a variable is undefined, return the value nil. Otherwise, return the variable itself. + Parameters: VARIABLE - the variable to check + Example: (begin example) // _var is undefined hintSilent format ["_var=%1", RETNIL(_var)]; // "_var=any" (end example) + Author: Alef (see CBA issue #8514) ------------------------------------------- */ @@ -384,7 +439,9 @@ Macro: RETNIL() /* ------------------------------------------- Macros: TRACE_n() Log a message and 1-8 variables to the RPT log. + Only run if is defined. + TRACE_1(MESSAGE,A) - Log 1 variable. TRACE_2(MESSAGE,A,B) - Log 2 variables. TRACE_3(MESSAGE,A,B,C) - Log 3 variables. @@ -394,13 +451,16 @@ Macros: TRACE_n() TRACE_7(MESSAGE,A,B,C,D,E,F,G) - Log 7 variables. TRACE_8(MESSAGE,A,B,C,D,E,F,G,H) - Log 8 variables. TRACE_9(MESSAGE,A,B,C,D,E,F,G,H,I) - Log 9 variables. + Parameters: MESSAGE - Message to add to the trace [String] A..H - Variable names to log values of [Any] + Example: (begin example) TRACE_3("After takeoff",_vehicle player,getPos (_vehicle player), getPosASL (_vehicle player)); (end) + Author: Spooner ------------------------------------------- */ @@ -480,16 +540,20 @@ Group: General /* ------------------------------------------- Macro: INC() + Description: Increase a number by one. + Parameters: VAR - Variable to increment [Number] + Example: (begin example) _counter = 0; INC(_counter); // _counter => 1 (end) + Author: Spooner ------------------------------------------- */ @@ -497,16 +561,20 @@ Macro: INC() /* ------------------------------------------- Macro: DEC() + Description: Decrease a number by one. + Parameters: VAR - Variable to decrement [Number] + Example: (begin example) _counter = 99; DEC(_counter); // _counter => 98 (end) + Author: Spooner ------------------------------------------- */ @@ -514,11 +582,14 @@ Macro: DEC() /* ------------------------------------------- Macro: ADD() + Description: Add a value to a variable. Variable and value should be both Numbers or both Strings. + Parameters: VAR - Variable to add to [Number or String] VALUE - Value to add [Number or String] + Examples: (begin example) _counter = 2; @@ -531,6 +602,7 @@ Macro: ADD() ADD(_str,"Fred"); // _str => "hello Fred" (end) + Author: Sickboy ------------------------------------------- */ @@ -538,11 +610,14 @@ Macro: ADD() /* ------------------------------------------- Macro: SUB() + Description: Subtract a value from a number variable. VAR and VALUE should both be Numbers. + Parameters: VAR - Variable to subtract from [Number] VALUE - Value to subtract [Number] + Examples: (begin example) _numChickens = 2; @@ -554,19 +629,24 @@ Macro: SUB() /* ------------------------------------------- Macro: REM() + Description: Remove an element from an array each time it occurs. + This recreates the entire array, so use BIS_fnc_removeIndex if modification of the original array is required or if only one of the elements that matches ELEMENT needs to be removed. + Parameters: ARRAY - Array to modify [Array] ELEMENT - Element to remove [Any] + Examples: (begin example) _array = [1, 2, 3, 4, 3, 8]; REM(_array,3); // _array = [1, 2, 4, 8]; (end) + Author: Spooner ------------------------------------------- */ @@ -574,17 +654,21 @@ Macro: REM() /* ------------------------------------------- Macro: PUSH() + Description: Appends a single value onto the end of an ARRAY. Change is made to the ARRAY itself, not creating a new array. + Parameters: ARRAY - Array to push element onto [Array] ELEMENT - Element to push [Any] + Examples: (begin example) _fish = ["blue", "green", "smelly"]; PUSH(_fish,"monkey-flavoured"); // _fish => ["blue", "green", "smelly", "monkey-flavoured"] (end) + Author: Spooner ------------------------------------------- */ @@ -667,11 +751,14 @@ Macro: INTERSECTION() /* ------------------------------------------- Macro: ISNILS() + Description: Sets a variable with a value, but only if it is undefined. + Parameters: VARIABLE - Variable to set [Any, not nil] DEFAULT_VALUE - Value to set VARIABLE to if it is undefined [Any, not nil] + Examples: (begin example) // _fish is undefined @@ -684,6 +771,7 @@ Macro: ISNILS() ISNILS(_fish,0); // _fish => 12 (end) + Author: Sickboy ------------------------------------------- */ @@ -777,15 +865,10 @@ Macro: ISNILS() #define COMPILE_SCRIPT(var1) compileScript ['PATHTO_SYS(PREFIX,COMPONENT_F,var1)'] -#define VERSIONING_SYS(var1) class CfgSettings \ -{ \ - class CBA \ - { \ - class Versioning \ - { \ - class var1 \ - { \ - }; \ +#define VERSIONING_SYS(var1) class CfgSettings { \ + class CBA { \ + class Versioning { \ + class var1 {}; \ }; \ }; \ }; @@ -795,13 +878,16 @@ Macro: ISNILS() /* ------------------------------------------- Macro: GVAR() Get full variable identifier for a global variable owned by this component. + Parameters: VARIABLE - Partial name of global variable owned by this component [Any]. + Example: (begin example) GVAR(frog) = 12; // In SPON_FrogDancing component, equivalent to SPON_FrogDancing_frog = 12 (end) + Author: Sickboy ------------------------------------------- */ @@ -815,13 +901,16 @@ Macro: GVAR() /* ------------------------------------------- Macro: GVARMAIN() Get full variable identifier for a global variable owned by this addon. + Parameters: VARIABLE - Partial name of global variable owned by this addon [Any]. + Example: (begin example) GVARMAIN(frog) = 12; // In SPON_FrogDancing component, equivalent to SPON_frog = 12 (end) + Author: Sickboy ------------------------------------------- */ @@ -842,25 +931,34 @@ Macro: GVARMAIN() /* ------------------------------------------- Macro: PREP() + Description: Defines a function. + Full file path: '\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\fnc_.sqf' + Resulting function name: 'PREFIX_COMPONENT_' + The PREP macro should be placed in a script run by a XEH preStart and XEH preInit event. + The PREP macro allows for CBA function caching, which drastically speeds up load times. Beware though that function caching is enabled by default and as such to disable it, you need to #define DISABLE_COMPILE_CACHE above your #include "script_components.hpp" include! + The function will be defined in ui and mission namespace. It can not be overwritten without a mission restart. + Parameters: FUNCTION NAME - Name of the function, unquoted + Examples: (begin example) PREP(banana); call FUNC(banana); (end) + Author: dixon13 ------------------------------------------- */ @@ -876,14 +974,18 @@ Macro: PREP() /* ------------------------------------------- Macro: PATHTO_FNC() + Description: Defines a function inside CfgFunctions. + Full file path in addons: '\MAINPREFIX\PREFIX\SUBPREFIX\COMPONENT\fnc_.sqf' Define 'RECOMPILE' to enable recompiling. Define 'SKIP_FUNCTION_HEADER' to skip adding function header. + Parameters: FUNCTION NAME - Name of the function, unquoted + Examples: (begin example) // file name: fnc_addPerFrameHandler.sqf @@ -896,6 +998,7 @@ Macro: PATHTO_FNC() }; // -> CBA_fnc_addPerFrameHandler (end) + Author: dixon13, commy2 ------------------------------------------- */ @@ -932,12 +1035,9 @@ Macro: PATHTO_FNC() #define QQEFUNC(var1,var2) QUOTE(QEFUNC(var1,var2)) #ifndef PRELOAD_ADDONS - #define PRELOAD_ADDONS class CfgAddons \ -{ \ - class PreloadAddons \ - { \ - class ADDON \ - { \ + #define PRELOAD_ADDONS class CfgAddons { \ + class PreloadAddons { \ + class ADDON { \ list[]={ QUOTE(ADDON) }; \ }; \ }; \ @@ -947,8 +1047,10 @@ Macro: PATHTO_FNC() /* ------------------------------------------- Macros: ARG_#() Select from list of array arguments + Parameters: VARIABLE(1-8) - elements for the list + Author: Rommel ------------------------------------------- */ @@ -965,8 +1067,10 @@ Macros: ARG_#() Macros: ARR_#() Create list from arguments. Useful for working around , in macro parameters. 1-8 arguments possible. + Parameters: VARIABLE(1-8) - elements for the list + Author: Nou ------------------------------------------- */ @@ -983,9 +1087,11 @@ Macros: ARR_#() Macros: FORMAT_#(STR, ARG1) Format - Useful for working around , in macro parameters. 1-8 arguments possible. + Parameters: STRING - string used by format VARIABLE(1-8) - elements for usage in format + Author: Nou & Sickboy ------------------------------------------- */ @@ -1005,6 +1111,7 @@ Macros: FORMAT_#(STR, ARG1) /* ------------------------------------------- Macros: IS_x() Checking the data types of variables. + IS_ARRAY() - Array IS_BOOL() - Boolean IS_BOOLEAN() - UI display handle(synonym for ) @@ -1023,8 +1130,10 @@ Macros: IS_x() IS_SIDE() - Game side. IS_STRING() - World object. IS_TEXT() - Structured text. + Parameters: VARIABLE - Variable to check if it is of a particular type [Any, not nil] + Author: Spooner ------------------------------------------- */ @@ -1055,12 +1164,15 @@ Macros: IS_x() Macro: SCRIPT() Sets name of script (relies on PREFIX and COMPONENT values being #defined). Define 'SKIP_SCRIPT_NAME' to skip adding scriptName. + Parameters: NAME - Name of script [Indentifier] + Example: (begin example) SCRIPT(eradicateMuppets); (end) + Author: Spooner ------------------------------------------- */ @@ -1073,9 +1185,12 @@ Macro: SCRIPT() /* ------------------------------------------- Macros: EXPLODE_n() DEPRECATED - Use param/params commands added in Arma 3 1.48 + Splitting an ARRAY into a number of variables (A, B, C, etc). + Note that this NOT does make the created variables private. _PVT variants do. + EXPLODE_1(ARRAY,A,B) - Split a 1-element array into separate variable. EXPLODE_2(ARRAY,A,B) - Split a 2-element array into separate variables. EXPLODE_3(ARRAY,A,B,C) - Split a 3-element array into separate variables. @@ -1085,14 +1200,17 @@ Macros: EXPLODE_n() EXPLODE_7(ARRAY,A,B,C,D,E,F,G) - Split a 7-element array into separate variables. EXPLODE_8(ARRAY,A,B,C,D,E,F,G,H) - Split a 8-element array into separate variables. EXPLODE_9(ARRAY,A,B,C,D,E,F,G,H,I) - Split a 9-element array into separate variables. + Parameters: ARRAY - Array to read from [Array] A..H - Names of variables to set from array [Identifier] + Example: (begin example) _array = ["fred", 156.8, 120.9]; EXPLODE_3(_array,_name,_height,_weight); (end) + Author: Spooner ------------------------------------------- */ @@ -1135,8 +1253,10 @@ Macros: EXPLODE_n() /* ------------------------------------------- Macro: xSTRING() Get full string identifier from a stringtable owned by this component. + Parameters: VARIABLE - Partial name of global variable owned by this component [Any]. + Example: ADDON is CBA_Balls. (begin example) @@ -1145,6 +1265,7 @@ Macro: xSTRING() // Config String (note the $) CSTRING(Example); // $STR_CBA_Balls_Example; (end) + Author: Jonpas ------------------------------------------- */ @@ -1154,9 +1275,11 @@ Macro: xSTRING() #define ELSTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2)) #define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1)) #define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2)) + #define SUBCSTRING(var1) QUOTE(TRIPLES($STR,SUBADDON,var1)) #define LLSTRING(var1) localize QUOTE(TRIPLES(STR,ADDON,var1)) #define LELSTRING(var1,var2) localize QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2)) + #define LSUBLSTRING(var1) localize QUOTE(TRIPLES(STR,SUBADDON,var1)) #endif @@ -1167,8 +1290,11 @@ Group: Managing Function Parameters /* ------------------------------------------- Macros: PARAMS_n() DEPRECATED - Use param/params commands added in Arma 3 1.48 + Setting variables based on parameters passed to a function. + Each parameter is defines as private and set to the appropriate value from _this. + PARAMS_1(A) - Get 1 parameter from the _this array (or _this if it's not an array). PARAMS_2(A,B) - Get 2 parameters from the _this array. PARAMS_3(A,B,C) - Get 3 parameters from the _this array. @@ -1177,8 +1303,10 @@ Macros: PARAMS_n() PARAMS_6(A,B,C,D,E,F) - Get 6 parameters from the _this array. PARAMS_7(A,B,C,D,E,F,G) - Get 7 parameters from the _this array. PARAMS_8(A,B,C,D,E,F,G,H) - Get 8 parameters from the _this array. + Parameters: A..H - Name of variable to read from _this [Identifier] + Example: A function called like this: (begin example) @@ -1191,6 +1319,7 @@ Macros: PARAMS_n() // Rest of function follows... }; (end) + Author: Spooner ------------------------------------------- */ @@ -1207,12 +1336,15 @@ Macros: PARAMS_n() /* ------------------------------------------- Macro: DEFAULT_PARAM() DEPRECATED - Use param/params commands added in Arma 3 1.48 + Getting a default function parameter. This may be used together with to have a mix of required and optional parameters. + Parameters: INDEX - Index of parameter in _this [Integer, 0+] NAME - Name of the variable to set [Identifier] DEF_VALUE - Default value to use in case the array is too short or the value at INDEX is nil [Any] + Example: A function called with optional parameters: (begin example) @@ -1230,6 +1362,7 @@ Macro: DEFAULT_PARAM() // Rest of function follows... }; (end) + Author: Spooner ------------------------------------------- */ @@ -1242,11 +1375,15 @@ Macro: DEFAULT_PARAM() /* ------------------------------------------- Macro: KEY_PARAM() Get value from key in _this list, return default when key is not included in list. + Parameters: KEY - Key name [String] NAME - Name of the variable to set [Identifier] DEF_VALUE - Default value to use in case key not found [ANY] + Example: + + Author: Muzzleflash ------------------------------------------- */ @@ -1264,13 +1401,16 @@ Group: Assertions /* ------------------------------------------- Macro: ASSERT_TRUE() Asserts that a CONDITION is true. When an assertion fails, an error is raised with the given MESSAGE. + Parameters: CONDITION - Condition to assert as true [Boolean] MESSSAGE - Message to display if (A OPERATOR B) is false [String] + Example: (begin example) ASSERT_TRUE(_frogIsDead,"The frog is alive"); (end) + Author: Spooner ------------------------------------------- */ @@ -1283,13 +1423,16 @@ Macro: ASSERT_TRUE() /* ------------------------------------------- Macro: ASSERT_FALSE() Asserts that a CONDITION is false. When an assertion fails, an error is raised with the given MESSAGE. + Parameters: CONDITION - Condition to assert as false [Boolean] MESSSAGE - Message to display if (A OPERATOR B) is true [String] + Example: (begin example) ASSERT_FALSE(_frogIsDead,"The frog died"); (end) + Author: Spooner ------------------------------------------- */ @@ -1302,15 +1445,18 @@ Macro: ASSERT_FALSE() /* ------------------------------------------- Macro: ASSERT_OP() Asserts that (A OPERATOR B) is true. When an assertion fails, an error is raised with the given MESSAGE. + Parameters: A - First value [Any] OPERATOR - Binary operator to use [Operator] B - Second value [Any] MESSSAGE - Message to display if (A OPERATOR B) is false. [String] + Example: (begin example) ASSERT_OP(_fish,>,5,"Too few fish!"); (end) + Author: Spooner ------------------------------------------- */ @@ -1323,14 +1469,17 @@ Macro: ASSERT_OP() /* ------------------------------------------- Macro: ASSERT_DEFINED() Asserts that a VARIABLE is defined. When an assertion fails, an error is raised with the given MESSAGE.. + Parameters: VARIABLE - Variable to test if defined [String or Function]. MESSAGE - Message to display if variable is undefined [String]. + Examples: (begin example) ASSERT_DEFINED("_anUndefinedVar","Too few fish!"); ASSERT_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!"); (end) + Author: Spooner ------------------------------------------- */ @@ -1350,13 +1499,16 @@ Group: Unit tests Macro: TEST_TRUE() Tests that a CONDITION is true. If the condition is not true, an error is raised with the given MESSAGE. + Parameters: CONDITION - Condition to assert as true [Boolean] MESSSAGE - Message to display if (A OPERATOR B) is false [String] + Example: (begin example) TEST_TRUE(_frogIsDead,"The frog is alive"); (end) + Author: Killswitch ------------------------------------------- */ @@ -1374,13 +1526,16 @@ Macro: TEST_TRUE() Macro: TEST_FALSE() Tests that a CONDITION is false. If the condition is not false, an error is raised with the given MESSAGE. + Parameters: CONDITION - Condition to test as false [Boolean] MESSSAGE - Message to display if (A OPERATOR B) is true [String] + Example: (begin example) TEST_FALSE(_frogIsDead,"The frog died"); (end) + Author: Killswitch ------------------------------------------- */ @@ -1398,15 +1553,18 @@ Macro: TEST_FALSE() Macro: TEST_OP() Tests that (A OPERATOR B) is true. If the test fails, an error is raised with the given MESSAGE. + Parameters: A - First value [Any] OPERATOR - Binary operator to use [Operator] B - Second value [Any] MESSSAGE - Message to display if (A OPERATOR B) is false. [String] + Example: (begin example) TEST_OP(_fish,>,5,"Too few fish!"); (end) + Author: Killswitch ------------------------------------------- */ @@ -1424,15 +1582,18 @@ Macro: TEST_OP() Macro: TEST_DEFINED_AND_OP() Tests that A and B are defined and (A OPERATOR B) is true. If the test fails, an error is raised with the given MESSAGE. + Parameters: A - First value [Any] OPERATOR - Binary operator to use [Operator] B - Second value [Any] MESSSAGE - Message to display [String] + Example: (begin example) TEST_OP(_fish,>,5,"Too few fish!"); (end) + Author: Killswitch, PabstMirror ------------------------------------------- */ @@ -1453,14 +1614,17 @@ Macro: TEST_DEFINED_AND_OP() /* ------------------------------------------- Macro: TEST_DEFINED() Tests that a VARIABLE is defined. + Parameters: VARIABLE - Variable to test if defined [String or Function]. MESSAGE - Message to display if variable is undefined [String]. + Examples: (begin example) TEST_DEFINED("_anUndefinedVar","Too few fish!"); TEST_DEFINED({ obj getVariable "anUndefinedVar" },"Too many fish!"); (end) + Author: Killswitch ------------------------------------------- */ @@ -1481,17 +1645,22 @@ Group: Managing Deprecation /* ------------------------------------------- Macro: DEPRECATE_SYS() Allow deprecation of a function that has been renamed. + Replaces an old OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION (PREFIX_ prepended) with the intention that the old function will be disabled in the future. + Shows a warning in RPT each time the deprecated function is used, but runs the new function. + Parameters: OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] NEW_FUNCTION - Full name of new function [Function] + Example: (begin example) // After renaming CBA_fnc_frog as CBA_fnc_fish DEPRECATE_SYS(CBA_fnc_frog,CBA_fnc_fish); (end) + Author: Sickboy ------------------------------------------- */ @@ -1504,17 +1673,22 @@ Macro: DEPRECATE_SYS() /* ------------------------------------------- Macro: DEPRECATE() Allow deprecation of a function, in the current component, that has been renamed. + Replaces an OLD_FUNCTION (which will have PREFIX_ prepended) with a NEW_FUNCTION (PREFIX_ prepended) with the intention that the old function will be disabled in the future. + Shows a warning in RPT each time the deprecated function is used, but runs the new function. + Parameters: OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] NEW_FUNCTION - Name of new function, assuming PREFIX [Function] + Example: (begin example) // After renaming CBA_fnc_frog as CBA_fnc_fish DEPRECATE(fnc_frog,fnc_fish); (end) + Author: Sickboy ------------------------------------------- */ @@ -1524,17 +1698,22 @@ Macro: DEPRECATE() /* ------------------------------------------- Macro: OBSOLETE_SYS() Replace a function that has become obsolete. + Replace an obsolete OLD_FUNCTION with a simple COMMAND_FUNCTION, with the intention that anyone using the function should replace it with the simple command, since the function will be disabled in the future. + Shows a warning in RPT each time the deprecated function is used, and runs the command function. + Parameters: OLD_FUNCTION - Full name of old function [Identifier for function that does not exist any more] COMMAND_CODE - Code to replace the old function [Function] + Example: (begin example) // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: OBSOLETE_SYS(CBA_fMyWeapon,{ currentWeapon player }); (end) + Author: Spooner ------------------------------------------- */ @@ -1547,18 +1726,23 @@ Macro: OBSOLETE_SYS() /* ------------------------------------------- Macro: OBSOLETE() Replace a function, in the current component, that has become obsolete. + Replace an obsolete OLD_FUNCTION (which will have PREFIX_ prepended) with a simple COMMAND_CODE, with the intention that anyone using the function should replace it with the simple command. + Shows a warning in RPT each time the deprecated function is used. + Parameters: OLD_FUNCTION - Name of old function, assuming PREFIX [Identifier for function that does not exist any more] COMMAND_CODE - Code to replace the old function [Function] + Example: (begin example) // In Arma2, currentWeapon command made the CBA_fMyWeapon function obsolete: OBSOLETE(fMyWeapon,{ currentWeapon player }); (end) + Author: Spooner ------------------------------------------- */ @@ -1591,14 +1775,18 @@ Macro: OBSOLETE() /* ------------------------------------------- Macro: IS_ADMIN Check if the local machine is an admin in the multiplayer environment. + Reports 'true' for logged and voted in admins. + Parameters: None + Example: (begin example) // print "true" if player is admin systemChat str IS_ADMIN; (end) + Author: commy2 ------------------------------------------- */ @@ -1608,14 +1796,18 @@ Macro: IS_ADMIN /* ------------------------------------------- Macro: IS_ADMIN_LOGGED Check if the local machine is a logged in admin in the multiplayer environment. + Reports 'false' if the player was voted to be the admin. + Parameters: None + Example: (begin example) // print "true" if player is admin and entered in the server password systemChat str IS_ADMIN_LOGGED; (end) + Author: commy2 ------------------------------------------- */ @@ -1625,14 +1817,18 @@ Macro: IS_ADMIN_LOGGED /* ------------------------------------------- Macro: FILE_EXISTS Check if a file exists + Reports "false" if the file does not exist. + Parameters: FILE - Path to the file + Example: (begin example) // print "true" if file exists systemChat str FILE_EXISTS("\A3\ui_f\data\igui\cfg\cursors\weapon_ca.paa"); (end) + Author: commy2 ------------------------------------------- */ diff --git a/logolarge.paa b/logolarge.paa new file mode 100644 index 0000000..b67b3ce Binary files /dev/null and b/logolarge.paa differ diff --git a/mod.cpp b/mod.cpp index dd6ab1d..23768a9 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,3 +1,14 @@ -name = "DUI Squad Radar"; -dir = "@dui"; -author = "Diwako"; +name = "DUI - Squad Radar {version}"; +picture = "logolarge.paa"; +actionName = "Website"; +action = "https://github.com/diwako/diwako_dui"; +logoSmall = "logolarge.paa"; +logo = "logosmall.paa"; +logoOver = "logosmall.paa"; +tooltip = "DUI - Squad Radar"; +tooltipOwned = "DUI - Squad Radar"; +description = "DUI - Squad Radar"; +overview = "DUI - Squad Radar, is a mod which adds a compass and a list of units in your squad to your hud. The compass shows nearby squad mates and in which direction they are currently looking"; +author = "diwako"; +hidePicture = 0; +hideName = 0;