|
| 1 | +// This fullscreen overlay prevents clients with HW accel or directX disabled from seeing anything |
| 2 | +// As it's only transparent with full rendering capabilities ON. |
| 3 | +// If HW accel is OFF, BLEND_MULTIPLY is turned to BLEND_OVERLAY, manually. |
| 4 | +// If HW accel is ON but DirectX and shaders are fucked, the colour matrix giving the full black whiteness fails to render |
| 5 | +// and it stays as pitch black, resulting in black multiplying into black. |
| 6 | +/obj/abstract/screen/fullscreen/__secret__hwfuck |
| 7 | + plane = HUD_PLANE + 1 |
| 8 | + icon = 'icons/secret/x.png' |
| 9 | + blend_mode = BLEND_DEFAULT |
| 10 | + mouse_opacity = 0 |
| 11 | + color = list( |
| 12 | + 0, 0, 0, 0, |
| 13 | + 0, 0, 0, 0, |
| 14 | + 0, 0, 0, 0, |
| 15 | + 0, 0, 0, 0, |
| 16 | + 1, 1, 1, 1 |
| 17 | + ) |
| 18 | + var/client/my_client |
| 19 | + |
| 20 | +/client |
| 21 | + var/obj/abstract/screen/fullscreen/__secret__hwfuck/HW |
| 22 | + |
| 23 | +/obj/abstract/screen/fullscreen/__secret__hwfuck/New(var/client/C) |
| 24 | + my_client = C |
| 25 | + my_client.HW = src |
| 26 | + verbs.Cut() |
| 27 | + ..() |
| 28 | + |
| 29 | +/obj/abstract/screen/fullscreen/__secret__hwfuck/proc/check() |
| 30 | + if (winget(my_client, null, "hwmode") != "true") |
| 31 | + my_client.screen |= src |
| 32 | + if (my_client in shitlist) |
| 33 | + to_chat(my_client, "<span class='danger big'>You have been kicked for not enabling hardware acceleration in the game client's options menu.<br>Please enable hardware acceleration, then reconnect.</span>") |
| 34 | + sleep(1) |
| 35 | + var/log = "[key_name(my_client)] has been kicked for failing to activate hardware acceleration on their client." |
| 36 | + message_admins(log) |
| 37 | + log_game(log) |
| 38 | + del(my_client) |
| 39 | + else |
| 40 | + my_client << 'sound/effects/adminhelp.ogg' |
| 41 | + to_chat(my_client, "<span class='danger big'>Your client has hardware acceleration disabled in Dream Seeker's options menu. You will be kicked if you do not enable hardware acceleration.<br>To enable HW acceleration: left click the SS13 icon at the very top left of the game window -> client -> preferences..., tick the checkbox reading 'Use graphics hardware for displaying maps.'</span>") |
| 42 | + shitlist += my_client |
| 43 | + |
| 44 | + else |
| 45 | + my_client.screen -= src |
| 46 | + blend_mode = BLEND_MULTIPLY |
| 47 | + if (my_client in shitlist) |
| 48 | + shitlist -= my_client |
| 49 | +/* |
| 50 | +/world/New() |
| 51 | + ..() |
| 52 | +
|
| 53 | + // 2 MINUTES but the define isn't included here. |
| 54 | + spawn (1200) |
| 55 | + __secret__hwcheck_loop() |
| 56 | +*/ |
| 57 | +var/list/shitlist = list() |
| 58 | +/proc/__secret__hwcheck_loop() |
| 59 | + // List of clients that have been warned last iteration. |
| 60 | + while (TRUE) |
| 61 | + for (var/client/C in clients) |
| 62 | + C.HW?.check() |
| 63 | + // 1 MINUTES. |
| 64 | + sleep(600) |
0 commit comments