forked from Foundation-19/Foundation-19
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8ee3ba
commit 2d0ccfb
Showing
9 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/datum/modpack/laptop_rotate | ||
/// A string name for the modpack. Used for looking up other modpacks in init. | ||
name = "laptop_rotate" | ||
/// A string desc for the modpack. Can be used for modpack verb list as description. | ||
desc = "-" | ||
/// A string with authors of this modpack. | ||
author = "XAH" | ||
|
||
/datum/modpack/laptop_rotate/pre_initialize() | ||
. = ..() | ||
|
||
/datum/modpack/laptop_rotate/initialize() | ||
. = ..() | ||
|
||
/datum/modpack/laptop_rotate/post_initialize() | ||
. = ..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "_laptop_rotate.dm" | ||
|
||
#include "code/laptop_rotate.dm" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/obj/item/modular_computer | ||
var/icon_state_unpowered = null // Icon state when the computer is turned off | ||
var/icon_state_menu = "mod_celadon/laptop_rotate/code/laptop_rotate.dmi/menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen. | ||
var/icon_state_screensaver = "mod_celadon/laptop_rotate/code/laptop_rotate.dmi/standby" | ||
var/max_hardware_size = 0 // Maximal hardware size. Currently, tablets have 1, laptops 2 and consoles 3. Limits what hardware types can be installed. | ||
var/steel_sheet_cost = 5 // Amount of steel sheets refunded when disassembling an empty frame of this computer. | ||
var/light_strength = 0 // Intensity of light this computer emits. Comparable to numbers light fixtures use. | ||
var/list/idle_threads = list() | ||
|
||
/obj/item/modular_computer/laptop | ||
anchored = TRUE | ||
name = "laptop computer" | ||
desc = "A portable computer." | ||
hardware_flag = PROGRAM_LAPTOP | ||
icon_state_unpowered = "laptop-open" | ||
icon = 'mod_celadon/laptop_rotate/code/laptop_rotate.dmi' | ||
icon_state = "laptop-open" | ||
icon_state_screensaver = "standby" | ||
base_idle_power_usage = 25 | ||
base_active_power_usage = 200 | ||
max_hardware_size = 2 | ||
light_strength = 3 | ||
max_damage = 200 | ||
broken_damage = 100 | ||
w_class = ITEM_SIZE_NORMAL | ||
var/icon_state_closed = "laptop-closed" | ||
interact_sounds = list(SFX_KEYBOARD, SFX_KEYSTROKE) | ||
interact_sound_volume = 20 | ||
|
||
/obj/item/modular_computer/laptop/AltClick(mob/living/carbon/user) | ||
// We need to be close to it to open it | ||
if((!in_range(src, user)) || user.stat || user.restrained()) | ||
return | ||
// Prevents carrying of open laptops inhand. | ||
// While they work inhand, i feel it'd make tablets lose some of their high-mobility advantage they have over laptops now. | ||
if(!istype(loc, /turf/)) | ||
to_chat(usr, "\The [src] has to be on a stable surface first!") | ||
return | ||
anchored = !anchored | ||
screen_on = anchored | ||
update_icon() | ||
|
||
/obj/item/modular_computer/laptop/update_icon() | ||
if(anchored) | ||
..() | ||
else | ||
cut_overlays() | ||
set_light(0) // No glow from closed laptops | ||
compile_overlays() | ||
icon_state = icon_state_closed | ||
|
||
/obj/item/modular_computer/laptop/preset | ||
anchored = FALSE | ||
screen_on = FALSE | ||
|
||
/obj/item/modular_computer/laptop/CtrlAltClick(mob/user) | ||
src.set_dir(turn(src.dir, -90)) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters