mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-19 03:55:11 +01:00
MODLink System (+ NWTLMM) (#77639)
## About The Pull Request A pact made with `@Kapu1178` Small changes you should not care about: RD MODsuit outfit (admin only) no longer has a beret that blocks the activation of the suit The beret used by death squad officers no longer is blocked from being put on a hat stabilizer module Admins can now Shear matrices of objects in Modify Transform Multitool buffers have been a little refactored to use a setter proc that saves them from causing hard dels Cooler stuff: A revival and remake of [Nobody Wants To Learn Matrix Math](https://github.com/tgstation/tgstation/pull/59103), this time with additional tooling for quick matrix calculations.  The MODLink system, available through every MODsuit and MODLink scryers (a neck item obtainable from advanced modsuit research or charliestation) Let's you make a holographic call with any other MODLink user, where you can chat in realtime and see what's up with em   ## Why It's Good For The Game Adds a fun way for the crew to communicate with each other that can be done in real-time with relative privacy compared to radio. ## Changelog 🆑 Fikou, Armhulen, Sheets (+rep for Mothblocks and Potato) fix: RD MODsuit outfit (admin only) no longer has a beret that blocks the activation of the suit fix: The beret used by death squad officers no longer is blocked from being put on a hat stabilizer module admin: Admins can now Shear matrices of objects in Modify Transform admin: Admins now have access to Test Matrices in the VV dropdown, an all-in-one tool for editing transforms. add: MODLink system, available through scryers (from RnD and Charlie Station) and through MODsuits. Lets you call people with holographs! /🆑
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
|
||||
/**
|
||||
* ## nobody wants to learn matrix math!
|
||||
*
|
||||
* More than just a completely true statement, this datum is created as a tgui interface
|
||||
* allowing you to modify each vector until you know what you're doing.
|
||||
* Much like filteriffic, 'nobody wants to learn matrix math' is meant for developers like you and I
|
||||
* to implement interesting matrix transformations without the hassle if needing to know... algebra? Damn, i'm stupid.
|
||||
*/
|
||||
/datum/nobody_wants_to_learn_matrix_math
|
||||
var/atom/target
|
||||
var/matrix/testing_matrix
|
||||
|
||||
/datum/nobody_wants_to_learn_matrix_math/New(atom/target)
|
||||
src.target = target
|
||||
testing_matrix = matrix(target.transform)
|
||||
|
||||
/datum/nobody_wants_to_learn_matrix_math/Destroy(force, ...)
|
||||
QDEL_NULL(testing_matrix)
|
||||
return ..()
|
||||
|
||||
/datum/nobody_wants_to_learn_matrix_math/ui_state(mob/user)
|
||||
return GLOB.admin_state
|
||||
|
||||
/datum/nobody_wants_to_learn_matrix_math/ui_close(mob/user)
|
||||
qdel(src)
|
||||
|
||||
/datum/nobody_wants_to_learn_matrix_math/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "MatrixMathTester")
|
||||
ui.open()
|
||||
|
||||
/datum/nobody_wants_to_learn_matrix_math/ui_data()
|
||||
var/list/data = list()
|
||||
data["matrix_a"] = testing_matrix.a
|
||||
data["matrix_b"] = testing_matrix.b
|
||||
data["matrix_c"] = testing_matrix.c
|
||||
data["matrix_d"] = testing_matrix.d
|
||||
data["matrix_e"] = testing_matrix.e
|
||||
data["matrix_f"] = testing_matrix.f
|
||||
data["pixelated"] = target.appearance_flags & PIXEL_SCALE
|
||||
return data
|
||||
|
||||
/datum/nobody_wants_to_learn_matrix_math/ui_act(action, list/params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("change_var")
|
||||
var/matrix_var_name = params["var_name"]
|
||||
var/matrix_var_value = params["var_value"]
|
||||
if(testing_matrix.vv_edit_var(matrix_var_name, matrix_var_value) == FALSE)
|
||||
to_chat(src, "Your edit was rejected by the object. This is a bug with the matrix tester, not your fault, so report it on github.", confidential = TRUE)
|
||||
return
|
||||
set_transform()
|
||||
if("scale")
|
||||
testing_matrix.Scale(params["x"], params["y"])
|
||||
set_transform()
|
||||
if("translate")
|
||||
testing_matrix.Translate(params["x"], params["y"])
|
||||
set_transform()
|
||||
if("shear")
|
||||
testing_matrix.Shear(params["x"], params["y"])
|
||||
set_transform()
|
||||
if("turn")
|
||||
testing_matrix.Turn(params["angle"])
|
||||
set_transform()
|
||||
if("toggle_pixel")
|
||||
target.appearance_flags ^= PIXEL_SCALE
|
||||
|
||||
/datum/nobody_wants_to_learn_matrix_math/proc/set_transform()
|
||||
animate(target, transform = testing_matrix, time = 0.5 SECONDS)
|
||||
testing_matrix = matrix(target.transform)
|
||||
|
||||
/client/proc/open_matrix_tester(atom/in_atom)
|
||||
if(holder)
|
||||
var/datum/nobody_wants_to_learn_matrix_math/matrix_tester = new(in_atom)
|
||||
matrix_tester.ui_interact(mob)
|
||||
Reference in New Issue
Block a user