Files
Bubberstation/code/modules/wiremod/components/string/contains.dm
Watermelon914 74dddffb29 Refactored fundamental circuit components that have varying inputs. Improvements to the integrated circuit UI. Improves and rebalances the drone shell (#68586)
* Refactored fundamental circuit components that have varying inputs. Made the integrated circuit UI slightly better.

* Fixes with UI

* Removes logger

* Ran prettier

* Fixed documentation

* Rebalances drone circuit

* Drones can now charge in chargers

Co-authored-by: Watermelon914 <hidden@hidden.com>
2022-07-28 23:55:41 -07:00

31 lines
780 B
Plaintext

/**
* # String Contains Component
*
* Checks if a string contains a word/letter
*/
/obj/item/circuit_component/compare/contains
display_name = "String Contains"
desc = "Checks if a string contains a word/letter"
category = "String"
var/datum/port/input/needle
var/datum/port/input/haystack
/obj/item/circuit_component/compare/contains/populate_custom_ports()
needle = add_input_port("Needle", PORT_TYPE_STRING)
haystack = add_input_port("Haystack", PORT_TYPE_STRING)
/obj/item/circuit_component/compare/contains/Destroy()
needle = null
haystack = null
return ..()
/obj/item/circuit_component/compare/contains/do_comparisons()
var/to_find = needle.value
var/to_search = haystack.value
if(!to_find || !to_search)
return
return findtext(to_search, to_find)