Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
colormanager.c
Go to the documentation of this file.
2{
3 private ref static ColorManager m_Instance;
4
5 static int COLOR_NORMAL_TEXT = ARGB( 255, 255, 255, 255 );
6 static int COLOR_NORMAL_PANEL = ARGB( 140, 0, 0, 0 );
7 static int COLOR_HIGHLIGHT_TEXT = ARGB( 255, 200, 0, 0 );
8 static int COLOR_HIGHLIGHT_PANEL = ARGB( 255, 0, 0, 0 );
9 static int COLOR_SELECTED_TEXT = ARGB( 255, 255, 255, 255 );
10 static int COLOR_SELECTED_PANEL = ARGB( 255, 200, 0, 0 );
11 static int COLOR_DISABLED_TEXT = ARGB( 100, 255, 255, 255 );
12 static int COLOR_DISABLED_PANEL = ARGB( 140, 0, 0, 0 );
13
14 static int ITEM_BACKGROUND_COLOR = ARGB( 50, 255, 255, 255 );
15 static int BASE_COLOR = ARGB( 10, 255, 255, 255 );
16 static int RED_COLOR = ARGB( 150, 255, 1, 1 );
17 static int GREEN_COLOR = ARGB( 150, 1, 255, 1 );
18 static int SWAP_COLOR = ARGB( 150, 135, 206, 250 );
19 static int FSWAP_COLOR = ARGB( 150, 35, 106, 150 );
20 static int COMBINE_COLOR = ARGB( 150, 255, 165, 0 );
21
22 void ColorManager()
23 {
24 m_Instance = this;
25 }
26
27 static ColorManager GetInstance()
28 {
29 return m_Instance;
30 }
31
32 void SetColor( Widget w, int color )
33 {
34 if ( w.FindAnyWidget( "Cursor" ) )
35 {
36 w.FindAnyWidget( "Cursor" ).SetColor( color );
37 }
38 else
39 {
40 string name = w.GetName();
41 name.Replace( "PanelWidget", "Cursor" );
42 Widget w2 = w.GetParent().FindAnyWidget( name );
43 if( w2 )
44 {
45 w2.SetColor( color );
46 }
47 }
48 }
49
50 //TODO: revise this mess
51 int GetItemColor( ItemBase item )
52 {
53 int color = -1;
54 ItemBase dragged_item = ItemBase.Cast( ItemManager.GetInstance().GetDraggedItem() );
55 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
56
57 if ( item == dragged_item )
58 return color;
59
60 // if item icon is main icon (view, viewgrid )
61 if ( item.GetHierarchyParent() && item.GetHierarchyParent() != player )
62 {
63 color = -1;
64 }
65
66 if ( item )
67 {
68 float temperature = item.GetTemperature();
69 if ( temperature )
70 {
71 color = ObjectTemperatureState.GetStateData(temperature).m_Color;
72 }
73 }
74 return color;
75 }
76}
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
EntityAI GetDraggedItem()
static ItemManager GetInstance()
proto native CGame GetGame()
PlayerBase GetPlayer()
int ARGB(int a, int r, int g, int b)
Definition proto.c:322