-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathhuman.dm
More file actions
454 lines (389 loc) · 13.3 KB
/
Copy pathhuman.dm
File metadata and controls
454 lines (389 loc) · 13.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
/atom/movable/screen/human
icon = 'icons/hud/screen_midnight.dmi'
/atom/movable/screen/human/toggle
name = "toggle"
icon_state = "toggle"
base_icon_state = "toggle"
mouse_over_pointer = MOUSE_HAND_POINTER
/atom/movable/screen/human/toggle/Click()
var/mob/targetmob = usr
if(isobserver(usr))
if(ishuman(usr.client.eye) && (usr.client.eye != usr))
var/mob/M = usr.client.eye
targetmob = M
if(usr.hud_used.inventory_shown && targetmob.hud_used)
usr.hud_used.inventory_shown = FALSE
usr.client.screen -= targetmob.hud_used.toggleable_inventory
else
usr.hud_used.inventory_shown = TRUE
usr.client.screen += targetmob.hud_used.toggleable_inventory
targetmob.hud_used.hidden_inventory_update(usr)
update_appearance()
/atom/movable/screen/human/toggle/update_icon_state()
icon_state = "[base_icon_state][hud?.inventory_shown ? "_active" : ""]"
return ..()
/atom/movable/screen/ling
icon = 'icons/hud/screen_changeling.dmi'
/atom/movable/screen/ling/chems
name = "chemical storage"
icon_state = "power_display"
screen_loc = ui_lingchemdisplay
/atom/movable/screen/ling/sting
name = "current sting"
screen_loc = ui_lingstingdisplay
invisibility = INVISIBILITY_ABSTRACT
mouse_over_pointer = MOUSE_HAND_POINTER
/atom/movable/screen/ling/sting/Click()
if(isobserver(usr))
return
var/mob/living/carbon/carbon_user = usr
carbon_user.unset_sting()
/datum/hud/human/New(mob/living/carbon/human/owner)
..()
var/atom/movable/screen/using
var/atom/movable/screen/inventory/inv_box
using = new /atom/movable/screen/language_menu(null, src)
using.icon = ui_style
using.screen_loc = ui_human_language
static_inventory += using
using = new /atom/movable/screen/navigate(null, src)
using.icon = ui_style
using.screen_loc = ui_human_navigate
static_inventory += using
using = new /atom/movable/screen/area_creator(null, src)
using.icon = ui_style
using.screen_loc = ui_human_area
static_inventory += using
action_intent = new /atom/movable/screen/combattoggle/flashy(null, src)
action_intent.icon = ui_style
action_intent.screen_loc = ui_combat_toggle
static_inventory += action_intent
floor_change = new /atom/movable/screen/floor_changer/vertical(null, src)
floor_change.icon = ui_style
floor_change.screen_loc = ui_human_floor_changer
static_inventory += floor_change
using = new /atom/movable/screen/mov_intent(null, src)
using.icon = ui_style
using.update_appearance() // NON-MODULE CHANGE
using.screen_loc = ui_movi
static_inventory += using
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "uniform"
inv_box.icon = ui_style
inv_box.slot_id = ITEM_SLOT_ICLOTHING
inv_box.icon_state = "uniform"
inv_box.icon_full = "template"
inv_box.screen_loc = ui_iclothing
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "suit"
inv_box.icon = ui_style
inv_box.slot_id = ITEM_SLOT_OCLOTHING
inv_box.icon_state = "suit"
inv_box.icon_full = "template"
inv_box.screen_loc = ui_oclothing
toggleable_inventory += inv_box
build_hand_slots()
using = new /atom/movable/screen/drop(null, src)
using.icon = ui_style
using.screen_loc = ui_swaphand_position(owner, 1)
static_inventory += using
using = new /atom/movable/screen/swap_hand(null, src)
using.icon = ui_style
using.icon_state = "act_swap"
using.screen_loc = ui_swaphand_position(owner, 2)
static_inventory += using
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "id"
inv_box.icon = ui_style
inv_box.icon_state = "id"
inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_id
inv_box.slot_id = ITEM_SLOT_ID
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "mask"
inv_box.icon = ui_style
inv_box.icon_state = "mask"
inv_box.icon_full = "template"
inv_box.screen_loc = ui_mask
inv_box.slot_id = ITEM_SLOT_MASK
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "neck"
inv_box.icon = ui_style
inv_box.icon_state = "neck"
inv_box.icon_full = "template"
inv_box.screen_loc = ui_neck
inv_box.slot_id = ITEM_SLOT_NECK
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "back"
inv_box.icon = ui_style
inv_box.icon_state = "back"
inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_back
inv_box.slot_id = ITEM_SLOT_BACK
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "left pocket"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_storage1
inv_box.slot_id = ITEM_SLOT_LPOCKET
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "right pocket"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_storage2
inv_box.slot_id = ITEM_SLOT_RPOCKET
static_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "suit storage"
inv_box.icon = ui_style
inv_box.icon_state = "suit_storage"
inv_box.icon_full = "template"
inv_box.screen_loc = ui_sstore1
inv_box.slot_id = ITEM_SLOT_SUITSTORE
static_inventory += inv_box
resist_icon = new /atom/movable/screen/resist(null, src)
resist_icon.icon = ui_style
resist_icon.screen_loc = ui_above_movement
hotkeybuttons += resist_icon
using = new /atom/movable/screen/human/toggle(null, src)
using.icon = ui_style
using.screen_loc = ui_inventory
static_inventory += using
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "gloves"
inv_box.icon = ui_style
inv_box.icon_state = "gloves"
inv_box.icon_full = "template"
inv_box.screen_loc = ui_gloves
inv_box.slot_id = ITEM_SLOT_GLOVES
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "eyes"
inv_box.icon = ui_style
inv_box.icon_state = "glasses"
inv_box.icon_full = "template"
inv_box.screen_loc = ui_glasses
inv_box.slot_id = ITEM_SLOT_EYES
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "ears"
inv_box.icon = ui_style
inv_box.icon_state = "ears"
inv_box.icon_full = "template"
inv_box.screen_loc = ui_ears
inv_box.slot_id = ITEM_SLOT_EARS
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "head"
inv_box.icon = ui_style
inv_box.icon_state = "head"
inv_box.icon_full = "template"
inv_box.screen_loc = ui_head
inv_box.slot_id = ITEM_SLOT_HEAD
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "shoes"
inv_box.icon = ui_style
inv_box.icon_state = "shoes"
inv_box.icon_full = "template"
inv_box.screen_loc = ui_shoes
inv_box.slot_id = ITEM_SLOT_FEET
toggleable_inventory += inv_box
inv_box = new /atom/movable/screen/inventory(null, src)
inv_box.name = "belt"
inv_box.icon = ui_style
inv_box.icon_state = "belt"
inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_belt
inv_box.slot_id = ITEM_SLOT_BELT
static_inventory += inv_box
throw_icon = new /atom/movable/screen/throw_catch(null, src)
throw_icon.icon = ui_style
throw_icon.screen_loc = ui_drop_throw
hotkeybuttons += throw_icon
rest_icon = new /atom/movable/screen/rest(null, src)
rest_icon.icon = ui_style
rest_icon.screen_loc = ui_rest
rest_icon.update_appearance()
static_inventory += rest_icon
sleep_icon = new /atom/movable/screen/sleep(null, src)
sleep_icon.icon = ui_style
sleep_icon.screen_loc = ui_above_throw
spacesuit = new /atom/movable/screen/spacesuit(null, src)
infodisplay += spacesuit
healths = new /atom/movable/screen/healths(null, src)
healths.name = "heart rate"
infodisplay += healths
hunger = new /atom/movable/screen/hunger(null, src)
infodisplay += hunger
healthdoll = new /atom/movable/screen/healthdoll/human(null, src)
healthdoll.name = "body status"
infodisplay += healthdoll
/*
stamina = new /atom/movable/screen/stamina(null, src)
infodisplay += stamina
*/
pull_icon = new /atom/movable/screen/pull(null, src)
pull_icon.icon = ui_style
pull_icon.screen_loc = ui_above_movement_top
pull_icon.update_appearance()
static_inventory += pull_icon
zone_select = new /atom/movable/screen/zone_sel(null, src)
zone_select.icon = ui_style
zone_select.update_appearance()
static_inventory += zone_select
combo_display = new /atom/movable/screen/combo(null, src)
infodisplay += combo_display
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_appearance()
update_locked_slots()
/datum/hud/human/update_locked_slots()
if(!mymob)
return
// NON-MODULE CHANGE
var/blocked_slots = NONE
var/mob/living/carbon/human/human_mob = mymob
if(istype(human_mob))
blocked_slots |= human_mob.dna?.species?.no_equip_flags
if((isnull(human_mob.w_uniform) || !(human_mob.w_uniform.item_flags & IN_INVENTORY)) && !HAS_TRAIT(human_mob, TRAIT_NO_JUMPSUIT))
var/obj/item/bodypart/chest = human_mob.get_bodypart(BODY_ZONE_CHEST)
if(isnull(chest) || IS_ORGANIC_LIMB(chest))
blocked_slots |= ITEM_SLOT_ID|ITEM_SLOT_BELT
var/obj/item/bodypart/left_leg = human_mob.get_bodypart(BODY_ZONE_L_LEG)
if(isnull(left_leg) || IS_ORGANIC_LIMB(left_leg))
blocked_slots |= ITEM_SLOT_LPOCKET
var/obj/item/bodypart/right_leg = human_mob.get_bodypart(BODY_ZONE_R_LEG)
if(isnull(right_leg) || IS_ORGANIC_LIMB(right_leg))
blocked_slots |= ITEM_SLOT_RPOCKET
if(isnull(human_mob.wear_suit) || !(human_mob.wear_suit.item_flags & IN_INVENTORY))
blocked_slots |= ITEM_SLOT_SUITSTORE
if(human_mob.num_hands < 2)
blocked_slots |= ITEM_SLOT_GLOVES
if(human_mob.num_legs < 2)
blocked_slots |= ITEM_SLOT_FEET
var/obj/item/bodypart/head/head = human_mob.get_bodypart(BODY_ZONE_HEAD)
if(isnull(head))
blocked_slots |= ITEM_SLOT_HEAD|ITEM_SLOT_EARS|ITEM_SLOT_EYES|ITEM_SLOT_MASK
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(!inv.slot_id)
continue
inv.alpha = (blocked_slots & inv.slot_id) ? 128 : initial(inv.alpha)
/datum/hud/human/hidden_inventory_update(mob/viewer)
if(!mymob)
return
var/mob/living/carbon/human/H = mymob
var/mob/screenmob = viewer || H
if(screenmob.hud_used.inventory_shown && screenmob.hud_used.hud_shown)
if(H.shoes)
H.shoes.screen_loc = ui_shoes
screenmob.client.screen += H.shoes
if(H.gloves)
H.gloves.screen_loc = ui_gloves
screenmob.client.screen += H.gloves
if(H.ears)
H.ears.screen_loc = ui_ears
screenmob.client.screen += H.ears
if(H.glasses)
H.glasses.screen_loc = ui_glasses
screenmob.client.screen += H.glasses
if(H.w_uniform)
H.w_uniform.screen_loc = ui_iclothing
screenmob.client.screen += H.w_uniform
if(H.wear_suit)
H.wear_suit.screen_loc = ui_oclothing
screenmob.client.screen += H.wear_suit
if(H.wear_mask)
H.wear_mask.screen_loc = ui_mask
screenmob.client.screen += H.wear_mask
if(H.wear_neck)
H.wear_neck.screen_loc = ui_neck
screenmob.client.screen += H.wear_neck
if(H.head)
H.head.screen_loc = ui_head
screenmob.client.screen += H.head
else
if(H.shoes)
screenmob.client.screen -= H.shoes
if(H.gloves)
screenmob.client.screen -= H.gloves
if(H.ears)
screenmob.client.screen -= H.ears
if(H.glasses)
screenmob.client.screen -= H.glasses
if(H.w_uniform)
screenmob.client.screen -= H.w_uniform
if(H.wear_suit)
screenmob.client.screen -= H.wear_suit
if(H.wear_mask)
screenmob.client.screen -= H.wear_mask
if(H.wear_neck)
screenmob.client.screen -= H.wear_neck
if(H.head)
screenmob.client.screen -= H.head
/datum/hud/human/persistent_inventory_update(mob/viewer)
if(!mymob)
return
..()
var/mob/living/carbon/human/H = mymob
var/mob/screenmob = viewer || H
if(screenmob.hud_used)
if(screenmob.hud_used.hud_shown)
if(H.s_store)
H.s_store.screen_loc = ui_sstore1
screenmob.client.screen += H.s_store
if(H.wear_id)
H.wear_id.screen_loc = ui_id
screenmob.client.screen += H.wear_id
if(H.belt)
H.belt.screen_loc = ui_belt
screenmob.client.screen += H.belt
if(H.back)
H.back.screen_loc = ui_back
screenmob.client.screen += H.back
if(H.l_store)
H.l_store.screen_loc = ui_storage1
screenmob.client.screen += H.l_store
if(H.r_store)
H.r_store.screen_loc = ui_storage2
screenmob.client.screen += H.r_store
else
if(H.s_store)
screenmob.client.screen -= H.s_store
if(H.wear_id)
screenmob.client.screen -= H.wear_id
if(H.belt)
screenmob.client.screen -= H.belt
if(H.back)
screenmob.client.screen -= H.back
if(H.l_store)
screenmob.client.screen -= H.l_store
if(H.r_store)
screenmob.client.screen -= H.r_store
if(hud_version != HUD_STYLE_NOHUD)
for(var/obj/item/I in H.held_items)
I.screen_loc = ui_hand_position(H.get_held_index_of_item(I))
screenmob.client.screen += I
else
for(var/obj/item/I in H.held_items)
I.screen_loc = null
screenmob.client.screen -= I
/mob/living/carbon/human/verb/toggle_hotkey_verbs()
set category = "OOC"
set name = "Toggle hotkey buttons"
set desc = "This disables or enables the user interface buttons which can be used with hotkeys."
if(hud_used.hotkey_ui_hidden)
client.screen += hud_used.hotkeybuttons
hud_used.hotkey_ui_hidden = FALSE
else
client.screen -= hud_used.hotkeybuttons
hud_used.hotkey_ui_hidden = TRUE