From 28f50c8e1da5a80a34008f54777f49d586d3a601 Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Sat, 8 Jun 2024 19:32:58 -0400 Subject: [PATCH] cleanup remove leftover comments and logging --- code/modules/admin/game_master/sound_panel.dm | 28 +------------------ tgui/packages/tgui/interfaces/SoundPanel.tsx | 26 +---------------- 2 files changed, 2 insertions(+), 52 deletions(-) diff --git a/code/modules/admin/game_master/sound_panel.dm b/code/modules/admin/game_master/sound_panel.dm index 3113d603fa..8aff8b0f23 100644 --- a/code/modules/admin/game_master/sound_panel.dm +++ b/code/modules/admin/game_master/sound_panel.dm @@ -1,9 +1,6 @@ -//GLOBAL_DATUM_INIT(sound_panel, /datum/sound_panel_tgui, new) - /client/proc/open_sound_panel() set name = "Sound Panel" - //set category = "Admin.Events" - set category = "Game Master" + set category = "Admin.Panels" if(!check_rights(R_SOUNDS)) return @@ -31,7 +28,6 @@ var/target_group /datum/sound_panel/New(user) - //. = ..() if(isnull(sound_list)) //first run, init statics sound_list = get_sounds() @@ -67,8 +63,6 @@ var/list/file_paths = list() for(var/i = 1, i <= length(dirs), i++) var/path = dirs[i] - //while(length(dirs)) - //var/path = popleft(dirs) var/list/filenames = flist(path) for(var/filename as anything in filenames) @@ -81,14 +75,7 @@ return file_paths -/* -/datum/sound_panel/Destroy(force, ...) - . = ..() -*/ - /datum/sound_panel/ui_static_data(mob/user) - //. = ..() - var/list/data = list() data["sound_list"] = sound_list @@ -136,7 +123,6 @@ ui.open() /datum/sound_panel/proc/InterceptClickOn(mob/user, params, atom/object) - //var/list/modifiers = params2list(params) if(loc_click_intercept) var/turf/chosen_loc = get_turf(object) if(QDELETED(chosen_loc)) @@ -157,12 +143,6 @@ return TRUE -/* -#define IS_VALID_SOUND(sound) ((sound) in sound_list) -#define IS_VALID_CATEGORY(category) ((category) in category_list) -#define IS_VALID_VOLUME(volume) (ISINRANGE((volume), 0, 100)) -*/ - /datum/sound_panel/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) . = ..() if(.) @@ -290,9 +270,3 @@ for(var/mob/target as anything in targets) playsound_client(target.client, sound_datum, vol = sound_volume, vol_cat = category_lookup[sound_category]) return TRUE - -/* -#undef IS_VALID_SOUND -#undef IS_VALID_CATEGORY -#undef IS_VALID_VOLUME -*/ diff --git a/tgui/packages/tgui/interfaces/SoundPanel.tsx b/tgui/packages/tgui/interfaces/SoundPanel.tsx index 5170e7ff43..645bf037b7 100644 --- a/tgui/packages/tgui/interfaces/SoundPanel.tsx +++ b/tgui/packages/tgui/interfaces/SoundPanel.tsx @@ -3,7 +3,6 @@ import { Box, Button, Dropdown, Input, Section, Slider, Stack, Tabs } from 'tgui import { Window } from 'tgui/layouts'; import { Component, Fragment } from 'inferno'; import { debounce } from 'common/timer'; -import { logger } from '../logging'; interface SoundPanelData { sound_list: string[]; @@ -117,7 +116,6 @@ interface ListSearchBoxEntry { class ListSearchBox extends Component { state: ListSearchBoxState = { query: '', - // selection: '', }; handleQueryChange(value: string) { if (value === this.state.query) { @@ -126,12 +124,6 @@ class ListSearchBox extends Component { this.setState({ query: value, }); - - /* - if (this.state.selection.toLowerCase().includes(value.toLowerCase())) { - return; - } - */ this.handleSelectionChange(''); } handleSelectionChange(value: string) { @@ -142,18 +134,8 @@ class ListSearchBox extends Component { this.handleQueryChange(value); }, 250); - /* - shouldComponentUpdate(nextState) { - return ( - nextState.selection !== this.state.selection || - nextState.query !== this.state.query - ); - } - */ - parsedItems = this.props.items .map((item, index) => { - if (index === 0) logger.log('parsing items'); const dirIndex = item.lastIndexOf('/'); const dirName = item.slice(6, dirIndex); const extIndex = item.lastIndexOf('.'); @@ -175,14 +157,12 @@ class ListSearchBox extends Component { }); render() { - logger.log('in render'); return (
{this.parsedItems .filter((item, index) => { - if (index === 0) logger.log('filtering items'); return item.fileName .toLowerCase() .includes(this.state.query.toLowerCase()); @@ -193,7 +173,6 @@ class ListSearchBox extends Component { color="transparent" content={item.fileName} fluid - // id={item.id} key={item.id} my={0} onClick={() => this.handleSelectionChange(item.fullPath)} @@ -201,9 +180,7 @@ class ListSearchBox extends Component { style={{ animation: 'none', transition: 'none', - }} - // tabIndex={undefined} - > + }}>
{ } options={category_list} selected={sound_category} - // minWidth="90px" />