mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 00:55:20 +01:00
Implements color matrix and transform modification support for Filterrific (#93867)
## About The Pull Request Allows users to edit color matrix filters and layered filters' transforms through Filterrific, which were the two last unsupported filter fields. The menus are pretty minimal, but you shouldn't be touching them if you don't know what you're doing anyways. https://github.com/user-attachments/assets/e87447f3-e5d6-4f6c-a8e4-bf50a1d5fa79 ## Why It's Good For The Game Makes our tooling actually work ## Changelog 🆑 admin: Implemented color matrix and transform modification support for Filterrific /🆑
This commit is contained in:
@@ -32,7 +32,7 @@ GLOBAL_PROTECT(href_token)
|
||||
|
||||
var/deadmined
|
||||
|
||||
var/datum/filter_editor/filteriffic
|
||||
var/datum/filter_editor/filterrific
|
||||
var/datum/particle_editor/particle_test
|
||||
var/datum/colorblind_tester/color_test
|
||||
var/datum/plane_master_debug/plane_debug
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/datum/filter_editor/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "Filteriffic")
|
||||
ui = new(user, src, "Filterrific")
|
||||
ui.open()
|
||||
|
||||
/datum/filter_editor/ui_static_data(mob/user)
|
||||
@@ -21,7 +21,14 @@
|
||||
/datum/filter_editor/ui_data()
|
||||
var/list/data = list()
|
||||
data["target_name"] = target.name
|
||||
data["target_filter_data"] = target.filter_data
|
||||
var/list/target_filter_data = list()
|
||||
for (var/list/filter_info as anything in target.filter_data)
|
||||
filter_info = deep_copy_list(filter_info)
|
||||
if (filter_info["transform"])
|
||||
var/matrix/filter_transform = filter_info["transform"]
|
||||
filter_info["transform"] = list("a" = filter_transform.a, "b" = filter_transform.b, "c" = filter_transform.c, "d" = filter_transform.d, "e" = filter_transform.e, "f" = filter_transform.f)
|
||||
target_filter_data += list(filter_info)
|
||||
data["target_filter_data"] = target_filter_data
|
||||
return data
|
||||
|
||||
/datum/filter_editor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
@@ -59,7 +66,7 @@
|
||||
target.modify_filter(params["name"], params["new_data"])
|
||||
. = TRUE
|
||||
if("modify_color_value")
|
||||
var/new_color = input(usr, "Pick new filter color", "Filteriffic Colors!") as color|null
|
||||
var/new_color = input(usr, "Pick new filter color", "Filterrific Colors!") as color|null
|
||||
if(new_color)
|
||||
target.transition_filter(params["name"], list("color" = new_color), 4)
|
||||
. = TRUE
|
||||
@@ -68,6 +75,16 @@
|
||||
if(new_icon)
|
||||
target.modify_filter(params["name"], list("icon" = new_icon))
|
||||
. = TRUE
|
||||
if("modify_transform_value")
|
||||
var/list/filter_info = target.get_filter_data(params["name"])
|
||||
if (!filter_info)
|
||||
return
|
||||
var/matrix/new_transform = matrix(filter_info[params["field_name"]])
|
||||
if (!(params["transform_key"] in list("a", "b", "c", "d", "e", "f")))
|
||||
return
|
||||
new_transform.vars[params["transform_key"]] = text2num(params["transform_value"])
|
||||
target.modify_filter(params["name"], list(params["field_name"] = new_transform))
|
||||
. = TRUE
|
||||
if("mass_apply")
|
||||
if(!check_rights_for(usr.client, R_FUN))
|
||||
to_chat(usr, span_userdanger("Stay in your lane, jannie."))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* 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
|
||||
* Much like filterrific, '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
|
||||
|
||||
Reference in New Issue
Block a user