Skip to content

Commit

Permalink
SDQL2 bugfixes & features (#6270)
Browse files Browse the repository at this point in the history
# About the pull request

## Fixes

- Fixed partially empty string being printed to chat when `CALL` query
wasn't used
- Fixed `SDQL_print()` not handling assoc lists-in-lists correctly

## Features

- SDQL2 tab now works. Also appears instantly instead of on next
`SSstatpanels` fire.
- Clients now can be selected without needing to add `IN global.clients`
to a query.
- Added `LISTSOURCE` option, taking arg `OPTIMIZED`. Adding this arg
will use some CM-added lists (like `GLOB.mob_list`) instead of iterating
over `world`. This arg does nothing if the list being queried isn't
`world`.
- Added `SELECTPRINT` option, taking arg `NO_PRINT`. Adding this arg
will prevent the HTML window containing every object found using a
`SELECT` query. Useful because assembling the HTML window is incredibly
taxing on the server when `SELECT`ing a massive amount of objects at
once.
- You can now call `sleep()` in SDQL queries by using `global._sleep()`
- Added `SINGLECALL` query, taking an arg of `object.proc_call()`. This
allows you to call a proc on an object (`global`, `marked`, `SSticker`,
etc.) without needing to iterate over anything. Primarily useful for an
in-between when chaining queries together.

For more details and examples, see [my SDQL2
documentation](https://hackmd.io/@mRAdleXgRfmKqh97O8ixSA/ryZ-oqE2c).

# Explain why it's good for the game
Fixes good, features that make SDQL2 better good.

# Changelog
:cl:
admin: Added LISTSOURCE and SELECTPRINT options to SDQL queries.
admin: Added SINGLECALL SQDL query.
admin: SDQL tab now works.
admin: Clients can now be selected with SDQL more easily.
/:cl:
  • Loading branch information
Zonespace27 committed May 14, 2024
1 parent b7722a3 commit e64c5bb
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 57 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# Zonespace

/code/datums/tutorial/ @Zonespace27
/code/modules/admin/verbs/SDQL2/ @Zonespace27
/maps/tutorial/ @Zonespace27

# MULTIPLE OWNERS
12 changes: 9 additions & 3 deletions code/controllers/subsystem/statpanel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,23 @@ SUBSYSTEM_DEF(statpanels)

/// Sets the current tab to the SDQL tab
/datum/controller/subsystem/statpanels/proc/set_SDQL2_tab(client/target)
if(!target)
return

var/list/sdql2_initial = list()
//sdql2_initial[length(sdql2_initial)++] = list("", "Access Global SDQL2 List", REF(GLOB.sdql2_vv_statobj))
sdql2_initial[++sdql2_initial.len] = list("", "Access Global SDQL2 List", REF(GLOB.sdql2_vv_statobj))
var/list/sdql2_querydata = list()
//for(var/datum/sdql2_query/query as anything in GLOB.sdql2_queries)
//sdql2_querydata = query.generate_stat()
for(var/datum/sdql2_query/query as anything in GLOB.sdql2_queries)
sdql2_querydata += query.generate_stat()

sdql2_initial += sdql2_querydata
target.stat_panel.send_message("update_sdql2", sdql2_initial)

///immediately update the active statpanel tab of the target client
/datum/controller/subsystem/statpanels/proc/immediate_send_stat_data(client/target)
if(!target)
return FALSE

if(!target.stat_panel.is_ready())
return FALSE

Expand Down
1 change: 1 addition & 0 deletions code/game/objects/effects/effect.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/obj/effect
icon = 'icons/effects/effects.dmi'
blocks_emissive = EMISSIVE_BLOCK_GENERIC

/obj/effect/get_applying_acid_time()
return -1
Loading

0 comments on commit e64c5bb

Please sign in to comment.