Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Constants.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
3 //------------------------------------------------------------------------------------------------
4 
6 const float KILOMETERS_PER_HOUR_TO_METERS_PER_SEC = 0.277778; // 1 / 3.6
7 
8 const float METERS_TO_KNOTS = 1.943844;
9 const float KNOTS_TO_METERS = 0.514444;
10 
11 const float COLOR_255_TO_1 = 0.003921568; // 1 / 255
12 const float COLOR_1_TO_255 = 255;
13 
14 const int TRACE_LAYER_CAMERA = EPhysicsLayerDefs.Camera;
15 
16 class UIColors
17 {
18  static const ref Color DARK_SAGE = Color.FromSRGBA(86, 92, 84, 255);
19  static const ref Color DARK_GREY = Color.FromSRGBA(85, 85, 85, 255);
20  static const ref Color LIGHT_GREY = Color.FromSRGBA(255, 255, 255, 179);
21  static const ref Color TRANSPARENT = Color.FromSRGBA(0, 0, 0, 0);
22 
23  // Refined UI colors
24  static const ref Color CONTRAST_DISABLED = Color.FromSRGBA(0, 0, 0, 38);
25  static const ref Color CONTRAST_DEFAULT = Color.FromSRGBA(226, 167, 79, 76);
26  static const ref Color CONTRAST_HOVERED = Color.FromSRGBA(239, 199, 139, 102);
27  static const ref Color CONTRAST_CLICKED = Color.FromSRGBA(226, 167, 79, 255);
28  static const ref Color CONTRAST_CLICKED_HOVERED = Color.FromSRGBA(226, 167, 79, 255);
29 
30  static const ref Color WHITE_DISABLED = Color.FromSRGBA(255, 255, 255, 38);
31  static const ref Color WHITE_DEFAULT = Color.FromSRGBA(255, 255, 255, 25);
32  static const ref Color WHITE_HOVERED = Color.FromSRGBA(255, 255, 255, 102);
33 
34  static const ref Color BACKGROUND_DISABLED = Color.FromSRGBA(0, 0, 0, 38);
35  static const ref Color BACKGROUND_DEFAULT = Color.FromSRGBA(0, 0, 0, 102);
36  static const ref Color BACKGROUND_HOVERED = Color.FromSRGBA(0, 0, 0, 153);
37 
38  static const ref Color WARNING_FOCUSED = Color.FromSRGBA(249, 67, 67, 107);
39  static const ref Color INFO = Color.FromSRGBA(0, 128, 255, 255);
40 
41  // From Manual
42  static const ref Color HIGHLIGHTED = Color.FromSRGBA(255, 203, 123, 255); //#FFCB7B
43  static const ref Color NEUTRAL_INFORMATION = Color.FromSRGBA(255, 255, 255, 255); //#FFFFFF
44  static const ref Color NEUTRAL_ACTIVE_STANDBY = Color.FromSRGBA(189, 189, 188, 255); //#BDBDBC
45  static const ref Color IDLE_ACTIVE = Color.FromSRGBA(255, 255, 255, 179); //#FFFFFF at 70% Alpha
46  static const ref Color IDLE_DISABLED = Color.FromSRGBA(77, 77, 77, 255); //#4D4D4D
47  static const ref Color IDLE_DISABLED_TRANSPARENT = Color.FromSRGBA(77, 77, 77, 153); //60% #4D4D4D
48  static const ref Color WARNING = Color.FromSRGBA(249, 67, 67, 255); //#f94343 red
49  static const ref Color WARNING_DISABLED = Color.FromSRGBA(146, 72, 72, 255); //#924848 dark red
50  static const ref Color SLIGHT_WARNING = Color.FromSRGBA(234, 203, 131, 255); //#EACB83 light yellow
51  static const ref Color CONFIRM = Color.FromSRGBA(67, 194, 93, 255); //#43C25D green, Manual calls it POSITIVE
52  static const ref Color CONTRAST_COLOR = Color.FromSRGBA(226, 167, 79, 255); //#e2a74f REFORGER ORANGE
53  static const ref Color ONLINE = Color.FromSRGBA(0, 128, 255, 255); //#0080FF blue
54  static const ref Color EDIT_WIDGET_BACKGROUND = Color.FromSRGBA(42, 42, 42, 255); //#2a2a2a
55  static const ref Color SUB_HEADER = Color.FromSRGBA(255, 220, 105, 255); //#ffdc69 yellow
56 
57  //~ editor
58  static const ref Color EDITOR_ICON_COLOR_NEUTRAL = Color.FromSRGBA(255, 255, 255, 255);
59  static const ref Color EDITOR_ICON_COLOR_DESTROYED = Color(0.25, 0.25, 0.25, 1);
60 
61  //------------------------------------------------------------------------------------------------
65  static string GetColorAttribute(Color color)
66  {
67  if (color)
68  return string.Format("%1 %2 %3 %4", color.R(), color.G(), color.B(), color.A());
69 
70  return "1 1 1 1";
71  }
72 
73  //------------------------------------------------------------------------------------------------
77  static string SRGBAFloatToInt(Color color)
78  {
79  if (!color)
80  return "255, 255, 255, 255";
81 
82  Color returnColor = new Color(color.R(), color.G(), color.B(), color.A());
83 
84  //--- Convert to sRGBA format for rich text
85  returnColor.LinearToSRGB();
86 
87  //--- Convert to ints, no fractions allowed in rich text
88  int colorR = returnColor.R() * 255;
89  int colorG = returnColor.G() * 255;
90  int colorB = returnColor.B() * 255;
91  int colorA = returnColor.A() * 255;
92 
93  return string.Format("%1, %2, %3, %4", colorR, colorG, colorB, colorA);
94  }
95 }
96 
97 class GUIColors
98 {
99  static const ref Color DISABLED = Color.FromSRGBA(200, 200, 200, 100); //WHITE with 30% alpha converted to GREY with 100% alpha
100  static const ref Color DISABLED_GLOW = Color.FromSRGBA(0, 0, 0, 100);
101 
102  static const ref Color ENABLED = Color.FromSRGBA(255, 255, 255, 255); //WHITE
103  static const ref Color ENABLED_GLOW = Color.FromSRGBA(162, 162, 162, 255); //GREY
104 
105  static const ref Color DEFAULT = Color.FromSRGBA(255, 255, 255, 255); //WHITE
106  static const ref Color DEFAULT_GLOW = Color.FromSRGBA(0, 0, 0, 255); //BLACK
107  //---
108 
109  static const ref Color ORANGE = Color.FromSRGBA(226, 167, 80, 255); //ORANGE, standard UI orange, warnings
110  static const ref Color ORANGE_BRIGHT = Color.FromSRGBA(255, 207, 136, 255); //ORANGE (bright)
111  static const ref Color ORANGE_BRIGHT2 = Color.FromSRGBA(255, 233, 200, 255); //ORANGE (bright++)
112  static const ref Color ORANGE_DARK = Color.FromSRGBA(162, 97, 0, 255); //DARK ORANGE
113 
114  static const ref Color RED = Color.FromSRGBA(236, 80, 80, 255); //RED, error states
115  static const ref Color RED_BRIGHT = Color.FromSRGBA(255, 134, 134, 255); //RED (bright)
116  static const ref Color RED_BRIGHT2 = Color.FromSRGBA(255, 150, 150, 255); //RED (bright++)
117  static const ref Color RED_DARK = Color.FromSRGBA(162, 0, 0, 255); //DARK RED
118 
119  static const ref Color BLUE = Color.FromSRGBA(41, 127, 240, 255); //BLUE
120  static const ref Color BLUE_BRIGHT = Color.FromSRGBA(122, 175, 255, 255); //BLUE (bright)
121  static const ref Color BLUE_BRIGHT2 = Color.FromSRGBA(184, 212, 255, 255); //BLUE (bright++)
122  static const ref Color BLUE_DARK = Color.FromSRGBA(27, 92, 189, 255); //DARK BLUE
123 
124  static const ref Color GREEN = Color.FromSRGBA(37, 209, 29, 255); //GREEN
125  static const ref Color GREEN_BRIGHT = Color.FromSRGBA(157, 250, 153, 255); //GREEN (bright)
126  static const ref Color GREEN_BRIGHT2 = Color.FromSRGBA(216, 255, 214, 255); //GREEN (bright++)
127  static const ref Color GREEN_DARK = Color.FromSRGBA(28, 157, 22, 255); //DARK GREEN
128 }
129 
131 {
132  // Animation
133  static const float FADE_RATE_INSTANT = 0;
134  static const float FADE_RATE_SUPER_FAST = 20;
135  static const float FADE_RATE_FAST = 10;
136  static const float FADE_RATE_DEFAULT = 5; // Used for near instant actions
137  static const float FADE_RATE_SLOW = 1; // Used for fading out elements that should be visible for some time
138  static const float FADE_RATE_SUPER_SLOW = 0.2; // Very slow fade out
139 
140  // Spinners
141  static const float PROCESSING_SPINNER_ANIMATION_SPEED = 0.75;
142 
143  // Common labels
144  static const string FAVORITE_LABEL_ADD = "#AR-Workshop_ButtonAddToFavourites";
145  static const string FAVORITE_LABEL_REMOVE = "#AR-Workshop_ButtonRemoveFavourites";
146  static const string BOHEMIA_INTERACTIVE = "Bohemia Interactive";
147  static const string BOHEMIA_INTERACTIVE_LOC = "#AR-Author_BI";
148 
149  // Common icons
150  static const ResourceName ICONS_IMAGE_SET = "{3262679C50EF4F01}UI/Textures/Icons/icons_wrapperUI.imageset";
151  static const ResourceName ICONS_GLOW_IMAGE_SET = "{00FE3DBDFD15227B}UI/Textures/Icons/icons_wrapperUI-glow.imageset";
152 
153  static const string ACTION_DISPLAY_ICON_SCALE_BIG = "1.25";
154  static const string ACTION_DISPLAY_ICON_SCALE_VERY_BIG = "1.5";
155 
156  // Values
157  static const float DISABLED_WIDGET_OPACITY = 0.3;
158  static const float ENABLED_WIDGET_OPACITY = 1;
159 
160  static const float DISABLED_WIDGET_SATURATION = 0.5;
161  static const float ENABLED_WIDGET_SATURATION = 1;
162 
163  static const int LOADING_SCREEN_Z_ORDER = 1000;
164  static const int SPLASH_SCREEN_Z_ORDER = 1001;
165 
166  // Menu base actions
167  static const string MENU_ACTION_LEFT = "MenuLeft";
168  static const string MENU_ACTION_RIGHT = "MenuRight";
169  static const string MENU_ACTION_UP = "MenuUp";
170  static const string MENU_ACTION_DOWN = "MenuDown";
171  static const string MENU_ACTION_BACK = "MenuBack";
172  static const string MENU_ACTION_SELECT = "MenuSelect";
173 
174  // Connection related
175  static const string ICON_SERVICES_ISSUES = "connection-issues";
176  static const string ICON_CONNECTION = "connection";
177  static const string ICON_DISCONNECTION = "disconnection";
178 
179  static const string MESSAGE_SERVICES_ISSUES = "#AR-CoreMenus_Tooltips_UnavailableServices";
180  static const string MESSAGE_CONNECTING = "#AR-Workshop_Connecting";
181  static const string MESSAGE_DISCONNECTION = "#AR-CoreMenus_Tooltips_NoConnection";
182 
183  //------------------------------------------------------------------------------------------------
184  // Convert the action display state to a string for attributes and Rich Text formatting
185  static string GetActionDisplayStateAttribute(SCR_EActionDisplayState state)
186  {
187  return typename.EnumToString(SCR_EActionDisplayState, state);
188  }
189 }
190 
191 // Input action display state for Rich text widgets
192 // States allow overriding icon colors in {2F14B8749FE911B4}Configs/WidgetLibrary/SCR_InputButton/SCR_InputButtonLayout.conf
193 enum SCR_EActionDisplayState
194 {
195  DEFAULT,
196  DISABLED,
198 }
BLUE
@ BLUE
Definition: SCR_BaseVehicleInfo.c:19
KNOTS_TO_METERS
const float KNOTS_TO_METERS
Definition: Constants.c:9
ORANGE
@ ORANGE
Definition: SCR_BaseVehicleInfo.c:21
UIConstants
Definition: Constants.c:130
RED
@ RED
Definition: SCR_BaseVehicleInfo.c:22
DEFAULT
@ DEFAULT
Definition: SCR_CampaignFeedbackComponent.c:1421
METERS_TO_KNOTS
const float METERS_TO_KNOTS
Definition: Constants.c:8
COLOR_1_TO_255
const float COLOR_1_TO_255
Definition: Constants.c:12
GREEN
@ GREEN
Definition: SCR_BaseVehicleInfo.c:20
UIColors
Definition: Constants.c:16
TRACE_LAYER_CAMERA
const int TRACE_LAYER_CAMERA
Definition: Constants.c:14
NON_INTERACTABLE_HINT
enum ETimeFormatParam NON_INTERACTABLE_HINT
COLOR_255_TO_1
const float COLOR_255_TO_1
Definition: Constants.c:11
METERS_PER_SEC_TO_KILOMETERS_PER_HOUR
const float METERS_PER_SEC_TO_KILOMETERS_PER_HOUR
Contains various global constants.
Definition: Constants.c:5
DISABLED
class UIColors DISABLED
KILOMETERS_PER_HOUR_TO_METERS_PER_SEC
const float KILOMETERS_PER_HOUR_TO_METERS_PER_SEC
Definition: Constants.c:6