Add version info to CfgPatches
Needs Review, Needs TriagePublic

Description

Currently there's no method to find the mod version from within the game. This is sad.

Suggestion: do as CBA does.

In CBA-style projects,version info is put into the CfgPatches >> _addon class

For example:

class CfgPatches {
  class MyMod {
    version = 3.15;
    versionAr[] = {3,15,3,210310};
    versionStr = "3.15.3.210310";
  };
};

Details

Branch
Release/Stable
Reproducable without other mods?
Yes
audiocustoms added a subscriber: audiocustoms.EditedJun 16 2021, 10:47 PM

This could be added to the LoadOrder i guess.
No idea if it works with strings, that's up to people with bigger heads like me to find out :D

class CfgPatches {
    class CUP_Weapons_LoadOrder {		
	author = "$STR_CUP_AUTHOR_STRING";
        units[] = {};
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = {"blah"};
        version = $VERNUMBER_WEAPONS;
    	versionAr[] = {$VERNUMBER_WEAPONS};
    	versionStr = "$VERNUMBER_WEAPONS";
    };
};

It then would be awesome if the build server could fill the strings according to the build number...

AFAIK adding it to main patches is common practice, and where people generally look for version information