Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream 19.05.2024 #270

Merged
merged 160 commits into from
May 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
ba9cb64
Tgui: More common components in ts (#83098)
jlsnow301 May 11, 2024
b535d22
Automatic changelog compile [ci skip]
actions-user May 12, 2024
c3622c3
Enables right click, alt click, ctrl click for alt-click item window …
Metekillot May 12, 2024
67a8912
Automatic changelog for PR #83179 [ci skip]
comfyorange May 12, 2024
6606fa4
Bitrunner job figurine (#83173)
Rhials May 12, 2024
400ba8e
Automatic changelog for PR #83173 [ci skip]
comfyorange May 12, 2024
1b09d8d
Rat Kings can no longer create grime and miasma while ventcrawling (#…
PapaMichae1 May 12, 2024
de25d43
Automatic changelog for PR #83176 [ci skip]
comfyorange May 12, 2024
45b403f
Fix the RMB action on the cigarettes pack and add a new QoL (#83170)
paganiy May 12, 2024
f20a080
Automatic changelog for PR #83170 [ci skip]
comfyorange May 12, 2024
2083960
Adds a period to the end of the wendigo deathrattle (#83185)
nikothedude May 12, 2024
72c92f3
Automatic changelog for PR #83185 [ci skip]
comfyorange May 12, 2024
a838d0b
Replace cigarette smoke with particles, add a big puff when taking ci…
MrMelbert May 13, 2024
4524b70
Automatic changelog for PR #83101 [ci skip]
comfyorange May 13, 2024
951f24d
Automatic changelog compile [ci skip]
actions-user May 13, 2024
547ca8f
Node Bootstrap: Cast OS version to int so compat code works (#83190)
MrsTonedOne May 13, 2024
c12af14
Fixes sabre alt-click (#83162)
jlsnow301 May 13, 2024
30675c9
Automatic changelog for PR #83162 [ci skip]
comfyorange May 13, 2024
d70aa8b
Fix the size of the projectile of the accelerator laser cannon (#83144)
paganiy May 13, 2024
1e2df8b
Automatic changelog for PR #83144 [ci skip]
comfyorange May 13, 2024
bca5685
tgui: Strings.ts (#83096)
jlsnow301 May 13, 2024
28791c0
Bodybuilders can see each others' power levels. (#83088)
Jacquerel May 13, 2024
671c47f
Automatic changelog for PR #83088 [ci skip]
comfyorange May 13, 2024
013e40b
Fixes brain deletion not being lethal (#83203)
Time-Green May 13, 2024
6e794ef
Automatic changelog for PR #83203 [ci skip]
comfyorange May 13, 2024
6933307
Fixes tram malfuction event not ending properly (#83200)
ShizCalev May 13, 2024
5d81ba7
Makes Health Sensor assemblies a bit nicer to use (#83183)
May 13, 2024
8895e8d
Automatic changelog for PR #83183 [ci skip]
comfyorange May 13, 2024
2dc73fb
Automatic changelog compile [ci skip]
actions-user May 14, 2024
65fd769
Fixes arcade spawners in Interdyne Spinward Research Base (#83171)
DaCoolBoss May 14, 2024
8d81e19
Automatic changelog for PR #83171 [ci skip]
comfyorange May 14, 2024
e1ac6e4
Makes it so cargo security doesnt get stuck in mining station. (#83209)
KingkumaArt May 14, 2024
3e1889d
Automatic changelog for PR #83209 [ci skip]
comfyorange May 14, 2024
1184365
Allows status effects with alerts to display their duration (on the a…
MrMelbert May 14, 2024
6e1d6e7
Automatic changelog for PR #83211 [ci skip]
comfyorange May 14, 2024
db782b6
Fixes random decal in space on Tramstation (#83178)
iwishforducks May 14, 2024
348d69c
Automatic changelog for PR #83178 [ci skip]
comfyorange May 14, 2024
a8dda64
Moves as many db related date/time operations to the db side to avoid…
MrsTonedOne May 14, 2024
d7aef14
Fixes cultist blood rites runtime (#83220)
Lufferly May 15, 2024
55d77b5
Automatic changelog for PR #83220 [ci skip]
comfyorange May 15, 2024
40c2bca
Fixes a reversion to the greyscale plate armor (#83214)
necromanceranne May 15, 2024
268cf9a
Automatic changelog for PR #83214 [ci skip]
comfyorange May 15, 2024
16be085
Fixes energy lost as heat for some machines (#83205)
SyncIt21 May 15, 2024
ca92ca4
Fixes destroyed solar panels dropping overlays (#83224)
Lufferly May 15, 2024
bfa1582
Automatic changelog compile [ci skip]
actions-user May 15, 2024
2860887
Automatic changelog for PR #83205 [ci skip]
comfyorange May 15, 2024
b825ac4
Automatic changelog for PR #83224 [ci skip]
comfyorange May 15, 2024
9affd58
Fixes kinetic accelerator fire sound div 0 runtime (#83177)
ShizCalev May 15, 2024
8b8934c
Portals now make sounds (#83166)
Sadboysuss May 15, 2024
db33f07
[NO GBP] Fixes the knife offsets of pipeguns (#83155)
necromanceranne May 15, 2024
1d1a264
Confirm Order button now active when cargo shuttle is at Central (#83…
Shadow-Quill May 15, 2024
a35e1e4
Automatic changelog for PR #83166 [ci skip]
comfyorange May 15, 2024
1f7bb38
Automatic changelog for PR #83155 [ci skip]
comfyorange May 15, 2024
7e4886c
Automatic changelog for PR #83152 [ci skip]
comfyorange May 15, 2024
3f73d00
allows the SC/FISHER to shoot floor lights (#83182)
Hatterhat May 15, 2024
183bd6b
Fixes minor runtime when borgs get qdeleted (#83221)
ShizCalev May 15, 2024
a0a51c5
Ensures kinetic accelerators always get their mods added to the modki…
ShizCalev May 15, 2024
4a1cb19
Automatic changelog for PR #83182 [ci skip]
comfyorange May 15, 2024
7017305
Automatic changelog for PR #83222 [ci skip]
comfyorange May 15, 2024
fce5209
Fixes some bitrunning related issues [no gbp] (#83184)
jlsnow301 May 15, 2024
9748ccd
Automatic changelog for PR #83184 [ci skip]
comfyorange May 15, 2024
261548f
Staff of Shrinking for the wizard (#83115)
PKPenguin321 May 15, 2024
d942da7
Blood Brothers admin tooling (#83130)
Jacquerel May 15, 2024
ca8dcc2
Automatic changelog for PR #83115 [ci skip]
comfyorange May 15, 2024
df3d409
Automatic changelog for PR #83130 [ci skip]
comfyorange May 15, 2024
4b174e4
Adds a new neutral lawset, the Y.E.S.M.A.N. lawset, to the AI lawset …
Iamgoofball May 15, 2024
7499b84
Protects space spawned humans from radiation nebula (#83202)
Time-Green May 15, 2024
db6ce47
Adds -y to upgrade in the docker files to prevent breakage (#83198)
DaxDupont May 15, 2024
1ea3cfc
The Shovellening: Coroner and Miner Coats can now hold Shovels (#83139)
DrAmazing343 May 15, 2024
0ab70e4
Automatic changelog for PR #83202 [ci skip]
comfyorange May 15, 2024
f0e8ee6
Adds more box types to cardboard crafting (#83135)
Derpguy3 May 15, 2024
45dfe7d
Automatic changelog for PR #83198 [ci skip]
comfyorange May 15, 2024
6712682
Automatic changelog for PR #83139 [ci skip]
comfyorange May 15, 2024
25eae99
Automatic changelog for PR #83135 [ci skip]
comfyorange May 15, 2024
d06d92b
General maintenance for smoke machine (#83158)
SyncIt21 May 15, 2024
737f571
Blade creation ritual returns lost blades (#82592)
Xackii May 15, 2024
95b3cfa
Automatic changelog for PR #83158 [ci skip]
comfyorange May 15, 2024
066815a
The armoury contraband locker guns have a chance to be rigged. (#83167)
Pickle-Coding May 15, 2024
32ff8d1
Automatic changelog for PR #83167 [ci skip]
comfyorange May 15, 2024
e143e52
Moves the departmental delivery area check to a unit test so it stops…
Majkl-J May 15, 2024
1133e90
Shift-clicking an offer for an item will examine the item (#83180)
MrMelbert May 15, 2024
e12e3df
Automatic changelog for PR #83180 [ci skip]
comfyorange May 15, 2024
b5f6b04
parrots try to immitate voices (#82773)
Ben10Omintrix May 15, 2024
1946ba1
Automatic changelog for PR #82773 [ci skip]
comfyorange May 15, 2024
53518e0
Circuit editor QoL and new circuit components (#82969)
tmyqlfpir May 15, 2024
84472cb
[no gbp] Fixes uniform alt click while resting (#83231)
jlsnow301 May 15, 2024
ae64cae
Automatic changelog for PR #82969 [ci skip]
comfyorange May 15, 2024
b832885
Automatic changelog for PR #83231 [ci skip]
comfyorange May 15, 2024
428c594
Automatic changelog compile [ci skip]
actions-user May 16, 2024
926f819
Remove sleeper protocol objective + Remove the upper limit to sabotag…
Xander3359 May 16, 2024
150418d
Automatic changelog for PR #83206 [ci skip]
comfyorange May 16, 2024
2d5f448
Assorted minor alt-click reskinning fixes, primarily context-based (#…
00-Steven May 16, 2024
e55f24b
Automatic changelog for PR #83105 [ci skip]
comfyorange May 16, 2024
ec41cba
Fixes wings working in space (#83239)
Lufferly May 16, 2024
fb7e9fc
Automatic changelog for PR #83239 [ci skip]
comfyorange May 16, 2024
125d637
Fixes some atoms conduct electricity flag (#83230)
RengaN02 May 16, 2024
40ca497
Automatic changelog for PR #83230 [ci skip]
comfyorange May 16, 2024
1904409
Neckties can be worn below suits and accessories (#83131)
siliconOpossum May 16, 2024
a8fc20d
Automatic changelog for PR #83131 [ci skip]
comfyorange May 16, 2024
091e3af
Restores Balance to the Candle Economy (#83240)
Thunder12345 May 16, 2024
501c8c7
Automatic changelog for PR #83240 [ci skip]
comfyorange May 16, 2024
650492a
Fixes Spess Knife's cutter tool having an invisible sprite (#83246)
May 16, 2024
e364c3e
Automatic changelog for PR #83246 [ci skip]
comfyorange May 16, 2024
f70350c
Fixes simplebot ui [no gbp] (#83235)
jlsnow301 May 16, 2024
6f9f3cf
Automatic changelog for PR #83235 [ci skip]
comfyorange May 16, 2024
77e739a
Cargo goodies section typo fix (#83245)
May 16, 2024
959477c
Atoms that are on the border of a tile will now only trigger landmine…
ShizCalev May 16, 2024
e8b834c
Automatic changelog for PR #83245 [ci skip]
comfyorange May 16, 2024
c0e5e32
Automatic changelog for PR #83156 [ci skip]
comfyorange May 16, 2024
03db803
Parse_zone audit + minor misc cleanup (#83154)
nikothedude May 16, 2024
ffd227c
Automatic changelog for PR #83154 [ci skip]
comfyorange May 16, 2024
74f52a7
Fixes cyborg omnitool combat behaviour. (#83243)
Pickle-Coding May 16, 2024
5a3d67a
Automatic changelog for PR #83243 [ci skip]
comfyorange May 16, 2024
d93d19c
mobile defibrillator mount (#83000)
mc-oofert May 16, 2024
1faa23b
Automatic changelog for PR #83000 [ci skip]
comfyorange May 16, 2024
4264919
Fix radiation not causing mutations or making you bald (3 year old bu…
MrMelbert May 16, 2024
0e12079
Automatic changelog for PR #83251 [ci skip]
comfyorange May 16, 2024
1548372
Rust Heretic rework: THE PUKENING. (#83006)
EnterTheJake May 16, 2024
6e36398
Automatic changelog for PR #83006 [ci skip]
comfyorange May 16, 2024
5dc5ccd
Fixes missing scrubber pipes on metastation (#83232)
improvedname May 16, 2024
a051994
Automatic changelog for PR #83232 [ci skip]
comfyorange May 16, 2024
a3940a4
Updates to orbit ui [READY] (#83186)
jlsnow301 May 16, 2024
a50e2cd
Automatic changelog for PR #83186 [ci skip]
comfyorange May 16, 2024
f1a22b3
Changes how lube crawling works and fixes a bug with snails (#83238)
JohnFulpWillard May 16, 2024
10b2af4
Automatic changelog for PR #83238 [ci skip]
comfyorange May 16, 2024
2edb3af
Automatic changelog compile [ci skip]
actions-user May 17, 2024
761b14e
lavaland raptors (#82537)
Ben10Omintrix May 17, 2024
0e63413
Automatic changelog for PR #82537 [ci skip]
comfyorange May 17, 2024
c79cedc
Fixes Space Phase softlock (#83241)
Absolucy May 17, 2024
4c79bd5
Automatic changelog for PR #83241 [ci skip]
comfyorange May 17, 2024
74efdd3
Adds Minecarts (#83175)
MrMelbert May 17, 2024
ee0d5f3
Automatic changelog for PR #83175 [ci skip]
comfyorange May 17, 2024
225562b
Cancel CI on new commit (#83255)
jlsnow301 May 17, 2024
55f4249
fixes runtime when trying to remove a nonexistent source ID via Remov…
ShizCalev May 17, 2024
f70ea21
Fixes a bunch of hearts becoming errors when being eaten (#83259)
Echriser May 17, 2024
31c13fd
Automatic changelog for PR #83259 [ci skip]
comfyorange May 17, 2024
eb5ac96
Upgrades nukies ordnance by adding more gasses and better stock parts…
improvedname May 17, 2024
83d0154
Automatic changelog for PR #83233 [ci skip]
comfyorange May 17, 2024
f0f026d
Standardises name of The Lizard's Gas (Lava) (#83250)
DaCoolBoss May 17, 2024
868c85c
Fixes Malf AI not being able to override/overload turrets that have c…
ShizCalev May 17, 2024
df6939f
Automatic changelog for PR #83250 [ci skip]
comfyorange May 17, 2024
7684168
Automatic changelog for PR #83252 [ci skip]
comfyorange May 17, 2024
cd9e9dc
Tgui: Events & Colors in typescript (#83218)
jlsnow301 May 17, 2024
14e27ec
adds the Ansem/SC, the logical conclusion to the John Splintercell se…
Hatterhat May 17, 2024
0612a49
Automatic changelog for PR #83228 [ci skip]
comfyorange May 17, 2024
e81a94d
Malf AI overload blacklists (#83226)
Sadboysuss May 17, 2024
715d61f
Automatic changelog for PR #83226 [ci skip]
comfyorange May 17, 2024
d83bf4f
Suit sensors can now be quick-maxed by ctrl clicking (#83265)
Sadboysuss May 17, 2024
8ebef95
Automatic changelog for PR #83265 [ci skip]
comfyorange May 17, 2024
de11d2b
[Icebox] Retvrn: Brings Bar Back to Base (level) (#83163)
MrMelbert May 17, 2024
d6d8103
Automatic changelog for PR #83163 [ci skip]
comfyorange May 17, 2024
d37779e
Micro-optimizes _SendSignal a bit (#83244)
Watermelon914 May 17, 2024
0ae4675
Mobs spawners won't spawn more mobs than they are supposed to (#83266)
Jacquerel May 17, 2024
3291b81
Automatic changelog for PR #83266 [ci skip]
comfyorange May 17, 2024
2a31a79
Automatic changelog compile [ci skip]
actions-user May 18, 2024
357a14e
Resprites the Blade Heretic knives. (#83207)
EnterTheJake May 18, 2024
511b9fd
Removes a bunch of unused families huds (#82916)
Rex9001 May 18, 2024
2a29dd3
[no gbp] removes signpost from icebox (#83272)
Ben10Omintrix May 18, 2024
87dbd5c
Merge remote-tracking branch 'off/master' into merge-upstream
Gaxeer May 19, 2024
0d0c0cd
refactor: adjust to `string.js` refactor to `string.ts`
Gaxeer May 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Circuit editor QoL and new circuit components (tgstation#82969)
## About The Pull Request

This PR introduces a number of minor quality of life improvements to
already existing circuit components, and adds three new components.

<img width="600" alt="preview"
src="https://github.com/tgstation/tgstation/assets/80724828/85d39b6d-b055-430e-8996-0da088616887">

## Why It's Good For The Game

This improves the overall experience for circuits.

### UI changes

<img width="550" alt="grid aligned"
src="https://github.com/tgstation/tgstation/assets/80724828/cc7b43b5-292f-4643-beab-e01ae675fb19">

Grid align is now an option for circuit designers. It will round objects
to the nearest 10px units internally, and can be toggled on/off by the
new additional button beside the component menu button. This makes
circuits easier on the eyes as things are pixel perfect aligned.

<img width="814" alt="tooltips"
src="https://github.com/tgstation/tgstation/assets/80724828/0d31c98f-3be9-46e0-ab37-20bac3799112">

All three buttons have been given tool tips.

### Tweaked Components

<img width="136" alt="voice activator"
src="https://github.com/tgstation/tgstation/assets/80724828/21dd0f65-cb98-4bd5-aeb0-63315e842cb6">

* Adds a on/off flag to the voice activator component
-- This saves power for circuits as you're not forced to use a compare
flag check to turn off voice activation

<img width="136" alt="speech"
src="https://github.com/tgstation/tgstation/assets/80724828/9137b76c-3077-4597-8411-2d9694b39e9e">

* Adds a quiet mode flag to speech component
-- This is ideal when you want a device to speak, but don't want other
people to hear. A good example would be a handheld translator that you
only want to hear yourself.

### New Components

<img width="136" alt="ntnet list literal"
src="https://github.com/tgstation/tgstation/assets/80724828/657c851b-d442-4a63-8650-410cb8e76089">

* An NTNet Send component that allows everything to be input much like
the list literal component
-- This makes sending stuff over NTNet easier for the user, and use less
power as it won't require an additional list literal component

<img width="136" alt="compare health state"
src="https://github.com/tgstation/tgstation/assets/80724828/0bed076c-3aa1-4931-af90-2b9eb8e1ae9a">

* A health comparison component that checks the entity's health state,
and can return true or false depending if the entity is alive, sleeping,
unconscious, critical or dead
-- This could be achieved by using a health sensor and a compare
component, however it lacks the ability to know when a entity is
unconscious or sleeping

<img width="136" alt="toggle"
src="https://github.com/tgstation/tgstation/assets/80724828/7017b6bf-937a-42ad-87f3-4f1134853ac3">

* A quick toggle component to allow the switching between a true and
false state
-- This could be achieved by using a logic component and self linking,
however this makes it far easier for newcomers to make something as
simple as an on/off switch (such as a handheld translator which uses the
front button to turn on/off)

## Changelog
:cl:
qol: Add tooltips to circuit editor buttons
qol: Add grid alignment mode to circuit editor
add: Added new compare health state component
add: Added new NTNet send list literal component
add: Added new toggle component
qol: Added activity toggle to voice activator component
qol: Added quiet mode to speech component
qol: NTNet send component will not use power/trigger if NTNet is offline
/:cl:
tmyqlfpir authored May 15, 2024
commit 53518e043bfe5c8bef980b3e5230e3933fb62b94
15 changes: 15 additions & 0 deletions code/modules/research/designs/wiremod_designs.dm
Original file line number Diff line number Diff line change
@@ -81,6 +81,11 @@
id = "comp_logic"
build_path = /obj/item/circuit_component/compare/logic

/datum/design/component/toggle
name = "Toggle Component"
id = "comp_toggle"
build_path = /obj/item/circuit_component/compare/toggle

/datum/design/component/delay
name = "Delay Component"
id = "comp_delay"
@@ -221,6 +226,11 @@
id = "comp_health"
build_path = /obj/item/circuit_component/health

/datum/design/component/compare/health_state
name = "Compare Health State Component"
id = "comp_health_state"
build_path = /obj/item/circuit_component/compare/health_state

/datum/design/component/matscanner
name = "Material Scanner"
id = "comp_matscanner"
@@ -337,6 +347,11 @@
id = "comp_ntnet_send"
build_path = /obj/item/circuit_component/ntnet_send

/datum/design/component/list_literal/ntnet_send
name = "NTNet Transmitter List Literal"
id = "comp_ntnet_send_list_literal"
build_path = /obj/item/circuit_component/list_literal/ntnet_send

/datum/design/component/list_literal
name = "List Literal Component"
id = "comp_list_literal"
3 changes: 3 additions & 0 deletions code/modules/research/techweb/all_nodes.dm
Original file line number Diff line number Diff line change
@@ -344,6 +344,7 @@
"comp_get_column",
"comp_gps",
"comp_health",
"comp_health_state",
"comp_hear",
"comp_id_access_reader",
"comp_id_getter",
@@ -368,6 +369,7 @@
"comp_not",
"comp_ntnet_receive",
"comp_ntnet_send",
"comp_ntnet_send_list_literal",
"comp_pinpointer",
"comp_pressuresensor",
"comp_radio",
@@ -386,6 +388,7 @@
"comp_tempsensor",
"comp_textcase",
"comp_timepiece",
"comp_toggle",
"comp_tonumber",
"comp_tostring",
"comp_trigonometry",
5 changes: 4 additions & 1 deletion code/modules/wiremod/components/action/speech.dm
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@

/// The message to send
var/datum/port/input/message
/// The quiet mode flag
var/datum/port/input/quietmode

/// The cooldown for this component of how often it can send speech messages.
var/speech_cooldown = 1 SECONDS
@@ -21,6 +23,7 @@

/obj/item/circuit_component/speech/populate_ports()
message = add_input_port("Message", PORT_TYPE_STRING, trigger = null)
quietmode = add_input_port("Quiet Mode", PORT_TYPE_NUMBER, default = 0)

/obj/item/circuit_component/speech/input_received(datum/port/input/port)
if(!parent.shell)
@@ -31,5 +34,5 @@

if(message.value)
var/atom/movable/shell = parent.shell
shell.say(message.value, forced = "circuit speech | [parent.get_creator()]")
shell.say(message.value, forced = "circuit speech | [parent.get_creator()]", message_range = quietmode.value > 0 ? WHISPER_RANGE : MESSAGE_RANGE)
TIMER_COOLDOWN_START(shell, COOLDOWN_CIRCUIT_SPEECH, speech_cooldown)
56 changes: 56 additions & 0 deletions code/modules/wiremod/components/atom/health_state.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* # Compare Health State Component
*
* Returns true when state matches entity.
*/

/obj/item/circuit_component/compare/health_state
display_name = "Compare Health State"
desc = "A component that compares the health state of an organism, and returns true or false."
category = "Entity"

/// The input port
var/datum/port/input/input_port

/// Compare state option
var/datum/port/input/option/state_option

var/max_range = 5

/obj/item/circuit_component/compare/health_state/get_ui_notices()
. = ..()
. += create_ui_notice("Maximum Range: [max_range] tiles", "orange", "info")

/obj/item/circuit_component/compare/health_state/populate_options()
input_port = add_input_port("Organism", PORT_TYPE_ATOM)

var/static/component_options = list(
"Alive",
"Asleep",
"Critical",
"Unconscious",
"Deceased",
)
state_option = add_option_port("Comparison Option", component_options)

/obj/item/circuit_component/compare/health_state/do_comparisons()
var/mob/living/organism = input_port.value
var/turf/current_turf = get_location()
if(!istype(organism) || current_turf.z != organism.z || get_dist(current_turf, organism) > max_range)
return FALSE

var/current_option = state_option.value
var/state = organism.stat
switch(current_option)
if("Alive")
return state != DEAD
if("Asleep")
return !!organism.IsSleeping() && !organism.IsUnconscious()
if("Critical")
return state == SOFT_CRIT || state == HARD_CRIT
if("Unconscious")
return state == UNCONSCIOUS || state == HARD_CRIT || !!organism.IsUnconscious()
if("Deceased")
return state == DEAD
//Unknown state, something fucked up really bad - just return false
return FALSE
6 changes: 6 additions & 0 deletions code/modules/wiremod/components/atom/hear.dm
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@
desc = "A component that listens for messages. Requires a shell."
category = "Entity"

/// The on/off port
var/datum/port/input/on

/// The message heard
var/datum/port/output/message_port
/// The language heard
@@ -20,6 +23,7 @@
var/datum/port/output/trigger_port

/obj/item/circuit_component/hear/populate_ports()
on = add_input_port("On", PORT_TYPE_NUMBER, default = 1)
message_port = add_output_port("Message", PORT_TYPE_STRING)
language_port = add_output_port("Language", PORT_TYPE_STRING)
speaker_port = add_output_port("Speaker", PORT_TYPE_ATOM)
@@ -40,6 +44,8 @@
return Hear(arglist(arguments))

/obj/item/circuit_component/hear/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, list/message_mods, message_range)
if(!on.value)
return FALSE
if(speaker == parent?.shell)
return FALSE

36 changes: 36 additions & 0 deletions code/modules/wiremod/components/math/toggle.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* # Toggle Component
*
* Does a toggle between true and false on trigger
*/
/obj/item/circuit_component/compare/toggle
display_name = "Toggle"
desc = "A component that toggles between on and off when triggered. All input ports (except for set toggle) will trigger the component."
category = "Math"

/// A signal to reset the toggle back to 0
var/datum/port/input/toggle_set
/// A signal to toggle and return the current state
var/datum/port/input/toggle_and_compare

var/toggle_state = FALSE

/obj/item/circuit_component/compare/toggle/populate_custom_ports()
toggle_set = add_input_port("Set Toggle State", PORT_TYPE_NUMBER)
toggle_and_compare = add_input_port("Toggle And Compare", PORT_TYPE_SIGNAL)
toggle_state = FALSE

/obj/item/circuit_component/compare/toggle/input_received(datum/port/input/port)
if(port == toggle_set)
toggle_state = !!port.value
return
if(COMPONENT_TRIGGERED_BY(toggle_and_compare, port))
toggle_state = !toggle_state
if(toggle_state)
true.set_output(COMPONENT_SIGNAL)
else
false.set_output(COMPONENT_SIGNAL)
return ..()

/obj/item/circuit_component/compare/toggle/do_comparisons()
return toggle_state
11 changes: 8 additions & 3 deletions code/modules/wiremod/components/ntnet/ntnet_send.dm
Original file line number Diff line number Diff line change
@@ -27,12 +27,17 @@
data_package = add_input_port("Data Package", PORT_TYPE_LIST(PORT_TYPE_ANY))
enc_key = add_input_port("Encryption Key", PORT_TYPE_STRING)

/obj/item/circuit_component/ntnet_send/should_receive_input(datum/port/input/port)
. = ..()
if(!.)
return FALSE
/// If the server is down, don't use power or attempt to send data
return find_functional_ntnet_relay()

/obj/item/circuit_component/ntnet_send/pre_input_received(datum/port/input/port)
if(port == list_options)
var/new_datatype = list_options.value
data_package.set_datatype(PORT_TYPE_LIST(new_datatype))

/obj/item/circuit_component/ntnet_send/input_received(datum/port/input/port)
if(!find_functional_ntnet_relay())
return
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CIRCUIT_NTNET_DATA_SENT, list("data" = data_package.value, "enc_key" = enc_key.value, "port" = WEAKREF(data_package)))
send_ntnet_data(data_package, enc_key.value)
30 changes: 30 additions & 0 deletions code/modules/wiremod/components/ntnet/ntnet_send_literal.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* # NTNet Transmitter List Literal Component
*
* Create a list literal and send a data package through NTNet
*
* This file is based off of ntnet_send.dm
* Any changes made to those files should be copied over with discretion
*/
/obj/item/circuit_component/list_literal/ntnet_send
display_name = "NTNet Transmitter List Literal"
desc = "Creates a list literal data package and sends it through NTNet. If Encryption Key is set then transmitted data will be only picked up by receivers with the same Encryption Key."
category = "NTNet"

/// Encryption key
var/datum/port/input/enc_key

/obj/item/circuit_component/list_literal/ntnet_send/populate_ports()
. = ..()
enc_key = add_input_port("Encryption Key", PORT_TYPE_STRING)

/obj/item/circuit_component/list_literal/ntnet_send/should_receive_input(datum/port/input/port)
. = ..()
if(!.)
return FALSE
/// If the server is down, don't use power or attempt to send data
return find_functional_ntnet_relay()

/obj/item/circuit_component/list_literal/ntnet_send/input_received(datum/port/input/port)
. = ..()
send_ntnet_data(list_output, enc_key.value)
11 changes: 11 additions & 0 deletions code/modules/wiremod/core/component.dm
Original file line number Diff line number Diff line change
@@ -405,3 +405,14 @@
*/
/obj/item/circuit_component/proc/unregister_usb_parent(atom/movable/shell)
return

/**
* Called when a circuit component requests to send Ntnet data signal.
*
* Arguments:
* * port - The required list port needed by the Ntnet recieve
* * key - The encryption key
* * signal_type - The signal type used for sending this global signal (optional, default is COMSIG_GLOB_CIRCUIT_NTNET_DATA_SENT)
*/
/obj/item/circuit_component/proc/send_ntnet_data(datum/port/input/port, key, signal_type = COMSIG_GLOB_CIRCUIT_NTNET_DATA_SENT)
SEND_GLOBAL_SIGNAL(signal_type, list("data" = port.value, "enc_key" = key, "port" = WEAKREF(port)))
11 changes: 11 additions & 0 deletions code/modules/wiremod/core/integrated_circuit.dm
Original file line number Diff line number Diff line change
@@ -80,6 +80,9 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
/// The Y position of the screen. Used for adding components.
var/screen_y = 0

/// The grid mode state for the circuit.
var/grid_mode = TRUE

/// The current size of the circuit.
var/current_size = 0

@@ -400,6 +403,7 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
.["examined_notices"] = examined?.get_ui_notices()
.["examined_rel_x"] = examined_rel_x
.["examined_rel_y"] = examined_rel_y
.["grid_mode"] = grid_mode

.["is_admin"] = (admin_only || isAdminGhostAI(user)) && check_rights_for(user.client, R_VAREDIT)

@@ -577,6 +581,9 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
else
set_display_name("")
. = TRUE
if("toggle_grid_mode")
toggle_grid_mode()
. = TRUE
if("set_examined_component")
var/component_id = text2num(params["component_id"])
if(!WITHIN_RANGE(component_id, attached_components))
@@ -709,6 +716,10 @@ GLOBAL_LIST_EMPTY_TYPED(integrated_circuits, /obj/item/integrated_circuit)
else
shell.name = initial(shell.name)

/// Toggles the grid mode property for this circuit.
/obj/item/integrated_circuit/proc/toggle_grid_mode()
grid_mode = !grid_mode

/**
* Returns the creator of the integrated circuit. Used in admin messages and other related things.
*/
3 changes: 3 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
@@ -6087,6 +6087,7 @@
#include "code\modules\wiremod\components\atom\direction.dm"
#include "code\modules\wiremod\components\atom\gps.dm"
#include "code\modules\wiremod\components\atom\health.dm"
#include "code\modules\wiremod\components\atom\health_state.dm"
#include "code\modules\wiremod\components\atom\hear.dm"
#include "code\modules\wiremod\components\atom\matscanner.dm"
#include "code\modules\wiremod\components\atom\pinpointer.dm"
@@ -6130,9 +6131,11 @@
#include "code\modules\wiremod\components\math\logic.dm"
#include "code\modules\wiremod\components\math\not.dm"
#include "code\modules\wiremod\components\math\random.dm"
#include "code\modules\wiremod\components\math\toggle.dm"
#include "code\modules\wiremod\components\math\trigonometry.dm"
#include "code\modules\wiremod\components\ntnet\ntnet_receive.dm"
#include "code\modules\wiremod\components\ntnet\ntnet_send.dm"
#include "code\modules\wiremod\components\ntnet\ntnet_send_literal.dm"
#include "code\modules\wiremod\components\sensors\pressuresensor.dm"
#include "code\modules\wiremod\components\sensors\tempsensor.dm"
#include "code\modules\wiremod\components\sensors\view_sensor.dm"
Original file line number Diff line number Diff line change
@@ -39,8 +39,8 @@ export class ObjectComponent extends Component {
if (dragPos) {
act('set_component_coordinates', {
component_id: index,
rel_x: dragPos.x,
rel_y: dragPos.y,
rel_x: this.roundToGrid(dragPos.x),
rel_y: this.roundToGrid(dragPos.y),
});
}

@@ -81,6 +81,12 @@ export class ObjectComponent extends Component {
);
}

// Round the units to the grid (bypass if grid mode is off)
roundToGrid(input_value) {
if (!this.props.gridMode) return input_value;
return Math.round(input_value / 10) * 10;
}

render() {
const {
input_ports,
@@ -99,14 +105,15 @@ export class ObjectComponent extends Component {
onPortRightClick = noop,
onPortMouseUp = noop,
act = noop,
gridMode = true,
...rest
} = this.props;
const { startPos, dragPos } = this.state;

let [x_pos, y_pos] = [x, y];
if (dragPos && startPos && startPos.x === x_pos && startPos.y === y_pos) {
x_pos = dragPos.x;
y_pos = dragPos.y;
x_pos = this.roundToGrid(dragPos.x);
y_pos = this.roundToGrid(dragPos.y);
}

// Assigned onto the ports
15 changes: 15 additions & 0 deletions tgui/packages/tgui/interfaces/IntegratedCircuit/index.jsx
Original file line number Diff line number Diff line change
@@ -401,6 +401,7 @@ export class IntegratedCircuit extends Component {
examined_rel_y,
screen_x,
screen_y,
grid_mode,
is_admin,
variables,
global_basic_types,
@@ -473,6 +474,7 @@ export class IntegratedCircuit extends Component {
position="absolute"
top={0}
color="transparent"
tooltip="Show Variables Menu"
icon="cog"
selected={variableMenuOpen}
onClick={() =>
@@ -487,6 +489,7 @@ export class IntegratedCircuit extends Component {
position="absolute"
top={0}
color="transparent"
tooltip="Show Components Menu"
icon="plus"
selected={componentMenuOpen}
onClick={() =>
@@ -496,6 +499,17 @@ export class IntegratedCircuit extends Component {
}
/>
</Stack.Item>
<Stack.Item basis="24px">
<Button
position="absolute"
top={0}
color="transparent"
tooltip="Enable Grid Aligning"
icon="th-large"
selected={grid_mode}
onClick={() => act('toggle_grid_mode')}
/>
</Stack.Item>
{!!is_admin && (
<Stack.Item>
<Button
@@ -539,6 +553,7 @@ export class IntegratedCircuit extends Component {
onPortRightClick={this.handlePortRightClick}
onPortMouseUp={this.handlePortUp}
act={act}
gridMode={grid_mode}
/>
),
)}