100 {
101 ItemPreviewWidget iw;
102 InventoryItem dragged_item;
103 iw = ItemPreviewWidget.Cast( w.FindAnyWidget( "Render" ) );
104 if( !iw )
105 {
106 string name = w.GetName();
107 name.Replace(
"PanelWidget",
"Render" );
108 iw = ItemPreviewWidget.Cast( w.FindAnyWidget(
name ) );
109 }
110
112 {
113 return;
114 }
115
116 if(!dragged_item && iw)
117 dragged_item = InventoryItem.Cast( iw.
GetItem() );
118
119 if ( dragged_item == NULL)
120 return;
121
122 if (dragged_item && dragged_item.GetInventory().CanRemoveEntity() == false)
123 {
124 int color;
125
126 color =
ARGB( 150, 255, 1, 1 );
127
128 if( w.FindAnyWidget("Cursor") )
129 {
130 w.FindAnyWidget("Cursor").SetColor( color );
131 }
132 else
133 {
135 name.Replace(
"PanelWidget",
"Cursor" );
136 if( w.FindAnyWidget(
name ) )
137 {
138 w.FindAnyWidget(
name ).SetColor( color );
139 }
140 }
141 }
142 else
143 {
144 color =
ARGB( 150, 1, 255, 1 );
145
146 if( w.FindAnyWidget("Cursor") )
147 {
148 w.FindAnyWidget("Cursor").SetColor( color );
149 }
150 else
151 {
153 name.Replace(
"PanelWidget",
"Cursor" );
154 if( w.FindAnyWidget(
name ) )
155 {
156 w.FindAnyWidget(
name ).SetColor( color );
157 }
158 }
159 }
160 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
int ARGB(int a, int r, int g, int b)