Files
Yogstation/code/modules/integrated_electronics/core/debugger.dm
arsserpentarium bdfbafd54a [READY]integrated circuitry port+upgrade. (#32481)
* first

* printer, tools, prefab, assemblies, power.dm(looks like so)

* integrated circuit

* input memory epv2 exonet node

* input,manipulation,output,poweract

* fixes

* reagents fix

* time

* minor fixes

* all errors fixed

* bugfixes

* prefab, tickers, camera, led, assembling bugs,

* All except exonet node UI and led's

* cameras, led and some exonet

* 11

* 111

* lesser fixes.

* botanic shit

* icon

* nobludgeon for debugger

* gui, typos

* gui, typos

* dopil

* smaller diff, rm template and node

* mergefix

* list fix

* weakrefs

* fixes

* Clamp, crowbar, minor shit

* fukken refs

* exonet node refactor, put defines into defines.

* dme upload

* defines,helpers,exonet node, botanic

* TRUE/FALSE and minors

* datumfix

* moved init to ss

* quickfix

* cryo runtime fix

* datums quickfix

* admins

* minor fixes

* fixes

* refs,tools

* printer

* fixes

* fixes

* check interactivity redo.

* usercheck, fixes

* weakrefs

* T/F

* WEAKREF

* unfuckup

* fixes and shit

* Update assemblies.dm

* crypto

* fuck

* SS, final fixes

* looks like final fixes.

* release,crypto, ranged scnner

* defines

* Resets some files

* find/replace

* Associative addresses

* Update exonet_node.dm

* push

* there we go

* fix

* FINISH!

* WEAKREFUCK

* FixeS

* Woops

* Woops

* woops

* fix

* fixes

* loops

* fix or break?

* fix,dammit!

* fix,dammit![2]

* fix,dammit![3]

* disconnect

* fix

* input

* lag

* pin

* map

* sdegsds

* >>>lights

* fixes le map

* makes circuits actually speak

* halffix

* resets maps to tgstation master

* typeless loops in init

* Changes subsystem to not initialize new types and use initial instead.

* fix

* trying to get rid of obj list.

* get rid of .

* Better code makes better mind

* fixed

* pin fixes

* fix

* compiled tgui

* circuits config

* spelling
2017-11-14 04:05:22 -05:00

65 lines
2.9 KiB
Plaintext

/obj/item/device/integrated_electronics/debugger
name = "circuit debugger"
desc = "This small tool allows one working with custom machinery to directly set data to a specific pin, useful for writing \
settings to specific circuits, or for debugging purposes. It can also pulse activation pins."
icon = 'icons/obj/electronic_assemblies.dmi'
icon_state = "debugger"
flags_1 = CONDUCT_1 | NOBLUDGEON_1
w_class = WEIGHT_CLASS_SMALL
var/data_to_write = null
var/accepting_refs = FALSE
/obj/item/device/integrated_electronics/debugger/attack_self(mob/user)
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null")
if(!user.IsAdvancedToolUser())
return
var/new_data = null
switch(type_to_use)
if("string")
accepting_refs = FALSE
new_data = input("Now type in a string.","[src] string writing") as null|text
if(istext(new_data) && user.IsAdvancedToolUser())
data_to_write = new_data
to_chat(user, "<span class='notice'>You set \the [src]'s memory to \"[new_data]\".</span>")
if("number")
accepting_refs = FALSE
new_data = input("Now type in a number.","[src] number writing") as null|num
if(isnum(new_data) && user.IsAdvancedToolUser())
data_to_write = new_data
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [new_data].</span>")
if("ref")
accepting_refs = TRUE
to_chat(user, "<span class='notice'>You turn \the [src]'s ref scanner on. Slide it across \
an object for a ref of that object to save it in memory.</span>")
if("null")
data_to_write = null
to_chat(user, "<span class='notice'>You set \the [src]'s memory to absolutely nothing.</span>")
/obj/item/device/integrated_electronics/debugger/afterattack(atom/target, mob/living/user, proximity)
if(accepting_refs && proximity)
data_to_write = WEAKREF(target)
visible_message("<span class='notice'>[user] slides \a [src]'s over \the [target].</span>")
to_chat(user, "<span class='notice'>You set \the [src]'s memory to a reference to [target.name] \[Ref\]. The ref scanner is \
now off.</span>")
accepting_refs = FALSE
else
return ..()
/obj/item/device/integrated_electronics/debugger/proc/write_data(var/datum/integrated_io/io, mob/user)
if(io.io_type == DATA_CHANNEL)
io.write_data_to_pin(data_to_write)
var/data_to_show = data_to_write
if(isweakref(data_to_write))
var/datum/weakref/w = data_to_write
var/atom/A = w.resolve()
data_to_show = A.name
to_chat(user, "<span class='notice'>You write '[data_to_write ? data_to_show : "NULL"]' to the '[io]' pin of \the [io.holder].</span>")
else if(io.io_type == PULSE_CHANNEL)
io.holder.check_then_do_work(ignore_power = TRUE)
to_chat(user, "<span class='notice'>You pulse \the [io.holder]'s [io].</span>")
io.holder.interact(user) // This is to update the UI.