From 79773f1edbce436cd9798d7779efdf7f666798e0 Mon Sep 17 00:00:00 2001 From: Drofseh Date: Fri, 7 Jun 2019 11:30:23 -0700 Subject: [PATCH] Extend 3den selectable date range from 1900 to 2050 (#1155) * Extend 3den selectable date range * add commy2 suggestions * update ModuleDate_F with expanded years * add macro * Update addons/common/CfgVehicles.hpp Co-Authored-By: commy2 * Update addons/common/Cfg3DEN.hpp Co-Authored-By: commy2 --- addons/common/Cfg3DEN.hpp | 21 +++++++ addons/common/CfgVehicles.hpp | 92 ++++++++++++++++++++++++++++++ addons/common/script_component.hpp | 5 ++ 3 files changed, 118 insertions(+) diff --git a/addons/common/Cfg3DEN.hpp b/addons/common/Cfg3DEN.hpp index d61aacd8f..b884758e2 100644 --- a/addons/common/Cfg3DEN.hpp +++ b/addons/common/Cfg3DEN.hpp @@ -4,8 +4,29 @@ #define POS_H_TITLE(N) (N * 3.5 + 1 * 5) * (pixelH * pixelGrid * 0.50) #define POS_H_VALUE(N) N * 3.5 * (pixelH * pixelGrid * 0.50) +class ctrlCombo; + class Cfg3DEN { class Attributes { + class Default; + class Title: Default { + class Controls; + }; + + class Date: Title { + class Controls: Controls { + class ValueYear: ctrlCombo { + onLoad = "\ + params ['_ctrlYear'];\ + for '_y' from 1900 to 2050 do {\ + _ctrlYear lbSetValue [_ctrlYear lbAdd str _y, _y];\ + };\ + _ctrlYear lbSetCurSel 53;\ + "; + }; + }; + }; + class Edit; class EditMulti3: Edit { class Controls; diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index 67ce56ba7..0dc09c372 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -5,4 +5,96 @@ class CfgVehicles { scope = 1; displayName = ""; }; + + class Module_F; + class ModuleDate_F: Module_F { + class Arguments { + class Year { + class values { + YEAR(1900); + YEAR(1901); + YEAR(1902); + YEAR(1903); + YEAR(1904); + YEAR(1905); + YEAR(1906); + YEAR(1907); + YEAR(1908); + YEAR(1909); + YEAR(1910); + YEAR(1911); + YEAR(1912); + YEAR(1913); + YEAR(1914); + YEAR(1915); + YEAR(1916); + YEAR(1917); + YEAR(1918); + YEAR(1919); + YEAR(1920); + YEAR(1921); + YEAR(1922); + YEAR(1923); + YEAR(1924); + YEAR(1925); + YEAR(1926); + YEAR(1927); + YEAR(1928); + YEAR(1929); + YEAR(1930); + YEAR(1931); + YEAR(1932); + YEAR(1933); + YEAR(1934); + YEAR(1935); + YEAR(1936); + YEAR(1937); + YEAR(1938); + YEAR(1939); + YEAR(1940); + YEAR(1941); + YEAR(1942); + YEAR(1943); + YEAR(1944); + YEAR(1945); + YEAR(1946); + YEAR(1947); + YEAR(1948); + YEAR(1949); + YEAR(1950); + YEAR(1951); + YEAR(1952); + YEAR(1953); + YEAR(1954); + YEAR(1955); + YEAR(1956); + YEAR(1957); + YEAR(1958); + YEAR(1959); + YEAR(1960); + YEAR(1961); + YEAR(1962); + YEAR(1963); + YEAR(1964); + YEAR(1965); + YEAR(1966); + YEAR(1967); + YEAR(1968); + YEAR(1969); + YEAR(1970); + YEAR(1971); + YEAR(1972); + YEAR(1973); + YEAR(1974); + YEAR(1975); + YEAR(1976); + YEAR(1977); + YEAR(1978); + YEAR(1979); + YEAR(1980); + YEAR(1981); + }; + }; + }; + }; }; diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp index 3018585f6..eb9423b83 100644 --- a/addons/common/script_component.hpp +++ b/addons/common/script_component.hpp @@ -13,3 +13,8 @@ #include "\x\cba\addons\main\script_macros.hpp" #define DUMMY_POSITION [-1000, -1000, 0] + +#define YEAR(x) class Number##x {\ + name = QUOTE(x);\ + value = x;\ +}