mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-01 04:21:42 +00:00
Done using this command sed -Ei 's/(\s*\S+)\s*\t+/\1 /g' code/**/*.dm We have countless examples in the codebase with this style gone wrong, and defines and such being on hideously different levels of indentation. Fixing this to keep the alignment involves tainting the blames of code your PR doesn't need to be touching at all. And ultimately, it's hideous. There are some files that this sed makes uglier. I can fix these when they are pointed out, but I believe this is ultimately for the greater good of readability. I'm more concerned with if any strings relied on this. Hi codeowners! Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
44 lines
2.3 KiB
Plaintext
44 lines
2.3 KiB
Plaintext
//LISTS - CAN NOT DO VV_DO_TOPIC BECAUSE LISTS AREN'T DATUMS :(
|
|
/client/proc/vv_do_list(list/target, href_list)
|
|
var/target_index = text2num(GET_VV_VAR_TARGET)
|
|
if(check_rights(R_VAREDIT))
|
|
if(target_index)
|
|
if(href_list[VV_HK_LIST_EDIT])
|
|
mod_list(target, null, "list", "contents", target_index, autodetect_class = TRUE)
|
|
if(href_list[VV_HK_LIST_CHANGE])
|
|
mod_list(target, null, "list", "contents", target_index, autodetect_class = FALSE)
|
|
if(href_list[VV_HK_LIST_REMOVE])
|
|
var/variable = target[target_index]
|
|
var/prompt = alert("Do you want to remove item number [target_index] from list?", "Confirm", "Yes", "No")
|
|
if (prompt != "Yes")
|
|
return
|
|
target.Cut(target_index, target_index+1)
|
|
log_world("### ListVarEdit by [src]: /list's contents: REMOVED=[html_encode("[variable]")]")
|
|
log_admin("[key_name(src)] modified list's contents: REMOVED=[variable]")
|
|
message_admins("[key_name_admin(src)] modified list's contents: REMOVED=[variable]")
|
|
if(href_list[VV_HK_LIST_ADD])
|
|
mod_list_add(target, null, "list", "contents")
|
|
if(href_list[VV_HK_LIST_ERASE_DUPES])
|
|
uniqueList_inplace(target)
|
|
log_world("### ListVarEdit by [src]: /list contents: CLEAR DUPES")
|
|
log_admin("[key_name(src)] modified list's contents: CLEAR DUPES")
|
|
message_admins("[key_name_admin(src)] modified list's contents: CLEAR DUPES")
|
|
if(href_list[VV_HK_LIST_ERASE_NULLS])
|
|
listclearnulls(target)
|
|
log_world("### ListVarEdit by [src]: /list contents: CLEAR NULLS")
|
|
log_admin("[key_name(src)] modified list's contents: CLEAR NULLS")
|
|
message_admins("[key_name_admin(src)] modified list's contents: CLEAR NULLS")
|
|
if(href_list[VV_HK_LIST_SET_LENGTH])
|
|
var/value = vv_get_value(VV_NUM)
|
|
if (value["class"] != VV_NUM || value["value"] > max(50000, target.len)) //safety - would rather someone not put an extra 0 and erase the server's memory lmao.
|
|
return
|
|
target.len = value["value"]
|
|
log_world("### ListVarEdit by [src]: /list len: [target.len]")
|
|
log_admin("[key_name(src)] modified list's len: [target.len]")
|
|
message_admins("[key_name_admin(src)] modified list's len: [target.len]")
|
|
if(href_list[VV_HK_LIST_SHUFFLE])
|
|
shuffle_inplace(target)
|
|
log_world("### ListVarEdit by [src]: /list contents: SHUFFLE")
|
|
log_admin("[key_name(src)] modified list's contents: SHUFFLE")
|
|
message_admins("[key_name_admin(src)] modified list's contents: SHUFFLE")
|