Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
armband_colorbase.c
Go to the documentation of this file.
2 {
3  override bool CanPutInCargo( EntityAI parent )
4  {
5  if( !super.CanPutInCargo(parent) ) {return false;}
6  if ( GetNumberOfItems() == 0 || !parent || parent.IsMan() )
7  {
8  return true;
9  }
10  return false;
11  }
12 
13  override bool CanPutAsAttachment( EntityAI parent )
14  {
15  if(!super.CanPutAsAttachment(parent)) {return false;}
16  if ( GetQuantity() <= 1 )
17  {
18  return true;
19  }
20  return false;
21  }
22 
23  override void SetActions()
24  {
25  super.SetActions();
27  }
28 
29  override void SwitchItemSelectionTextureEx(EItemManipulationContext context, Param par = null)
30  {
31  super.SwitchItemSelectionTextureEx(context, par);
32 
33  if (context == EItemManipulationContext.ATTACHING || context == EItemManipulationContext.UPDATE)
34  {
35  Param1<PlayerBase> data = Param1<PlayerBase>.Cast(par);
36  if (!data)
37  {
38  return;
39  }
40 
41  PlayerBase player = data.param1;
42 
43  int selection_idx = -1;
44  string texture;
45 
46  array<string> show_selections = new array<string>;
47  array<string> hide_selections = new array<string>;
48 
49  //has top
50  if (player.FindAttachmentBySlotName("Body"))
51  {
52  show_selections.Insert("camoMale_big_a");
53  show_selections.Insert("camoMale_big_b");
54  show_selections.Insert("camoFemale_big_a");
55  show_selections.Insert("camoFemale_big_b");
56 
57  hide_selections.Insert("camoMale_small_a");
58  hide_selections.Insert("camoMale_small_b");
59  hide_selections.Insert("camoFemale_small_a");
60  hide_selections.Insert("camoFemale_small_b");
61  }
62  //has no top
63  else
64  {
65  hide_selections.Insert("camoMale_big_a");
66  hide_selections.Insert("camoMale_big_b");
67  hide_selections.Insert("camoFemale_big_a");
68  hide_selections.Insert("camoFemale_big_b");
69 
70  show_selections.Insert("camoMale_small_a");
71  show_selections.Insert("camoMale_small_b");
72  show_selections.Insert("camoFemale_small_a");
73  show_selections.Insert("camoFemale_small_b");
74  }
75 
76  int i;
77  for (i = 0; i < show_selections.Count(); i++)
78  {
79  selection_idx = GetHiddenSelectionIndex(show_selections[i]);
80  texture = GetHiddenSelectionsData().GetHiddenSelectionsTextures()[selection_idx];
81  SetObjectTexture( selection_idx, texture );
82  }
83 
84  for (i = 0; i < hide_selections.Count(); i++)
85  {
86  selection_idx = GetHiddenSelectionIndex(hide_selections[i]);
87  SetObjectTexture( selection_idx, "" );
88  }
89  }
90  }
91 };
92 
93 class Armband_Dyed extends Armband_ColorBase {};
94 class Armband_White extends Armband_ColorBase {};
95 class Armband_Yellow extends Armband_ColorBase {};
96 class Armband_Orange extends Armband_ColorBase {};
97 class Armband_Red extends Armband_ColorBase {};
98 class Armband_Green extends Armband_ColorBase {};
99 class Armband_Pink extends Armband_ColorBase {};
100 class Armband_Blue extends Armband_ColorBase {};
101 class Armband_Rex extends Armband_ColorBase {};
102 class Armband_Zagorky extends Armband_ColorBase {};
103 class Armband_Crook extends Armband_ColorBase {};
104 class Armband_Black extends Armband_ColorBase {};
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
CanPutAsAttachment
override bool CanPutAsAttachment(EntityAI parent)
Definition: itembase.c:4021
GetQuantity
override float GetQuantity()
Definition: itembase.c:3316
PlayerBase
Definition: playerbaseclient.c:1
CanPutInCargo
override bool CanPutInCargo(EntityAI parent)
Definition: explosivesbase.c:247
Clothing
Definition: armband_colorbase.c:1
Armband_ColorBase
Definition: armband_colorbase.c:93
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
SetActions
void SetActions()
Definition: advancedcommunication.c:79
array< string >
GetNumberOfItems
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
Definition: itembase.c:3380
ActionWringClothes
Definition: actionwringclothes.c:12
EntityAI
Definition: building.c:5