From 39bc14bb4a8f0f4ad3fa82fe2a17da4154a2e590 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Mon, 8 Apr 2024 03:44:30 -0700 Subject: [PATCH] reworks game preferences (characters v2 staging) (#6310) Co-authored-by: silicons Co-authored-by: LordME <58342752+TheLordME@users.noreply.github.com> --- README.md | 22 +- SQL/database_schema.sql | 22 +- SQL/database_schema_prefixed.sql | 22 +- citadel.dme | 21 +- code/__DEFINES/client/game_preferences.dm | 32 + code/__DEFINES/controllers/_subsystems.dm | 1 + code/__DEFINES/{ => interface}/skin.dm | 7 + code/__DEFINES/interface/verbs.dm | 9 + code/__HELPERS/_logging.dm | 14 +- code/__HELPERS/game.dm | 6 +- code/__HELPERS/text.dm | 37 +- code/__HELPERS/unsorted.dm | 2 +- .../configuration/entries/cross_server.dm | 26 +- .../configuration_old/configuration.dm | 6 - code/controllers/subsystem.dm | 7 +- code/controllers/subsystem/dbcore/_dbcore.dm | 14 + code/controllers/subsystem/playtime.dm | 4 + code/controllers/subsystem/preferences.dm | 76 +++ code/controllers/subsystem/vote.dm | 2 +- .../elements/clothing/dynamic_recolor.dm | 2 +- code/datums/helper_datums/getrev.dm | 2 +- code/datums/looping_sounds/_looping_sound.dm | 2 +- .../datums/looping_sounds/machinery_sounds.dm | 4 +- code/datums/looping_sounds/weather_sounds.dm | 2 +- code/datums/progressbar.dm | 2 +- code/datums/world_topic.dm | 19 - code/game/antagonist/antagonist_objectives.dm | 2 +- code/game/area/area.dm | 2 +- code/game/click/rig.dm | 2 +- code/game/dna/dna_modifier.dm | 4 +- code/game/gamemodes/game_mode.dm | 2 +- code/game/gamemodes/nuclear/pinpointer.dm | 2 +- code/game/gamemodes/technomancer/core_obj.dm | 2 +- code/game/machinery/OpTable.dm | 2 +- code/game/machinery/Sleeper.dm | 2 +- code/game/machinery/_frame.dm | 4 +- code/game/machinery/adv_med.dm | 2 +- code/game/machinery/bioprinter.dm | 2 +- code/game/machinery/cloning.dm | 4 +- code/game/machinery/computer/law.dm | 2 +- code/game/machinery/computer/medical.dm | 2 +- code/game/machinery/computer/security.dm | 2 +- code/game/machinery/cryo.dm | 4 +- code/game/machinery/cryopod.dm | 4 +- code/game/machinery/iv_drip.dm | 4 +- code/game/machinery/nuclear_bomb.dm | 2 +- code/game/machinery/oxygen_pump.dm | 2 +- code/game/machinery/pipe/construction.dm | 4 +- code/game/machinery/rechargestation.dm | 4 +- .../machinery/suit_storage/suit_cycler.dm | 2 +- .../suit_storage/suit_storage_unit.dm | 4 +- code/game/machinery/telecomms/broadcaster.dm | 8 +- code/game/machinery/teleporter/console.dm | 2 +- code/game/machinery/transportpod.dm | 4 +- code/game/machinery/vending/vending.dm | 2 +- .../machinery/virtual_reality/ar_console.dm | 2 +- .../machinery/virtual_reality/vr_console.dm | 4 +- code/game/machinery/vitals_monitor.dm | 2 +- code/game/machinery/vr_console.dm | 4 +- code/game/machinery/washing_machine.dm | 4 +- code/game/mecha/equipment/tools/passenger.dm | 2 +- code/game/mecha/mecha.dm | 4 +- code/game/mecha/micro/micro_equipment.dm | 2 +- code/game/objects/items.dm | 8 +- code/game/objects/items/devices/PDA/PDA.dm | 10 +- .../items/devices/communicator/UI_tgui.dm | 2 +- .../items/devices/communicator/messaging.dm | 2 +- code/game/objects/items/devices/defib.dm | 2 +- code/game/objects/items/devices/flashlight.dm | 4 +- .../objects/items/devices/floor_painter.dm | 6 +- code/game/objects/items/devices/megaphone.dm | 6 +- .../objects/items/devices/radio/beacon.dm | 2 +- .../game/objects/items/devices/radio/radio.dm | 2 +- code/game/objects/items/devices/spy_bug.dm | 2 +- .../devices/tape_recorder/tape_recorder.dm | 12 +- .../objects/items/devices/taperecorder.dm | 12 +- code/game/objects/items/devices/whistle.dm | 2 +- code/game/objects/items/godfigures.dm | 4 +- code/game/objects/items/id_cards/cards.dm | 2 +- .../objects/items/id_cards/station_ids.dm | 2 +- code/game/objects/items/scanners/biology.dm | 2 +- code/game/objects/items/scanners/health.dm | 4 +- code/game/objects/items/scanners/plant.dm | 2 +- code/game/objects/items/storage/backpack.dm | 2 +- code/game/objects/items/storage/belt.dm | 2 +- .../objects/items/storage/medical/firstaid.dm | 2 +- code/game/objects/items/storage/quickdraw.dm | 2 +- code/game/objects/items/storage/wallets.dm | 2 +- code/game/objects/items/toys.dm | 2 +- code/game/objects/items/weapons/autopsy.dm | 2 +- .../items/weapons/implants/implantchair.dm | 4 +- .../items/weapons/implants/implanter.dm | 2 +- .../weapons/implants/implantreagent_vr.dm | 2 +- .../objects/items/weapons/tanks/jetpack.dm | 4 +- .../structures/crates_lockers/__closet.dm | 4 +- .../crates_lockers/closets/fireaxe.dm | 4 +- .../crates_lockers/closets/secure/personal.dm | 2 +- .../structures/crates_lockers/crates.dm | 2 +- code/game/objects/structures/electricchair.dm | 2 +- code/game/objects/structures/fireaxe.dm | 4 +- code/game/objects/structures/gravemarker.dm | 2 +- code/game/objects/structures/inflatable.dm | 2 +- .../objects/structures/medical_stand_vr.dm | 4 +- code/game/objects/structures/railing.dm | 6 +- .../structures/stool_bed_chair_nest/chairs.dm | 2 +- .../objects/structures/tables/flipping.dm | 4 +- .../objects/structures/windoor_assembly.dm | 4 +- code/game/objects/structures/window.dm | 4 +- code/game/rendering/legacy/hud.dm | 12 +- code/game/rendering/legacy/human.dm | 2 +- .../rendering/parallax/parallax_holder.dm | 2 +- .../rendering/plane_masters/plane_holder.dm | 2 +- code/game/response_team.dm | 2 +- code/game/sound.dm | 4 +- code/game/verbs/advanced_who.dm | 4 +- code/game/verbs/character_directory.dm | 2 +- code/game/verbs/ignore.dm | 4 +- code/game/verbs/who.dm | 2 +- code/modules/admin/admin.dm | 16 +- code/modules/admin/admin_verbs.dm | 69 -- code/modules/admin/news.dm | 4 +- code/modules/admin/topic.dm | 3 - code/modules/admin/verbs/adminhelp.dm | 10 +- code/modules/admin/verbs/adminpm.dm | 5 +- code/modules/admin/verbs/antag-ooc.dm | 2 +- code/modules/admin/verbs/custom_event.dm | 2 +- code/modules/admin/verbs/deadsay.dm | 4 +- code/modules/admin/verbs/lightning_strike.dm | 2 +- code/modules/admin/verbs/playsound.dm | 6 +- code/modules/admin/verbs/possess.dm | 4 +- code/modules/admin/verbs/pray.dm | 7 +- code/modules/assembly/holder.dm | 2 +- code/modules/assembly/infrared.dm | 2 +- code/modules/assembly/mousetrap.dm | 2 +- code/modules/assembly/signaler.dm | 2 +- .../components/binary_devices/circulator.dm | 4 +- .../components/binary_devices/pipeturbine.dm | 8 +- code/modules/catalogue/cataloguer_vr.dm | 2 +- code/modules/client/client.dm | 4 + code/modules/client/client_procs.dm | 33 +- code/modules/client/data/client_data.dm | 8 +- code/modules/client/data/player_data.dm | 42 +- .../client/game_preferences/entries/game.dm | 73 +++ .../game_preferences/entries/graphics.dm | 42 ++ .../game_preferences/game_preference_entry.dm | 149 +++++ .../game_preference_middleware.dm | 47 ++ .../game_preference_toggle.dm | 270 ++++++++ .../game_preferences/game_preferences.dm | 609 ++++++++++++++++++ .../middleware/keybindings.dm | 140 ++++ .../game_preferences/middleware/toggles.dm | 59 ++ .../client/onboarding/age_verification.dm | 3 +- code/modules/client/statpanel.dm | 4 +- code/modules/client/ui_style.dm | 68 +- code/modules/client/verbs/minimap.dm | 2 +- code/modules/client/verbs/ooc.dm | 38 +- .../client/verbs/panic_bunker_player.dm | 34 - code/modules/client/verbs/preferences.dm | 11 - .../client/verbs/{ping.dm => system.dm} | 27 +- code/modules/client/verbs/view.dm | 8 +- code/modules/client/viewport.dm | 2 +- code/modules/clothing/clothing.dm | 2 +- code/modules/clothing/clothing_accessories.dm | 2 +- code/modules/clothing/ears/ears.dm | 2 +- code/modules/clothing/ears/speakrock.dm | 2 +- code/modules/clothing/glasses/_glasses.dm | 8 +- code/modules/clothing/glasses/hud.dm | 6 +- code/modules/clothing/head/misc_special.dm | 2 +- code/modules/clothing/head/pilot_helmet.dm | 2 +- code/modules/clothing/masks/breath.dm | 2 +- code/modules/clothing/masks/gasmask.dm | 4 +- code/modules/clothing/masks/miscellaneous.dm | 2 +- code/modules/clothing/masks/voice.dm | 6 +- code/modules/clothing/shoes/_shoes.dm | 4 +- .../modules/clothing/spacesuits/spacesuits.dm | 2 +- code/modules/clothing/spacesuits/void/void.dm | 6 +- .../clothing/spacesuits/void/zaddat.dm | 2 +- code/modules/clothing/suits/eventclothing.dm | 6 +- code/modules/clothing/suits/miscellaneous.dm | 8 +- code/modules/clothing/suits/storage.dm | 4 +- code/modules/clothing/under/_under.dm | 2 +- .../clothing/under/accessories/accessory.dm | 2 +- .../under/accessories/bracelets/_bracelets.dm | 2 +- .../clothing/under/accessories/holster.dm | 2 +- code/modules/clothing/under/jobs/security.dm | 2 +- code/modules/clothing/under/miscellaneous.dm | 6 +- code/modules/detectivework/tools/scanner.dm | 4 +- .../modules/economy/machines/cash_register.dm | 2 +- code/modules/flufftext/look_up.dm | 2 +- code/modules/food/drinks/bottle.dm | 2 +- .../food/machinery/appliance/_appliance.dm | 2 +- .../food/machinery/appliance/_mixer.dm | 4 +- .../food/machinery/appliance/container.dm | 2 +- code/modules/food/machinery/appliance/oven.dm | 4 +- code/modules/food/machinery/gibber.dm | 2 +- code/modules/food/machinery/microwave.dm | 2 +- code/modules/games/cards.dm | 12 +- code/modules/games/dice.dm | 4 +- code/modules/guidebook/guidebook.dm | 2 +- code/modules/hydroponics/trays/tray.dm | 6 +- code/modules/instruments/songs/play_legacy.dm | 2 +- .../instruments/songs/play_synthesized.dm | 2 +- .../integrated_electronics/core/assemblies.dm | 2 +- .../core/assemblies/device.dm | 2 +- .../core/integrated_circuit.dm | 2 +- code/modules/keybindings/bindings_client.dm | 17 +- code/modules/keybindings/keybind/_keybind.dm | 20 +- code/modules/keybindings/keybind/admin.dm | 15 +- code/modules/keybindings/keybind/carbon.dm | 8 +- code/modules/keybindings/keybind/client.dm | 4 +- code/modules/keybindings/keybind/emote.dm | 2 +- code/modules/keybindings/keybind/mob.dm | 38 +- code/modules/keybindings/keybind/movement.dm | 8 +- code/modules/keybindings/setup.dm | 10 +- code/modules/language/language.dm | 6 +- code/modules/language/languages/silicons.dm | 4 +- code/modules/media/mediamanager.dm | 4 +- code/modules/mining/drilling/drill.dm | 4 +- code/modules/mining/ore_box.dm | 2 +- code/modules/mob/animations.dm | 2 +- code/modules/mob/emote.dm | 2 +- code/modules/mob/floating_message.dm | 2 +- code/modules/mob/hear_say.dm | 18 +- code/modules/mob/living/autohiss.dm | 4 +- code/modules/mob/living/carbon/brain/MMI.dm | 2 +- code/modules/mob/living/carbon/brain/emote.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 2 +- code/modules/mob/living/carbon/give.dm | 2 +- code/modules/mob/living/carbon/human/emote.dm | 8 +- code/modules/mob/living/carbon/human/human.dm | 10 +- .../living/carbon/human/human_attackhand.dm | 2 +- .../carbon/human/human_modular_limbs.dm | 4 +- .../mob/living/carbon/human/human_powers.dm | 14 +- code/modules/mob/living/carbon/human/life.dm | 4 +- code/modules/mob/living/default_language.dm | 4 +- code/modules/mob/living/inventory.dm | 2 +- code/modules/mob/living/living.dm | 4 +- code/modules/mob/living/living_vr.dm | 2 +- code/modules/mob/living/mobility.dm | 2 +- code/modules/mob/living/resist.dm | 2 +- code/modules/mob/living/say.dm | 4 - code/modules/mob/living/silicon/ai/ai.dm | 2 +- .../modules/mob/living/silicon/ai/latejoin.dm | 2 +- code/modules/mob/living/silicon/pai/verbs.dm | 4 +- .../silicon/robot/dogborg/dog_sleeper_vr.dm | 16 +- .../living/silicon/robot/drone/drone_say.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 8 +- .../mob/living/silicon/robot/robot_items.dm | 2 +- code/modules/mob/living/silicon/silicon.dm | 6 +- .../mob/living/simple_mob/simple_mob_vr.dm | 2 +- .../simple_mob/subtypes/animal/borer/borer.dm | 2 +- .../subtypes/animal/borer/borer_captive.dm | 2 +- .../simple_mob/subtypes/animal/pets/cat.dm | 2 +- .../simple_mob/subtypes/animal/pets/fox_vr.dm | 4 +- code/modules/mob/login.dm | 5 - code/modules/mob/mob.dm | 34 +- code/modules/mob/mob_helpers.dm | 12 +- code/modules/mob/new_player/login.dm | 1 - code/modules/mob/new_player/new_player.dm | 17 +- code/modules/mob/new_player/poll.dm | 49 -- code/modules/mob/new_player/skill.dm | 2 +- code/modules/mob/observer/dead/dead.dm | 16 +- code/modules/mob/observer/dead/free_vr.dm | 2 +- code/modules/mob/perspective.dm | 2 +- code/modules/mob/pulling.dm | 2 +- code/modules/mob/say.dm | 8 +- code/modules/mob/say_vr.dm | 6 +- code/modules/mob/typing_indicator.dm | 3 - .../computers/modular_computer/interaction.dm | 6 +- code/modules/multiz/movement.dm | 4 +- code/modules/multiz/structures/hoist.dm | 2 +- code/modules/nifsoft/nif.dm | 2 +- code/modules/nifsoft/nif_tgui.dm | 2 +- .../nifsoft/software/13_soulcatcher.dm | 6 +- code/modules/organs/internal/subtypes/eyes.dm | 2 +- code/modules/paperwork/carbonpaper.dm | 2 +- code/modules/paperwork/paper/paper.dm | 2 +- code/modules/paperwork/paper_bundle.dm | 4 +- code/modules/paperwork/papershredder.dm | 2 +- code/modules/paperwork/pen.dm | 2 +- code/modules/photography/camera.dm | 2 +- code/modules/photography/photo.dm | 2 +- code/modules/power/cable.dm | 4 +- .../fusion/fuel_assembly/fuel_injector.dm | 4 +- code/modules/power/generator.dm | 4 +- code/modules/power/singularity/emitter.dm | 2 +- .../particle_accelerator.dm | 8 +- .../particle_accelerator/particle_smasher.dm | 2 +- code/modules/preferences/_preferences.dm | 57 -- code/modules/preferences/migration.dm | 33 +- .../preference_setup/global/01_ui.dm | 96 --- .../preference_setup/global/02_settings.dm | 119 ---- .../preference_setup/global/04_ooc.dm | 2 - .../global/language_prefix.dm | 66 -- .../preference_setup/global/setting_datums.dm | 365 ----------- .../keybindings/keybindings.dm | 214 ------ .../preferences/preferences_toggle_procs.dm | 344 +--------- code/modules/projectiles/dnalocking.dm | 6 +- code/modules/projectiles/gun.dm | 4 +- code/modules/projectiles/guns/ballistic.dm | 2 +- code/modules/projectiles/guns/energy/laser.dm | 4 +- .../projectiles/guns/energy/sizegun_vr.dm | 2 +- .../projectiles/guns/energy/special.dm | 2 +- .../projectiles/guns/launcher/pneumatic.dm | 2 +- .../projectiles/guns/projectile/boltaction.dm | 2 +- .../projectiles/guns/projectile/musket.dm | 2 +- .../projectiles/guns/projectile/pistol.dm | 4 +- .../projectiles/guns/projectile/revolver.dm | 12 +- .../projectiles/guns/projectile/semiauto.dm | 2 +- .../projectiles/guns/projectile/shotgun.dm | 4 +- .../projectiles/guns/projectile/sniper.dm | 4 +- .../projectile/sniper/collapsible_sniper.dm | 2 +- .../modules/projectiles/magazines/smartmag.dm | 2 +- .../projectiles/targeting/targeting_mob.dm | 2 +- code/modules/reagents/items/hypospray.dm | 2 +- .../reagents/machinery/dispenser/cartridge.dm | 2 +- .../reagents/machinery/reagent_dispenser.dm | 2 +- .../reagent_dispenser/watercooler.dm | 2 +- code/modules/reagents/reagent_containers.dm | 2 +- .../reagents/reagent_containers/spray.dm | 2 +- .../recycling/disposal-construction.dm | 4 +- code/modules/resleeving/computers.dm | 2 +- code/modules/resleeving/infomorph.dm | 4 +- code/modules/resleeving/machines.dm | 4 +- code/modules/shieldgen/shield_capacitor.dm | 2 +- code/modules/species/station/alraune.dm | 2 +- code/modules/tgui/module.dm | 3 +- code/modules/tgui/modules/general/cardmod.dm | 1 - code/modules/tgui/tgui.dm | 19 +- code/modules/tgui/tgui_module_context.dm | 30 + code/modules/tgui/tgui_module_function.dm | 31 + code/modules/tgui_panel/external.dm | 2 +- code/modules/tooltip/tooltip.dm | 4 +- code/modules/vore/eating/belly_obj_vr.dm | 12 +- code/modules/vore/eating/bellymodes_vr.dm | 28 +- code/modules/vore/eating/living_vr.dm | 6 +- code/modules/vore/eating/simple_animal_vr.dm | 6 +- .../modules/vore/fluffstuff/custom_clothes.dm | 2 +- code/modules/vore/fluffstuff/custom_items.dm | 2 +- .../modules/vore/fluffstuff/guns/bsharpoon.dm | 2 +- code/modules/xenoarcheaology/finds/talking.dm | 2 +- .../tools/suspension_generator.dm | 4 +- code/modules/xenobio/machinery/processor.dm | 2 +- config/entries/cross_server.txt | 8 - config/entries/database.txt | 2 +- interface/interface.dm | 23 +- interface/menus/_menus.dm | 3 + interface/menus/main.dm | 3 + tgui/docs/migration-to-v4-from-v3.md | 91 --- tgui/packages/common/keyboard.ts | 354 ++++++++++ tgui/packages/tgui-panel/themes.js | 4 +- tgui/packages/tgui-polyfill/10-misc.js | 14 + tgui/packages/tgui/backend.ts | 57 +- tgui/packages/tgui/components/Box.tsx | 89 ++- tgui/packages/tgui/components/LabeledList.tsx | 10 +- .../tgui/components/{Table.js => Table.tsx} | 23 +- tgui/packages/tgui/components/index.js | 2 +- .../components/{ => keyboard}/KeyListener.tsx | 4 +- tgui/packages/tgui/index.js | 5 +- .../GamePreferences/GamePreferenceEntry.tsx | 180 ++++++ .../GamePreferenceKeybinds.tsx | 339 ++++++++++ .../GamePreferences/GamePreferenceToggles.tsx | 87 +++ .../tgui/interfaces/GamePreferences/index.tsx | 228 +++++++ .../packages/tgui/interfaces/PaiInterface.tsx | 2 +- .../game_preferences/ambient_occlusion.tsx | 8 - .../game_preferences/auto_fit_viewport.tsx | 7 - .../game_preferences/darkened_flash.tsx | 12 - .../game_preferences/fov_darkness.tsx | 8 - .../features/game_preferences/fps.tsx | 56 -- .../features/game_preferences/hotkeys.tsx | 8 - .../game_preferences/preferred_map.tsx | 13 - .../features/game_preferences/runechat.tsx | 29 - .../game_preferences/scaling_method.tsx | 11 - .../features/game_preferences/screentips.tsx | 22 - .../features/game_preferences/tgui.tsx | 36 -- .../features/game_preferences/tooltips.tsx | 20 - .../features/game_preferences/ui_style.tsx | 63 -- .../features/game_preferences/widescreen.tsx | 7 - .../packages/tgui/interfaces/items/Crayon.tsx | 4 + .../tgui/interfaces/machines/AirAlarm.tsx | 2 +- .../UIAgeVerifyMenu.tsx} | 8 +- .../{ => unused}/AbductorConsole.js | 8 +- .../interfaces/{ => unused}/Achievements.js | 6 +- .../interfaces/{ => unused}/Adminhelp.tsx | 6 +- .../{ => unused}/AdventureBrowser.tsx | 10 +- .../{ => unused}/AnomalyRefinery.js | 8 +- .../{ => unused}/AtmosControlPanel.js | 6 +- .../interfaces/{ => unused}/AtmosHandbook.tsx | 4 +- .../tgui/interfaces/{ => unused}/Bepis.js | 6 +- .../{ => unused}/BluespaceArtillery.js | 6 +- .../{ => unused}/BluespaceLocator.js | 6 +- .../{ => unused}/BluespaceSender.js | 8 +- .../{ => unused}/BluespaceVendor.js | 8 +- .../antag}/AntagInfoBrainwashed.tsx | 6 +- .../{ => unused/antag}/AntagInfoBrother.tsx | 6 +- .../antag}/AntagInfoChangeling.tsx | 6 +- .../{ => unused/antag}/AntagInfoDemon.tsx | 6 +- .../antag}/AntagInfoGangmember.tsx | 6 +- .../{ => unused/antag}/AntagInfoGeneric.tsx | 6 +- .../{ => unused/antag}/AntagInfoHeretic.tsx | 6 +- .../{ => unused/antag}/AntagInfoMalf.tsx | 8 +- .../{ => unused/antag}/AntagInfoMorph.tsx | 4 +- .../{ => unused/antag}/AntagInfoNightmare.tsx | 4 +- .../antag}/AntagInfoSeparatist.tsx | 6 +- .../{ => unused/antag}/AntagInfoThief.tsx | 6 +- .../{ => unused/antag}/AntagInfoTraitor.tsx | 6 +- .../{ => unused/antag}/AntagInfoWizard.tsx | 6 +- .../{ => unused/economy}/AccountingConsole.js | 8 +- .../{ => unused/economy}/AccountsTerminal.js | 6 +- .../{ => unused/economy}/BlackMarketUplink.js | 8 +- .../tgui/interfaces/{ => unused/pda}/Pda.js | 10 +- .../pda/cartridges}/pda_atmos_scan.js | 4 +- .../pda/cartridges}/pda_janitor.js | 4 +- .../pda/cartridges}/pda_main_menu.js | 4 +- .../pda/cartridges}/pda_manifest.js | 6 +- .../pda/cartridges}/pda_medical.js | 4 +- .../pda/cartridges}/pda_messenger.js | 4 +- .../pda/cartridges}/pda_news.js | 4 +- .../pda/cartridges}/pda_notekeeper.js | 4 +- .../pda/cartridges}/pda_power.js | 6 +- .../pda/cartridges}/pda_security.js | 4 +- .../pda/cartridges}/pda_signaller.js | 2 +- .../pda/cartridges}/pda_status_display.js | 4 +- .../pda/cartridges}/pda_supply.js | 4 +- tgui/packages/tgui/styles/base.scss | 15 + tgui/packages/tgui/styles/base.ts | 9 + .../tgui/styles/components/Dimmer.scss | 4 +- tgui/public/tgui-polyfill.min.js | 2 +- 427 files changed, 3981 insertions(+), 2842 deletions(-) create mode 100644 code/__DEFINES/client/game_preferences.dm rename code/__DEFINES/{ => interface}/skin.dm (92%) create mode 100644 code/__DEFINES/interface/verbs.dm create mode 100644 code/controllers/subsystem/preferences.dm create mode 100644 code/modules/client/game_preferences/entries/game.dm create mode 100644 code/modules/client/game_preferences/entries/graphics.dm create mode 100644 code/modules/client/game_preferences/game_preference_entry.dm create mode 100644 code/modules/client/game_preferences/game_preference_middleware.dm create mode 100644 code/modules/client/game_preferences/game_preference_toggle.dm create mode 100644 code/modules/client/game_preferences/game_preferences.dm create mode 100644 code/modules/client/game_preferences/middleware/keybindings.dm create mode 100644 code/modules/client/game_preferences/middleware/toggles.dm delete mode 100644 code/modules/client/verbs/panic_bunker_player.dm delete mode 100644 code/modules/client/verbs/preferences.dm rename code/modules/client/verbs/{ping.dm => system.dm} (55%) delete mode 100644 code/modules/preferences/preference_setup/global/01_ui.dm delete mode 100644 code/modules/preferences/preference_setup/global/language_prefix.dm delete mode 100644 code/modules/preferences/preference_setup/global/setting_datums.dm delete mode 100644 code/modules/preferences/preference_setup/keybindings/keybindings.dm create mode 100644 code/modules/tgui/tgui_module_context.dm create mode 100644 code/modules/tgui/tgui_module_function.dm delete mode 100644 tgui/docs/migration-to-v4-from-v3.md create mode 100644 tgui/packages/common/keyboard.ts rename tgui/packages/tgui/components/{Table.js => Table.tsx} (68%) rename tgui/packages/tgui/components/{ => keyboard}/KeyListener.tsx (88%) create mode 100644 tgui/packages/tgui/interfaces/GamePreferences/GamePreferenceEntry.tsx create mode 100644 tgui/packages/tgui/interfaces/GamePreferences/GamePreferenceKeybinds.tsx create mode 100644 tgui/packages/tgui/interfaces/GamePreferences/GamePreferenceToggles.tsx create mode 100644 tgui/packages/tgui/interfaces/GamePreferences/index.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/ambient_occlusion.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/auto_fit_viewport.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/darkened_flash.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/fov_darkness.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/fps.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/hotkeys.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/preferred_map.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/runechat.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/scaling_method.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/screentips.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/tgui.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/tooltips.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/ui_style.tsx delete mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/widescreen.tsx rename tgui/packages/tgui/interfaces/{AgeVerifyMenu.tsx => ui/UIAgeVerifyMenu.tsx} (94%) rename tgui/packages/tgui/interfaces/{ => unused}/AbductorConsole.js (95%) rename tgui/packages/tgui/interfaces/{ => unused}/Achievements.js (96%) rename tgui/packages/tgui/interfaces/{ => unused}/Adminhelp.tsx (96%) rename tgui/packages/tgui/interfaces/{ => unused}/AdventureBrowser.tsx (94%) rename tgui/packages/tgui/interfaces/{ => unused}/AnomalyRefinery.js (97%) rename tgui/packages/tgui/interfaces/{ => unused}/AtmosControlPanel.js (96%) rename tgui/packages/tgui/interfaces/{ => unused}/AtmosHandbook.tsx (98%) rename tgui/packages/tgui/interfaces/{ => unused}/Bepis.js (97%) rename tgui/packages/tgui/interfaces/{ => unused}/BluespaceArtillery.js (95%) rename tgui/packages/tgui/interfaces/{ => unused}/BluespaceLocator.js (93%) rename tgui/packages/tgui/interfaces/{ => unused}/BluespaceSender.js (95%) rename tgui/packages/tgui/interfaces/{ => unused}/BluespaceVendor.js (96%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoBrainwashed.tsx (93%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoBrother.tsx (90%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoChangeling.tsx (98%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoDemon.tsx (96%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoGangmember.tsx (95%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoGeneric.tsx (90%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoHeretic.tsx (98%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoMalf.tsx (96%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoMorph.tsx (94%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoNightmare.tsx (96%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoSeparatist.tsx (95%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoThief.tsx (94%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoTraitor.tsx (97%) rename tgui/packages/tgui/interfaces/{ => unused/antag}/AntagInfoWizard.tsx (96%) rename tgui/packages/tgui/interfaces/{ => unused/economy}/AccountingConsole.js (93%) rename tgui/packages/tgui/interfaces/{ => unused/economy}/AccountsTerminal.js (97%) rename tgui/packages/tgui/interfaces/{ => unused/economy}/BlackMarketUplink.js (95%) rename tgui/packages/tgui/interfaces/{ => unused/pda}/Pda.js (95%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_atmos_scan.js (91%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_janitor.js (95%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_main_menu.js (94%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_manifest.js (53%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_medical.js (96%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_messenger.js (97%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_news.js (96%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_notekeeper.js (83%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_power.js (52%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_security.js (95%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_signaller.js (61%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_status_display.js (92%) rename tgui/packages/tgui/interfaces/{pda => unused/pda/cartridges}/pda_supply.js (91%) create mode 100644 tgui/packages/tgui/styles/base.ts diff --git a/README.md b/README.md index da9805985b3b..8b1f8b6807bb 100644 --- a/README.md +++ b/README.md @@ -37,14 +37,32 @@ On **May 9, 2022** we have changed the way to compile the codebase. [Guides for Contributors](.github/CONTRIBUTING.md) -[CitadelRP HACKMD account](https://hackmd.io/@CitadelStation13RP) +[CitadelRP HackMD - Design Documents & Planning](https://hackmd.io/@CitadelStation13RP) ## SQL Setup -The SQL backend for the library and stats tracking requires a MySQL server. +The SQL backend for the library and stats tracking requires a MariaDB server. Your server details go in /config/legacy/dbconfig.txt, and the SQL schema is in /SQL/tgstation_schema.sql. More detailed setup instructions arecoming soon, for now ask in our Discord. +todo: update this section + +## Static Files + +The following folders are considered 'static folders' and should be added to TGS4's static files: + +These are also the folders you are likely going to encounter while managing the server. + +- /config: server configuration + - /legacy: legacy configuration data go in here +- /data: server persistent data + - /logs: logs are dumped in here + - /players: player data, like saves and characters get dumped in here + +You only need to make the top level folders (e.g. config, data) static folders in TGS4. + +Subfolders are automatically included. + ## LICENSE The code for Citadel-Station-13-RP is licensed under the [GNU AGPL v3](http://www.gnu.org/licenses/agpl-3.0.html). diff --git a/SQL/database_schema.sql b/SQL/database_schema.sql index 9d827388db4d..f7237e6ac2db 100644 --- a/SQL/database_schema.sql +++ b/SQL/database_schema.sql @@ -128,7 +128,7 @@ CREATE TABLE IF NOT EXISTS `%_PREFIX_%photographs` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; --- players -- +-- Players -- -- Player lookup table -- -- Used to look up player ID from ckey, as well as -- @@ -153,6 +153,7 @@ CREATE TABLE IF NOT EXISTS `%_PREFIX_%player` ( `flags` int(24) NOT NULL DEFAULT 0, `firstseen` datetime NOT NULL DEFAULT Now(), `lastseen` datetime NOT NULL, + `misc` MEDIUMTEXT NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; @@ -194,6 +195,25 @@ END $$ DELIMITER ; + +-- Preferences -- + +-- Stores game preferences -- +CREATE TABLE IF NOT EXISTS `%_PREFIX_%game_preferences` ( + `player` INT(11) NOT NULL, + `entries` MEDIUMTEXT NOT NULL, + `misc` MEDIUMTEXT NOT NULL, + `keybinds` MEDIUMTEXT NOT NULL, + `toggles` MEDIUMTEXT NOT NULL, + `modified` DATETIME NOT NULL, + `version` INT(11) NOT NULL, + PRIMARY KEY (`player`), + CONSTRAINT `linked_player` FOREIGN KEY (`player`) + REFERENCES `%_PREFIX_%player` (`id`) + ON DELETE CASCADE + ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + -- Security - Ipintel -- -- Ipintel Cache Table -- diff --git a/SQL/database_schema_prefixed.sql b/SQL/database_schema_prefixed.sql index e792364b8f79..58b5b32cc103 100644 --- a/SQL/database_schema_prefixed.sql +++ b/SQL/database_schema_prefixed.sql @@ -128,7 +128,7 @@ CREATE TABLE IF NOT EXISTS `rp_photographs` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; --- players -- +-- Players -- -- Player lookup table -- -- Used to look up player ID from ckey, as well as -- @@ -153,6 +153,7 @@ CREATE TABLE IF NOT EXISTS `rp_player` ( `flags` int(24) NOT NULL DEFAULT 0, `firstseen` datetime NOT NULL DEFAULT Now(), `lastseen` datetime NOT NULL, + `misc` MEDIUMTEXT NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; @@ -194,6 +195,25 @@ END $$ DELIMITER ; + +-- Preferences -- + +-- Stores game preferences -- +CREATE TABLE IF NOT EXISTS `rp_game_preferences` ( + `player` INT(11) NOT NULL, + `entries` MEDIUMTEXT NOT NULL, + `misc` MEDIUMTEXT NOT NULL, + `keybinds` MEDIUMTEXT NOT NULL, + `toggles` MEDIUMTEXT NOT NULL, + `modified` DATETIME NOT NULL, + `version` INT(11) NOT NULL, + PRIMARY KEY (`player`), + CONSTRAINT `linked_player` FOREIGN KEY (`player`) + REFERENCES `rp_player` (`id`) + ON DELETE CASCADE + ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + -- Security - Ipintel -- -- Ipintel Cache Table -- diff --git a/citadel.dme b/citadel.dme index e08e54e0ca8c..4535fc5d5f70 100644 --- a/citadel.dme +++ b/citadel.dme @@ -78,7 +78,6 @@ #include "code\__DEFINES\shuttle.dm" #include "code\__DEFINES\shuttles.dm" #include "code\__DEFINES\singletons.dm" -#include "code\__DEFINES\skin.dm" #include "code\__DEFINES\sonar.dm" #include "code\__DEFINES\space.dm" #include "code\__DEFINES\spaceman_dmm.dm" @@ -131,6 +130,7 @@ #include "code\__DEFINES\atmospherics\machinery\scrubber.dm" #include "code\__DEFINES\atmospherics\machinery\vent.dm" #include "code\__DEFINES\cargo\supply.dm" +#include "code\__DEFINES\client\game_preferences.dm" #include "code\__DEFINES\client\player_flags.dm" #include "code\__DEFINES\client\playtime.dm" #include "code\__DEFINES\color\color.dm" @@ -200,6 +200,8 @@ #include "code\__DEFINES\fishing\aquarium.dm" #include "code\__DEFINES\fishing\fish.dm" #include "code\__DEFINES\fishing\fishing.dm" +#include "code\__DEFINES\interface\skin.dm" +#include "code\__DEFINES\interface\verbs.dm" #include "code\__DEFINES\inventory\accessories.dm" #include "code\__DEFINES\inventory\bodytypes.dm" #include "code\__DEFINES\inventory\carry_weight.dm" @@ -532,6 +534,7 @@ #include "code\controllers\subsystem\planets.dm" #include "code\controllers\subsystem\plants.dm" #include "code\controllers\subsystem\playtime.dm" +#include "code\controllers\subsystem\preferences.dm" #include "code\controllers\subsystem\radiation.dm" #include "code\controllers\subsystem\repository.dm" #include "code\controllers\subsystem\research.dm" @@ -2399,15 +2402,21 @@ #include "code\modules\client\wrappers.dm" #include "code\modules\client\data\client_data.dm" #include "code\modules\client\data\player_data.dm" +#include "code\modules\client\game_preferences\game_preference_entry.dm" +#include "code\modules\client\game_preferences\game_preference_middleware.dm" +#include "code\modules\client\game_preferences\game_preference_toggle.dm" +#include "code\modules\client\game_preferences\game_preferences.dm" +#include "code\modules\client\game_preferences\entries\game.dm" +#include "code\modules\client\game_preferences\entries\graphics.dm" +#include "code\modules\client\game_preferences\middleware\keybindings.dm" +#include "code\modules\client\game_preferences\middleware\toggles.dm" #include "code\modules\client\onboarding\_onboarding.dm" #include "code\modules\client\onboarding\age_verification.dm" #include "code\modules\client\onboarding\panic_bunker.dm" #include "code\modules\client\onboarding\security_checks.dm" #include "code\modules\client\verbs\minimap.dm" #include "code\modules\client\verbs\ooc.dm" -#include "code\modules\client\verbs\panic_bunker_player.dm" -#include "code\modules\client\verbs\ping.dm" -#include "code\modules\client\verbs\preferences.dm" +#include "code\modules\client\verbs\system.dm" #include "code\modules\client\verbs\view.dm" #include "code\modules\clothing\chameleon.dm" #include "code\modules\clothing\clothing.dm" @@ -4231,16 +4240,12 @@ #include "code\modules\preferences\preference_setup\general\04_equipment.dm" #include "code\modules\preferences\preference_setup\general\05_background.dm" #include "code\modules\preferences\preference_setup\general\06_flavor.dm" -#include "code\modules\preferences\preference_setup\global\01_ui.dm" #include "code\modules\preferences\preference_setup\global\02_settings.dm" #include "code\modules\preferences\preference_setup\global\03_pai.dm" #include "code\modules\preferences\preference_setup\global\04_ooc.dm" #include "code\modules\preferences\preference_setup\global\05_media.dm" -#include "code\modules\preferences\preference_setup\global\language_prefix.dm" -#include "code\modules\preferences\preference_setup\global\setting_datums.dm" #include "code\modules\preferences\preference_setup\helpers\language_pick.dm" #include "code\modules\preferences\preference_setup\helpers\species_pick.dm" -#include "code\modules\preferences\preference_setup\keybindings\keybindings.dm" #include "code\modules\preferences\preference_setup\loadout\loadout.dm" #include "code\modules\preferences\preference_setup\occupation\occupation.dm" #include "code\modules\preferences\preference_setup\vore\01_ears.dm" diff --git a/code/__DEFINES/client/game_preferences.dm b/code/__DEFINES/client/game_preferences.dm new file mode 100644 index 000000000000..7fe82c5f8f1f --- /dev/null +++ b/code/__DEFINES/client/game_preferences.dm @@ -0,0 +1,32 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + +//* Versioning *// + +// Migration Directives: +// * prefer append-update instead of change-remove. +// append-update means write new, changed data instead of overwrite old data +// this means that reverting a testmerge doesn't cause problems. + +// todo: how to do migration in a downstream-friendly way? current +// would require downstreams to manually edit code. +// this is bad! + +// current version; bump to trigger migrations +#define GAME_PREFERENCES_VERSION_CURRENT 1 +// prefs start at this version when legacy +#define GAME_PREFERENCES_VERSION_LEGACY 1 +// at or below this, we throw out all data +#define GAME_PREFERENCES_VERSION_DROP 0 + +//* Misc Keys *// + +/// boolean value for if we're in hotkeys mode +#define GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE "hotkey-mode" + +//* Category Names + +// these are the same due to low entry count + +#define GAME_PREFERENCE_CATEGORY_GAME "Game" +#define GAME_PREFERENCE_CATEGORY_GRAPHICS "Game" diff --git a/code/__DEFINES/controllers/_subsystems.dm b/code/__DEFINES/controllers/_subsystems.dm index 49fd3741c400..58c84f5d48ce 100644 --- a/code/__DEFINES/controllers/_subsystems.dm +++ b/code/__DEFINES/controllers/_subsystems.dm @@ -84,6 +84,7 @@ DEFINE_BITFIELD(runlevels, list( #define INIT_ORDER_EARLY_INIT 185 #define INIT_ORDER_REPOSITORY 180 #define INIT_ORDER_STATPANELS 170 +#define INIT_ORDER_PREFERENCES 165 #define INIT_ORDER_INPUT 160 #define INIT_ORDER_JOBS 150 #define INIT_ORDER_CHARACTERS 140 diff --git a/code/__DEFINES/skin.dm b/code/__DEFINES/interface/skin.dm similarity index 92% rename from code/__DEFINES/skin.dm rename to code/__DEFINES/interface/skin.dm index 7772d6251340..f4c2eeea2f8a 100644 --- a/code/__DEFINES/skin.dm +++ b/code/__DEFINES/interface/skin.dm @@ -1,3 +1,6 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + //? WINCLONE IDs; NO SKIN CONTROL MAY HAVE THESE IDs, OR WINCLONE WILL NOT CREATE "NAKED" CONTROLS OF THIS TYPE! #define SKIN_ID_ABSTRACT_MENU "menu" #define SKIN_ID_ABSTRACT_WINDOW "window" @@ -17,6 +20,10 @@ /// main window split #define SKIN_SPLITTER_ID_MAIN "mainwindow.split" +//* Chat System +#define SKIN_OUTPUT_ID_LEGACY_CHAT "output" +#define SKIN_BROWSER_ID_CHAT "outputbrowser" + //* Cutscene System #define SKIN_BROWSER_ID_CUTSCENE "cutscenebrowser" diff --git a/code/__DEFINES/interface/verbs.dm b/code/__DEFINES/interface/verbs.dm new file mode 100644 index 000000000000..22a3b39eb81f --- /dev/null +++ b/code/__DEFINES/interface/verbs.dm @@ -0,0 +1,9 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + +#define VERB_CATEGORY_IC "IC" +#define VERB_CATEGORY_OOC "OOC" +#define VERB_CATEGORY_OBJECT "Object" +#define VERB_CATEGORY_SYSTEM "System" + +// todo: admin verb categories too diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index f9e8cd4d1587..29dc2560586c 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -421,13 +421,13 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global")) if (config_legacy.log_debug) WRITE_LOG(GLOB.world_runtime_log, "DEBUG: [text]") - for(var/client/C in GLOB.admins) - if(C.is_preference_enabled(/datum/client_preference/debug/show_debug_logs)) - to_chat(C, - type = MESSAGE_TYPE_DEBUG, - html = "DEBUG: [text]", - confidential = TRUE, - ) + // for(var/client/C in GLOB.admins) + // if(C.get_preference_toggle(/datum/client_preference/debug/show_debug_logs)) + // to_chat(C, + // type = MESSAGE_TYPE_DEBUG, + // html = "DEBUG: [text]", + // confidential = TRUE, + // ) /proc/log_ghostsay(text, mob/speaker) if (config_legacy.log_say) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index e5511d5a9f66..4dcc19101528 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -267,7 +267,7 @@ var/turf/ear = get_turf(M) if(ear) // Ghostship is magic: Ghosts can hear radio chatter from anywhere - if(speaker_coverage[ear] || (istype(M, /mob/observer/dead) && M.is_preference_enabled(/datum/client_preference/ghost_radio))) + if(speaker_coverage[ear] || (istype(M, /mob/observer/dead) && M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_radio))) . |= M // Since we're already looping through mobs, why bother using |= ? This only slows things down. return . @@ -308,11 +308,11 @@ switch(type) // Audio messages use ghost_ears. if(1) - if(M.is_preference_enabled(/datum/client_preference/ghost_ears)) + if(M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears)) mobs |= M // Visual messages use ghost_sight. if(2) - if(M.is_preference_enabled(/datum/client_preference/ghost_sight)) + if(M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_sight)) mobs |= M // For objects below the top level who still want to hear. diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index e4a7c7c00503..08ba49b5fd2e 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -320,41 +320,6 @@ /proc/capitalize(t as text) return uppertext(copytext_char(t, 1, 2)) + copytext_char(t, 2) -/** - * Syntax is "stringtoreplace"="stringtoreplacewith". - */ -/proc/autocorrect(input as text) - return input = replace_characters(input, list( - " i " = " I ", - "i'm" = "I'm", - "s's" = "s'", - "isnt" = "isn't", - "dont" = "don't", - "shouldnt" = "shouldn't", - " ive " = " I've ", - "whove" = "who've", - "whod" = "who’d", - "whats " = "what’s ", - "whatd" = "what’d", - "thats" = "that’s", - "thatll" = "that’ll", - "thatd" = "that’d", - " nows " = " now’s ", - "isnt" = "isn’t", - " arent " = " aren’t ", - "wasnt" = "wasn’t", - "werent" = "weren’t", - "havent" = "haven’t", - "hasnt" = "hasn’t", - "hadnt" = "hadn’t", - "doesnt" = "doesn’t", - "didnt" = "didn’t", - "couldnt" = "couldn’t", - "wouldnt" = "wouldn’t", - "mustnt" = "mustn’t", - "shouldnt" = "shouldn’t", - )) - /** * This proc strips html properly, remove < > and all text between * for complete text sanitizing should be used sanitize() @@ -460,7 +425,7 @@ GLOBAL_VAR_INIT(text_tag_icons, new /icon('./icons/chattags.dmi')) /proc/create_text_tag(tagname, tagdesc = tagname, client/C) - if(!(C && C.is_preference_enabled(/datum/client_preference/chat_tags))) + if(!(C && C.get_preference_toggle(/datum/game_preference_toggle/chat/legacy_chat_tags))) return tagdesc return icon2html(GLOB.text_tag_icons, C, tagname) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 2e3e736f72bd..1cda55518d3c 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -430,7 +430,7 @@ var/list/creatures = list() var/list/namecounts = list() for(var/mob/M in mobs) - if(isobserver(M) && ghostfollow && M.client?.holder && M.client.holder.fakekey && M.is_preference_enabled(/datum/client_preference/holder/stealth_ghost_mode)) + if(isobserver(M) && ghostfollow && M.client?.holder && M.client.holder.fakekey && M.get_preference_toggle(/datum/game_preference_toggle/admin/stealth_hides_ghost)) continue var/name = M.name if (name in names) diff --git a/code/controllers/configuration/entries/cross_server.dm b/code/controllers/configuration/entries/cross_server.dm index d8d29b913129..9a7bd1f9d92c 100644 --- a/code/controllers/configuration/entries/cross_server.dm +++ b/code/controllers/configuration/entries/cross_server.dm @@ -1,28 +1,14 @@ +// todo: we need to rethink if we need/want a cluster at some point (and why is the answer yes :^)) +// and how to orchestrate. topics are nice, but they shouldn't be the end-all backend for this. +// +// not to mention we also need a cross-server/unified DB. +// 2025 DB rework..? + /datum/config_entry/string/comms_key protection = CONFIG_ENTRY_HIDDEN /datum/config_entry/string/comms_key/ValidateAndSet(str_val) return str_val != "default_pwd" && length(str_val) > 6 && ..() -// todo: remove -/datum/config_entry/keyed_list/cross_server_bunker_override - key_mode = KEY_MODE_TEXT - value_mode = VALUE_MODE_TEXT - protection = CONFIG_ENTRY_LOCKED - -/datum/config_entry/keyed_list/cross_server_bunker_override/ValidateAndSet(str_val) - . = ..() - if(.) - var/list/newv = list() - for(var/I in config_entry_value) - newv[replacetext(I, "+", " ")] = config_entry_value[I] - config_entry_value = newv - -/datum/config_entry/keyed_list/cross_server_bunker_override/ValidateListEntry(key_name, key_value) - return key_value != "byond:\\address:port" && ..() - -/datum/config_entry/flag/allow_cross_server_bunker_override - protection = CONFIG_ENTRY_LOCKED - // todo: remove, cluster staging/organization should be in a database /datum/config_entry/string/cross_comms_name diff --git a/code/controllers/configuration_old/configuration.dm b/code/controllers/configuration_old/configuration.dm index 3bd2f44c0539..95e30b2287ef 100644 --- a/code/controllers/configuration_old/configuration.dm +++ b/code/controllers/configuration_old/configuration.dm @@ -225,12 +225,6 @@ var/list/gamemode_cache = list() - var/lock_client_view_x - var/lock_client_view_y - var/max_client_view_x - var/max_client_view_y - - /datum/configuration_legacy/New() var/list/L = subtypesof(/datum/game_mode) for (var/T in L) diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm index fe3ef114b9c8..8958eba3cd6d 100644 --- a/code/controllers/subsystem.dm +++ b/code/controllers/subsystem.dm @@ -405,5 +405,8 @@ /datum/controller/subsystem/proc/on_max_z_changed(old_z_count, new_z_count) return -// todo: generic json-based save/load for subsystems, for simple state storage -// todo: generic K-V store for subsystems, for storing stuff that's rare needed but still persistent. +/** + * Called when SQL is reconnected after being disconnected + */ +/datum/controller/subsystem/proc/on_sql_reconnect() + return diff --git a/code/controllers/subsystem/dbcore/_dbcore.dm b/code/controllers/subsystem/dbcore/_dbcore.dm index a3fb78f2fd39..728980a93fc8 100644 --- a/code/controllers/subsystem/dbcore/_dbcore.dm +++ b/code/controllers/subsystem/dbcore/_dbcore.dm @@ -15,6 +15,8 @@ SUBSYSTEM_DEF(dbcore) var/connection // Arbitrary handle returned from rust_g. + var/was_ever_connected = FALSE + /datum/controller/subsystem/dbcore/Initialize() //We send warnings to the admins during subsystem init, as the clients will be New'd and messages //will queue properly with goonchat @@ -95,6 +97,12 @@ SUBSYSTEM_DEF(dbcore) . = (result["status"] == "ok") if (.) connection = result["handle"] + if(was_ever_connected) + // we got re-connected. + for(var/datum/controller/subsystem/subsystem in Master.subsystems) + subsystem.on_sql_reconnect() + world.on_sql_reconnect() + was_ever_connected = TRUE else connection = null last_error = result["data"] @@ -361,3 +369,9 @@ Delayed insert mode was removed in mysql 7 and only works with MyISAM type table text = replacetext(text, ";", "") text = replacetext(text, "&", "") return text + +/** + * Override this proc when you need to hook into it. + */ +/world/proc/on_sql_reconnect() + return diff --git a/code/controllers/subsystem/playtime.dm b/code/controllers/subsystem/playtime.dm index 24802707054e..4dbfd544fc68 100644 --- a/code/controllers/subsystem/playtime.dm +++ b/code/controllers/subsystem/playtime.dm @@ -67,6 +67,10 @@ SUBSYSTEM_DEF(playtime) . += PLAYER_PLAYTIME_ROLE(J.id) /datum/controller/subsystem/playtime/proc/queue_playtimes(client/C) + set waitfor = FALSE + queue_playtimes_sync(C) + +/datum/controller/subsystem/playtime/proc/queue_playtimes_sync(client/C) if(isnull(C)) return if(!C.initialized) diff --git a/code/controllers/subsystem/preferences.dm b/code/controllers/subsystem/preferences.dm new file mode 100644 index 000000000000..08bdf079e1cb --- /dev/null +++ b/code/controllers/subsystem/preferences.dm @@ -0,0 +1,76 @@ +SUBSYSTEM_DEF(preferences) + name = "Preferences" + init_order = INIT_ORDER_PREFERENCES + subsystem_flags = SS_NO_FIRE + + var/list/datum/game_preference_entry/entries_by_key + var/list/datum/game_preference_toggle/toggles_by_key + var/static/list/datum/game_preferences/preferences_by_key = list() + +/datum/controller/subsystem/preferences/Initialize() + init_preference_entries() + init_preference_toggles() + return ..() + +/datum/controller/subsystem/preferences/proc/resolve_preference_entry(datum/game_preference_entry/entrylike) + if(ispath(entrylike)) + entrylike = initial(entrylike.key) + entrylike = entries_by_key[entrylike] + else if(istype(entrylike)) + else + entrylike = entries_by_key[entrylike] + return entrylike + +/datum/controller/subsystem/preferences/proc/resolve_preference_toggle(datum/game_preference_toggle/togglelike) + if(ispath(togglelike)) + togglelike = initial(togglelike.key) + togglelike = toggles_by_key[togglelike] + else if(istype(togglelike)) + else + togglelike = toggles_by_key[togglelike] + return togglelike + +/datum/controller/subsystem/preferences/proc/init_preference_entries() + . = list() + for(var/datum/game_preference_entry/casted as anything in subtypesof(/datum/game_preference_entry)) + if(initial(casted.abstract_type) == casted) + continue + casted = new casted + if(!casted.key || !istext(casted.key)) + STACK_TRACE("bad key: [casted.key]") + continue + if(!isnull(.[casted.key])) + STACK_TRACE("dupe key between [casted.type] and [.[casted.key]:type]") + continue + .[casted.key] = casted + entries_by_key = . + +/datum/controller/subsystem/preferences/proc/init_preference_toggles() + . = list() + for(var/datum/game_preference_toggle/casted as anything in subtypesof(/datum/game_preference_toggle)) + if(initial(casted.abstract_type) == casted) + continue + casted = new casted + if(!casted.key || !istext(casted.key)) + STACK_TRACE("bad key: [casted.key]") + continue + if(!isnull(.[casted.key])) + STACK_TRACE("dupe key between [casted.type] and [.[casted.key]:type]") + continue + .[casted.key] = casted + toggles_by_key = . + +/datum/controller/subsystem/preferences/proc/resolve_game_preferences(key, ckey) + if(!istype(preferences_by_key[ckey], /datum/game_preferences)) + var/datum/game_preferences/initializing = new(key, ckey) + preferences_by_key[ckey] = initializing + initializing.initialize() + return preferences_by_key[ckey] + +/datum/controller/subsystem/preferences/on_sql_reconnect() + for(var/ckey in SSpreferences.preferences_by_key) + var/datum/game_preferences/preferences = SSpreferences.preferences_by_key[ckey] + if(!istype(preferences)) + continue + preferences.oops_sql_came_back_perform_a_reload() + return ..() diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 5dea5d4896ea..165dbf162920 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -223,7 +223,7 @@ SUBSYSTEM_DEF(vote) usr.client.vote() /client/verb/vote() - set category = "OOC" + set category = VERB_CATEGORY_OOC set name = "Vote" if(SSvote) diff --git a/code/datums/elements/clothing/dynamic_recolor.dm b/code/datums/elements/clothing/dynamic_recolor.dm index 4c0802d97dba..23968124d2ac 100644 --- a/code/datums/elements/clothing/dynamic_recolor.dm +++ b/code/datums/elements/clothing/dynamic_recolor.dm @@ -40,7 +40,7 @@ /obj/item/clothing/proc/dynamic_recolor_verb() set name = "Set Color Style" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Set the coloration of this piece of clothing." set src in usr diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index 6985d31efd37..84dbe96bd6a9 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -52,7 +52,7 @@ . += "#[tm.number][details]
" /client/verb/showrevinfo() - set category = "OOC" + set category = VERB_CATEGORY_OOC set name = "Show Server Revision" set desc = "Check the current server code revision" diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm index 66bb5e0a7424..78954674804a 100644 --- a/code/datums/looping_sounds/_looping_sound.dm +++ b/code/datums/looping_sounds/_looping_sound.dm @@ -91,7 +91,7 @@ if(direct) if(ismob(thing)) var/mob/M = thing - if(!M.is_preference_enabled(pref_check)) + if(!M.get_preference_toggle(pref_check)) continue SEND_SOUND(thing, S) else diff --git a/code/datums/looping_sounds/machinery_sounds.dm b/code/datums/looping_sounds/machinery_sounds.dm index aee8a07408d6..83466f14b430 100644 --- a/code/datums/looping_sounds/machinery_sounds.dm +++ b/code/datums/looping_sounds/machinery_sounds.dm @@ -13,7 +13,7 @@ mid_length = 60 volume = 40 extra_range = 10 - pref_check = /datum/client_preference/supermatter_hum + pref_check = /datum/game_preference_toggle/ambience/supermatter_hum /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -102,4 +102,4 @@ mid_length = 4 end_sound = 'sound/machines/air_pump/airpumpshutdown.ogg' volume = 15 - pref_check = /datum/client_preference/air_pump_noise + pref_check = /datum/game_preference_toggle/ambience/atmospherics diff --git a/code/datums/looping_sounds/weather_sounds.dm b/code/datums/looping_sounds/weather_sounds.dm index 869673df27a4..df7410b0eca9 100644 --- a/code/datums/looping_sounds/weather_sounds.dm +++ b/code/datums/looping_sounds/weather_sounds.dm @@ -1,5 +1,5 @@ /datum/looping_sound/weather - pref_check = /datum/client_preference/weather_sounds + pref_check = /datum/game_preference_toggle/ambience/weather soundenvwet = -10000 soundenvdry = 0 diff --git a/code/datums/progressbar.dm b/code/datums/progressbar.dm index ee4a71eee143..5db22df83520 100644 --- a/code/datums/progressbar.dm +++ b/code/datums/progressbar.dm @@ -46,6 +46,6 @@ progress = clamp(progress, 0, goal) bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]" - if (!shown && user.is_preference_enabled(/datum/client_preference/show_progress_bar)) + if (!shown) user.client.images += bar shown = 1 diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 4b984a1beac1..d25c2379d647 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -75,25 +75,6 @@ for(var/client/C in GLOB.clients) C.AnnouncePR(final_composed) -/datum/world_topic/auto_bunker_passthrough - keyword = "auto_bunker_override" - require_comms_key = TRUE - -/datum/world_topic/auto_bunker_passthrough/Run(list/input) - if(!CONFIG_GET(flag/allow_cross_server_bunker_override)) - return "Function Disabled" - var/ckeytobypass = input["ckey"] - var/is_new_ckey = !(ckey(ckeytobypass) in GLOB.bunker_passthrough) - var/sender = input["source"] || "UNKNOWN" - GLOB.bunker_passthrough |= ckey(ckeytobypass) - GLOB.bunker_passthrough[ckey(ckeytobypass)] = world.realtime - SSpersistence.SavePanicBunker() //we can do this every time, it's okay - if(!is_new_ckey) - log_admin("AUTO BUNKER: [ckeytobypass] given access (incoming comms from [sender]).") - message_admins("AUTO BUNKER: [ckeytobypass] given access (incoming comms from [sender]).") - send2irc("Panic Bunker", "AUTO BUNKER: [ckeytobypass] given access (incoming comms from [sender]).") - return "Success" - /datum/world_topic/jsonstatus keyword = "jsonstatus" diff --git a/code/game/antagonist/antagonist_objectives.dm b/code/game/antagonist/antagonist_objectives.dm index da542288ea5f..b502cea8cae3 100644 --- a/code/game/antagonist/antagonist_objectives.dm +++ b/code/game/antagonist/antagonist_objectives.dm @@ -32,7 +32,7 @@ /mob/living/proc/write_ambition() set name = "Set Ambition" - set category = "IC" + set category = VERB_CATEGORY_IC set src = usr if(!mind) diff --git a/code/game/area/area.dm b/code/game/area/area.dm index c436fc18f1e1..675cf7864d9c 100644 --- a/code/game/area/area.dm +++ b/code/game/area/area.dm @@ -564,7 +564,7 @@ GLOBAL_LIST_EMPTY(forced_ambiance_list) /area/proc/play_ambience(var/mob/living/L) // Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch - if(!L?.is_preference_enabled(/datum/client_preference/play_ambiance)) + if(!L?.get_preference_toggle(/datum/game_preference_toggle/ambience/area_ambience)) return // If we previously were in an area with force-played ambiance, stop it. diff --git a/code/game/click/rig.dm b/code/game/click/rig.dm index 360aa04cd046..d1b0f87f6fe2 100644 --- a/code/game/click/rig.dm +++ b/code/game/click/rig.dm @@ -10,7 +10,7 @@ /client/verb/toggle_hardsuit_mode() set name = "Toggle Hardsuit Activation Mode" set desc = "Switch between hardsuit activation modes." - set category = "OOC" + set category = VERB_CATEGORY_OOC hardsuit_click_mode++ if(hardsuit_click_mode > MAX_HARDSUIT_CLICK_MODE) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index ff5617444f56..3f2835b7d3dd 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -65,7 +65,7 @@ /obj/machinery/dna_scannernew/verb/eject() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject DNA Scanner" if (usr.stat != 0) @@ -95,7 +95,7 @@ /obj/machinery/dna_scannernew/verb/move_inside() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Enter DNA Scanner" if (usr.stat != 0) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 5a430ae0741d..f5b71ab2dc0c 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -539,7 +539,7 @@ var/global/list/additional_antag_types = list() /mob/verb/check_round_info() set name = "Check Round Info" - set category = "OOC" + set category = VERB_CATEGORY_OOC if(!SSticker || !SSticker.mode) to_chat(usr, "Something is terribly wrong; there is no gametype.") diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 7140731a6ed1..e086731d45d5 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -119,7 +119,7 @@ spawn(5) .() /obj/item/pinpointer/advpinpointer/verb/toggle_mode() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Toggle Pinpointer Mode" set src in view(1) diff --git a/code/game/gamemodes/technomancer/core_obj.dm b/code/game/gamemodes/technomancer/core_obj.dm index 879c6cb70993..01d47d273471 100644 --- a/code/game/gamemodes/technomancer/core_obj.dm +++ b/code/game/gamemodes/technomancer/core_obj.dm @@ -341,7 +341,7 @@ /obj/item/technomancer_core/verb/toggle_lock() set name = "Toggle Core Lock" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Toggles the locking mechanism on your manipulation core." var/had = HAS_TRAIT_FROM(src, TRAIT_ITEM_NODROP, TECHNOMANCER_TRAIT) diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 0a95097a3876..dea856fe44ae 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -92,7 +92,7 @@ /obj/machinery/optable/verb/climb_on() set name = "Climb On Table" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat || !ishuman(usr) || usr.restrained() || !check_table(usr)) diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 6e36d6b781d3..c894c4e47efd 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -295,7 +295,7 @@ /obj/machinery/sleeper/verb/move_eject() set name = "Eject occupant" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr == occupant) switch(usr.stat) diff --git a/code/game/machinery/_frame.dm b/code/game/machinery/_frame.dm index 0c32c989ef4b..171763dd9dd9 100644 --- a/code/game/machinery/_frame.dm +++ b/code/game/machinery/_frame.dm @@ -603,7 +603,7 @@ /obj/structure/frame/verb/rotate_counterclockwise() set name = "Rotate Frame Counter-Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.incapacitated()) @@ -622,7 +622,7 @@ /obj/structure/frame/verb/rotate_clockwise() set name = "Rotate Frame Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.incapacitated()) diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 5efd47539ee3..a9948a020498 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -107,7 +107,7 @@ /obj/machinery/bodyscanner/verb/eject() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject Body Scanner" if(usr.incapacitated()) diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm index 5c27edd487b8..2b89e6e6b2e8 100644 --- a/code/game/machinery/bioprinter.dm +++ b/code/game/machinery/bioprinter.dm @@ -187,7 +187,7 @@ /obj/machinery/organ_printer/verb/eject_beaker() set name = "Eject Beaker" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != NONE) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 87610114a575..d041ea1fc64d 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -305,7 +305,7 @@ /obj/machinery/clonepod/verb/eject() set name = "Eject Cloner" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != 0) @@ -377,7 +377,7 @@ // Empties all of the beakers from the cloning pod, used to refill it /obj/machinery/clonepod/verb/empty_beakers() set name = "Eject Beakers" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != 0) diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 0b78a2ed1e77..f6d34ea319fd 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -10,7 +10,7 @@ /obj/machinery/computer/aiupload/verb/AccessInternals() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Access Computer's Internals" set src in oview(1) if(get_dist(src, usr) > 1 || usr.restrained() || usr.lying || usr.stat || istype(usr, /mob/living/silicon)) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 1867b9da4302..40f65b2fb923 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -72,7 +72,7 @@ return ..() /obj/machinery/computer/med_data/verb/eject_id() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject ID Card" set src in oview(1) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index edfeb3565c32..981fc2fdfd99 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -58,7 +58,7 @@ return ..() /obj/machinery/computer/secure_data/verb/eject_id() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject ID Card" set src in oview(1) diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 7a01a6e8a9ab..eb4321638e1f 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -323,7 +323,7 @@ /obj/machinery/atmospherics/component/unary/cryo_cell/verb/move_eject() set name = "Eject occupant" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr == occupant)//If the user is inside the tube... if(usr.stat == 2)//and he's not dead.... @@ -342,7 +342,7 @@ /obj/machinery/atmospherics/component/unary/cryo_cell/verb/move_inside() set name = "Move Inside" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(isliving(usr)) var/mob/living/L = usr diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 52b0754c80fb..0e49fb098544 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -555,7 +555,7 @@ /obj/machinery/cryopod/verb/eject() set name = "Eject Pod" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != 0) return @@ -581,7 +581,7 @@ /obj/machinery/cryopod/verb/move_inside() set name = "Enter Pod" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != 0 || !check_occupant_allowed(usr)) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 023687111b6c..65c62f2eb074 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -260,7 +260,7 @@ return reagent_container?.reagents /obj/machinery/iv_drip/verb/eject_beaker() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Remove IV Container" set src in oview(1) @@ -280,7 +280,7 @@ update_appearance() /obj/machinery/iv_drip/verb/toggle_mode() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Toggle Mode" set src in oview(1) diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index ab29e0b796fd..2cd56489cbdd 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -213,7 +213,7 @@ var/bomb_set onclose(user, "nukebomb_hack") /obj/machinery/nuclearbomb/verb/make_deployable() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Make Deployable" set src in oview(1) diff --git a/code/game/machinery/oxygen_pump.dm b/code/game/machinery/oxygen_pump.dm index 331d22d233ba..3f1e3fcba9cd 100644 --- a/code/game/machinery/oxygen_pump.dm +++ b/code/game/machinery/oxygen_pump.dm @@ -173,7 +173,7 @@ //Create rightclick to view tank settings /obj/machinery/oxygen_pump/verb/settings() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Show Tank Settings" nano_ui_interact(usr) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 1d33af8d1ad3..d63fd7c04691 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -100,7 +100,7 @@ Buildable meters icon_state = initial(fakeA.pipe_state) /obj/item/pipe/verb/flip() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Flip Pipe" set src in view(1) @@ -122,7 +122,7 @@ Buildable meters icon_state = "[initial(fakeA.pipe_state)][mirrored ? "m" : ""]" /obj/item/pipe/verb/rotate_clockwise() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Rotate Pipe Clockwise" set src in view(1) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 958c142cccc1..e7a0d712e6f1 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -282,7 +282,7 @@ update_appearance() /obj/machinery/recharge_station/verb/move_eject() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject Recharger" set src in oview(1) @@ -294,7 +294,7 @@ return /obj/machinery/recharge_station/verb/move_inside() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Enter Recharger" set src in oview(1) diff --git a/code/game/machinery/suit_storage/suit_cycler.dm b/code/game/machinery/suit_storage/suit_cycler.dm index ed8a64779beb..dbdc44a1ea6a 100644 --- a/code/game/machinery/suit_storage/suit_cycler.dm +++ b/code/game/machinery/suit_storage/suit_cycler.dm @@ -434,7 +434,7 @@ /obj/machinery/suit_cycler/verb/leave() set name = "Eject Cycler" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != 0) diff --git a/code/game/machinery/suit_storage/suit_storage_unit.dm b/code/game/machinery/suit_storage/suit_storage_unit.dm index 7698d7d9cb65..a1b8ff57cca6 100644 --- a/code/game/machinery/suit_storage/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage/suit_storage_unit.dm @@ -409,7 +409,7 @@ /obj/machinery/suit_storage_unit/verb/get_out() set name = "Eject Suit Storage Unit" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != 0) @@ -423,7 +423,7 @@ /obj/machinery/suit_storage_unit/verb/move_inside() set name = "Hide in Suit Storage Unit" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != 0) diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm index 178cf7e403f0..3aadb57ee041 100644 --- a/code/game/machinery/telecomms/broadcaster.dm +++ b/code/game/machinery/telecomms/broadcaster.dm @@ -246,14 +246,12 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept for (var/mob/R in receive) /* --- Loop through the receivers and categorize them --- */ - if(!R.is_preference_enabled(/datum/client_preference/holder/hear_radio)) - continue if(istype(R, /mob/new_player)) // we don't want new players to hear messages. rare but generates runtimes. continue // Ghosts hearing all radio chat don't want to hear syndicate intercepts, they're duplicates - if(data == DATA_ANTAG && istype(R, /mob/observer/dead) && R.is_preference_enabled(/datum/client_preference/ghost_radio)) + if(data == DATA_ANTAG && istype(R, /mob/observer/dead) && R.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_radio)) continue // --- Check for compression --- @@ -446,10 +444,6 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept /* --- Loop through the receivers and categorize them --- */ - if(!R.is_preference_enabled(/datum/client_preference/holder/hear_radio)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios. - continue - - // --- Check for compression --- if(compression > 0) diff --git a/code/game/machinery/teleporter/console.dm b/code/game/machinery/teleporter/console.dm index 6b5a96a44705..d2c7551f9240 100644 --- a/code/game/machinery/teleporter/console.dm +++ b/code/game/machinery/teleporter/console.dm @@ -190,7 +190,7 @@ playsound(get_turf(src), 'sound/machines/ping.ogg', 50, 0) /obj/machinery/computer/teleporter/verb/set_id(t as text) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Set teleporter ID" set src in oview(1) set desc = "ID Tag:" diff --git a/code/game/machinery/transportpod.dm b/code/game/machinery/transportpod.dm index aab18a872520..e0718e9210ac 100644 --- a/code/game/machinery/transportpod.dm +++ b/code/game/machinery/transportpod.dm @@ -79,7 +79,7 @@ update_icon() /obj/machinery/transportpod/verb/move_eject() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject Pod" set src in oview(1) @@ -91,7 +91,7 @@ return /obj/machinery/transportpod/verb/move_inside() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Enter Pod" set src in oview(1) diff --git a/code/game/machinery/vending/vending.dm b/code/game/machinery/vending/vending.dm index 196547946051..f7506da156bd 100644 --- a/code/game/machinery/vending/vending.dm +++ b/code/game/machinery/vending/vending.dm @@ -486,7 +486,7 @@ /obj/machinery/vending/verb/check_logs() set name = "Check Vending Logs" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) show_log(usr) diff --git a/code/game/machinery/virtual_reality/ar_console.dm b/code/game/machinery/virtual_reality/ar_console.dm index 4b709393de5c..50724b831254 100644 --- a/code/game/machinery/virtual_reality/ar_console.dm +++ b/code/game/machinery/virtual_reality/ar_console.dm @@ -40,7 +40,7 @@ /obj/machinery/vr_sleeper/alien/eject() set src in view(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return diff --git a/code/game/machinery/virtual_reality/vr_console.dm b/code/game/machinery/virtual_reality/vr_console.dm index 44341a10dd4e..aacdf43c5474 100644 --- a/code/game/machinery/virtual_reality/vr_console.dm +++ b/code/game/machinery/virtual_reality/vr_console.dm @@ -120,7 +120,7 @@ /obj/machinery/vr_sleeper/verb/eject() set src in view(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject VR Capsule" if(usr.incapacitated()) @@ -136,7 +136,7 @@ /obj/machinery/vr_sleeper/verb/climb_in() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Enter VR Capsule" if(usr.incapacitated()) diff --git a/code/game/machinery/vitals_monitor.dm b/code/game/machinery/vitals_monitor.dm index f64a6e866bd3..e5f0c1197e9d 100644 --- a/code/game/machinery/vitals_monitor.dm +++ b/code/game/machinery/vitals_monitor.dm @@ -133,7 +133,7 @@ /obj/machinery/vitals_monitor/verb/toggle_beep() set name = "Toggle Monitor Beeping" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) var/mob/user = usr diff --git a/code/game/machinery/vr_console.dm b/code/game/machinery/vr_console.dm index 6ae30bbb5712..bb977527e02e 100644 --- a/code/game/machinery/vr_console.dm +++ b/code/game/machinery/vr_console.dm @@ -82,7 +82,7 @@ /obj/machinery/vr_sleeper/verb/eject() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject VR Capsule" if(usr.incapacitated()) @@ -99,7 +99,7 @@ /obj/machinery/vr_sleeper/verb/climb_in() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Enter VR Capsule" if(usr.incapacitated()) diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 3a51e757c4f8..db2d8c8b4d29 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -27,7 +27,7 @@ /obj/machinery/washing_machine/verb/start() set name = "Start Washing" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(!istype(usr, /mob/living)) //ew ew ew usr, but it's the only way to check. @@ -60,7 +60,7 @@ /obj/machinery/washing_machine/verb/climb_out() set name = "Climb out" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr.loc sleep(20) diff --git a/code/game/mecha/equipment/tools/passenger.dm b/code/game/mecha/equipment/tools/passenger.dm index 6f44e5a0cce6..285331ad228e 100644 --- a/code/game/mecha/equipment/tools/passenger.dm +++ b/code/game/mecha/equipment/tools/passenger.dm @@ -103,7 +103,7 @@ #define OCCUPIED 2 /obj/mecha/proc/move_inside_passenger() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Enter Passenger Compartment" set src in oview(1) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index fc65bdce1517..0b274a4ae479 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1791,7 +1791,7 @@ move_inside() /obj/mecha/verb/enter() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Enter Exosuit" set src in oview(1) move_inside() @@ -1942,7 +1942,7 @@ /* /obj/mecha/verb/force_eject() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Force Eject" set src in view(5) src.go_out() diff --git a/code/game/mecha/micro/micro_equipment.dm b/code/game/mecha/micro/micro_equipment.dm index 1e0f76cea70a..be8a6a92216c 100644 --- a/code/game/mecha/micro/micro_equipment.dm +++ b/code/game/mecha/micro/micro_equipment.dm @@ -199,7 +199,7 @@ /obj/item/mecha_parts/mecha_equipment/tool/orescoop/verb/empty_box() //so you can still get the ore out if someone detaches it from the mech set name = "Empty Ore compartment" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if(!istype(usr, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can empty ore boxes. diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 385aad2097b0..8f96673b39a5 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -239,7 +239,7 @@ /obj/item/verb/move_to_top() set name = "Move To Top" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(!istype(src.loc, /turf) || usr.stat || usr.restrained() ) @@ -493,7 +493,7 @@ else playsound(A, 'sound/weapons/throwtap.ogg', 1, volume, -1) else - playsound(src, drop_sound, 30, preference = /datum/client_preference/drop_sounds) + playsound(src, drop_sound, 30) /obj/item/throw_land(atom/A, datum/thrownthing/TT) . = ..() @@ -506,7 +506,7 @@ /obj/item/verb/verb_pickup() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Pick up" if(!(usr)) //BS12 EDIT @@ -692,7 +692,7 @@ GLOBAL_LIST_EMPTY(blood_overlay_cache) /mob/living/carbon/verb/showoff() set name = "Show Held Item" - set category = "Object" + set category = VERB_CATEGORY_OBJECT var/obj/item/I = get_active_held_item() if(I && !(I.atom_flags & ATOM_ABSTRACT)) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 09414202d85c..7faba817a15d 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -1128,7 +1128,7 @@ GLOBAL_LIST_EMPTY(PDAs) tnote.Add(list(list("sent" = 1, "owner" = "[P.owner]", "job" = "[P.ownjob]", "message" = "[t]", "target" = "\ref[P]"))) P.tnote.Add(list(list("sent" = 0, "owner" = "[owner]", "job" = "[ownjob]", "message" = "[t]", "target" = "\ref[src]"))) for(var/mob/M in GLOB.player_list) - if(M.stat == DEAD && M.client && (M.is_preference_enabled(/datum/client_preference/ghost_ears))) // src.client is so that ghosts don't have to listen to mice + if(M.stat == DEAD && M.client && (M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears))) // src.client is so that ghosts don't have to listen to mice if(istype(M, /mob/new_player)) continue if(M.forbid_seeing_deadchat) @@ -1210,7 +1210,7 @@ GLOBAL_LIST_EMPTY(PDAs) new_message = 1 /obj/item/pda/verb/verb_reset_pda() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Reset PDA" set src in usr @@ -1225,7 +1225,7 @@ GLOBAL_LIST_EMPTY(PDAs) to_chat(usr, "You cannot do this while restrained.") /obj/item/pda/verb/verb_remove_id() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Remove id" set src in usr @@ -1242,7 +1242,7 @@ GLOBAL_LIST_EMPTY(PDAs) /obj/item/pda/verb/verb_remove_pen() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Remove pen" set src in usr @@ -1255,7 +1255,7 @@ GLOBAL_LIST_EMPTY(PDAs) to_chat(usr, "You cannot do this while restrained.") /obj/item/pda/verb/verb_remove_cartridge() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Remove cartridge" set src in usr diff --git a/code/game/objects/items/devices/communicator/UI_tgui.dm b/code/game/objects/items/devices/communicator/UI_tgui.dm index 60aaeb2f05ca..aeb323f274df 100644 --- a/code/game/objects/items/devices/communicator/UI_tgui.dm +++ b/code/game/objects/items/devices/communicator/UI_tgui.dm @@ -373,7 +373,7 @@ im_list += list(list("address" = exonet.address, "to_address" = their_address, "im" = text)) log_pda("(COMM: [src]) sent \"[text]\" to [exonet.get_atom_from_address(their_address)]", usr) for(var/mob/M in GLOB.player_list) - if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears)) + if(M.stat == DEAD && M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears)) if(istype(M, /mob/new_player) || M.forbid_seeing_deadchat) continue if(exonet.get_atom_from_address(their_address) == M) diff --git a/code/game/objects/items/devices/communicator/messaging.dm b/code/game/objects/items/devices/communicator/messaging.dm index d231a2941f39..d78d54c8556f 100644 --- a/code/game/objects/items/devices/communicator/messaging.dm +++ b/code/game/objects/items/devices/communicator/messaging.dm @@ -146,7 +146,7 @@ exonet_messages.Add("To [chosen_communicator]:
[text_message]") log_pda("(DCOMM: [src]) sent \"[text_message]\" to [chosen_communicator]", src) for(var/mob/M in GLOB.player_list) - if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears)) + if(M.stat == DEAD && M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears)) if(istype(M, /mob/new_player) || M.forbid_seeing_deadchat) continue if(M == src) diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm index 19afd5eef280..a65364e3d812 100644 --- a/code/game/objects/items/devices/defib.dm +++ b/code/game/objects/items/devices/defib.dm @@ -109,7 +109,7 @@ /obj/item/defib_kit/verb/toggle_paddles() set name = "Toggle Paddles" - set category = "Object" + set category = VERB_CATEGORY_OBJECT var/mob/living/carbon/human/user = usr if(!paddles) diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index a6fbc69d99e8..ad47a2cfafff 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -62,7 +62,7 @@ /obj/item/flashlight/verb/toggle() set name = "Toggle Flashlight Brightness" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr set_brightness(usr) @@ -306,7 +306,7 @@ /obj/item/flashlight/lamp/verb/toggle_light() set name = "Toggle light" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(!usr.stat) diff --git a/code/game/objects/items/devices/floor_painter.dm b/code/game/objects/items/devices/floor_painter.dm index 0469c6bdaa15..64f772bd0261 100644 --- a/code/game/objects/items/devices/floor_painter.dm +++ b/code/game/objects/items/devices/floor_painter.dm @@ -119,7 +119,7 @@ /obj/item/floor_painter/verb/choose_colour() set name = "Choose Colour" set desc = "Choose a floor painter colour." - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(usr.incapacitated()) @@ -132,7 +132,7 @@ /obj/item/floor_painter/verb/choose_decal() set name = "Choose Decal" set desc = "Choose a floor painter decal." - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(usr.incapacitated()) @@ -146,7 +146,7 @@ /obj/item/floor_painter/verb/choose_direction() set name = "Choose Direction" set desc = "Choose a floor painter direction." - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(usr.incapacitated()) diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm index 310f2d4973f0..2f477cd51642 100644 --- a/code/game/objects/items/devices/megaphone.dm +++ b/code/game/objects/items/devices/megaphone.dm @@ -97,7 +97,7 @@ /obj/item/megaphone/super/verb/turn_volume_dial() set name = "Change Volume" set desc = "Allows you to change the megaphone's volume." - set category = "Object" + set category = VERB_CATEGORY_OBJECT adjust_volume(usr) @@ -110,7 +110,7 @@ /obj/item/megaphone/super/verb/change_font() set name = "Change... Pronunciation?" set desc = "Allows you to change the megaphone's font." - set category = "Object" + set category = VERB_CATEGORY_OBJECT adjust_font(usr) @@ -123,7 +123,7 @@ /obj/item/megaphone/super/verb/change_color() set name = "Change... Tune?" set desc = "Allows you to change the megaphone's color." - set category = "Object" + set category = VERB_CATEGORY_OBJECT adjust_color(usr) diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index 1aa2c8dbea5f..e217dc918c61 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -32,7 +32,7 @@ GLOBAL_LIST_BOILERPLATE(all_beacons, /obj/item/radio/beacon) /obj/item/radio/beacon/verb/alter_signal(t as text) set name = "Alter Beacon's Signal" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(CHECK_MOBILITY(usr, MOBILITY_CAN_MOVE)) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index f7c49691a135..cdc248f6f6c3 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -835,7 +835,7 @@ GLOBAL_DATUM_INIT(virtual_announcer_ai, /mob/living/silicon/ai/announcer, new(nu /obj/item/bluespace_radio/verb/toggle_handset() set name = "Toggle Handset" - set category = "Object" + set category = VERB_CATEGORY_OBJECT var/mob/living/carbon/human/user = usr if(!handset) diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm index b8f2560a9a5b..8165600c4cb9 100644 --- a/code/game/objects/items/devices/spy_bug.dm +++ b/code/game/objects/items/devices/spy_bug.dm @@ -33,7 +33,7 @@ /obj/item/camerabug/verb/reset() set name = "Reset camera bug" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(linkedmonitor) linkedmonitor.unpair(src) linkedmonitor = null diff --git a/code/game/objects/items/devices/tape_recorder/tape_recorder.dm b/code/game/objects/items/devices/tape_recorder/tape_recorder.dm index 90d2b459bd5b..076367dc8a25 100644 --- a/code/game/objects/items/devices/tape_recorder/tape_recorder.dm +++ b/code/game/objects/items/devices/tape_recorder/tape_recorder.dm @@ -205,7 +205,7 @@ /obj/item/tape_recorder/verb/playback_memory() set name = "Playback Tape" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return @@ -257,7 +257,7 @@ /obj/item/tape_recorder/verb/eject() set name = "Eject Tape" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return @@ -337,7 +337,7 @@ /obj/item/tape_recorder/verb/record() set name = "Start Recording" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return @@ -345,7 +345,7 @@ /obj/item/tape_recorder/verb/stop() set name = "Stop" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return @@ -355,7 +355,7 @@ /obj/item/tape_recorder/verb/wipe_tape() set name = "Wipe Tape" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return @@ -376,7 +376,7 @@ /obj/item/tape_recorder/verb/print_transcript() set name = "Print Transcript" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index 508d252ec860..3a38f6b4f221 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -67,7 +67,7 @@ /obj/item/tape_recorder/verb/eject() set name = "Eject Tape" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return @@ -138,7 +138,7 @@ /obj/item/tape_recorder/verb/record() set name = "Start Recording" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return @@ -193,7 +193,7 @@ /obj/item/tape_recorder/verb/stop() set name = "Stop" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return @@ -211,7 +211,7 @@ /obj/item/tape_recorder/verb/wipe_tape() set name = "Wipe Tape" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return @@ -234,7 +234,7 @@ /obj/item/tape_recorder/verb/playback_memory() set name = "Playback Tape" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return @@ -306,7 +306,7 @@ /obj/item/tape_recorder/verb/print_transcript() set name = "Print Transcript" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.incapacitated()) return diff --git a/code/game/objects/items/devices/whistle.dm b/code/game/objects/items/devices/whistle.dm index 401ab578fcbf..02331f9744d7 100644 --- a/code/game/objects/items/devices/whistle.dm +++ b/code/game/objects/items/devices/whistle.dm @@ -13,7 +13,7 @@ /obj/item/hailer/verb/set_message() set name = "Set Hailer Message" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Alter the message shouted by your hailer." if(!isnull(insults)) diff --git a/code/game/objects/items/godfigures.dm b/code/game/objects/items/godfigures.dm index dc1f8fa2fbac..c2e1f7f31049 100644 --- a/code/game/objects/items/godfigures.dm +++ b/code/game/objects/items/godfigures.dm @@ -54,7 +54,7 @@ /obj/item/godfig/verb/rename_fig() set name = "Name Figure" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Rename your icon." var/mob/M = usr @@ -223,7 +223,7 @@ /* /obj/item/godfig/verb/resprite_figure() set name = "Customize Figure" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Click to choose an appearance for your icon." var/mob/M = usr diff --git a/code/game/objects/items/id_cards/cards.dm b/code/game/objects/items/id_cards/cards.dm index 4ce9ce5d66dc..62997abe8a8f 100644 --- a/code/game/objects/items/id_cards/cards.dm +++ b/code/game/objects/items/id_cards/cards.dm @@ -57,7 +57,7 @@ /obj/item/card/data/verb/label(t as text) set name = "Label Disk" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if (t) diff --git a/code/game/objects/items/id_cards/station_ids.dm b/code/game/objects/items/id_cards/station_ids.dm index 361ad7a66e06..176cc5e9de84 100644 --- a/code/game/objects/items/id_cards/station_ids.dm +++ b/code/game/objects/items/id_cards/station_ids.dm @@ -162,7 +162,7 @@ /obj/item/card/id/verb/read() set name = "Read ID Card" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr to_chat(usr, "[icon2html(thing = src, target = usr)] [src.name]: The current assignment on the card is [src.assignment].") diff --git a/code/game/objects/items/scanners/biology.dm b/code/game/objects/items/scanners/biology.dm index 1baffbd71d81..15dfdfbb12b2 100644 --- a/code/game/objects/items/scanners/biology.dm +++ b/code/game/objects/items/scanners/biology.dm @@ -6,7 +6,7 @@ /obj/item/biology_analyzer/proc/print_report_verb() set name = "Print Plant Report" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src = usr if(usr.stat || usr.restrained() || usr.lying) diff --git a/code/game/objects/items/scanners/health.dm b/code/game/objects/items/scanners/health.dm index 01754f56c307..a5a907d2b98b 100644 --- a/code/game/objects/items/scanners/health.dm +++ b/code/game/objects/items/scanners/health.dm @@ -275,7 +275,7 @@ /obj/item/healthanalyzer/verb/toggle_mode() set name = "Switch Verbosity" - set category = "Object" + set category = VERB_CATEGORY_OBJECT mode = !mode switch (mode) @@ -286,7 +286,7 @@ /obj/item/healthanalyzer/proc/toggle_adv() set name = "Toggle Advanced Scan" - set category = "Object" + set category = VERB_CATEGORY_OBJECT showadvscan = !showadvscan switch (showadvscan) diff --git a/code/game/objects/items/scanners/plant.dm b/code/game/objects/items/scanners/plant.dm index a06add08026f..cfb901f01a5d 100644 --- a/code/game/objects/items/scanners/plant.dm +++ b/code/game/objects/items/scanners/plant.dm @@ -101,7 +101,7 @@ /obj/item/plant_analyzer/proc/print_report_verb() set name = "Print Plant Report" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src = usr if(usr.stat || usr.restrained() || usr.lying) diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index c8853d0b68ca..6b5652a0277d 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -518,7 +518,7 @@ /obj/item/storage/backpack/parachute/verb/pack_parachute() set name = "Pack/Unpack Parachute" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(src.loc, /mob/living)) diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index 2fbbec5b7f5a..37aa58512548 100644 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -16,7 +16,7 @@ /obj/item/storage/belt/verb/toggle_layer() set name = "Switch Belt Layer" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(show_above_suit == -1) to_chat(usr, SPAN_NOTICE("\The [src] cannot be worn above your suit!")) diff --git a/code/game/objects/items/storage/medical/firstaid.dm b/code/game/objects/items/storage/medical/firstaid.dm index 1d6f1bc4a34b..74be1b9dc196 100644 --- a/code/game/objects/items/storage/medical/firstaid.dm +++ b/code/game/objects/items/storage/medical/firstaid.dm @@ -218,7 +218,7 @@ /obj/item/storage/pill_bottle/proc/choose_color() set name = "Recolor bottle" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Click to choose a color for the pill bottle." var/mob/M = usr diff --git a/code/game/objects/items/storage/quickdraw.dm b/code/game/objects/items/storage/quickdraw.dm index b60e8caff1a6..11575db69b74 100644 --- a/code/game/objects/items/storage/quickdraw.dm +++ b/code/game/objects/items/storage/quickdraw.dm @@ -38,7 +38,7 @@ // /obj/item/storage/quickdraw/verb/toggle_quickdraw() // set name = "Switch Quickdraw Mode" -// set category = "Object" +// set category = VERB_CATEGORY_OBJECT // quickmode = !quickmode // switch (quickmode) diff --git a/code/game/objects/items/storage/wallets.dm b/code/game/objects/items/storage/wallets.dm index d447f80218c8..958ca4766610 100644 --- a/code/game/objects/items/storage/wallets.dm +++ b/code/game/objects/items/storage/wallets.dm @@ -111,7 +111,7 @@ /obj/item/storage/wallet/poly/verb/change_color() set name = "Change Wallet Color" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Change the color of the wallet." set src in usr diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index e2b7fb48f5c2..794faedf935e 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -988,7 +988,7 @@ /obj/item/toy/plushie/verb/rename_plushie() set name = "Name Plushie" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Give your plushie a cute name!" var/mob/M = usr if(!M.mind) diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm index 85e382fb8f2b..937fa1232213 100644 --- a/code/game/objects/items/weapons/autopsy.dm +++ b/code/game/objects/items/weapons/autopsy.dm @@ -74,7 +74,7 @@ chemtraces += V /obj/item/autopsy_scanner/verb/print_data() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(usr, 1) set name = "Print Data" if(usr.stat || !(istype(usr,/mob/living/carbon/human))) diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm index fdf177025f0b..fe80c61ab876 100644 --- a/code/game/objects/items/weapons/implants/implantchair.dm +++ b/code/game/objects/items/weapons/implants/implantchair.dm @@ -141,7 +141,7 @@ /obj/machinery/implantchair/verb/get_out() set name = "Eject occupant" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != 0) return @@ -152,7 +152,7 @@ /obj/machinery/implantchair/verb/move_inside() set name = "Move Inside" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != 0 || machine_stat & (NOPOWER|BROKEN)) return diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm index ad4ae9d4a720..fee012d365e1 100644 --- a/code/game/objects/items/weapons/implants/implanter.dm +++ b/code/game/objects/items/weapons/implants/implanter.dm @@ -19,7 +19,7 @@ update() /obj/item/implanter/verb/remove_implant(var/mob/user) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Remove Implant" set src in usr diff --git a/code/game/objects/items/weapons/implants/implantreagent_vr.dm b/code/game/objects/items/weapons/implants/implantreagent_vr.dm index e3f4ae3f4820..e192a0fd1647 100644 --- a/code/game/objects/items/weapons/implants/implantreagent_vr.dm +++ b/code/game/objects/items/weapons/implants/implantreagent_vr.dm @@ -62,7 +62,7 @@ /mob/living/carbon/human/proc/use_reagent_implant() set name = "Transfer From Reagent Implant" set desc = "Remove reagents from am internal reagent into a container." - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) do_reagent_implant(usr) diff --git a/code/game/objects/items/weapons/tanks/jetpack.dm b/code/game/objects/items/weapons/tanks/jetpack.dm index 351c4e94be45..e2accf4da190 100644 --- a/code/game/objects/items/weapons/tanks/jetpack.dm +++ b/code/game/objects/items/weapons/tanks/jetpack.dm @@ -35,13 +35,13 @@ /obj/item/tank/jetpack/verb/toggle_rockets() set name = "Toggle Jetpack Stabilization" - set category = "Object" + set category = VERB_CATEGORY_OBJECT stabilization_on = !( stabilization_on ) to_chat(usr, "You toggle the stabilization [stabilization_on? "on":"off"].") /obj/item/tank/jetpack/verb/toggle() set name = "Toggle Jetpack" - set category = "Object" + set category = VERB_CATEGORY_OBJECT on = !on if(on) diff --git a/code/game/objects/structures/crates_lockers/__closet.dm b/code/game/objects/structures/crates_lockers/__closet.dm index 312de858b471..8a5aa5a5d508 100644 --- a/code/game/objects/structures/crates_lockers/__closet.dm +++ b/code/game/objects/structures/crates_lockers/__closet.dm @@ -420,7 +420,7 @@ /obj/structure/closet/verb/verb_togglelock() set src in oview(1) // One square distance - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Toggle Lock" if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) // Don't use it if you're not able to! Checks for stuns, ghost and restrain @@ -445,7 +445,7 @@ /obj/structure/closet/verb/verb_toggleopen() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Toggle Open" if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm index b622c843d61c..e7e320a32367 100644 --- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm +++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm @@ -161,7 +161,7 @@ /obj/structure/closet/fireaxecabinet/verb/toggle_openness() //nice name, huh? HUH?! -Erro //YEAH -Agouri set name = "Open/Close" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (isrobot(usr) || src.locked || src.smashed) @@ -176,7 +176,7 @@ /obj/structure/closet/fireaxecabinet/verb/remove_fire_axe() set name = "Remove Fire Axe" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (isrobot(usr)) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm index 741f930efdb2..24ea0ce03cfe 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -73,7 +73,7 @@ /obj/structure/closet/secure_closet/personal/verb/reset() set src in oview(1) // One square distance - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Reset Lock" if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) // Don't use it if you're not able to! Checks for stuns, ghost and restrain diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 258fc80a918c..cb54ee6530fd 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -189,7 +189,7 @@ /obj/structure/closet/crate/secure/verb_togglelock() set src in oview(1) // One square distance - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Toggle Lock" if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) // Don't use it if you're not able to! Checks for stuns, ghost and restrain diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm index d41885f16cb9..36d20189f758 100644 --- a/code/game/objects/structures/electricchair.dm +++ b/code/game/objects/structures/electricchair.dm @@ -24,7 +24,7 @@ /obj/structure/bed/chair/e_chair/verb/toggle() set name = "Toggle Electric Chair" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(on) diff --git a/code/game/objects/structures/fireaxe.dm b/code/game/objects/structures/fireaxe.dm index bc90ef272282..5b21c9d390de 100644 --- a/code/game/objects/structures/fireaxe.dm +++ b/code/game/objects/structures/fireaxe.dm @@ -137,7 +137,7 @@ /obj/structure/fireaxecabinet/verb/toggle_openness() //nice name, huh? HUH?! -Erro //YEAH -Agouri set name = "Open/Close" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if (isrobot(usr) || locked || smashed) if(locked) @@ -151,7 +151,7 @@ /obj/structure/fireaxecabinet/verb/remove_fire_axe() set name = "Remove Fire Axe" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if (isrobot(usr)) return diff --git a/code/game/objects/structures/gravemarker.dm b/code/game/objects/structures/gravemarker.dm index 93c06de3cdc0..9b434772aabd 100644 --- a/code/game/objects/structures/gravemarker.dm +++ b/code/game/objects/structures/gravemarker.dm @@ -85,7 +85,7 @@ /obj/structure/gravemarker/verb/rotate_clockwise() set name = "Rotate Grave Marker Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(anchored) diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index 9a9665a2459e..1622e5da57c8 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -50,7 +50,7 @@ /obj/structure/inflatable/verb/hand_deflate() set name = "Deflate" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(isobserver(usr) || usr.restrained() || !usr.Adjacent(src)) diff --git a/code/game/objects/structures/medical_stand_vr.dm b/code/game/objects/structures/medical_stand_vr.dm index 2fb5f1f0f6e0..0eed1c210f1a 100644 --- a/code/game/objects/structures/medical_stand_vr.dm +++ b/code/game/objects/structures/medical_stand_vr.dm @@ -221,7 +221,7 @@ update_icon() /obj/structure/medical_stand/verb/toggle_mode() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Toggle IV Mode" set src in view(1) @@ -237,7 +237,7 @@ /obj/structure/medical_stand/verb/set_APTFT() set name = "Set IV transfer amount" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in range(1) var/N = input("Amount per transfer from this:","[src]") as null|anything in transfer_amounts if(N) diff --git a/code/game/objects/structures/railing.dm b/code/game/objects/structures/railing.dm index 2321c53e56e5..e988470c54cd 100644 --- a/code/game/objects/structures/railing.dm +++ b/code/game/objects/structures/railing.dm @@ -124,7 +124,7 @@ /obj/structure/railing/verb/rotate_counterclockwise() set name = "Rotate Railing Counter-Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.incapacitated()) @@ -143,7 +143,7 @@ /obj/structure/railing/verb/rotate_clockwise() set name = "Rotate Railing Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.incapacitated()) @@ -162,7 +162,7 @@ /obj/structure/railing/verb/flip() // This will help push railing to remote places, such as open space turfs set name = "Flip Railing" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.incapacitated()) diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index ba7df78018d2..26cece5c48f0 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -158,7 +158,7 @@ /obj/structure/bed/chair/verb/rotate_clockwise() set name = "Rotate Chair Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(!usr || !isturf(usr.loc)) diff --git a/code/game/objects/structures/tables/flipping.dm b/code/game/objects/structures/tables/flipping.dm index 1f5f41ead030..6e4f4ff8a76e 100644 --- a/code/game/objects/structures/tables/flipping.dm +++ b/code/game/objects/structures/tables/flipping.dm @@ -81,7 +81,7 @@ /obj/structure/table/verb/do_flip() set name = "Flip table" set desc = "Flips a non-reinforced table" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (!can_touch(usr) || ismouse(usr)) @@ -97,7 +97,7 @@ /obj/structure/table/proc/do_put() set name = "Put table back" set desc = "Puts flipped table back" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (!can_touch(usr)) diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 077ea0bde9df..c5c1968e6ae9 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -252,7 +252,7 @@ //Rotates the windoor assembly clockwise /obj/structure/windoor_assembly/verb/rotate_clockwise() set name = "Rotate Windoor Assembly Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (src.anchored) @@ -272,7 +272,7 @@ //Flips the windoor assembly, determines whather the door opens to the left or the right /obj/structure/windoor_assembly/verb/flip() set name = "Flip Windoor Assembly" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(src.facing == "l") diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 0fa304773dce..ad312448ed6c 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -453,7 +453,7 @@ /obj/structure/window/verb/rotate_counterclockwise() set name = "Rotate Counterclockwise" // Temporary fix until someone more intelligent figures out how to add proper rotation verbs to the panels - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (usr.incapacitated()) @@ -471,7 +471,7 @@ /obj/structure/window/verb/rotate_clockwise() set name = "Rotate Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (usr.incapacitated()) diff --git a/code/game/rendering/legacy/hud.dm b/code/game/rendering/legacy/hud.dm index f25e70190c7d..38e5dfcf95f5 100644 --- a/code/game/rendering/legacy/hud.dm +++ b/code/game/rendering/legacy/hud.dm @@ -251,11 +251,13 @@ GLOBAL_DATUM_INIT(global_hud, /datum/global_hud, new) /datum/hud/proc/instantiate() - if(!ismob(mymob)) return 0 - if(!mymob.client) return 0 - ui_style = ui_style2icon(mymob.client.prefs.UI_style) - ui_color = mymob.client.prefs.UI_style_color - ui_alpha = mymob.client.prefs.UI_style_alpha + if(!ismob(mymob)) + return 0 + if(!mymob.client) + return 0 + ui_style = ui_style2icon(mymob.get_preference_entry(/datum/game_preference_entry/dropdown/hud_style)) + ui_color = mymob.get_preference_entry(/datum/game_preference_entry/simple_color/hud_color) + ui_alpha = mymob.get_preference_entry(/datum/game_preference_entry/number/hud_alpha) if(ishuman(mymob)) human_hud(ui_style, ui_color, ui_alpha, mymob) // Pass the player the UI style chosen in preferences diff --git a/code/game/rendering/legacy/human.dm b/code/game/rendering/legacy/human.dm index 052964f4aaa2..b1158856be78 100644 --- a/code/game/rendering/legacy/human.dm +++ b/code/game/rendering/legacy/human.dm @@ -382,7 +382,7 @@ /mob/living/carbon/human/verb/toggle_hotkey_verbs() - set category = "OOC" + set category = VERB_CATEGORY_OOC set name = "Toggle hotkey buttons" set desc = "This disables or enables the user interface buttons which can be used with hotkeys." diff --git a/code/game/rendering/parallax/parallax_holder.dm b/code/game/rendering/parallax/parallax_holder.dm index e018f065419c..e27a152e78bd 100644 --- a/code/game/rendering/parallax/parallax_holder.dm +++ b/code/game/rendering/parallax/parallax_holder.dm @@ -164,7 +164,7 @@ if(QDELETED(C)) return . = list() - if(C.is_preference_enabled(/datum/client_preference/parallax)) + if(C.get_preference_entry(/datum/game_preference_entry/toggle/parallax)) for(var/atom/movable/screen/parallax_layer/L in layers) // if(L.parallax_intensity > owner.prefs.parallax) // continue diff --git a/code/game/rendering/plane_masters/plane_holder.dm b/code/game/rendering/plane_masters/plane_holder.dm index eb34d3c92fdf..fcdc77f1b4e5 100644 --- a/code/game/rendering/plane_masters/plane_holder.dm +++ b/code/game/rendering/plane_masters/plane_holder.dm @@ -70,7 +70,7 @@ CRASH("invalid fetch") /datum/plane_holder/proc/sync_owner(client/C) - set_fake_ambient_occlusion(C.is_preference_enabled(/datum/client_preference/ambient_occlusion)) + set_fake_ambient_occlusion(C.get_preference_entry(/datum/game_preference_entry/toggle/ambient_occlusion)) /datum/plane_holder/proc/set_fake_ambient_occlusion(enabled) return diff --git a/code/game/response_team.dm b/code/game/response_team.dm index c4a3a55a3939..0761a4b5ec2c 100644 --- a/code/game/response_team.dm +++ b/code/game/response_team.dm @@ -40,7 +40,7 @@ var/silent_ert = 0 /client/verb/JoinResponseTeam() set name = "Join Response Team" - set category = "IC" + set category = VERB_CATEGORY_IC if(!MayRespawn(1)) to_chat(usr, "You cannot join the response team at this time.") diff --git a/code/game/sound.dm b/code/game/sound.dm index 5357cf4c6eac..f05434c775d6 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -93,7 +93,7 @@ GLOBAL_VAR_INIT(sound_distance_offscreen, 7) if(ear_deaf > 0) return - if(preference && !client.is_preference_enabled(preference)) + if(preference && !client.get_preference_toggle(preference)) return if(!S) @@ -197,7 +197,7 @@ GLOBAL_VAR_INIT(sound_distance_offscreen, 7) /client/proc/playtitlemusic() if(!SSticker || !SSmedia_tracks.lobby_tracks.len || !media) return - if(is_preference_enabled(/datum/client_preference/play_lobby_music)) + if(get_preference_toggle(/datum/game_preference_toggle/music/lobby)) var/datum/media_track/T = pick(SSmedia_tracks.lobby_tracks) media.push_music(T.url, world.time, 0.85) to_chat(src,"Lobby music: [T.title] by [T.artist].") diff --git a/code/game/verbs/advanced_who.dm b/code/game/verbs/advanced_who.dm index a0359f7f56b8..d60a7a51dba0 100644 --- a/code/game/verbs/advanced_who.dm +++ b/code/game/verbs/advanced_who.dm @@ -3,7 +3,7 @@ /client/verb/who_advanced() set name = "Advanced Who" - set category = "OOC" + set category = VERB_CATEGORY_OOC var/msg = "Current Players:\n" @@ -68,7 +68,7 @@ entry += "[C.holder.fakekey]" else entry += "[C.key]" - if(C.is_preference_enabled(/datum/client_preference/show_in_advanced_who)) + if(C.get_preference_toggle(/datum/game_preference_toggle/presence/show_advanced_who)) if(isobserver(C.mob)) entry += " - Observing" else if(istype(C.mob, /mob/new_player)) diff --git a/code/game/verbs/character_directory.dm b/code/game/verbs/character_directory.dm index 8313016a25df..3bda5b602a29 100644 --- a/code/game/verbs/character_directory.dm +++ b/code/game/verbs/character_directory.dm @@ -2,7 +2,7 @@ GLOBAL_DATUM(character_directory, /datum/character_directory) /client/verb/show_character_directory() set name = "Character Directory" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Shows a listing of all active characters, along with their associated OOC notes, flavor text, and more." // This is primarily to stop malicious users from trying to lag the server by spamming this verb diff --git a/code/game/verbs/ignore.dm b/code/game/verbs/ignore.dm index be565f390ec5..4e7c315bb538 100644 --- a/code/game/verbs/ignore.dm +++ b/code/game/verbs/ignore.dm @@ -1,6 +1,6 @@ /client/verb/ignore(key_to_ignore as text) set name = "Ignore" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Makes OOC and Deadchat messages from a specific player not appear to you." if(!key_to_ignore) @@ -20,7 +20,7 @@ /client/verb/unignore(key_to_unignore as text) set name = "Unignore" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Reverts your ignoring of a specific player." if(!key_to_unignore) diff --git a/code/game/verbs/who.dm b/code/game/verbs/who.dm index 3a9f73e3bfca..c1491171b5c4 100644 --- a/code/game/verbs/who.dm +++ b/code/game/verbs/who.dm @@ -3,7 +3,7 @@ /client/verb/who() set name = "Who" - set category = "OOC" + set category = VERB_CATEGORY_OOC var/msg = "Current Players:\n" diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 977ebb2d1f45..9090799bf10b 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -12,12 +12,13 @@ var/global/floorIsLava = 0 confidential = TRUE) /proc/msg_admin_attack(var/text) //Toggleable Attack Messages - var/rendered = "ATTACK: [text]" - for(var/client/C in GLOB.admins) - if((R_ADMIN|R_MOD) & C.holder.rights) - if(C.is_preference_enabled(/datum/client_preference/mod/show_attack_logs)) - var/msg = rendered - to_chat(C, msg) + return + // var/rendered = "ATTACK: [text]" + // for(var/client/C in GLOB.admins) + // if((R_ADMIN|R_MOD) & C.holder.rights) + // if(C.get_preference_toggle(/datum/client_preference/mod/show_attack_logs)) + // var/msg = rendered + // to_chat(C, msg) /proc/admin_notice(var/message, var/rights) for(var/mob/M in GLOB.mob_list) @@ -66,7 +67,6 @@ var/global/floorIsLava = 0 Mob type: [M.type]
Inactivity time: [M.client ? "[M.client.inactivity/600] minutes" : "Logged out"]

Kick | - Warn | Ban | Jobban | [is_role_banned_ckey(M.ckey, role = BAN_ROLE_OOC)? "OOC Ban" : "OOC Ban"] | @@ -1561,7 +1561,7 @@ datum/admins/var/obj/item/paper/admin/faxreply // var to hold fax replies in if(!isobserver(owner.mob)) return var/mob/observer/dead/dead = owner.mob - var/stealthghost = owner.is_preference_enabled(/datum/client_preference/holder/stealth_ghost_mode) + var/stealthghost = owner.get_preference_toggle(/datum/game_preference_toggle/admin/stealth_hides_ghost) if(!stealthghost || !fakekey) dead.invisibility = initial(dead.invisibility) dead.alpha = initial(dead.alpha) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 4d599cb6551f..cb878a2e71bc 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -30,7 +30,6 @@ var/list/admin_verbs_admin = list( /datum/admins/proc/announce, //priority announce something to all clients., /datum/admins/proc/intercom, //send a fake intercom message, like an arrivals announcement, /datum/admins/proc/intercom_convo, //send a fake intercom conversation, like an ATC exchange, - /client/proc/colorooc, //allows us to set a custom colour for everythign we say in ooc, /client/proc/admin_ghost, //allows us to ghost/reenter body at will, /client/proc/toggle_view_range, //changes how far we can see, /client/proc/cmd_admin_pm_context, //right-click adminPM interface, @@ -99,8 +98,6 @@ var/list/admin_verbs_admin = list( /client/proc/change_security_level, /client/proc/view_chemical_reaction_logs, /client/proc/makePAI, - /client/proc/toggle_debug_logs, - /client/proc/toggle_attack_logs, /datum/admins/proc/paralyze_mob, /client/proc/fixatmos, /datum/admins/proc/quick_nif, @@ -231,7 +228,6 @@ var/list/admin_verbs_debug = list( /client/proc/jumptomob, /client/proc/jumptocoord, /client/proc/dsay, - /client/proc/toggle_debug_logs, /client/proc/admin_ghost, //allows us to ghost/reenter body at will, /datum/admins/proc/view_runtimes, /client/proc/show_gm_status, @@ -268,7 +264,6 @@ var/list/admin_verbs_hideable = list( /datum/admins/proc/toggleenter, /datum/admins/proc/toggleguests, /datum/admins/proc/announce, - /client/proc/colorooc, /client/proc/admin_ghost, /client/proc/toggle_view_range, /client/proc/cmd_admin_subtle_message, @@ -352,7 +347,6 @@ var/list/admin_verbs_mod = list( /client/proc/check_antagonists, /client/proc/aooc, /client/proc/jobbans, - /client/proc/toggle_attack_logs, /client/proc/cmd_admin_subtle_message, //send an message to somebody as a 'voice in their head', /client/proc/cmd_admin_icsubtle_message, /datum/admins/proc/paralyze_mob, @@ -590,21 +584,6 @@ var/list/admin_verbs_event_manager = list( if (holder) holder.Secrets() feedback_add_details("admin_verb","S") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return - -/client/proc/colorooc() - set category = "Fun" - set name = "OOC Text Color" - if(!holder) return - var/response = alert(src, "Please choose a distinct color that is easy to read and doesn't mix with all the other chat and radio frequency colors.", "Change own OOC color", "Pick new color", "Reset to default", "Cancel") - if(response == "Pick new color") - prefs.ooccolor = input(src, "Please select your OOC colour.", "OOC colour") as color - else if(response == "Reset to default") - prefs.ooccolor = initial(prefs.ooccolor) - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","OC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return /client/proc/findStealthKey(txt) if(txt) @@ -648,48 +627,6 @@ var/list/admin_verbs_event_manager = list( message_admins("[key_name_admin(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]", 1) feedback_add_details("admin_verb","SM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -#define MAX_WARNS 3 -#define AUTOBANTIME 10 - -/client/proc/warn(warned_ckey) - if(!check_rights(R_ADMIN)) return - - if(!warned_ckey || !istext(warned_ckey)) return - if(warned_ckey in admin_datums) - to_chat(usr, "Error: warn(): You can't warn admins.") - return - - var/datum/preferences/D - var/client/C = GLOB.directory[warned_ckey] - if(C) D = C.prefs - else D = GLOB.preferences_datums[warned_ckey] - - if(!D) - to_chat(src, "Error: warn(): No such ckey found.") - return - - if(++D.warns >= MAX_WARNS) //uh ohhhh...you'reee iiiiin trouuuubble O:) - ban_unban_log_save("[ckey] warned [warned_ckey], resulting in a [AUTOBANTIME] minute autoban.") - if(C) - message_admins("[key_name_admin(src)] has warned [key_name_admin(C)] resulting in a [AUTOBANTIME] minute ban.") - to_chat(C, "You have been autobanned due to a warning by [ckey].
This is a temporary ban, it will be removed in [AUTOBANTIME] minutes.
") - del(C) - else - message_admins("[key_name_admin(src)] has warned [warned_ckey] resulting in a [AUTOBANTIME] minute ban.") - AddBan(warned_ckey, D.last_id, "Autobanning due to too many formal warnings", ckey, 1, AUTOBANTIME) - feedback_inc("ban_warn",1) - else - if(C) - to_chat(C, "You have been formally warned by an administrator.
Further warnings will result in an autoban.
") - message_admins("[key_name_admin(src)] has warned [key_name_admin(C)]. They have [MAX_WARNS-D.warns] strikes remaining.") - else - message_admins("[key_name_admin(src)] has warned [warned_ckey] (DC). They have [MAX_WARNS-D.warns] strikes remaining.") - - feedback_add_details("admin_verb","WARN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -#undef MAX_WARNS -#undef AUTOBANTIME - /client/proc/drop_bomb() // Some admin dickery that can probably be done better -- TLE set category = "Special Verbs" set name = "Drop Bomb" @@ -1137,9 +1074,3 @@ var/list/admin_verbs_event_manager = list( popup.set_content(dat.Join("")) popup.open() -/client/verb/stop_client_sounds() - set name = "Stop Sounds" - set category = "Preferences" - set desc = "Stop Current Sounds" - usr << sound(null) - usr.client?.tgui_panel?.stop_music() diff --git a/code/modules/admin/news.dm b/code/modules/admin/news.dm index 7c578430f940..474546fdf949 100644 --- a/code/modules/admin/news.dm +++ b/code/modules/admin/news.dm @@ -5,9 +5,11 @@ // Returns true if news was updated since last seen. /client/proc/check_for_new_server_news() + if(!player.block_on_available()) + return FALSE var/savefile/F = get_server_news() if(F) - if(md5(F["body"]) != prefs.lastnews) + if(md5(F["body"]) != player.player_misc["lastnews"]) return TRUE return FALSE diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 6feede2494ce..b5b07d730e7e 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -311,9 +311,6 @@ alert(usr, "This ban has already been lifted / does not exist.", "Error", "Ok") unbanpanel() - else if(href_list["warn"]) - usr.client.warn(href_list["warn"]) - else if(href_list["unbane"]) if(!check_rights(R_BAN)) return diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 5efad661ec66..3e07dc740a7b 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -252,8 +252,9 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick/ticket_list) //send this msg to all admins for(var/client/X in GLOB.admins) - if(X.is_preference_enabled(/datum/client_preference/holder/play_adminhelp_ping)) - SEND_SOUND(X, sound('sound/effects/adminhelp.ogg')) + // if(X.get_preference_toggle(/datum/client_preference/holder/play_adminhelp_ping)) + // SEND_SOUND(X, sound('sound/effects/adminhelp.ogg')) + SEND_SOUND(X, sound('sound/effects/adminhelp.ogg')) window_flash(X) to_chat(X, chat_msg) @@ -339,8 +340,9 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick/ticket_list) return if(initiator) - if(initiator.is_preference_enabled(/datum/client_preference/holder/play_adminhelp_ping)) - SEND_SOUND(initiator, sound('sound/effects/adminhelp.ogg')) + // if(initiator.get_preference_toggle(/datum/client_preference/holder/play_adminhelp_ping)) + // SEND_SOUND(initiator, sound('sound/effects/adminhelp.ogg')) + SEND_SOUND(initiator, sound('sound/effects/adminhelp.ogg')) to_chat(initiator, "- AdminHelp Rejected! -") to_chat(initiator, "Your admin help was rejected.") diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 756134de3540..7f0f2d1d55ef 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -166,8 +166,9 @@ to_chat(src, "PM to-Admins: [msg]") //play the recieving admin the adminhelp sound (if they have them enabled) - if(recipient.is_preference_enabled(/datum/client_preference/holder/play_adminhelp_ping)) - SEND_SOUND(recipient, sound('sound/effects/adminhelp.ogg')) + // if(recipient.get_preference_toggle(/datum/client_preference/holder/play_adminhelp_ping)) + // SEND_SOUND(recipient, sound('sound/effects/adminhelp.ogg')) + SEND_SOUND(recipient, sound('sound/effects/adminhelp.ogg')) else if(holder) //sender is an admin but recipient is not. Do BIG RED TEXT diff --git a/code/modules/admin/verbs/antag-ooc.dm b/code/modules/admin/verbs/antag-ooc.dm index 2a4601924dfc..42ddff81155b 100644 --- a/code/modules/admin/verbs/antag-ooc.dm +++ b/code/modules/admin/verbs/antag-ooc.dm @@ -1,5 +1,5 @@ /client/proc/aooc(msg as text) - set category = "OOC" + set category = VERB_CATEGORY_OOC set name = "AOOC" set desc = "Antagonist OOC" diff --git a/code/modules/admin/verbs/custom_event.dm b/code/modules/admin/verbs/custom_event.dm index 700477ec4fb3..6a775a8814d6 100644 --- a/code/modules/admin/verbs/custom_event.dm +++ b/code/modules/admin/verbs/custom_event.dm @@ -28,7 +28,7 @@ // normal verb for players to view info /client/verb/cmd_view_custom_event() - set category = "OOC" + set category = VERB_CATEGORY_OOC set name = "Custom Event Info" if(!custom_event_msg || custom_event_msg == "") diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 258ee8098252..170b05efba82 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -13,7 +13,7 @@ GLOBAL_LIST_INIT(stealthmin_nicknames, world.file2list("[global.config.directory to_chat(src, "You cannot send DSAY messages (muted).") return - if(!is_preference_enabled(/datum/client_preference/show_dsay)) + if(!get_preference_toggle(/datum/game_preference_toggle/chat/dsay)) to_chat(src, "You have deadchat muted.") return @@ -27,7 +27,7 @@ GLOBAL_LIST_INIT(stealthmin_nicknames, world.file2list("[global.config.directory var/key if(holder.fakekey) - if(is_preference_enabled(/datum/client_preference/holder/obfuscate_stealth_dsay)) + if(get_preference_toggle(/datum/game_preference_toggle/admin/obfuscate_stealth_dsay)) key = pick(GLOB.stealthmin_nicknames) else key = holder.fakekey diff --git a/code/modules/admin/verbs/lightning_strike.dm b/code/modules/admin/verbs/lightning_strike.dm index 45b2e2eb2f82..eb436a3faba1 100644 --- a/code/modules/admin/verbs/lightning_strike.dm +++ b/code/modules/admin/verbs/lightning_strike.dm @@ -67,7 +67,7 @@ var/sound = get_sfx("thunder") for(var/mob/M in GLOB.player_list) if((P && (M.z in P.expected_z_levels)) || M.z == T.z) - if(M.is_preference_enabled(/datum/client_preference/weather_sounds)) + if(M.get_preference_toggle(/datum/game_preference_toggle/ambience/weather)) M.playsound_local(get_turf(M), soundin = sound, vol = 70, vary = FALSE, is_global = TRUE) if(cosmetic) // Everything beyond here involves potentially damaging things. If we don't want to do that, stop now. diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index bf3c98a1f3c8..657f117b3ccc 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -33,7 +33,7 @@ message_admins("[key_name_admin(src)] played sound [S]") for(var/mob/M in GLOB.player_list) - if(M.is_preference_enabled(/datum/client_preference/play_admin_midis)) //if(M.client.prefs.toggles & SOUND_MIDI) + if(M.get_preference_toggle(/datum/game_preference_toggle/music/admin)) //if(M.client.prefs.toggles & SOUND_MIDI) admin_sound.volume = vol * M.client.admin_music_volume SEND_SOUND(M, admin_sound) admin_sound.volume = vol @@ -126,7 +126,7 @@ for(var/m in GLOB.player_list) var/mob/M = m var/client/C = M.client - if(M.is_preference_enabled(/datum/client_preference/play_admin_midis)) //if(C.prefs.toggles & SOUND_MIDI) + if(M.get_preference_toggle(/datum/game_preference_toggle/music/admin)) //if(C.prefs.toggles & SOUND_MIDI) if(!stop_web_sounds) C.tgui_panel?.play_music(web_sound_url, music_extra_data) else @@ -176,7 +176,7 @@ for(var/m in GLOB.player_list) var/mob/M = m var/client/C = M.client - if(M.is_preference_enabled(/datum/client_preference/play_admin_midis)) //if(C.prefs.toggles & SOUND_MIDI) + if(M.get_preference_toggle(/datum/game_preference_toggle/music/admin)) //if(C.prefs.toggles & SOUND_MIDI) C.tgui_panel?.play_music(web_sound_input, music_extra_data) //SSblackbox.record_feedback("tally", "admin_verb", 1, "Manual Play Internet Sound") diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm index 233afb359f9f..4fda1c1a7638 100644 --- a/code/modules/admin/verbs/possess.dm +++ b/code/modules/admin/verbs/possess.dm @@ -1,6 +1,6 @@ /proc/possess(obj/O as obj in world) set name = "Possess Obj" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(!O.loc) return // erm erm erm maybe not? @@ -31,7 +31,7 @@ /proc/release(obj/O as obj in world) set name = "Release Obj" - set category = "Object" + set category = VERB_CATEGORY_OBJECT //usr.loc = get_turf(usr) if(usr.control_object && usr.name_archive) //if you have a name archived and if you are actually relassing an object diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index d54fb2e98f7e..2cb95a1feb10 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -1,6 +1,6 @@ /// Used by players to ask badmins to do things for them, but ICly. /mob/verb/pray(msg as text) - set category = "IC" + set category = VERB_CATEGORY_IC set name = "Pray" msg = sanitize(msg) @@ -49,9 +49,8 @@ for(var/client/C in GLOB.admins) if((R_ADMIN|R_MOD) & C.holder.rights) - if(C.is_preference_enabled(/datum/client_preference/admin/show_chat_prayers)) - to_chat(C, msg) - SEND_SOUND(C, sound('sound/effects/ding.ogg')) + to_chat(C, msg) + SEND_SOUND(C, sound('sound/effects/ding.ogg')) to_chat(usr, SPAN_INFO("You pray to the gods: \"[msg_tmp]\""), confidential = TRUE) diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index 4ce675966b92..5f83a4fa06b9 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -188,7 +188,7 @@ /obj/item/assembly_holder/timer_igniter/verb/configure() set name = "Set Timer" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if ( !(usr.stat || usr.restrained()) ) diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index dea3be27a78d..2f95cd1aadf5 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -194,7 +194,7 @@ /obj/item/assembly/infra/verb/rotate_clockwise() set name = "Rotate Infrared Laser Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr setDir(turn(dir, 90)) diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index 65d59150ed03..891d109980bc 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -127,7 +127,7 @@ /obj/item/assembly/mousetrap/verb/hide_under() set src in oview(1) set name = "Hide" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(usr.stat) return diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index c27af1c62fb7..6ed5d1844b59 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -155,7 +155,7 @@ set src in usr set name = "Threaten to push the button!" set desc = "BOOOOM!" - set category = "IC" + set category = VERB_CATEGORY_IC deadman = TRUE START_PROCESSING(SSobj, src) log_and_message_admins("is threatening to trigger a signaler deadman's switch") diff --git a/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm b/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm index b74f9b7643d5..0ff8e57082fc 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm @@ -138,7 +138,7 @@ /obj/machinery/atmospherics/component/binary/circulator/verb/rotate_clockwise() set name = "Rotate Circulator Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (usr.stat || usr.restrained() || anchored) @@ -150,7 +150,7 @@ /obj/machinery/atmospherics/component/binary/circulator/verb/rotate_counterclockwise() set name = "Rotate Circulator Counterclockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (usr.stat || usr.restrained() || anchored) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm b/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm index 25745efec598..be56c8c7ad13 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pipeturbine.dm @@ -122,7 +122,7 @@ /obj/machinery/atmospherics/pipeturbine/verb/rotate_clockwise() set name = "Rotate Turbine Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (usr.stat || usr.restrained() || anchored) @@ -133,7 +133,7 @@ /obj/machinery/atmospherics/pipeturbine/verb/rotate_counterclockwise() set name = "Rotate Turbine Counterclockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (usr.stat || usr.restrained() || anchored) @@ -276,7 +276,7 @@ /obj/machinery/power/turbinemotor/verb/rotate_clockwise() set name = "Rotate Motor Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if (usr.stat || usr.restrained() || anchored) @@ -286,7 +286,7 @@ /obj/machinery/power/turbinemotor/verb/rotate_counterclockwise() set name = "Rotate Motor Counterclockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if (usr.stat || usr.restrained() || anchored) diff --git a/code/modules/catalogue/cataloguer_vr.dm b/code/modules/catalogue/cataloguer_vr.dm index 6b3ae9d83cad..56a8ea60738b 100644 --- a/code/modules/catalogue/cataloguer_vr.dm +++ b/code/modules/catalogue/cataloguer_vr.dm @@ -18,7 +18,7 @@ /obj/item/cataloguer/compact/verb/toggle() set name = "Toggle Cataloguer" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(busy) diff --git a/code/modules/client/client.dm b/code/modules/client/client.dm index 57b2b0908a09..3e753a8add94 100644 --- a/code/modules/client/client.dm +++ b/code/modules/client/client.dm @@ -96,6 +96,10 @@ /// menu group statuses var/list/menu_group_status = list() + //? Preferences + /// client preferences + var/datum/game_preferences/preferences + //? Statpanel /// statpanel tab ; can be null (e.g. we're looking at verb tabs) var/statpanel_tab diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 30684835ef89..15e8c0243c7c 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -198,9 +198,21 @@ // resolve persistent data persistent = resolve_client_data(ckey, key) //* Resolve database data - player = new(key) + player = resolve_player_data(ckey, key) player.log_connect() - // todo: move preferences up here but above persistent + //* Resolve preferences + preferences = SSpreferences.resolve_game_preferences(key, ckey) + preferences.active = src + preferences.on_reconnect() + //? WARNING: SHITCODE ALERT ?// + // We allow a client/New sleep because preferences is currently required for + // everything else to work + // todo: maybe don't do this? + if(!UNLINT(preferences.block_on_initialized(5 SECONDS))) + security_kick("A fatal error occurred while attempting to load: preferences not initialized. Please notify a coder.") + stack_trace("we just kicked a client due to prefs not loading; something is horribly wrong!") + return + //? END ?// //* Setup user interface // todo: move top level menu here, for now it has to be under prefs. @@ -328,11 +340,12 @@ pre_init_viewport() mob.reload_rendering() - if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates. - to_chat(src, "You have unread updates in the changelog.") - winset(src, "infowindow.changelog", "background-color=#eaeaea;font-style=bold") - if(config_legacy.aggressive_changelog) - changelog_async() + // todo: this is dead because changelog is dead but we should fix it tbvqh + // if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates. + // to_chat(src, "You have unread updates in the changelog.") + // winset(src, "infowindow.changelog", "background-color=#eaeaea;font-style=bold") + // if(config_legacy.aggressive_changelog) + // changelog_async() // ensure asset cache is there INVOKE_ASYNC(src, PROC_REF(warn_if_no_asset_cache_browser)) @@ -383,9 +396,11 @@ // log log_access("Logout: [key_name(src)]") // unreference storage datums - prefs = null persistent = null player = null + if(preferences) + preferences.active = null + preferences = null //* unsorted GLOB.ahelp_tickets.ClientLogout(src) @@ -512,7 +527,7 @@ if(ab) //Citadel edit, things with stuff. return - if (prefs.hotkeys) + if (preferences.is_hotkeys_mode()) // If hotkey mode is enabled, then clicking the map will automatically // unfocus the text bar. This removes the red color from the text bar // so that the visual focus indicator matches reality. diff --git a/code/modules/client/data/client_data.dm b/code/modules/client/data/client_data.dm index 8e1387b858fb..7660a0a5e125 100644 --- a/code/modules/client/data/client_data.dm +++ b/code/modules/client/data/client_data.dm @@ -1,3 +1,6 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + GLOBAL_LIST_EMPTY(client_data) /proc/resolve_client_data(ckey, key) @@ -65,7 +68,7 @@ GLOBAL_LIST_EMPTY(client_data) log_shadowban("[ckey] autobanned based on [why].") message_admins(SPAN_DANGER("Automatically shadowbanning [ckey] based on configuration (matched on [why]). Varedit client.persistent.ligma to change this.")) -/datum/client_data/proc/block_on_account_age_loaded(timeout = INFINITY) +/datum/client_data/proc/block_on_account_age_loaded(timeout = 10 SECONDS) var/timed_out = world.time + timeout UNTIL(!isnull(account_age) || world.time > timed_out) return account_age @@ -143,7 +146,8 @@ GLOBAL_LIST_EMPTY(client_data) playtime_loaded = TRUE playtime_mutex = FALSE -/datum/client_data/proc/block_on_playtime_loaded(timeout = INFINITY) +/datum/client_data/proc/block_on_playtime_loaded(timeout = 10 SECONDS) var/timed_out = world.time + timeout load_playtime() UNTIL(playtime_loaded || world.time > timed_out) + return playtime_loaded diff --git a/code/modules/client/data/player_data.dm b/code/modules/client/data/player_data.dm index 33ed969c1fa1..08ef61a6f191 100644 --- a/code/modules/client/data/player_data.dm +++ b/code/modules/client/data/player_data.dm @@ -1,4 +1,16 @@ -// todo: this has to be globally cached for new admin panel +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + +GLOBAL_LIST_EMPTY(player_data) + +/proc/resolve_player_data(ckey, key) + ckey = ckey(ckey) // just in case + if(!islist(GLOB.player_data)) + // we CANNOT RUNTIME + GLOB.player_data = list() + if(!istype(GLOB.player_data[ckey], /datum/player_data)) + GLOB.player_data[ckey] = new /datum/player_data(ckey, key) + return GLOB.player_data[ckey] /** * holds db-related data @@ -31,9 +43,12 @@ var/player_age /// join date var/player_first_seen + /// arbitrary JSON-serializable key-value data + /// you must handle errors yourself! we won't handle it for you. + var/list/player_misc -/datum/player_data/New(key) - src.ckey = ckey(key) +/datum/player_data/New(ckey, key) + src.ckey = ckey if(!src.ckey) return src.key = key @@ -94,7 +109,7 @@ lookup_pid = text2num(lookup_pid) qdel(lookup) lookup = SSdbcore.ExecuteQuery( - "SELECT id, flags, datediff(Now(), firstseen), firstseen FROM [format_table_name("player")] WHERE id = :id", + "SELECT id, flags, datediff(Now(), firstseen), firstseen, misc FROM [format_table_name("player")] WHERE id = :id", list( "id" = lookup_pid ) @@ -111,6 +126,7 @@ player_flags = lookup_flags player_first_seen = lookup.item[4] player_age = lookup_age + player_misc = safe_json_decode(lookup.item[5]) qdel(lookup) available = TRUE else @@ -125,21 +141,24 @@ // new person! player_age = 0 player_flags = NONE + player_misc = list() var/datum/db_query/insert if(migrate_firstseen) insert = SSdbcore.ExecuteQuery( - "INSERT INTO [format_table_name("player")] (flags, firstseen, lastseen) VALUES (:flags, :fs, Now())", + "INSERT INTO [format_table_name("player")] (flags, firstseen, lastseen, misc) VALUES (:flags, :fs, Now(), :misc)", list( "flags" = player_flags, - "fs" = migrate_firstseen + "fs" = migrate_firstseen, + "misc" = safe_json_encode(player_misc), ) ) player_first_seen = migrate_firstseen else insert = SSdbcore.ExecuteQuery( - "INSERT INTO [format_table_name("player")] (flags, firstseen, lastseen) VALUES (:flags, Now(), Now())", + "INSERT INTO [format_table_name("player")] (flags, firstseen, lastseen, misc) VALUES (:flags, Now(), Now(), :misc)", list( "flags" = player_flags, + "misc" = safe_json_encode(player_misc), ) ) player_first_seen = time_stamp() @@ -190,10 +209,11 @@ /datum/player_data/proc/_save() qdel(SSdbcore.ExecuteQuery( - "UPDATE [format_table_name("player")] SET flags = :flags WHERE id = :id", + "UPDATE [format_table_name("player")] SET flags = :flags, misc = :misc WHERE id = :id", list( "flags" = player_flags, - "id" = player_id + "id" = player_id, + "misc" = safe_json_encode(player_misc, "{}"), ) )) @@ -211,7 +231,7 @@ qdel(SSdbcore.ExecuteQuery( "UPDATE [format_table_name("player")] SET lastseen = Now() WHERE id = :id", list( - "id" = player_id + "id" = player_id, ) )) return TRUE @@ -229,7 +249,7 @@ * * WARNING: without database, or if this is for a guest key, we will never be available. */ -/datum/player_data/proc/block_on_available(timeout = INFINITY) +/datum/player_data/proc/block_on_available(timeout = 10 SECONDS) var/timed_out = world.time + timeout UNTIL(!isnull(available) || world.time > timed_out) return available diff --git a/code/modules/client/game_preferences/entries/game.dm b/code/modules/client/game_preferences/entries/game.dm new file mode 100644 index 000000000000..e409bbc6037e --- /dev/null +++ b/code/modules/client/game_preferences/entries/game.dm @@ -0,0 +1,73 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +/datum/game_preference_entry/dropdown/hud_style + name = "HUD Style" + description = "Set the style of your inventory / game HUD" + key = "hud_style" + category = GAME_PREFERENCE_CATEGORY_GAME + subcategory = "HUD Overlay" + legacy_savefile_key = "UI_style" + +/datum/game_preference_entry/dropdown/hud_style/New() + options = list() + for(var/key in all_ui_styles) + options += key + ..() + +/datum/game_preference_entry/dropdown/hud_style/on_set(client/user, value, first_init) + . = ..() + user.set_ui_style(value) + +/datum/game_preference_entry/simple_color/hud_color + name = "HUD Color" + description = "Manually recolor your inventory / game HUD" + key = "hud_color" + category = GAME_PREFERENCE_CATEGORY_GAME + subcategory = "HUD Overlay" + default_value = "#ffffff" + legacy_savefile_key = "UI_style_color" + +/datum/game_preference_entry/simple_color/hud_color/on_set(client/user, value, first_init) + . = ..() + user.set_ui_color(value) + +/datum/game_preference_entry/number/hud_alpha + name = "HUD Alpha" + description = "Manually set the transparency of your inventory / game HUD" + key = "hud_alpha" + category = GAME_PREFERENCE_CATEGORY_GAME + subcategory = "HUD Overlay" + default_value = 255 + min_value = 0 + max_value = 255 + round_to_nearest = 1 + legacy_savefile_key = "UI_style_alpha" + +/datum/game_preference_entry/number/hud_alpha/on_set(client/user, value, first_init) + . = ..() + user.set_ui_alpha(value) + +/datum/game_preference_entry/dropdown/tooltip_style + name = "Tooltips Style" + description = "Set the HUD style of pop up tooltips." + key = "tooltip_style" + category = GAME_PREFERENCE_CATEGORY_GAME + subcategory = "Tooltips" + legacy_savefile_key = "tooltipstyle" + +/datum/game_preference_entry/dropdown/tooltip_style/New() + options = all_tooltip_styles.Copy() + ..() + +/datum/game_preference_entry/simple_color/admin_ooc_color + name = "OOC Color (Admin)" + description = "Choose your OOC color. Do not make it too eye-searing. Set to #000001 or reset to default to sync with server color." + key = "admin_ooc_color" + category = GAME_PREFERENCE_CATEGORY_GAME + subcategory = "OOC" + default_value = "#000001" + legacy_savefile_key = "ooccolor" + +/datum/game_preference_entry/simple_color/admin_ooc_color/is_visible(client/user) + return check_rights(C = user, show_msg = FALSE) && CONFIG_GET(flag/allow_admin_ooccolor) diff --git a/code/modules/client/game_preferences/entries/graphics.dm b/code/modules/client/game_preferences/entries/graphics.dm new file mode 100644 index 000000000000..356f51b3d7ee --- /dev/null +++ b/code/modules/client/game_preferences/entries/graphics.dm @@ -0,0 +1,42 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +/datum/game_preference_entry/toggle/parallax + name = "Parallax Enabled" + description = "Render space via parallax. This should be kept on." + key = "enable_parallax" + category = GAME_PREFERENCE_CATEGORY_GRAPHICS + subcategory = "Parallax" + default_value = TRUE + +/datum/game_preference_entry/toggle/parallax/on_set(client/user, value, first_init) + . = ..() + user.parallax_holder?.reset() + +/datum/game_preference_entry/toggle/ambient_occlusion + name = "Fake Ambient Occlusion" + description = "Fake, filter ambient occlusion. This should be kept off." + key = "fake_ambient_occlusion" + category = GAME_PREFERENCE_CATEGORY_GRAPHICS + subcategory = "Rendering" + default_value = FALSE + +/datum/game_preference_entry/toggle/ambient_occlusion/on_set(client/user, value, first_init) + . = ..() + user.using_perspective?.planes?.sync_owner(user) + +/datum/game_preference_entry/number/fps + name = "FPS" + description = "Client rendering FPS. It is recommended to set this to a multiple of the server's tickrate. 0 to sync with server." + key = "client_fps" + category = GAME_PREFERENCE_CATEGORY_GRAPHICS + subcategory = "Rendering" + default_value = 0 + min_value = 0 + max_value = 180 + round_to_nearest = 1 + legacy_savefile_key = "client_fps" + +/datum/game_preference_entry/number/fps/on_set(client/user, value, first_init) + . = ..() + user.fps = value diff --git a/code/modules/client/game_preferences/game_preference_entry.dm b/code/modules/client/game_preferences/game_preference_entry.dm new file mode 100644 index 000000000000..dcda4489a5d8 --- /dev/null +++ b/code/modules/client/game_preferences/game_preference_entry.dm @@ -0,0 +1,149 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +/datum/game_preference_entry + abstract_type = /datum/game_preference_entry + var/name = "-- broken entry --" + var/description = "A preference entry." + /// Must be unique + var/key + var/category = "Misc" + var/subcategory = "Misc" + /// priority - higher means it appears first. only valid within the same category. + var/priority = 0 + /// default value + var/default_value + /// legacy import id - set if it's using new global prefs system + var/legacy_global_key + /// legacy import id - set if it's using old savefile direct write + var/legacy_savefile_key + +/datum/game_preference_entry/proc/default_value(client/user) + return default_value + +/datum/game_preference_entry/proc/is_visible(client/user, silent) + return TRUE + +/** + * called when a value is changed with a client active + * + * @params + * * user - active client + * * value - current (sanitized) value + * * first_init - are we being called as a client is first being associated to a preferences datum, or on first load? + */ +/datum/game_preference_entry/proc/on_set(client/user, value, first_init) + return + +/datum/game_preference_entry/proc/filter_value(value) + return value + +/datum/game_preference_entry/proc/migrate_legacy_data(data) + return data + +/datum/game_preference_entry/proc/tgui_preference_schema() + return list( + "key" = key, + "category" = category, + "subcategory" = subcategory, + "name" = name, + "desc" = description, + "priority" = priority, + "defaultValue" = default_value, + ) + +/datum/game_preference_entry/number + abstract_type = /datum/game_preference_entry/number + default_value = 0 + /// optional + var/min_value + /// optional + var/max_value + /// optional + var/round_to_nearest + +/datum/game_preference_entry/number/filter_value(value) + . = isnum(value)? clamp(value, min_value, max_value) : default_value + if(!isnull(.) && round_to_nearest) + . = round(., round_to_nearest) + +/datum/game_preference_entry/number/tgui_preference_schema() + return ..() | list( + "type" = "number", + "minValue" = min_value, + "maxValue" = max_value, + "round_to" = round_to_nearest, + ) + +/datum/game_preference_entry/string + abstract_type = /datum/game_preference_entry/string + default_value = "" + /// mandatory + var/min_length = 0 + /// mandatory + var/max_length = 64 + +/datum/game_preference_entry/string/filter_value(value) + . = "[value]" + return copytext_char(., 1, min(length_char(.) + 1, max_length + 1)) + +/datum/game_preference_entry/string/tgui_preference_schema() + return ..() | list( + "type" = "string", + "minLength" = min_length, + "maxLength" = max_length, + ) + +/datum/game_preference_entry/toggle + abstract_type = /datum/game_preference_entry/toggle + default_value = TRUE + /// mandatory + var/enabled_name = "On" + /// mandatory + var/disabled_name = "Off" + +/datum/game_preference_entry/toggle/filter_value(value) + return !!value + +/datum/game_preference_entry/toggle/tgui_preference_schema() + return ..() | list( + "type" = "toggle", + "enabledName" = enabled_name, + "disabledName" = disabled_name, + ) + +/datum/game_preference_entry/dropdown + abstract_type = /datum/game_preference_entry/dropdown + default_value = null + /// entries must be strings + var/list/options = list() + +/datum/game_preference_entry/dropdown/New() + if(isnull(default_value) && length(options)) + default_value = options[1] + +/datum/game_preference_entry/dropdown/filter_value(value) + return (value in options)? value : ((length(options) && options[1]) || null) + +/datum/game_preference_entry/dropdown/tgui_preference_schema() + return ..() | list( + "type" = "dropdown", + "options" = options, + ) + +/datum/game_preference_entry/simple_color + abstract_type = /datum/game_preference_entry/simple_color + default_value = "#ffffff" + +/datum/game_preference_entry/simple_color/filter_value(value) + return sanitize_hexcolor( + value, + desired_format = 6, + include_crunch = TRUE, + default = default_value, + ) + +/datum/game_preference_entry/simple_color/tgui_preference_schema() + return ..() | list( + "type" = "simpleColor", + ) diff --git a/code/modules/client/game_preferences/game_preference_middleware.dm b/code/modules/client/game_preferences/game_preference_middleware.dm new file mode 100644 index 000000000000..b7a210287cf1 --- /dev/null +++ b/code/modules/client/game_preferences/game_preference_middleware.dm @@ -0,0 +1,47 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +/// key value id = middleware instance +GLOBAL_LIST_INIT(game_preference_middleware, init_game_preference_middleware()) + +/proc/init_game_preference_middleware() + var/list/keyed_middleware = list() + for(var/datum/game_preference_middleware/middleware as anything in subtypesof(/datum/game_preference_middleware)) + middleware = new middleware + keyed_middleware[middleware.key] = middleware + GLOB.game_preference_middleware = keyed_middleware + return keyed_middleware + +/datum/game_preference_middleware + /// category name + var/name + /// key + var/key + +/** + * return TRUE to stop handling + * + * we assume the 'usr' has been validated by the prefs datum! + */ +/datum/game_preference_middleware/proc/handle_topic(datum/game_preferences/prefs, action, list/params) + return FALSE + +/** + * when we want to reset whatever this handles + */ +/datum/game_preference_middleware/proc/handle_reset(datum/game_preferences/prefs) + prefs.mark_dirty() + return + +/** + * sanitize everything + */ +/datum/game_preference_middleware/proc/handle_sanitize(datum/game_preferences/prefs) + prefs.mark_dirty() + return + +/** + * on initial load + */ +/datum/game_preference_middleware/proc/on_initial_load(datum/game_preferences/prefs) + return diff --git a/code/modules/client/game_preferences/game_preference_toggle.dm b/code/modules/client/game_preferences/game_preference_toggle.dm new file mode 100644 index 000000000000..db431f3d9850 --- /dev/null +++ b/code/modules/client/game_preferences/game_preference_toggle.dm @@ -0,0 +1,270 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +/datum/game_preference_toggle + abstract_type = /datum/game_preference_toggle + var/name = "A Toggle" + var/description = "Someone fucked up" + var/enabled_name = "On" + var/disabled_name = "Off" + /// must be unique + var/key + var/category = "Misc" + /// priority - higher means it appears first. only valid within the same category. + var/priority = 0 + /// legacy import id + var/legacy_key + var/default_value = TRUE + +/datum/game_preference_toggle/proc/toggled(client/user, state) + return + +/datum/game_preference_toggle/proc/is_visible(client/user) + return TRUE + +/datum/game_preference_toggle/proc/tgui_preference_schema() + return list( + "key" = key, + "category" = category, + "priority" = priority, + "default" = default_value, + "name" = name, + "desc" = description, + "enabled" = enabled_name, + "disabled" = disabled_name, + ) + +/datum/game_preference_toggle/admin + abstract_type = /datum/game_preference_toggle/admin + category = "Admin" + +/datum/game_preference_toggle/admin/is_visible(client/user, silent) + return check_rights(C = user, show_msg = FALSE) + +/datum/game_preference_toggle/admin/global_looc + name = "Remote LOOC Sight" + description = "See all LOOC, regardless of location." + key = "admin_global_looc" + default_value = TRUE + legacy_key = "CHAT_RLOOC" + +/datum/game_preference_toggle/admin/obfuscate_stealth_dsay + name = "Obfuscate Stealthmin Dsay" + description = "Randomize ckey to a list of joke ckeys when dsay'ing while stealthed." + key = "admin_obfuscate_stealth_dsay" + default_value = TRUE + legacy_key = "OBFUSCATE_STEALTH_DSAY" + +/datum/game_preference_toggle/admin/stealth_hides_ghost + name = "Stealthmin Hides Ghost" + description = "Hide your ghost while stealthed." + key = "admin_hide_stealth_ghost" + default_value = TRUE + +/datum/game_preference_toggle/chat + abstract_type = /datum/game_preference_toggle/chat + category = "Chat" + +/datum/game_preference_toggle/chat/ooc + name = "OOC enabled" + description = "Toggles whether you see OOC (Out of Character) chat." + legacy_key = "CHAT_OOC" + key = "toggle_ooc" + +/datum/game_preference_toggle/chat/looc + name = "LOOC enabled" + description = "Toggles whether you see LOOC (Local Out of Character) chat." + legacy_key = "CHAT_LOOC" + key = "toggle_looc" + +/datum/game_preference_toggle/chat/dsay + name = "Deadchat enabled" + description = "Toggles whether you see dead chat." + legacy_key = "CHAT_DEAD" + key = "toggle_deadchat" + +/datum/game_preference_toggle/chat/legacy_chat_tags + name = "Chat Tags" + description = "Legacy chat visual system for tags to the left of messages; you should likely keep this on." + key = "legacy_chat_tags" + default_value = TRUE + legacy_key = "CHAT_SHOWICONS" + +/datum/game_preference_toggle/chat/language_indicators + name = "Language Indicators" + description = "Show language indicators in the chat when you hear a known language." + key = "language_indicators" + default_value = TRUE + legacy_key = "LANGUAGE_INDICATOR" + +/datum/game_preference_toggle/game + abstract_type = /datum/game_preference_toggle/game + category = "Game" + +/datum/game_preference_toggle/game/mob_tooltips + name = "Mob Tooltips" + key = "mob_tooltips" + legacy_key = "MOB_TOOLTIPS" + +/datum/game_preference_toggle/game/overhead_chat + name = "Overhead Chat" + key = "runechat" + legacy_key = "OVERHEAD_CHAT" + description = "Enable rendering messages sent by mobs over their icon on the map." + +/datum/game_preference_toggle/game/help_intent_firing + name = "Help Intent Gun Safety" + description = "If on, do not allow firing weapons in help intent." + key = "help_intent_gun_safety" + legacy_key = "HELP_INTENT_SAFETY" + default_value = FALSE + +/datum/game_preference_toggle/game/legacy_name_highlight + name = "Emphasize Name Mentions" + description = "Enlargen messages calling you by name." + key = "legacy_name_mention" + legacy_key = "CHAT_MENTION" + +/datum/game_preference_toggle/ambience + abstract_type = /datum/game_preference_toggle/ambience + category = "Sound - Ambience" + +/datum/game_preference_toggle/ambience/area_ambience + name = "Area Ambience" + key = "area_ambience" + default_value = TRUE + +/datum/game_preference_toggle/ambience/supermatter_hum + name = "Supermatter Hum" + key = "supermatter_ambience" + legacy_key = "SOUND_SUPERMATTER" + default_value = TRUE + +/datum/game_preference_toggle/ambience/weather + name = "Weather Sounds" + key = "weather_ambience" + legacy_key = "SOUND_WEATHER" + default_value = TRUE + +/datum/game_preference_toggle/ambience/atmospherics + name = "Atmos Machinery Sounds" + key = "atmos_machine_ambience" + default_value = TRUE + legacy_key = "SOUND_AIRPUMP" + +/datum/game_preference_toggle/sfx + abstract_type = /datum/game_preference_toggle/sfx + category = "Sound - Effects" + +/datum/game_preference_toggle/sfx/instruments + name = "Instruments" + description = "Play sounds from in-game instruments." + key = "instrument_music" + legacy_key = "SOUND_INSTRUMENT" + +/datum/game_preference_toggle/music + abstract_type = /datum/game_preference_toggle/music + category = "Sound - Music" + +/datum/game_preference_toggle/music/lobby + name = "Lobby Music" + description = "Play music in the lobby." + key = "lobby_music" + legacy_key = "SOUND_LOBBY" + +/datum/game_preference_toggle/music/lobby/toggled(client/user, state) + if(state) + user.playtitlemusic() + else + user.media?.stop_music() + +/datum/game_preference_toggle/music/admin + name = "Admin Music" + description = "Play admin MIDIs (or really just music nowadays)." + key = "admin_music" + legacy_key = "SOUND_MIDI" + +/datum/game_preference_toggle/music/jukebox + name = "Jukebox Music" + description = "Play in-game jukebox music." + key = "jukebox_music" + legacy_key = "SOUND_JUKEBOX" + +/datum/game_preference_toggle/music/jukebox/toggled(client/user, state) + // todo: jukebox / music rework + if(state) + user.mob?.update_music() + else + user.mob?.stop_all_music() + +// todo: this should probably not be in toggles + +/datum/game_preference_toggle/vore_sounds + abstract_type = /datum/game_preference_toggle/vore_sounds + category = "Sound - Vore" + +/datum/game_preference_toggle/vore_sounds/eating_noises + name = "Eating Noises" + key = "vore_eating_sounds" + default_value = FALSE + legacy_key = "EATING_NOISES" + +/datum/game_preference_toggle/vore_sounds/digestion_noises + name = "Digestion Noises" + key = "vore_digestion_sounds" + default_value = FALSE + legacy_key = "DIGEST_NOISES" + +/datum/game_preference_toggle/observer + abstract_type = /datum/game_preference_toggle/observer + category = "Observer" + +/datum/game_preference_toggle/observer/ghost_ears + name = "Hear All Speech" + description = "Hear all speech, regardless of distance" + key = "ghost_ears" + default_value = TRUE + legacy_key = "CHAT_GHOSTEARS" + +/datum/game_preference_toggle/observer/ghost_sight + name = "See All Emotes" + description = "See all emotes, regardless of distance" + key = "ghost_sight" + default_value = TRUE + legacy_key = "CHAT_GHOSTSIGHT" + +/datum/game_preference_toggle/observer/ghost_radio + name = "Hear All Radio" + description = "Hear all radio chatter, regardless of distance" + key = "ghost_radio" + default_value = TRUE + legacy_key = "CHAT_GHOSTRADIO" + +/datum/game_preference_toggle/observer/ghost_subtle + name = "See Subtle Emotes" + description = "See subtle emotes" + key = "ghost_subtle" + default_value = TRUE + legacy_key = "SUBTLE_SEE" + +/datum/game_preference_toggle/presence + abstract_type = /datum/game_preference_toggle/presence + category = "Presence" + +/datum/game_preference_toggle/presence/anonymous_ghost_chat + name = "Anonymous Ghost Chat" + description = "Hide your ckey when speaking in deadchat." + key = "hide_ckey_from_deadchat" + default_value = TRUE + +/datum/game_preference_toggle/presence/show_advanced_who + name = "Show Status in Advanced Who" + description = "Show your playing status in advanced who." + key = "advanced_who_status" + default_value = FALSE + +/datum/game_preference_toggle/presence/announce_ghost_joinleave + name = "Announce Observer Join/Leave" + description = "Announce to deadchat when you enter or exit deadchat." + key = "announce_ghost_joinleave" + default_value = FALSE diff --git a/code/modules/client/game_preferences/game_preferences.dm b/code/modules/client/game_preferences/game_preferences.dm new file mode 100644 index 000000000000..3c8da9b94037 --- /dev/null +++ b/code/modules/client/game_preferences/game_preferences.dm @@ -0,0 +1,609 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +/** + * Game preferences + * + * Game prefs don't need an init order because unlike character setup, there's no dependencies, in theory. + */ +/datum/game_preferences + //* Loading *// + /// loaded? + var/initialized = FALSE + + //* Preferences *// + /// preferences by key - key = value + var/list/entries_by_key + /// arbitrary key access used by middleware + var/list/misc_by_key + // todo: move menu options in here and not from /datum/preferences + + //* Middleware - Keybindings *// + /// keybindings - key to list of keybinds + var/list/keybindings + + //* Middleware - Toggles *// + /// toggles by key - TRUE or FALSE + var/list/toggles_by_key + + //* System *// + /// were we originally sql loaded? + /// used to determine if sql is authoritative when sql comes back + /// + /// - if sql was originally loaded and sql comes back, we are still authoritative + /// - if sql wasn't originally loaded and sql comes back and a sql save exists, we are overwritten + /// - if a save doesn't exist, we are authoritative and are flushed to sql + var/authoritatively_loaded_by_sql = FALSE + /// something fucky wucky happened and the next time sql comes back, + /// we need to flush data and assert authoritativeness + var/sql_state_desynced = FALSE + /// our player's ckey + var/ckey + /// we are a guest + var/is_guest = FALSE + /// our active client + var/client/active + /// our player's id + /// + /// set upon successful sql save + /// we will try to load a sql preferences of a given playerid + /// when we load from sql + var/authoritative_player_id + /// our prefs version + var/version = GAME_PREFERENCES_VERSION_CURRENT + /// are we saved? if TRUE, we have modified vars + var/is_dirty = FALSE + +/datum/game_preferences/New(key, ckey) + src.ckey = ckey + src.is_guest = IsGuestKey(key) + +//* Init *// + +/datum/game_preferences/proc/initialize() + perform_initial_load() + initialized = TRUE + +/datum/game_preferences/proc/on_reconnect() + if(!initialized) + return + initialize_client() + +/datum/game_preferences/proc/block_on_initialized(timeout = 10 SECONDS) + var/wait_until = world.time + timeout + UNTIL(initialized || (world.time >= wait_until)) + if(!initialized) + . = FALSE + CRASH("block_on_initialize timeout") + return initialized + +/datum/game_preferences/proc/initialize_client() + if(isnull(active)) + return + for(var/key in SSpreferences.entries_by_key) + var/datum/game_preference_entry/entry = SSpreferences.entries_by_key[key] + var/value = entries_by_key[entry.key] + entry.on_set(active, value, TRUE) + for(var/key in GLOB.game_preference_middleware) + var/datum/game_preference_middleware/middleware = GLOB.game_preference_middleware[key] + middleware.on_initial_load(src) + +/datum/game_preferences/proc/oops_sql_came_back_perform_a_reload() + // if we were sql loaded, don't desync from sql + if(authoritatively_loaded_by_sql) + if(!sql_state_desynced) + return + if(active) + to_chat(active, SPAN_BOLDANNOUNCE("The server's SQL database has reconnected and your preferences were changed during the lapse. Your preferences has been automatically flushed to database.")) + save_to_sql() + return + // load from sql if we can; SQL is authoritative + if(load_from_sql()) + if(active) + to_chat(active, SPAN_BOLDANNOUNCE("The server's SQL database has reconnected and your preferences were found to be fully desynced from the copy in the database. Your preferences has been automatically reloaded from the database. Please ensure all settings are workable.")) + return + // otherwise, save our current changes to SQL + save_to_sql() + if(active) + to_chat(active, SPAN_BOLDANNOUNCE("The server's SQL database has reconnected and your preferences were not found in them. Your preferences have been automatically saved to database.")) + +/datum/game_preferences/proc/perform_legacy_migration() + if(is_guest) + return FALSE + if(!fexists("data/player_saves/[copytext(ckey, 1, 2)]/[ckey]/preferences.sav")) + return FALSE + var/savefile/legacy_savefile = new /savefile("data/player_saves/[copytext(ckey, 1, 2)]/[ckey]/preferences.sav") + var/list/legacy_options + legacy_savefile["global"] >> legacy_options + if(isnull(legacy_options)) + legacy_options = list() + + // we are fired after reset, but before save + // we assume lists are init'd + for(var/key in SSpreferences.entries_by_key) + var/datum/game_preference_entry/entry = SSpreferences.entries_by_key[key] + var/migrated_value + if(entry.legacy_global_key) + migrated_value = legacy_options[entry.legacy_global_key] + else if(entry.legacy_savefile_key) + legacy_savefile[entry.legacy_savefile_key] >> migrated_value + if(!isnull(migrated_value)) + migrated_value = entry.filter_value(migrated_value) + entries_by_key[key] = migrated_value + + var/list/old_toggles + legacy_savefile["preferences"] >> old_toggles + + for(var/key in SSpreferences.toggles_by_key) + var/datum/game_preference_toggle/toggle = SSpreferences.toggles_by_key[key] + if(!toggle.legacy_key) + continue + toggles_by_key[key] = (toggle.legacy_key in old_toggles) + + var/list/old_keybinds + legacy_savefile["key_bindings"] >> old_keybinds + keybindings = sanitize_islist(old_keybinds) + + var/old_hotkeys + legacy_savefile["hotkeys"] >> old_hotkeys + misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE] = !!old_hotkeys + + return TRUE + +/datum/game_preferences/proc/perform_initial_load() + if(!is_guest) + // only if not guest + if(SSdbcore.IsConnected()) + // sql mode + // load + if(!load_from_sql()) + // if not, load from file + if(!load_from_file()) + // if not, reset to defaults + full_reset() + // perform legacy migration to see if there's data + if(perform_legacy_migration()) + // something was there, set our version to legacy + version = GAME_PREFERENCES_VERSION_LEGACY + // save results to sql, as sql is authoritative + save_to_sql() + // synchronize sql to file for backup for when sql is down + save_to_file() + else + // synchronize sql to file for backup for when sql is down + save_to_file() + else + // normal mode + // load + if(!load_from_file()) + // if not, reset to defaults + full_reset() + // perform legacy migration to see if there's data + if(perform_legacy_migration()) + // something was there, set our version to legacy + version = GAME_PREFERENCES_VERSION_LEGACY + // save to file + save_to_file() + + // do we need to migrate? + if(version < GAME_PREFERENCES_VERSION_CURRENT) + // yes + if(!perform_migration_sequence()) + // reset to defaults if failed + full_reset() + // perform save + if(SSdbcore.IsConnected()) + save_to_sql() + else + save_to_file() + else + // if guest, just reset lmao + full_reset() + + // todo: shouldn't we save after sanitize..? + sanitize_everything() + // loaded; push initial update triggers. + initialize_client() + // initialized! + initialized = TRUE + +/** + * @return FALSE if failed + */ +/datum/game_preferences/proc/perform_migration_sequence() + if(version <= GAME_PREFERENCES_VERSION_DROP) + return FALSE + perform_migrations(version) + version = GAME_PREFERENCES_VERSION_CURRENT + +/datum/game_preferences/proc/perform_migrations(from_version) + PRIVATE_PROC(TRUE) + +//* Reset *// + +/datum/game_preferences/proc/reset(category) + if(!category) + entries_by_key = list() + for(var/key in SSpreferences.entries_by_key) + var/datum/game_preference_entry/entry = SSpreferences.entries_by_key[key] + if(category && entry.category != category) + continue + var/value = entry.default_value(active) + entries_by_key[entry.key] = value + if(!isnull(active)) + entry.on_set(active, value, TRUE) + mark_dirty() + push_ui_data(data = list("values" = entries_by_key)) + +/datum/game_preferences/proc/full_reset() + // reset misc stuff first as everything potentially uses it + misc_by_key = list() + // reset normal categories + reset() + // reset middleware + for(var/id in GLOB.game_preference_middleware) + var/datum/game_preference_middleware/middleware = GLOB.game_preference_middleware[id] + middleware.handle_reset(src) + +//* Set / Get *// + +/datum/game_preferences/proc/set_toggle(datum/game_preference_toggle/id_path_instance, value) + var/datum/game_preference_toggle/toggle = SSpreferences.resolve_preference_toggle(id_path_instance) + if(isnull(toggle)) + CRASH("invalid fetch") + if(!initialized) + return FALSE + // we don't check is visible, as it's checked on 'get' + // if(!toggle.is_visible(active)) + // return FALSE + toggles_by_key[toggle.key] = value + if(active) + toggle.toggled(active, value) + mark_dirty() + return TRUE + +/datum/game_preferences/proc/toggle(datum/game_preference_toggle/id_path_instance) + var/datum/game_preference_toggle/toggle = SSpreferences.resolve_preference_toggle(id_path_instance) + if(isnull(toggle)) + CRASH("invalid fetch") + if(!initialized) + return FALSE + // we don't check is visible, as it's checked on 'get' + // if(!toggle.is_visible(active)) + // return FALSE + toggles_by_key[toggle.key] = !toggles_by_key[toggle.key] + if(active) + toggle.toggled(active, toggles_by_key[toggle.key]) + mark_dirty() + return TRUE + +/datum/game_preferences/proc/get_toggle(datum/game_preference_toggle/id_path_instance) + var/datum/game_preference_toggle/toggle = SSpreferences.resolve_preference_toggle(id_path_instance) + if(isnull(toggle)) + CRASH("invalid fetch") + if(!initialized) + return toggle.default_value + if(!toggle.is_visible(active, TRUE)) + return toggle.default_value + return toggles_by_key[toggle.key] + +/datum/game_preferences/proc/set_entry(datum/game_preference_entry/id_path_instance, value) + var/datum/game_preference_entry/entry = SSpreferences.resolve_preference_entry(id_path_instance) + if(isnull(entry)) + CRASH("invalid fetch") + if(!initialized) + return FALSE + if(!entry.is_visible(active, TRUE)) + return FALSE + value = entry.filter_value(value) + entries_by_key[entry.key] = value + if(active) + entry.on_set(active, value, FALSE) + mark_dirty() + push_ui_data(data = list("values" = entries_by_key)) + return TRUE + +/datum/game_preferences/proc/get_entry(datum/game_preference_entry/id_path_instance) + var/datum/game_preference_entry/entry = SSpreferences.resolve_preference_entry(id_path_instance) + if(isnull(entry)) + CRASH("invalid fetch") + if(!initialized) + return entry.default_value(active) + if(!entry.is_visible(active, TRUE)) + return entry.default_value(active) + return entries_by_key[entry.key] + +//* Save / Load *// + +/datum/game_preferences/proc/auto_save() + if(!is_dirty) + return + sanitize_everything() + save() + +/datum/game_preferences/proc/mark_dirty() + is_dirty = TRUE + push_ui_data(data = list("dirty" = TRUE)) + +/datum/game_preferences/proc/mark_saved() + is_dirty = FALSE + push_ui_data(data = list("dirty" = FALSE)) + +/datum/game_preferences/proc/save() + if(!initialized) + return FALSE + if(SSdbcore.Connect()) + return save_to_sql() + else + return save_to_file() + +/datum/game_preferences/proc/load() + if(!initialized) + return FALSE + if(SSdbcore.Connect()) + . = load_from_sql() + else + . = load_from_file() + sanitize_everything() + initialize_client() + +/** + * this proc does not sanitize! + * + * @return FALSE if we couldn't load + */ +/datum/game_preferences/proc/load_from_sql() + var/datum/player_data/player_data = resolve_player_data(ckey) + if(!player_data.block_on_available(10 SECONDS)) + message_admins(SPAN_BOLDANNOUNCE("failed to resolve player data during prefs op for [ckey]. ping maintainers.")) + CRASH("failed to grab player data while loading via sql. something bad has happened!") + authoritative_player_id = player_data.player_id + + var/mob/allow_admin_proccalls = usr + usr = null + + var/datum/db_query/query = SSdbcore.NewQuery( + "SELECT `toggles`, `entries`, `misc`, `keybinds`, `version` FROM [format_table_name("game_preferences")] \ + WHERE `player` = :player", + list( + "player" = authoritative_player_id, + ), + ) + + usr = allow_admin_proccalls + + query.warn_execute(FALSE) + if(!query.NextRow()) + qdel(query) + return FALSE + var/toggles_json = query.item[1] + var/entries_json = query.item[2] + var/misc_json = query.item[3] + var/keybinds_json = query.item[4] + var/loaded_version = query.item[5] + + toggles_by_key = sanitize_islist(safe_json_decode(toggles_json)) + entries_by_key = sanitize_islist(safe_json_decode(entries_json)) + misc_by_key = sanitize_islist(safe_json_decode(misc_json)) + keybindings = sanitize_islist(safe_json_decode(keybinds_json)) + version = loaded_version + + qdel(query) + + authoritatively_loaded_by_sql = TRUE + mark_saved() + update_static_data() + + return TRUE + +/datum/game_preferences/proc/save_to_sql() + var/datum/player_data/player_data = resolve_player_data(ckey) + if(!player_data.block_on_available(10 SECONDS)) + message_admins(SPAN_BOLDANNOUNCE("failed to resolve player data during prefs op for [ckey]. ping maintainers.")) + CRASH("failed to grab player data while loading via sql. something bad has happened!") + authoritative_player_id = player_data.player_id + + var/mob/allow_admin_proccalls = usr + usr = null + + var/datum/db_query/query = SSdbcore.NewQuery( + "INSERT INTO [format_table_name("game_preferences")] \ + (`player`, `toggles`, `entries`, `misc`, `keybinds`, `version`, `modified`) VALUES \ + (:player, :toggles, :entries, :misc, :keybinds, :version, Now()) ON DUPLICATE KEY UPDATE \ + `player` = VALUES(player), `toggles` = VALUES(toggles), `entries` = VALUES(entries), `misc` = VALUES(misc), \ + `keybinds` = VALUES(keybinds), `version` = VALUES(version), `modified` = Now()", + list( + "player" = authoritative_player_id, + "toggles" = safe_json_encode(toggles_by_key), + "entries" = safe_json_encode(entries_by_key), + "misc" = safe_json_encode(misc_by_key), + "keybinds" = safe_json_encode(keybindings), + "version" = version, + ) + ) + + usr = allow_admin_proccalls + + query.warn_execute(FALSE) + qdel(query) + + mark_saved() + authoritatively_loaded_by_sql = TRUE + sql_state_desynced = FALSE + + return TRUE + +/datum/game_preferences/proc/file_path() + return "data/players/[copytext(ckey, 1, 2)]/[ckey]/preferences.json" + +/** + * this proc does not sanitize! + * + * @return FALSE if we couldn't load + */ +/datum/game_preferences/proc/load_from_file() + var/savefile_path = file_path() + + if(!fexists(savefile_path)) + return FALSE + + var/list/deserialized = safe_json_decode(file2text(savefile_path)) + + entries_by_key = sanitize_islist(deserialized["entries"]) + toggles_by_key =sanitize_islist( deserialized["toggles"]) + keybindings = sanitize_islist(deserialized["keybindings"]) + misc_by_key = sanitize_islist(deserialized["misc"]) + + if(authoritatively_loaded_by_sql) + sql_state_desynced = TRUE + mark_saved() + update_static_data() + + return TRUE + +/datum/game_preferences/proc/save_to_file() + var/savefile_path = file_path() + + var/list/serializing = list( + "entries" = entries_by_key, + "toggles" = toggles_by_key, + "keybindings" = keybindings, + "misc" = misc_by_key, + ) + + if(fexists(savefile_path)) + fdel(savefile_path) + + text2file(safe_json_encode(serializing), savefile_path) + mark_saved() + + if(authoritatively_loaded_by_sql) + sql_state_desynced = TRUE + + return TRUE + +/datum/game_preferences/proc/sanitize_everything() + // reset middleware + for(var/id in GLOB.game_preference_middleware) + var/datum/game_preference_middleware/middleware = GLOB.game_preference_middleware[id] + middleware.handle_sanitize(src) + for(var/key in SSpreferences.entries_by_key) + var/datum/game_preference_entry/entry = SSpreferences.entries_by_key[key] + var/current_value = entries_by_key[key] + entries_by_key[key] = entry.filter_value(current_value) + mark_dirty() + +//* UI *// + +/datum/game_preferences/ui_static_data(mob/user, datum/tgui/ui) + . = ..() + var/list/middleware = list() + for(var/key in GLOB.game_preference_middleware) + var/datum/game_preference_middleware/middleware_instance = GLOB.game_preference_middleware[key] + middleware[key] = middleware_instance.name + .["middleware"] = middleware + var/list/entries = list() + for(var/key in SSpreferences.entries_by_key) + var/datum/game_preference_entry/entry = SSpreferences.entries_by_key[key] + if(!entry.is_visible(user?.client, TRUE)) + continue + entries[++entries.len] = entry.tgui_preference_schema() + .["entries"] = entries + .["values"] = entries_by_key + +// todo: when do we refactor tgui again i don't like ui_interact because i'm a snowflake who likes being different +// (real complaint: ui_interact is weird for being called from tgui as well as from external) +// (update procs should be internally called, imo, not the 'open ui' proc, it leads to) +// (confusion when people add code with side effects like shocking people on touch in it.) +/datum/game_preferences/ui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui) + if(!initialized) + to_chat(user, SPAN_BOLDANNOUNCE("Your preferences are still being loaded. Please wait.")) + return + ui = SStgui.try_update_ui(user, src, ui) + if(isnull(ui)) + ui = new(user, src, "GamePreferences") + for(var/key in GLOB.game_preference_middleware) + var/datum/game_preference_middleware/middleware = GLOB.game_preference_middleware[key] + ui.register_module(middleware, key) + ui.set_autoupdate(FALSE) + ui.open() + +/datum/game_preferences/ui_route(action, list/params, datum/tgui/ui, id) + . = ..() + if(.) + return + var/datum/game_preference_middleware/middleware = GLOB.game_preference_middleware[id] + if(middleware?.handle_topic(src, action, params)) + return TRUE + +/datum/game_preferences/ui_status(mob/user, datum/ui_state/state) + if(user.ckey == ckey) + return UI_INTERACTIVE + if(check_rights(C = user, rights_required = R_DEBUG)) + return UI_INTERACTIVE + return UI_CLOSE + +/datum/game_preferences/ui_act(action, list/params, datum/tgui/ui) + . = ..() + if(.) + return + switch(action) + if("set") + var/key = params["key"] + if(isnull(SSpreferences.entries_by_key[key])) + return TRUE + set_entry(key, params["value"]) + return TRUE + if("reset") + reset(params["category"]) + return TRUE + if("save") + auto_save() + return TRUE + if("discard") + load() + return TRUE + +//? Client Wrappers ?// + +/client/proc/get_preference_toggle(datum/game_preference_toggle/id_path_instance) + var/datum/game_preference_toggle/toggle = SSpreferences.resolve_preference_toggle(id_path_instance) + if(isnull(toggle)) + CRASH("invalid fetch") + if(!initialized || !preferences.initialized) + return toggle.default_value + if(!toggle.is_visible(src, TRUE)) + return toggle.default_value + return preferences.toggles_by_key[toggle.key] + +/client/proc/get_preference_entry(datum/game_preference_entry/id_path_instance) + var/datum/game_preference_entry/entry = SSpreferences.resolve_preference_entry(id_path_instance) + if(isnull(entry)) + CRASH("invalid fetch") + if(!initialized) + return entry.default_value(src) + if(!entry.is_visible(src, TRUE)) + return entry.default_value(src) + return preferences.entries_by_key[entry.key] + +//? Mob Wrappers ?// + +/mob/proc/get_preference_toggle(datum/game_preference_toggle/id_path_instance) + var/datum/game_preference_toggle/toggle = SSpreferences.resolve_preference_toggle(id_path_instance) + if(isnull(toggle)) + CRASH("invalid fetch") + if(!client?.initialized || !client.preferences.initialized) + return toggle.default_value + if(!toggle.is_visible(client, TRUE)) + return toggle.default_value + return client.preferences.toggles_by_key[toggle.key] + +/mob/proc/get_preference_entry(datum/game_preference_entry/id_path_instance) + var/datum/game_preference_entry/entry = SSpreferences.resolve_preference_entry(id_path_instance) + if(isnull(entry)) + CRASH("invalid fetch") + if(!client?.initialized || !client.preferences.initialized) + return entry.default_value(client) + if(!entry.is_visible(client, TRUE)) + return entry.default_value(client) + return client.preferences.entries_by_key[entry.key] diff --git a/code/modules/client/game_preferences/middleware/keybindings.dm b/code/modules/client/game_preferences/middleware/keybindings.dm new file mode 100644 index 000000000000..006a156a7a5d --- /dev/null +++ b/code/modules/client/game_preferences/middleware/keybindings.dm @@ -0,0 +1,140 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +/datum/game_preference_middleware/keybindings + name = "Keybindings" + key = "keybindings" + +/datum/game_preference_middleware/keybindings/on_initial_load(datum/game_preferences/prefs) + prefs.active?.update_movement_keys(src) + prefs.active?.set_macros() + return ..() + +/datum/game_preference_middleware/keybindings/handle_reset(datum/game_preferences/prefs) + . = ..() + + prefs.keybindings = list() + // don't change their hotkey mode.. unless it was never there. + prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE] = \ + isnull(prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE])? TRUE : !!prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE] + var/hotkey_mode = prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE] + var/list/defaults = deep_copy_list(hotkey_mode? GLOB.hotkey_keybinding_list_by_key : GLOB.classic_keybinding_list_by_key) + prefs.keybindings = defaults + + prefs.push_ui_modules(updates = list((src.key) = list( + "bindings" = prefs.keybindings, + "hotkeyMode" = prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE], + ))) + +/datum/game_preference_middleware/keybindings/handle_topic(datum/game_preferences/prefs, action, list/params) + . = ..() + if(.) + return + switch(action) + if("reset") + handle_reset(prefs) + return TRUE + if("hotkeys") + var/value = params["value"] + if(prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE] == value) + return TRUE + prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE] = !!value + prefs.mark_dirty() + prefs.push_ui_modules(updates = list((src.key) = list( + "hotkeyMode" = value, + ))) + prefs.active?.set_macros() + return TRUE + if("addBind") + var/keybind_id = params["keybind"] + // key can be blank if we're only using ctrl/alt/shift!! + var/key = params["key"] + var/alt_depressed = params["alt"] + var/shift_depressed = params["shift"] + var/ctrl_depressed = params["ctrl"] + var/is_numpad = params["numpad"] + var/replacing_key = params["replaceKey"] + var/adding_key = "[alt_depressed? "Alt":""][ctrl_depressed? "Ctrl":""][shift_depressed? "Shift":""][is_numpad? "Numpad":""][key]" + if(!adding_key) + return TRUE + if(adding_key == replacing_key) + return TRUE + if(!isnull(replacing_key)) + prefs.keybindings[replacing_key] -= keybind_id + if(isnull(prefs.keybindings[adding_key])) + prefs.keybindings[adding_key] = list() + if(!(keybind_id in prefs.keybindings[adding_key])) + prefs.keybindings[adding_key] += keybind_id + prefs.push_ui_modules(updates = list((src.key) = list( + "bindings" = prefs.keybindings, + ))) + prefs.active?.update_movement_keys() + return TRUE + if("removeBind") + var/keybind_id = params["keybind"] + var/key = params["key"] + if(!key) + return TRUE + prefs.keybindings[key] -= keybind_id + prefs.push_ui_modules(updates = list((src.key) = list( + "bindings" = prefs.keybindings, + ))) + prefs.active?.update_movement_keys() + return TRUE + +/datum/game_preference_middleware/keybindings/handle_sanitize(datum/game_preferences/prefs) + . = ..() + prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE] = \ + isnull(prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE])? TRUE : !!prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE] + var/list/keys_by_bind_id = list() + //! legacy: get rid of known trash values + prefs.keybindings -= "Unbound" + //! end + for(var/key in prefs.keybindings) + var/had_something = FALSE + if(islist(prefs.keybindings[key])) + var/list/keybind_ids = prefs.keybindings[key] + if(length(keybind_ids) > MAX_COMMANDS_PER_KEY) + keybind_ids.len = MAX_COMMANDS_PER_KEY + for(var/bind_id in prefs.keybindings[key]) + var/datum/keybinding/found = GLOB.keybindings_by_name[bind_id] + if(isnull(found)) + prefs.keybindings[key] -= bind_id + continue + if(isnull(keys_by_bind_id[bind_id])) + keys_by_bind_id[bind_id] = list() + if(length(keys_by_bind_id[bind_id]) > MAX_KEYS_PER_KEYBIND) + prefs.keybindings[key] -= bind_id + continue + keys_by_bind_id[bind_id] += key + had_something = TRUE + if(!had_something) + prefs.keybindings -= key + +/datum/game_preference_middleware/keybindings/ui_static_data(mob/user, datum/tgui/ui) + . = ..() + var/datum/game_preferences/prefs = ui.src_object + .["bindings"] = prefs.keybindings + var/list/constructed_keybinds = list() + for(var/key in GLOB.keybindings_by_name) + var/datum/keybinding/keybind = GLOB.keybindings_by_name[key] + if(!keybind.is_visible(user?.client)) + continue + constructed_keybinds[++constructed_keybinds.len] = keybind.tgui_keybinding_data() + .["keybinds"] = constructed_keybinds + .["hotkeyMode"] = prefs.misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE] + .["maxBinds"] = MAX_KEYS_PER_KEYBIND + .["maxPerKey"] = MAX_COMMANDS_PER_KEY + +//? Preferences Helpers + +/datum/game_preferences/proc/is_hotkeys_mode() + if(!initialized) + return TRUE + return misc_by_key[GAME_PREFERENCE_MISC_KEY_HOTKEY_MODE] + +//? UI Design Assertions + +#if MAX_KEYS_PER_KEYBIND != 3 + #error TGUI for prefs is only designed for 3 bindings per keybind datum. Fix it if you want more. +#endif diff --git a/code/modules/client/game_preferences/middleware/toggles.dm b/code/modules/client/game_preferences/middleware/toggles.dm new file mode 100644 index 000000000000..d055f35fb7a7 --- /dev/null +++ b/code/modules/client/game_preferences/middleware/toggles.dm @@ -0,0 +1,59 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +/datum/game_preference_middleware/toggles + name = "Toggles" + key = "toggles" + +/datum/game_preference_middleware/toggles/handle_reset(datum/game_preferences/prefs) + . = ..() + prefs.toggles_by_key = list() + for(var/key in SSpreferences.toggles_by_key) + var/datum/game_preference_toggle/toggle = SSpreferences.toggles_by_key[key] + prefs.toggles_by_key[toggle.key] = toggle.default_value + + prefs.push_ui_modules(updates = list((src.key) = list( + "states" = prefs.toggles_by_key, + ))) + +/datum/game_preference_middleware/toggles/handle_topic(datum/game_preferences/prefs, action, list/params) + . = ..() + if(.) + return + switch(action) + if("reset") + handle_reset(prefs) + return TRUE + if("toggle") + var/key = params["key"] + if(isnull(SSpreferences.toggles_by_key[key])) + return TRUE + prefs.set_toggle(key, !!params["val"]) + // todo: optimize this + prefs.push_ui_modules(updates = list((src.key) = list( + "states" = prefs.toggles_by_key, + ))) + prefs.mark_dirty() + return TRUE + +/datum/game_preference_middleware/toggles/ui_static_data(mob/user, datum/tgui/ui) + . = ..() + var/datum/game_preferences/prefs = ui.src_object + var/list/collected_toggles = list() + for(var/key in SSpreferences.toggles_by_key) + var/datum/game_preference_toggle/toggle = SSpreferences.toggles_by_key[key] + if(!toggle.is_visible(user?.client)) + continue + collected_toggles[toggle.key] = toggle.tgui_preference_schema() + .["toggles"] = collected_toggles + .["states"] = prefs.toggles_by_key + +/datum/game_preference_middleware/toggles/handle_sanitize(datum/game_preferences/prefs) + . = ..() + prefs.toggles_by_key = sanitize_islist(prefs.toggles_by_key) + for(var/key in prefs.toggles_by_key) + var/datum/game_preference_toggle/toggle = SSpreferences.toggles_by_key[key] + if(isnull(toggle)) + prefs.toggles_by_key -= key + continue + prefs.toggles_by_key[key] = !!prefs.toggles_by_key[key] diff --git a/code/modules/client/onboarding/age_verification.dm b/code/modules/client/onboarding/age_verification.dm index 22ed9ebc5036..f78e2a28a15b 100644 --- a/code/modules/client/onboarding/age_verification.dm +++ b/code/modules/client/onboarding/age_verification.dm @@ -41,7 +41,7 @@ GLOBAL_DATUM_INIT(age_verify_menu, /datum/age_verify_menu, new) /datum/age_verify_menu/ui_interact(mob/user, datum/tgui/ui, datum/tgui/parent_ui) ui = SStgui.try_update_ui(user, src, ui) if(!ui) - ui = new(user, src, "AgeVerifyMenu") + ui = new(user, src, "UIAgeVerifyMenu") ui.open() /datum/age_verify_menu/ui_status(mob/user, datum/ui_state/state) @@ -53,6 +53,7 @@ GLOBAL_DATUM_INIT(age_verify_menu, /datum/age_verify_menu, new) return if(usr.client.is_age_verified()) + qdel(ui) return TRUE var/player_month = text2num(params["month"]) diff --git a/code/modules/client/statpanel.dm b/code/modules/client/statpanel.dm index ff39ae01c0d6..d5062febecfe 100644 --- a/code/modules/client/statpanel.dm +++ b/code/modules/client/statpanel.dm @@ -31,7 +31,7 @@ /client/proc/statpanel_boot_impl() PRIVATE_PROC(TRUE) // give client a second to load - sleep(2 SECONDS) + sleep(world.tick_lag) // loads statbrowser if it isn't there src << browse(file('html/statbrowser.html'), "window=statbrowser") // if it is there and we can't tell because byond is byond, send it a signal to reload @@ -364,6 +364,6 @@ /client/verb/fix_stat_panel() set name = "Fix Stat Panel" - set category = "OOC" + set category = VERB_CATEGORY_OOC statpanel_reset() diff --git a/code/modules/client/ui_style.dm b/code/modules/client/ui_style.dm index 77e7600b33c0..c5d18f8c4a01 100644 --- a/code/modules/client/ui_style.dm +++ b/code/modules/client/ui_style.dm @@ -1,6 +1,8 @@ +// todo: lol we should datumize these probably? +// todo: refactor all of this -/var/all_ui_styles = list( +/var/global/list/all_ui_styles = list( UI_STYLE_MIDNIGHT = 'icons/mob/screen/midnight.dmi', UI_STYLE_ORANGE = 'icons/mob/screen/orange.dmi', UI_STYLE_OLD = 'icons/mob/screen/old.dmi', @@ -10,7 +12,7 @@ UI_STYLE_HOLOGRAM = 'icons/mob/screen/holo.dmi' ) -/var/all_ui_styles_robot = list( +/var/global/list/all_ui_styles_robot = list( UI_STYLE_MIDNIGHT = 'icons/mob/screen1_robot.dmi', UI_STYLE_ORANGE = 'icons/mob/screen1_robot.dmi', UI_STYLE_OLD = 'icons/mob/screen1_robot.dmi', @@ -34,27 +36,11 @@ var/global/list/all_tooltip_styles = list( return all_ui_styles[ui_style] return all_ui_styles[UI_STYLE_WHITE] - -/client/verb/change_ui() - set name = "Change UI" - set category = "Preferences" - set desc = "Configure your user interface" - - if(!ishuman(usr)) - if(!isrobot(usr)) - to_chat(usr, SPAN_WARNING("You must be a human or a robot to use this verb.")) - return - - var/UI_style_new = input(usr, "Select a style. White is recommended for customization") as null|anything in all_ui_styles - if(!UI_style_new) return - - var/UI_style_alpha_new = input(usr, "Select a new alpha (transparency) parameter for your UI, between 50 and 255") as null|num - if(!UI_style_alpha_new || !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) +// todo: refactor +/client/proc/set_ui_style(style) + if(!usr?.hud_used.adding) return - - var/UI_style_color_new = input(usr, "Choose your UI color. Dark colors are not recommended!") as color|null - if(!UI_style_color_new) return - + var/UI_style_new = style //update UI var/list/icons = usr.hud_used.adding + usr.hud_used.other + usr.hud_used.hotkeybuttons icons.Add(usr.zone_sel) @@ -70,13 +56,35 @@ var/global/list/all_tooltip_styles = list( for(var/atom/movable/screen/I in icons) if(I.name in list(INTENT_HELP, INTENT_HARM, INTENT_DISARM, INTENT_GRAB)) continue I.icon = ic - I.color = UI_style_color_new - I.alpha = UI_style_alpha_new +// todo: refactor +/client/proc/set_ui_alpha(alpha) + if(!usr?.hud_used.adding) + return + //update UI + var/list/icons = usr.hud_used.adding + usr.hud_used.other + usr.hud_used.hotkeybuttons + icons.Add(usr.zone_sel) + icons.Add(usr.gun_setting_icon) + icons.Add(usr.item_use_icon) + icons.Add(usr.gun_move_icon) + icons.Add(usr.radio_use_icon) + + for(var/atom/movable/screen/I in icons) + if(I.name in list(INTENT_HELP, INTENT_HARM, INTENT_DISARM, INTENT_GRAB)) continue + I.alpha = alpha + +// todo: refactor +/client/proc/set_ui_color(color) + if(!usr?.hud_used.adding) + return + //update UI + var/list/icons = usr.hud_used.adding + usr.hud_used.other + usr.hud_used.hotkeybuttons + icons.Add(usr.zone_sel) + icons.Add(usr.gun_setting_icon) + icons.Add(usr.item_use_icon) + icons.Add(usr.gun_move_icon) + icons.Add(usr.radio_use_icon) - if(alert("Like it? Save changes?",,"Yes", "No") == "Yes") - prefs.UI_style = UI_style_new - prefs.UI_style_alpha = UI_style_alpha_new - prefs.UI_style_color = UI_style_color_new - SScharacters.queue_preferences_save(prefs) - to_chat(usr, "UI was saved") + for(var/atom/movable/screen/I in icons) + if(I.name in list(INTENT_HELP, INTENT_HARM, INTENT_DISARM, INTENT_GRAB)) continue + I.color = color diff --git a/code/modules/client/verbs/minimap.dm b/code/modules/client/verbs/minimap.dm index 3d213dc21062..de207acee579 100644 --- a/code/modules/client/verbs/minimap.dm +++ b/code/modules/client/verbs/minimap.dm @@ -1,5 +1,5 @@ /client/verb/show_station_minimap() - set category = "OOC" + set category = VERB_CATEGORY_OOC set name = "Show Station Minimap" set desc = "Shows a minimap of the currently loaded station map." diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index ee6a11fd8014..2dc29bc7fcf5 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -1,6 +1,20 @@ +// todo: most of the things in here should probably be re-thought category wise; +// verticality for one is more graphics/visuals +// but isn't a preference because it's something you need to actively see at some times but not others.. + +/client/verb/toggle_verticality_visibility() + set name = "Toggle Verticality Plane" + set desc = "Toggle if you see ceiling overlays and similar." + set category = VERB_CATEGORY_OOC + + var/atom/movable/screen/plane_master/plane = global_planes.by_plane_type(/atom/movable/screen/plane_master/verticality) + plane.alpha = plane.alpha == 255? 0 : 255 + to_chat(src, SPAN_NOTICE("You now [plane.alpha == 255? "see" : "no longer see"] verticality overlays.")) + + /client/verb/motd() set name = "MOTD" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc ="Check the Message of the Day" var/motd = config.motd @@ -45,7 +59,7 @@ /client/verb/ooc(msg as text) set name = "OOC" //Gave this shit a shorter name so you only have to time out "ooc" rather than "ooc message" to use it --NeoFite - set category = "OOC" + set category = VERB_CATEGORY_OOC if(!reject_on_initialization_block()) return @@ -56,7 +70,7 @@ to_chat(src, "Guests may not use OOC.") return - if(!is_preference_enabled(/datum/client_preference/show_ooc)) + if(!get_preference_toggle(/datum/game_preference_toggle/chat/ooc)) to_chat(src, "You have OOC muted.") return @@ -103,7 +117,7 @@ return - if(!is_preference_enabled(/datum/client_preference/show_ooc)) + if(!get_preference_toggle(/datum/game_preference_toggle/chat/ooc)) to_chat(src, "You have OOC muted.") return @@ -126,11 +140,13 @@ if(holder.rights & R_ADMIN) ooc_style = "admin" + var/effective_color = holder && preferences.get_entry(/datum/game_preference_entry/simple_color/admin_ooc_color) + for(var/client/target in GLOB.clients) if(!target.initialized) continue - if(target.is_preference_enabled(/datum/client_preference/show_ooc)) + if(target.get_preference_toggle(/datum/game_preference_toggle/chat/ooc)) if(target.is_key_ignored(key)) // If we're ignored by this person, then do nothing. continue var/display_name = src.key @@ -140,8 +156,8 @@ display_name = "[holder.fakekey]/([src.key])" else display_name = holder.fakekey - if(holder && !holder.fakekey && (holder.rights & R_ADMIN) && CONFIG_GET(flag/allow_admin_ooccolor)) // keeping this for the badmins - to_chat(target, "" + "OOC: " + "[display_name]: [msg]") + if(effective_color) // keeping this for the badmins + to_chat(target, "" + "OOC: " + "[display_name]: [msg]") else to_chat(target, "OOC: [display_name]: [msg]") @@ -153,7 +169,7 @@ /client/verb/looc(msg as text) set name = "LOOC" set desc = "Local OOC, seen only by those in view." - set category = "OOC" + set category = VERB_CATEGORY_OOC if(!reject_on_initialization_block()) return @@ -175,7 +191,7 @@ if(!msg) return - if(!is_preference_enabled(/datum/client_preference/show_looc)) + if(!get_preference_toggle(/datum/game_preference_toggle/chat/looc)) to_chat(src, "You have LOOC muted.") return @@ -221,7 +237,7 @@ // Everyone in normal viewing range of the LOOC for(var/mob/viewer in m_viewers) - if(viewer.client && viewer.client.is_preference_enabled(/datum/client_preference/show_looc)) + if(viewer.client && viewer.client.get_preference_toggle(/datum/game_preference_toggle/chat/looc)) receivers |= viewer.client else if(istype(viewer,/mob/observer/eye)) // For AI eyes and the like var/mob/observer/eye/E = viewer @@ -230,7 +246,7 @@ // Admins with RLOOC displayed who weren't already in for(var/client/admin in GLOB.admins) - if(!(admin in receivers) && admin.is_preference_enabled(/datum/client_preference/holder/show_rlooc)) + if(!(admin in receivers) && admin.get_preference_toggle(/datum/game_preference_toggle/admin/global_looc)) r_receivers |= admin msg = emoji_parse(msg) diff --git a/code/modules/client/verbs/panic_bunker_player.dm b/code/modules/client/verbs/panic_bunker_player.dm deleted file mode 100644 index 7fba73bda804..000000000000 --- a/code/modules/client/verbs/panic_bunker_player.dm +++ /dev/null @@ -1,34 +0,0 @@ -/client/verb/bunker_auto_authorize() - set name = "Auto Authorize Panic Bunker" - set desc = "Authorizes your account in the panic bunker of any servers connected to this function." - set category = "OOC" - - world.send_cross_server_bunker_overrides(key, src) - -/world/proc/send_cross_server_bunker_overrides(key, client/C) - var/comms_key = CONFIG_GET(string/comms_key) - if(!comms_key) - return - var/list/message = list() - message["ckey"] = key - message["source"] = "[CONFIG_GET(string/cross_comms_name)]" - message["key"] = comms_key - message["auto_bunker_override"] = TRUE - var/list/servers = CONFIG_GET(keyed_list/cross_server_bunker_override) - if(!length(servers)) - to_chat(C, "AUTOBUNKER: No servers are configured to receive from this one.") - return - var/logtext = "[key] ([key_name(C)]) has initiated an autobunker authentication with linked servers." - message_admins(logtext) - log_admin(logtext) - for(var/name in servers) - var/returned = world.Export("[servers[name]]?[list2params(message)]") - switch(returned) - if("Bad Key") - to_chat(C, "AUTOBuNKER: [name] failed to authenticate with this server.") - if("Function Disabled") - to_chat(C, "AUTOBUNKER: [name] has autobunker receive disabled.") - if("Success") - to_chat(C, "AUTOBUNKER: Successfully authenticated with [name]. Panic bunker bypass granted to [key]..") - else - to_chat(C, "AUTOBUNKER: Unknown error ([name]).") diff --git a/code/modules/client/verbs/preferences.dm b/code/modules/client/verbs/preferences.dm deleted file mode 100644 index 2dbdcf1370e6..000000000000 --- a/code/modules/client/verbs/preferences.dm +++ /dev/null @@ -1,11 +0,0 @@ -/client/verb/character_setup() - set name = "Character Setup" - set category = "Preferences" - - prefs?.ShowChoices(usr) - -/client/verb/preferences() - set name = "Game Options" - set category = "Preferences" - - prefs?.ShowChoices(usr) diff --git a/code/modules/client/verbs/ping.dm b/code/modules/client/verbs/system.dm similarity index 55% rename from code/modules/client/verbs/ping.dm rename to code/modules/client/verbs/system.dm index 02c5b5a7fd96..0a957234e2b9 100644 --- a/code/modules/client/verbs/ping.dm +++ b/code/modules/client/verbs/system.dm @@ -1,3 +1,28 @@ +//? Setup Panels + +/client/verb/character_setup() + set name = "Character Setup" + set category = VERB_CATEGORY_SYSTEM + + prefs?.ShowChoices(usr) + +/client/verb/preferences() + set name = "Game Preferences" + set category = VERB_CATEGORY_SYSTEM + + preferences.ui_interact(mob) + +//? Sound Management + +/client/verb/stop_client_sounds() + set name = "Stop Sounds" + set category = VERB_CATEGORY_SYSTEM + set desc = "Stop Current Sounds" + usr << sound(null) + usr.client?.tgui_panel?.stop_music() + +//? Ping System + /client/verb/update_ping(time as num) set instant = TRUE set name = ".update_ping" @@ -18,5 +43,5 @@ /client/verb/ping() set name = "Ping" - set category = "OOC" + set category = VERB_CATEGORY_SYSTEM winset(src, null, "command=.display_ping+[world.time+world.tick_lag*TICK_USAGE_REAL/100]") diff --git a/code/modules/client/verbs/view.dm b/code/modules/client/verbs/view.dm index 9192ac7841af..6bbee5ac68cb 100644 --- a/code/modules/client/verbs/view.dm +++ b/code/modules/client/verbs/view.dm @@ -1,7 +1 @@ -/client/verb/toggle_verticality_visibility() - set name = "Toggle Verticality Plane" - set desc = "Toggle if you see ceiling overlays and similar." - - var/atom/movable/screen/plane_master/plane = global_planes.by_plane_type(/atom/movable/screen/plane_master/verticality) - plane.alpha = plane.alpha == 255? 0 : 255 - to_chat(src, SPAN_NOTICE("You now [plane.alpha == 255? "see" : "no longer see"] verticality overlays.")) +// this section left intentionally blank for now diff --git a/code/modules/client/viewport.dm b/code/modules/client/viewport.dm index dad6f2b9bed0..8254a7550ecd 100644 --- a/code/modules/client/viewport.dm +++ b/code/modules/client/viewport.dm @@ -410,7 +410,7 @@ GLOBAL_VAR(lock_client_view_y) */ /client/verb/user_fit_viewport() set name = "Fit Viewport" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Fit the width of the map window to match the viewport" request_viewport_fit() diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index dfa3be81f74b..07075db41526 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -276,7 +276,7 @@ /obj/item/clothing/verb/pick_style_verb() set name = "Set Worn Style" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Wear this piece of clothing in a different style." set src in usr diff --git a/code/modules/clothing/clothing_accessories.dm b/code/modules/clothing/clothing_accessories.dm index 6fa3138d3af9..cab51c659379 100644 --- a/code/modules/clothing/clothing_accessories.dm +++ b/code/modules/clothing/clothing_accessories.dm @@ -261,7 +261,7 @@ /obj/item/clothing/proc/removetie_verb() set name = "Remove Accessory" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return diff --git a/code/modules/clothing/ears/ears.dm b/code/modules/clothing/ears/ears.dm index d4fbd5008fa5..f14b1094e485 100644 --- a/code/modules/clothing/ears/ears.dm +++ b/code/modules/clothing/ears/ears.dm @@ -20,7 +20,7 @@ /obj/item/clothing/ears/earmuffs/headphones/verb/togglemusic() set name = "Toggle Headphone Music" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return if(usr.stat) return diff --git a/code/modules/clothing/ears/speakrock.dm b/code/modules/clothing/ears/speakrock.dm index 6a7df6f3653f..b78dd8b10026 100644 --- a/code/modules/clothing/ears/speakrock.dm +++ b/code/modules/clothing/ears/speakrock.dm @@ -13,7 +13,7 @@ // This is a clone of /obj/item/clothing/ears/earmuffs/headphones/verb/togglemusic()'s functionality. /obj/item/radio/headset/speak_n_rock/verb/togglemusic() set name = "Toggle Headphone Music" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living) || usr.stat) return diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 23914c7e43ad..44e29ba1ec6c 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -242,7 +242,7 @@ BLIND // can't see anything /obj/item/clothing/glasses/eyepatchwhite/verb/switcheye() set name = "Switch Eyepatch" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return if(usr.stat) return @@ -256,7 +256,7 @@ BLIND // can't see anything /obj/item/clothing/glasses/eyepatch/verb/switcheye() set name = "Switch Eyepatch" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return if(usr.stat) return @@ -428,7 +428,7 @@ BLIND // can't see anything toggle() /obj/item/clothing/glasses/welding/verb/toggle() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Adjust welding goggles" set src in usr @@ -668,7 +668,7 @@ BLIND // can't see anything toggle() /obj/item/clothing/glasses/aerogelgoggles/verb/toggle() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Adjust Orange Goggles" set src in usr diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 901069a5bded..0c98a49321e3 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -219,7 +219,7 @@ /obj/item/clothing/glasses/omnihud/eng/meson/verb/toggleprojector() set name = "Toggle projector" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return if(usr.stat) return @@ -275,7 +275,7 @@ /obj/item/clothing/glasses/hud/security/eyepatch/verb/switcheye() set name = "Switch Eyepatch" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return if(usr.stat) return @@ -306,7 +306,7 @@ /obj/item/clothing/glasses/hud/engi/eyepatch/verb/toggleprojector() set name = "Toggle projector" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return if(usr.stat) return diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 4e936cf290d5..cc059518ecbd 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -39,7 +39,7 @@ /obj/item/clothing/head/welding/verb/toggle() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Adjust welding mask" set src in usr diff --git a/code/modules/clothing/head/pilot_helmet.dm b/code/modules/clothing/head/pilot_helmet.dm index d28d319b5cee..771b392e4c9b 100644 --- a/code/modules/clothing/head/pilot_helmet.dm +++ b/code/modules/clothing/head/pilot_helmet.dm @@ -153,7 +153,7 @@ /obj/item/clothing/head/pilot/verb/hud_colors() set name = "Alter HUD color" set desc = "Change the color of the piloting HUD." - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr var/newcolor = input(usr,"Pick a color!","HUD Color") as null|color diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm index 9635659d100e..02319ec81fe0 100644 --- a/code/modules/clothing/masks/breath.dm +++ b/code/modules/clothing/masks/breath.dm @@ -36,7 +36,7 @@ adjust_mask(user) /obj/item/clothing/mask/breath/verb/toggle() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Adjust mask" set src in usr diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index 0186aca14eda..672a584a7648 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -74,7 +74,7 @@ update_worn_icon() /obj/item/clothing/mask/gas/half/verb/toggle() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Adjust mask" set src in usr adjust_mask(usr) @@ -368,7 +368,7 @@ /obj/item/clothing/mask/gas/orchid/verb/toggle_design() set name = "Change Design" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr change_mask(usr) diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index 38e7357fac5b..a2eb72240e5f 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -56,7 +56,7 @@ update_worn_icon() /obj/item/clothing/mask/surgical/verb/toggle() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Adjust mask" set src in usr diff --git a/code/modules/clothing/masks/voice.dm b/code/modules/clothing/masks/voice.dm index 5e2bc2dbc42e..1bfa58b46620 100644 --- a/code/modules/clothing/masks/voice.dm +++ b/code/modules/clothing/masks/voice.dm @@ -11,14 +11,14 @@ origin_tech = list(TECH_ILLEGAL = 4) /obj/item/clothing/mask/gas/voice/verb/Toggle_Voice_Changer() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr changer.active = !changer.active to_chat(usr, "You [changer.active ? "enable" : "disable"] the voice-changing module in \the [src].") /obj/item/clothing/mask/gas/voice/verb/Set_Voice(name as text) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr var/voice = sanitize(name, MAX_NAME_LEN) @@ -27,7 +27,7 @@ to_chat(usr, "You are now mimicking [changer.voice].") /obj/item/clothing/mask/gas/voice/verb/Reset_Voice() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr changer.voice = null diff --git a/code/modules/clothing/shoes/_shoes.dm b/code/modules/clothing/shoes/_shoes.dm index 0b04c5fbd1dd..db94bf4b60fe 100644 --- a/code/modules/clothing/shoes/_shoes.dm +++ b/code/modules/clothing/shoes/_shoes.dm @@ -49,7 +49,7 @@ /obj/item/clothing/shoes/proc/draw_knife() set name = "Draw Boot Knife" set desc = "Pull out your boot knife." - set category = "IC" + set category = VERB_CATEGORY_IC set src in usr if(usr.stat || usr.restrained() || usr.incapacitated()) @@ -117,7 +117,7 @@ /obj/item/clothing/shoes/verb/toggle_layer() set name = "Switch Shoe Layer" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(shoes_under_pants == -1) to_chat(usr, SPAN_NOTICE("\The [src] cannot be worn under your pants")) diff --git a/code/modules/clothing/spacesuits/spacesuits.dm b/code/modules/clothing/spacesuits/spacesuits.dm index a845a6f8cf72..cca1ecd8c208 100644 --- a/code/modules/clothing/spacesuits/spacesuits.dm +++ b/code/modules/clothing/spacesuits/spacesuits.dm @@ -35,7 +35,7 @@ /obj/item/clothing/head/helmet/space/verb/toggle_camera() set name = "Toggle Helmet Camera" set desc = "Turn your helmet's camera on or off." - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(usr.stat || usr.restrained() || usr.incapacitated()) return diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index a6bdc812a577..71635647065b 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -174,7 +174,7 @@ /obj/item/clothing/suit/space/void/verb/toggle_helmet() set name = "Toggle Helmet" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(src.loc,/mob/living)) return @@ -209,7 +209,7 @@ /obj/item/clothing/suit/space/void/verb/toggle_magboots() set name = "Toggle Magboots" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(src.loc,/mob/living)) @@ -247,7 +247,7 @@ /obj/item/clothing/suit/space/void/verb/eject_tank() set name = "Eject Voidsuit Tank/Cooler" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(src.loc,/mob/living)) diff --git a/code/modules/clothing/spacesuits/void/zaddat.dm b/code/modules/clothing/spacesuits/void/zaddat.dm index 9199ef9f09a4..1ced35804461 100644 --- a/code/modules/clothing/spacesuits/void/zaddat.dm +++ b/code/modules/clothing/spacesuits/void/zaddat.dm @@ -26,7 +26,7 @@ /obj/item/clothing/suit/space/void/zaddat/verb/custom_suit() set name = "Customize Shroud" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Pick an appearence for your Shroud." var/mob/M = usr diff --git a/code/modules/clothing/suits/eventclothing.dm b/code/modules/clothing/suits/eventclothing.dm index d14c6c51b44d..e669e8e239bb 100644 --- a/code/modules/clothing/suits/eventclothing.dm +++ b/code/modules/clothing/suits/eventclothing.dm @@ -14,7 +14,7 @@ /obj/item/clothing/under/event_reward/foxmiko/verb/partkimono() //Verb for parting kimono - kinky. User reporting, flips state, and updates icon set name = "Adjust Kimono" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) //Standard checks for clothing verbs return @@ -35,7 +35,7 @@ /obj/item/clothing/under/event_reward/foxmiko/verb/liftskirt() //Verb for parting skirt - lewd. User reporting, flips state, and updates icon set name = "Adjust Skirt" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) //Standard checks for clothing verbs return @@ -97,7 +97,7 @@ /obj/item/clothing/under/event_reward/foxmiko/verb/hidetie() //Verb for concealing assessory icons on mob spirt - this is a hack of the original code to remove accessories set name = "Hide Accessory" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return //Standard checks for clothing verbs if(usr.stat) return diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 49b603e447b4..4e882141414f 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -1111,7 +1111,7 @@ /obj/item/clothing/suit/storage/flannel/verb/roll_sleeves() set name = "Roll Sleeves" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return @@ -1130,7 +1130,7 @@ /obj/item/clothing/suit/storage/flannel/verb/tuck() set name = "Toggle Shirt Tucking" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)||usr.stat) return @@ -1145,7 +1145,7 @@ /obj/item/clothing/suit/storage/flannel/verb/button() set name = "Toggle Shirt Buttons" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)||usr.stat) return @@ -1303,7 +1303,7 @@ /* /obj/item/clothing/suit/storage/toggle/operations_coat/verb/toggle() set name = "Toggle coat buttons" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!usr.canmove || usr.stat || usr.restrained()) diff --git a/code/modules/clothing/suits/storage.dm b/code/modules/clothing/suits/storage.dm index c507cc3616f4..6ae29a4da3b4 100644 --- a/code/modules/clothing/suits/storage.dm +++ b/code/modules/clothing/suits/storage.dm @@ -123,7 +123,7 @@ /obj/item/clothing/suit/storage/hooded/toggle/verb/toggle() set name = "Toggle Coat Buttons" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return 0 @@ -149,7 +149,7 @@ /obj/item/clothing/suit/storage/vest/verb/toggle() set name ="Adjust Badge" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) return 0 diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index f5fef8dad1fa..092bf13f18dc 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -269,7 +269,7 @@ /obj/item/clothing/under/verb/toggle() set name = "Toggle Suit Sensors" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr set_sensors(usr) diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index 3ba683773a02..88bd2fcfd6a2 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -567,7 +567,7 @@ /obj/item/clothing/accessory/collar/bell/verb/jinglebell() set name = "Jingle Bell" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return if(usr.stat) return diff --git a/code/modules/clothing/under/accessories/bracelets/_bracelets.dm b/code/modules/clothing/under/accessories/bracelets/_bracelets.dm index b0d5fec00310..c4f0db9277f3 100644 --- a/code/modules/clothing/under/accessories/bracelets/_bracelets.dm +++ b/code/modules/clothing/under/accessories/bracelets/_bracelets.dm @@ -14,7 +14,7 @@ /obj/item/clothing/accessory/bracelet/friendship/verb/dedicate_bracelet() set name = "Dedicate Bracelet" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Dedicate your friendship bracelet to a special someone." var/mob/M = usr if(!M.mind) diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm index 5e5b9173ad02..278dcd11f92f 100644 --- a/code/modules/clothing/under/accessories/holster.dm +++ b/code/modules/clothing/under/accessories/holster.dm @@ -100,7 +100,7 @@ //For the holster hotkey /obj/item/clothing/accessory/holster/verb/holster_verb() set name = "Holster" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return if(usr.stat) return diff --git a/code/modules/clothing/under/jobs/security.dm b/code/modules/clothing/under/jobs/security.dm index 095be3868267..de6d3f189dc5 100644 --- a/code/modules/clothing/under/jobs/security.dm +++ b/code/modules/clothing/under/jobs/security.dm @@ -136,7 +136,7 @@ /* /obj/item/clothing/under/det/verb/rollup() set name = "Roll Suit Sleeves" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr var/unrolled = item_state_slots[SLOT_ID_UNIFORM] == initial(snowflake_worn_state) item_state_slots[SLOT_ID_UNIFORM] = unrolled ? "[snowflake_worn_state]_r" : initial(snowflake_worn_state) diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm index b6e570d096c0..cd53d14b75d2 100644 --- a/code/modules/clothing/under/miscellaneous.dm +++ b/code/modules/clothing/under/miscellaneous.dm @@ -1880,7 +1880,7 @@ var/original_size /obj/item/clothing/under/bluespace/verb/toggle_fibers() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Adjust fibers" set desc = "Adjust your suit fibers. This makes it so your stomach(s) will show or not." set src in usr @@ -1897,7 +1897,7 @@ /obj/item/clothing/under/bluespace/verb/resize() set name = "Adjust Size" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr bluespace_size(usr) @@ -2000,7 +2000,7 @@ /* /obj/item/clothing/under/antediluvian/verb/switchsprite() set name = "Reconfigure Suit" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(usr, /mob/living)) return diff --git a/code/modules/detectivework/tools/scanner.dm b/code/modules/detectivework/tools/scanner.dm index 87d6a6f59ddf..28f9281fa78d 100644 --- a/code/modules/detectivework/tools/scanner.dm +++ b/code/modules/detectivework/tools/scanner.dm @@ -138,7 +138,7 @@ /obj/item/detective_scanner/verb/examine_data() set name = "Examine Forensic Data" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) display_data(usr) @@ -188,7 +188,7 @@ /obj/item/detective_scanner/verb/wipe() set name = "Wipe Forensic Data" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if (alert("Are you sure you want to wipe all data from [src]?",,"Yes","No") == "Yes") diff --git a/code/modules/economy/machines/cash_register.dm b/code/modules/economy/machines/cash_register.dm index e96effd7f4d7..7ce7f3e4bab9 100644 --- a/code/modules/economy/machines/cash_register.dm +++ b/code/modules/economy/machines/cash_register.dm @@ -450,7 +450,7 @@ /obj/machinery/cash_register/verb/open_cash_box() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Open Cash Box" set desc = "Open/closes the register's cash box." set src in view(1) diff --git a/code/modules/flufftext/look_up.dm b/code/modules/flufftext/look_up.dm index 9818fb9178f2..28c7537a4f4a 100644 --- a/code/modules/flufftext/look_up.dm +++ b/code/modules/flufftext/look_up.dm @@ -2,7 +2,7 @@ /mob/living/verb/look_up() set name = "Look Up" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Look above you, and hope there's no ceiling spiders." to_chat(usr, "You look upwards...") diff --git a/code/modules/food/drinks/bottle.dm b/code/modules/food/drinks/bottle.dm index cacc715625eb..3c64ffaf6d1b 100644 --- a/code/modules/food/drinks/bottle.dm +++ b/code/modules/food/drinks/bottle.dm @@ -80,7 +80,7 @@ /obj/item/reagent_containers/food/drinks/bottle/verb/smash_bottle() set name = "Smash Bottle" - set category = "Object" + set category = VERB_CATEGORY_OBJECT var/list/things_to_smash_on = list() for(var/atom/A in range (1, usr)) diff --git a/code/modules/food/machinery/appliance/_appliance.dm b/code/modules/food/machinery/appliance/_appliance.dm index 33790c874314..8bf657ddface 100644 --- a/code/modules/food/machinery/appliance/_appliance.dm +++ b/code/modules/food/machinery/appliance/_appliance.dm @@ -167,7 +167,7 @@ /obj/machinery/appliance/proc/choose_output() set src in view() set name = "Choose output" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(!can_use_check(usr)) return diff --git a/code/modules/food/machinery/appliance/_mixer.dm b/code/modules/food/machinery/appliance/_mixer.dm index 2ac3ae28b444..c5ae636ae8bf 100644 --- a/code/modules/food/machinery/appliance/_mixer.dm +++ b/code/modules/food/machinery/appliance/_mixer.dm @@ -38,7 +38,7 @@ fundamental differences /obj/machinery/appliance/mixer/choose_output() set src in oview(1) set name = "Choose output" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(!can_use_check()) return @@ -98,7 +98,7 @@ fundamental differences /obj/machinery/appliance/mixer/toggle_power() set src in view() set name = "Toggle Power" - set category = "Object" + set category = VERB_CATEGORY_OBJECT var/datum/cooking_item/CI = cooking_objs[1] if (!CI.container.check_contents()) diff --git a/code/modules/food/machinery/appliance/container.dm b/code/modules/food/machinery/appliance/container.dm index c91f77b12066..e1817c51d61b 100644 --- a/code/modules/food/machinery/appliance/container.dm +++ b/code/modules/food/machinery/appliance/container.dm @@ -47,7 +47,7 @@ /obj/item/reagent_containers/cooking_container/verb/empty() set src in view(1) set name = "Empty Container" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Removes items from the container, excluding reagents." do_empty(usr) diff --git a/code/modules/food/machinery/appliance/oven.dm b/code/modules/food/machinery/appliance/oven.dm index 3e95c8de1c6f..a3c6c42084ca 100644 --- a/code/modules/food/machinery/appliance/oven.dm +++ b/code/modules/food/machinery/appliance/oven.dm @@ -78,7 +78,7 @@ /obj/machinery/appliance/cooker/oven/choose_output() set src in view() set name = "Choose output" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(!can_use_check(usr)) return @@ -104,7 +104,7 @@ /obj/machinery/appliance/cooker/oven/verb/toggle_door() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Open/close oven door" try_toggle_door(usr) diff --git a/code/modules/food/machinery/gibber.dm b/code/modules/food/machinery/gibber.dm index c48a4a1cfc6b..128eed53e599 100644 --- a/code/modules/food/machinery/gibber.dm +++ b/code/modules/food/machinery/gibber.dm @@ -147,7 +147,7 @@ update_icon() /obj/machinery/gibber/verb/eject() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Empty Gibber" set src in oview(1) diff --git a/code/modules/food/machinery/microwave.dm b/code/modules/food/machinery/microwave.dm index 3b032bc0548b..fbd660f080f2 100644 --- a/code/modules/food/machinery/microwave.dm +++ b/code/modules/food/machinery/microwave.dm @@ -433,7 +433,7 @@ /obj/machinery/microwave/verb/Eject() set src in oview(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject content" usr.visible_message( "[usr] tries to open [src] and remove its contents." , diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index 910cf957b377..7b76176cb2ae 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -76,7 +76,7 @@ /obj/item/deck/verb/draw_card() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Draw" set desc = "Draw a card from a deck." set src in view(1) @@ -118,7 +118,7 @@ /obj/item/deck/verb/deal_card() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Deal" set desc = "Deal a card from a deck." set src in view(1) @@ -142,7 +142,7 @@ /obj/item/deck/verb/deal_card_multi() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Deal Multiple Cards" set desc = "Deal multiple cards from a deck." set src in view(1) @@ -220,7 +220,7 @@ /obj/item/deck/verb/verb_shuffle() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Shuffle" set desc = "Shuffle the cards in the deck." set src in view(1) @@ -316,7 +316,7 @@ /obj/item/hand/verb/discard() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Discard" set desc = "Place (a) card(s) from your hand in front of you." @@ -366,7 +366,7 @@ /obj/item/hand/verb/Removecard() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Remove card" set desc = "Remove a card from the hand." set src in view(1) diff --git a/code/modules/games/dice.dm b/code/modules/games/dice.dm index a62a6699c87a..55bf090bfdd1 100644 --- a/code/modules/games/dice.dm +++ b/code/modules/games/dice.dm @@ -168,7 +168,7 @@ to_chat(viewer, "The [D.name] shows a [D.result].") /obj/item/storage/dicecup/verb/peekAtDice() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Peek at Dice" set desc = "Peek at the dice under your cup." @@ -176,7 +176,7 @@ /obj/item/storage/dicecup/verb/revealDiceHand() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Reveal Dice" set desc = "Reveal the dice hidden under your cup." diff --git a/code/modules/guidebook/guidebook.dm b/code/modules/guidebook/guidebook.dm index 6aa92d6e6f1f..26bcc08509f7 100644 --- a/code/modules/guidebook/guidebook.dm +++ b/code/modules/guidebook/guidebook.dm @@ -65,6 +65,6 @@ GLOBAL_DATUM_INIT(guidebook, /datum/guidebook, new) /client/verb/access_guidebook() set name = "Access Guidebook" - set category = "OOC" + set category = VERB_CATEGORY_OOC GLOB.guidebook.ui_interact(src) diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm index 75aa5e52051a..074840debc1c 100644 --- a/code/modules/hydroponics/trays/tray.dm +++ b/code/modules/hydroponics/trays/tray.dm @@ -380,7 +380,7 @@ /obj/machinery/portable_atmospherics/hydroponics/verb/remove_label() set name = "Remove Label" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if(usr.incapacitated()) @@ -396,7 +396,7 @@ /obj/machinery/portable_atmospherics/hydroponics/verb/setlight() set name = "Set Light" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if(usr.incapacitated()) @@ -641,7 +641,7 @@ /obj/machinery/portable_atmospherics/hydroponics/verb/close_lid_verb() set name = "Toggle Tray Lid" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if(usr.incapacitated()) return diff --git a/code/modules/instruments/songs/play_legacy.dm b/code/modules/instruments/songs/play_legacy.dm index 17cd68bf107a..5e5b25e57492 100644 --- a/code/modules/instruments/songs/play_legacy.dm +++ b/code/modules/instruments/songs/play_legacy.dm @@ -78,5 +78,5 @@ var/sound/music_played = sound(soundfile) for(var/i in hearing_mobs) var/mob/M = i - M.playsound_local(source, null, volume * using_instrument.volume_multiplier, falloff = 5, S = music_played, preference = /datum/client_preference/instrument_toggle) + M.playsound_local(source, null, volume * using_instrument.volume_multiplier, falloff = 5, S = music_played, preference = /datum/game_preference_toggle/sfx/instruments) // Could do environment and echo later but not for now diff --git a/code/modules/instruments/songs/play_synthesized.dm b/code/modules/instruments/songs/play_synthesized.dm index b51b0b7d01d9..5ea477782f00 100644 --- a/code/modules/instruments/songs/play_synthesized.dm +++ b/code/modules/instruments/songs/play_synthesized.dm @@ -80,7 +80,7 @@ last_channel_played = channel_text for(var/i in hearing_mobs) var/mob/M = i - M.playsound_local(get_turf(parent), null, volume, FALSE, K.frequency, INSTRUMENT_DISTANCE_NO_FALLOFF, FALSE, channel, null, copy, /datum/client_preference/instrument_toggle, distance_multiplier = INSTRUMENT_DISTANCE_FALLOFF_BUFF) + M.playsound_local(get_turf(parent), null, volume, FALSE, K.frequency, INSTRUMENT_DISTANCE_NO_FALLOFF, FALSE, channel, null, copy, /datum/game_preference_toggle/sfx/instruments, distance_multiplier = INSTRUMENT_DISTANCE_FALLOFF_BUFF) // Could do environment and echo later but not for now /datum/song/proc/terminate_all_sounds(clear_channels = TRUE) diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index d07fab6cb60a..ce6f8a5c68f5 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -306,7 +306,7 @@ */ /obj/item/electronic_assembly/verb/rename() set name = "Rename Circuit" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Rename your circuit, useful to stay organized." set src in usr diff --git a/code/modules/integrated_electronics/core/assemblies/device.dm b/code/modules/integrated_electronics/core/assemblies/device.dm index 656754f09cba..205160dd0602 100644 --- a/code/modules/integrated_electronics/core/assemblies/device.dm +++ b/code/modules/integrated_electronics/core/assemblies/device.dm @@ -60,7 +60,7 @@ /obj/item/assembly/electronic_assembly/verb/toggle() set src in usr - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Open/Close Device Assembly" set desc = "Open or close device assembly!" diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm index b26c514d50f3..5326044896e3 100644 --- a/code/modules/integrated_electronics/core/integrated_circuit.dm +++ b/code/modules/integrated_electronics/core/integrated_circuit.dm @@ -115,7 +115,7 @@ a creative player the means to solve many problems. Circuits are held inside an /obj/item/integrated_circuit/verb/rename_component() set name = "Rename Circuit" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Rename your circuit, useful to stay organized." set src in usr diff --git a/code/modules/keybindings/bindings_client.dm b/code/modules/keybindings/bindings_client.dm index f0aa414c57be..71775b65f6a2 100644 --- a/code/modules/keybindings/bindings_client.dm +++ b/code/modules/keybindings/bindings_client.dm @@ -17,6 +17,9 @@ set instant = TRUE set hidden = TRUE + if(!preferences.initialized) + return + client_keysend_amount += 1 var/cache = client_keysend_amount @@ -72,7 +75,7 @@ else full_key = "[AltMod][CtrlMod][ShiftMod][_key]" var/keycount = 0 - for(var/kb_name in prefs.key_bindings[full_key]) + for(var/kb_name in preferences.keybindings[full_key]) keycount++ var/datum/keybinding/kb = GLOB.keybindings_by_name[kb_name] if(kb.can_use(src) && kb.down(src) && keycount >= MAX_COMMANDS_PER_KEY) @@ -134,7 +137,7 @@ // We don't do full key for release, because for mod keys you // can hold different keys and releasing any should be handled by the key binding specifically - for (var/kb_name in prefs.key_bindings[_key]) + for (var/kb_name in preferences.keybindings[_key]) var/datum/keybinding/kb = GLOB.keybindings_by_name[kb_name] if(kb.can_use(src) && kb.up(src)) break @@ -149,13 +152,13 @@ return mob.key_focus?.keyLoop(src) -/client/proc/update_movement_keys(datum/preferences/direct_prefs) - var/datum/preferences/D = prefs || direct_prefs - if(!D?.key_bindings) +/client/proc/update_movement_keys(datum/game_preferences/direct_prefs) + var/datum/game_preferences/D = preferences || direct_prefs + if(!D?.keybindings) return movement_keys = list() - for(var/key in D.key_bindings) - for(var/kb_name in D.key_bindings[key]) + for(var/key in D.keybindings) + for(var/kb_name in D.keybindings[key]) switch(kb_name) if("North") movement_keys[key] = NORTH diff --git a/code/modules/keybindings/keybind/_keybind.dm b/code/modules/keybindings/keybind/_keybind.dm index 1d68e2d0373d..7e0744471d8a 100644 --- a/code/modules/keybindings/keybind/_keybind.dm +++ b/code/modules/keybindings/keybind/_keybind.dm @@ -3,13 +3,15 @@ var/list/classic_keys var/name var/full_name - var/description = "" + var/description = "No description provided." var/category = CATEGORY_MISC var/weight = WEIGHT_LOWEST + // todo: what is this for / why do we have it / should we do this? + // keybinds using primarily signals is kind of a :/ + // because said components can't really inject keybind data into prefs.. var/keybind_signal /datum/keybinding/New() - // Default keys to the master "hotkey_keys" if(LAZYLEN(hotkey_keys) && !LAZYLEN(classic_keys)) classic_keys = hotkey_keys.Copy() @@ -22,3 +24,17 @@ /datum/keybinding/proc/can_use(client/user) return TRUE + +/datum/keybinding/proc/is_visible(client/user) + return TRUE + +/** + * Data for a GamePreferenceKeybind + */ +/datum/keybinding/proc/tgui_keybinding_data() + return list( + "id" = name, + "name" = full_name, + "desc" = description, + "category" = category, + ) diff --git a/code/modules/keybindings/keybind/admin.dm b/code/modules/keybindings/keybind/admin.dm index 99dcd18ca77d..135923aecad3 100644 --- a/code/modules/keybindings/keybind/admin.dm +++ b/code/modules/keybindings/keybind/admin.dm @@ -5,6 +5,9 @@ /datum/keybinding/admin/can_use(client/user) return user.holder ? TRUE : FALSE +/datum/keybinding/admin/is_visible(client/user) + return !!user.holder + /datum/keybinding/admin/admin_say hotkey_keys = list("F5") name = "admin_say" @@ -16,7 +19,7 @@ return TRUE /datum/keybinding/admin/admin_ghost - hotkey_keys = list("Unbound") + hotkey_keys = list() name = "admin_ghost" full_name = "Aghost" description = "Go ghost" @@ -36,7 +39,7 @@ return TRUE /datum/keybinding/admin/toggle_buildmode_self - hotkey_keys = list("Unbound") + hotkey_keys = list() name = "toggle_buildmode_self" full_name = "Toggle Buildmode Self" description = "Toggles buildmode" @@ -46,7 +49,7 @@ return TRUE /datum/keybinding/admin/stealthmode - hotkey_keys = list("Unbound") + hotkey_keys = list() name = "stealth_mode" full_name = "Stealth mode" description = "Enters stealth mode" @@ -76,7 +79,7 @@ return TRUE /datum/keybinding/admin/deadsay - hotkey_keys = list("Unbound") + hotkey_keys = list() name = "dsay" full_name = "deadsay" description = "Allows you to send a message to dead chat" @@ -86,7 +89,7 @@ return TRUE /datum/keybinding/admin/deadmin - hotkey_keys = list("Unbound") + hotkey_keys = list() name = "deadmin" full_name = "Deadmin" description = "Shed your admin powers" @@ -96,7 +99,7 @@ return TRUE /datum/keybinding/admin/readmin - hotkey_keys = list("Unbound") + hotkey_keys = list() name = "readmin" full_name = "Readmin" description = "Regain your admin powers" diff --git a/code/modules/keybindings/keybind/carbon.dm b/code/modules/keybindings/keybind/carbon.dm index ee2ee48e8cd9..8a9a9e9c61d6 100644 --- a/code/modules/keybindings/keybind/carbon.dm +++ b/code/modules/keybindings/keybind/carbon.dm @@ -33,7 +33,7 @@ hotkey_keys = list("1") name = "select_help_intent" full_name = "Select help intent" - description = "" + description = "No description provided." category = CATEGORY_CARBON /datum/keybinding/carbon/select_help_intent/down(client/user) @@ -44,7 +44,7 @@ hotkey_keys = list("2") name = "select_disarm_intent" full_name = "Select disarm intent" - description = "" + description = "No description provided." category = CATEGORY_CARBON /datum/keybinding/carbon/select_disarm_intent/down(client/user) @@ -55,7 +55,7 @@ hotkey_keys = list("3") name = "select_grab_intent" full_name = "Select grab intent" - description = "" + description = "No description provided." category = CATEGORY_CARBON /datum/keybinding/carbon/select_grab_intent/down(client/user) @@ -66,7 +66,7 @@ hotkey_keys = list("4") name = "select_harm_intent" full_name = "Select harm intent" - description = "" + description = "No description provided." category = CATEGORY_CARBON /datum/keybinding/carbon/select_harm_intent/down(client/user) diff --git a/code/modules/keybindings/keybind/client.dm b/code/modules/keybindings/keybind/client.dm index 2bce8f45039b..84d844e9a476 100644 --- a/code/modules/keybindings/keybind/client.dm +++ b/code/modules/keybindings/keybind/client.dm @@ -3,7 +3,7 @@ weight = WEIGHT_HIGHEST /datum/keybinding/client/admin_help - hotkey_keys = list("Unbound") + hotkey_keys = list() name = "admin_help" full_name = "Admin Help" description = "Ask an admin for help." @@ -13,7 +13,7 @@ return TRUE /datum/keybinding/client/screenshot - hotkey_keys = list("Unbound") + hotkey_keys = list() name = "screenshot" full_name = "Screenshot" description = "Take a screenshot." diff --git a/code/modules/keybindings/keybind/emote.dm b/code/modules/keybindings/keybind/emote.dm index a3d1926243b9..7c06ba61e12d 100644 --- a/code/modules/keybindings/keybind/emote.dm +++ b/code/modules/keybindings/keybind/emote.dm @@ -5,7 +5,7 @@ var/emote_key /datum/keybinding/emote/proc/link_to_emote(datum/emote/faketype) - hotkey_keys = list("Unbound") + hotkey_keys = list() emote_key = initial(faketype.key) name = initial(faketype.key) full_name = capitalize(initial(faketype.key)) diff --git a/code/modules/keybindings/keybind/mob.dm b/code/modules/keybindings/keybind/mob.dm index 961eb396cce7..8472f2d4ef7f 100644 --- a/code/modules/keybindings/keybind/mob.dm +++ b/code/modules/keybindings/keybind/mob.dm @@ -6,7 +6,7 @@ hotkey_keys = list("CtrlW", "CtrlNorth") name = "face_north" full_name = "Face North" - description = "" + description = "No description provided." /datum/keybinding/mob/face_north/down(client/user) var/mob/M = user.mob @@ -17,7 +17,7 @@ hotkey_keys = list("CtrlD", "CtrlEast") name = "face_east" full_name = "Face East" - description = "" + description = "No description provided." /datum/keybinding/mob/face_east/down(client/user) var/mob/M = user.mob @@ -28,7 +28,7 @@ hotkey_keys = list("CtrlS", "CtrlSouth") name = "face_south" full_name = "Face South" - description = "" + description = "No description provided." /datum/keybinding/mob/face_south/down(client/user) var/mob/M = user.mob @@ -39,7 +39,7 @@ hotkey_keys = list("CtrlA", "CtrlWest") name = "face_west" full_name = "Face West" - description = "" + description = "No description provided." /datum/keybinding/mob/face_west/down(client/user) var/mob/M = user.mob @@ -50,7 +50,7 @@ hotkey_keys = list("J", "Delete") name = "stop_pulling" full_name = "Stop pulling" - description = "" + description = "No description provided." /datum/keybinding/mob/stop_pulling/down(client/user) var/mob/M = user.mob @@ -64,7 +64,7 @@ hotkey_keys = list("Northwest", "F") // HOME name = "cycle_intent_right" full_name = "cycle intent right" - description = "" + description = "No description provided." /datum/keybinding/mob/cycle_intent_right/down(client/user) var/mob/M = user.mob @@ -75,7 +75,7 @@ hotkey_keys = list("Insert", "G") name = "cycle_intent_left" full_name = "cycle intent left" - description = "" + description = "No description provided." /datum/keybinding/mob/cycle_intent_left/down(client/user) var/mob/M = user.mob @@ -86,7 +86,7 @@ hotkey_keys = list("X", "Northeast") // PAGEUP name = "swap_hands" full_name = "Swap hands" - description = "" + description = "No description provided." /datum/keybinding/mob/swap_hands/down(client/user) var/mob/M = user.mob @@ -202,7 +202,7 @@ hotkey_keys = list("Q") name = "drop_item" full_name = "Drop Item" - description = "" + description = "No description provided." /datum/keybinding/mob/drop_item/down(client/user) if(isrobot(user.mob)) //cyborgs can't drop items @@ -218,8 +218,8 @@ /datum/keybinding/mob/toggle_gun_mode hotkey_keys = list("J") name = "toggle_gun_mode" - full_name = "Toggle gun mode between aiming/hostage-taking and immediate fire." - description = "" + full_name = "Aim / Fire Toggle" + description = "Toggle your gun between taking aim at someone/taking hostages, and immediately firing on click." /datum/keybinding/mob/toggle_gun_mode/down(client/user) user.mob.toggle_gun_mode() @@ -242,7 +242,7 @@ return TRUE /datum/keybinding/mob/toggle_move_intent_alternative - hotkey_keys = list("Unbound") + hotkey_keys = list() name = "toggle_move_intent_alt" full_name = "press to cycle move intent" description = "Pressing this cycle to the opposite move intent, does not cycle back" @@ -256,7 +256,7 @@ hotkey_keys = list("Numpad8") name = "target_head_cycle" full_name = "Target: Cycle head" - description = "" + description = "No description provided." /datum/keybinding/mob/target_head_cycle/down(client/user) user.body_toggle_head() @@ -266,7 +266,7 @@ hotkey_keys = list("Numpad4") name = "target_r_arm" full_name = "Target: right arm" - description = "" + description = "No description provided." /datum/keybinding/mob/target_r_arm/down(client/user) user.body_r_arm() @@ -276,7 +276,7 @@ hotkey_keys = list("Numpad5") name = "target_body_chest" full_name = "Target: Body" - description = "" + description = "No description provided." /datum/keybinding/mob/target_body_chest/down(client/user) user.body_chest() @@ -286,7 +286,7 @@ hotkey_keys = list("Numpad6") name = "target_left_arm" full_name = "Target: left arm" - description = "" + description = "No description provided." /datum/keybinding/mob/target_left_arm/down(client/user) user.body_l_arm() @@ -296,7 +296,7 @@ hotkey_keys = list("Numpad1") name = "target_right_leg" full_name = "Target: Right leg" - description = "" + description = "No description provided." /datum/keybinding/mob/target_right_leg/down(client/user) user.body_r_leg() @@ -306,7 +306,7 @@ hotkey_keys = list("Numpad2") name = "target_body_groin" full_name = "Target: Groin" - description = "" + description = "No description provided." /datum/keybinding/mob/target_body_groin/down(client/user) user.body_groin() @@ -316,7 +316,7 @@ hotkey_keys = list("Numpad3") name = "target_left_leg" full_name = "Target: left leg" - description = "" + description = "No description provided." /datum/keybinding/mob/target_left_leg/down(client/user) user.body_l_leg() diff --git a/code/modules/keybindings/keybind/movement.dm b/code/modules/keybindings/keybind/movement.dm index 7d2358d11623..ebcfa276a22d 100644 --- a/code/modules/keybindings/keybind/movement.dm +++ b/code/modules/keybindings/keybind/movement.dm @@ -94,7 +94,7 @@ hotkey_keys = list("CtrlShiftW", "CtrlShiftNorth") name = "pixel_shift_north" full_name = "Pixel Shift North" - description = "" + description = "No description provided." category = CATEGORY_MOVEMENT /datum/keybinding/mob/shift_north/down(client/user) @@ -106,7 +106,7 @@ hotkey_keys = list("CtrlShiftD", "CtrlShiftEast") name = "pixel_shift_east" full_name = "Pixel Shift East" - description = "" + description = "No description provided." category = CATEGORY_MOVEMENT /datum/keybinding/mob/shift_east/down(client/user) @@ -118,7 +118,7 @@ hotkey_keys = list("CtrlShiftS", "CtrlShiftSouth") name = "pixel_shift_south" full_name = "Pixel Shift South" - description = "" + description = "No description provided." category = CATEGORY_MOVEMENT /datum/keybinding/mob/shift_south/down(client/user) @@ -130,7 +130,7 @@ hotkey_keys = list("CtrlShiftA", "CtrlShiftWest") name = "pixel_shift_west" full_name = "Pixel Shift West" - description = "" + description = "No description provided." category = CATEGORY_MOVEMENT /datum/keybinding/mob/shift_west/down(client/user) diff --git a/code/modules/keybindings/setup.dm b/code/modules/keybindings/setup.dm index 1b39171aef1a..8e3ee109ef18 100644 --- a/code/modules/keybindings/setup.dm +++ b/code/modules/keybindings/setup.dm @@ -35,7 +35,7 @@ /client/verb/fix_macros() set name = "Fix Keybindings" set desc = "Re-assert all your macros/keybindings." - set category = "OOC" + set category = VERB_CATEGORY_OOC if(!SSinput.initialized) to_chat(src, "Input hasn't been initialized yet. Wait a while.") return @@ -62,7 +62,7 @@ var/command = macroset[key] winset(src, "[name]-[REF(key)]", "parent=[name];name=[key];command=[command]") -/client/proc/set_macros(datum/preferences/prefs_override = prefs) +/client/proc/set_macros(datum/game_preferences/prefs_override = preferences) set waitfor = FALSE keys_held.Cut() @@ -81,10 +81,10 @@ window.set_mouse_macro() set_hotkeys_preference() - set_hotkeys_button(prefs_override.hotkeys) + set_hotkeys_button(prefs_override.is_hotkeys_mode()) -/client/proc/set_hotkeys_preference(datum/preferences/prefs_override = prefs) - if(prefs_override.hotkeys) +/client/proc/set_hotkeys_preference(datum/game_preferences/prefs_override = preferences) + if(prefs_override.is_hotkeys_mode()) winset(src, null, "map.focus=true input.background-color=[COLOR_INPUT_DISABLED] mainwindow.macro=[SKIN_MACROSET_HOTKEYS]") else winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED] mainwindow.macro=[SKIN_MACROSET_CLASSIC_INPUT]") diff --git a/code/modules/language/language.dm b/code/modules/language/language.dm index 268033e32f01..c491b968da33 100644 --- a/code/modules/language/language.dm +++ b/code/modules/language/language.dm @@ -276,15 +276,15 @@ return 0 /mob/proc/get_language_prefix() - return client?.prefs?.get_primary_language_prefix() || config_legacy.language_prefixes[1] + return config_legacy.language_prefixes[1] /mob/proc/is_language_prefix(prefix) - return client?.prefs?.is_language_prefix(prefix) || (prefix in config_legacy.language_prefixes) + return (prefix in config_legacy.language_prefixes) //TBD /mob/verb/check_languages() set name = "Check Known Languages" - set category = "IC" + set category = VERB_CATEGORY_IC set src = usr var/dat = "Known Languages

" diff --git a/code/modules/language/languages/silicons.dm b/code/modules/language/languages/silicons.dm index 95f1b6796792..9a921a0f87f7 100644 --- a/code/modules/language/languages/silicons.dm +++ b/code/modules/language/languages/silicons.dm @@ -26,7 +26,7 @@ for (var/mob/M in dead_mob_list) if(!istype(M,/mob/new_player) && !istype(M,/mob/living/carbon/brain)) //No meta-evesdropping var/message_to_send = "[message_start] ([ghost_follow_link(speaker, M)]) [message_body]" - if(M.check_mentioned(message) && M.is_preference_enabled(/datum/client_preference/check_mention)) + if(M.check_mentioned(message) && M.get_preference_toggle(/datum/game_preference_toggle/game/legacy_name_highlight)) message_to_send = "[message_to_send]" M.show_message(message_to_send, 2) @@ -39,7 +39,7 @@ continue var/message_to_send = "[message_start] [message_body]" - if(S.check_mentioned(message) && S.is_preference_enabled(/datum/client_preference/check_mention)) + if(S.check_mentioned(message) && S.get_preference_toggle(/datum/game_preference_toggle/game/legacy_name_highlight)) message_to_send = "[message_to_send]" S.show_message(message_to_send, 2) diff --git a/code/modules/media/mediamanager.dm b/code/modules/media/mediamanager.dm index 189e6a85a7be..edc2ed313d15 100644 --- a/code/modules/media/mediamanager.dm +++ b/code/modules/media/mediamanager.dm @@ -54,7 +54,7 @@ /client/verb/change_volume() set name = "Set Volume" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Set jukebox volume" set_new_volume(usr) @@ -140,7 +140,7 @@ /datum/media_manager/proc/send_update() if(!(owner.prefs)) return - if(!owner.is_preference_enabled(/datum/client_preference/play_jukebox) && url != "") + if(!owner.get_preference_toggle(/datum/game_preference_toggle/music/jukebox) && url != "") return // Don't send anything other than a cancel to people with SOUND_STREAMING pref disabled MP_DEBUG("Sending update to mediapanel ([url], [(world.time - start_time) / 10], [volume * source_volume])...") owner << output(list2params(list(url, (world.time - start_time) / 10, volume * source_volume)), "[WINDOW_ID]:SetMusic") diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index 4c5d3cf9bae8..5fa194bf4712 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -302,7 +302,7 @@ /obj/machinery/mining/drill/verb/unload_drill() set name = "Unload Drill" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) unload(usr) @@ -420,7 +420,7 @@ /obj/machinery/mining/brace/verb/rotate_clockwise() set name = "Rotate Brace Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) rotating_clockwise(usr) diff --git a/code/modules/mining/ore_box.dm b/code/modules/mining/ore_box.dm index 72074701defb..b4dfa7255121 100644 --- a/code/modules/mining/ore_box.dm +++ b/code/modules/mining/ore_box.dm @@ -84,7 +84,7 @@ /obj/structure/ore_box/verb/empty_box() set name = "Empty Ore Box" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if(!istype(usr, /mob/living/carbon/human) && !istype(usr, /mob/living/silicon/robot)) //Only living, intelligent creatures with gripping aparatti can empty ore boxes. diff --git a/code/modules/mob/animations.dm b/code/modules/mob/animations.dm index ce25032ee053..9da782411528 100644 --- a/code/modules/mob/animations.dm +++ b/code/modules/mob/animations.dm @@ -249,7 +249,7 @@ note dizziness decrements automatically in the mob's Life() proc. // for(var/m in viewers(A)) // var/mob/M = m // var/client/C = M.client - // if(C && C.is_preference_enabled(/datum/client_preference/attack_icons)) + // if(C && C.get_preference_toggle(/datum/client_preference/attack_icons)) // viewing += M.client // //Animals attacking each other in the distance, probably. Forgeddaboutit. diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 0cde1b1bcdaf..4c0626c6c9fb 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -67,7 +67,7 @@ to_chat(src, "You cannot send deadchat emotes (muted).") return - if(!is_preference_enabled(/datum/client_preference/show_dsay)) + if(!get_preference_toggle(/datum/game_preference_toggle/chat/dsay)) to_chat(src, "You have deadchat muted.") return diff --git a/code/modules/mob/floating_message.dm b/code/modules/mob/floating_message.dm index 19c868710912..7ae05e529e09 100644 --- a/code/modules/mob/floating_message.dm +++ b/code/modules/mob/floating_message.dm @@ -37,7 +37,7 @@ var/list/floating_chat_colors = list() var/image/gibberish = speaking ? generate_floating_text(src, speaking.scramble(message), style, fontsize, duration, show_to) : understood for(var/client/C in show_to) - if(!C.mob.is_deaf() && C.is_preference_enabled(/datum/client_preference/overhead_chat)) + if(!C.mob.is_deaf() && C.get_preference_toggle(/datum/game_preference_toggle/game/overhead_chat)) if(C.mob.say_understands(null, speaking)) C.images += understood else diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index 9779d52ec323..a9049881f760 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -4,7 +4,7 @@ if(!client && !teleop) return - if(speaker && !speaker.client && istype(src,/mob/observer/dead) && is_preference_enabled(/datum/client_preference/ghost_ears) && !(speaker in view(src))) + if(speaker && !speaker.client && istype(src,/mob/observer/dead) && get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears) && !(speaker in view(src))) //Does the speaker have a client? It's either random stuff that observers won't care about (Experiment 97B says, 'EHEHEHEHEHEHEHE') //Or someone snoring. So we make it where they won't hear it. return @@ -52,7 +52,7 @@ if(speaker_name != speaker.real_name && speaker.real_name) speaker_name = "[speaker.real_name] ([speaker_name])" track = "([ghost_follow_link(speaker, src)]) " - if(is_preference_enabled(/datum/client_preference/ghost_ears) && (speaker in view(src))) + if(get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears) && (speaker in view(src))) message = "[message]" if(is_deaf()) @@ -65,12 +65,12 @@ var/message_to_send = null if(language) //Hivemind languages already say their names. Also, no indicator if you don't know the language. - if(client && !(language.language_flags & LANGUAGE_HIVEMIND) && say_understands(speaker, language) && language.shorthand && client.is_preference_enabled(/datum/client_preference/language_indicator)) + if(client && !(language.language_flags & LANGUAGE_HIVEMIND) && say_understands(speaker, language) && language.shorthand && client.get_preference_toggle(/datum/game_preference_toggle/chat/language_indicators)) verb += " ([language.shorthand])" message_to_send = "[speaker_name][alt_name] [track][language.format_message(message, verb)]" else message_to_send = "[speaker_name][alt_name] [track][verb], \"[message]\"" - if(check_mentioned(message) && is_preference_enabled(/datum/client_preference/check_mention)) + if(check_mentioned(message) && get_preference_toggle(/datum/game_preference_toggle/game/legacy_name_highlight)) message_to_send = "[message_to_send]" @@ -252,7 +252,7 @@ var/formatted if(language) - if(client && !(language.language_flags & LANGUAGE_HIVEMIND) && say_understands(speaker, language) && language.shorthand && client.is_preference_enabled(/datum/client_preference/language_indicator)) + if(client && !(language.language_flags & LANGUAGE_HIVEMIND) && say_understands(speaker, language) && language.shorthand && client.get_preference_toggle(/datum/game_preference_toggle/chat/language_indicators)) verb += " ([language.shorthand])" formatted = "[language.format_message_radio(message, verb)][part_c]" else @@ -270,20 +270,20 @@ /mob/proc/on_hear_radio(part_a, speaker_name, track, part_b, formatted) var/final_message = "[part_a][speaker_name][part_b][formatted]" - if(check_mentioned(formatted) && is_preference_enabled(/datum/client_preference/check_mention)) + if(check_mentioned(formatted) && get_preference_toggle(/datum/game_preference_toggle/game/legacy_name_highlight)) final_message = "[final_message]" to_chat(src, final_message) /mob/observer/dead/on_hear_radio(part_a, speaker_name, track, part_b, formatted) var/final_message = "[part_a][track][part_b][formatted]" - if(check_mentioned(formatted) && is_preference_enabled(/datum/client_preference/check_mention)) + if(check_mentioned(formatted) && get_preference_toggle(/datum/game_preference_toggle/game/legacy_name_highlight)) final_message = "[final_message]" to_chat(src, final_message) /mob/living/silicon/on_hear_radio(part_a, speaker_name, track, part_b, formatted) var/time = say_timestamp() var/final_message = "[part_a][speaker_name][part_b][formatted]" - if(check_mentioned(formatted) && is_preference_enabled(/datum/client_preference/check_mention)) + if(check_mentioned(formatted) && get_preference_toggle(/datum/game_preference_toggle/game/legacy_name_highlight)) final_message = "[time][final_message]" else final_message = "[time][final_message]" @@ -292,7 +292,7 @@ /mob/living/silicon/ai/on_hear_radio(part_a, speaker_name, track, part_b, formatted) var/time = say_timestamp() var/final_message = "[part_a][track][part_b][formatted]" - if(check_mentioned(formatted) && is_preference_enabled(/datum/client_preference/check_mention)) + if(check_mentioned(formatted) && get_preference_toggle(/datum/game_preference_toggle/game/legacy_name_highlight)) final_message = "[time][final_message]" else final_message = "[time][final_message]" diff --git a/code/modules/mob/living/autohiss.dm b/code/modules/mob/living/autohiss.dm index c018ebd7715f..35ee630816a0 100644 --- a/code/modules/mob/living/autohiss.dm +++ b/code/modules/mob/living/autohiss.dm @@ -85,7 +85,7 @@ /mob/living/carbon/human/verb/toggle_autohiss() set name = "Toggle Autohiss" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Toggle your autohiss configuration between disabled, basic, and full." switch(autohiss_mode) @@ -102,7 +102,7 @@ /mob/living/carbon/human/verb/toggle_autohiss_type() set name = "Toggle Autohiss Type" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Set the type of autohissing you will do." var/new_autohiss_type = input(usr, "Select your new autohiss type.", "Autohiss Type") in list("None", SPECIES_UNATHI, "Tajaran") diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index ef2d3f2a6f9d..40dc650e890b 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -39,7 +39,7 @@ /obj/item/mmi/verb/toggle_radio() set name = "Toggle Brain Radio" set desc = "Enables or disables the integrated brain radio, which is only usable outside of a body." - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr set popup_menu = 1 if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) diff --git a/code/modules/mob/living/carbon/brain/emote.dm b/code/modules/mob/living/carbon/brain/emote.dm index 94136bfb3478..876ccfeae8e0 100644 --- a/code/modules/mob/living/carbon/brain/emote.dm +++ b/code/modules/mob/living/carbon/brain/emote.dm @@ -68,7 +68,7 @@ for(var/mob/M in dead_mob_list) if (!M.client || istype(M, /mob/new_player)) continue //skip monkeys, leavers, and new_players - if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_sight) && !(M in viewers(src,null))) + if(M.stat == DEAD && M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_sight) && !(M in viewers(src,null))) M.show_message(message) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index eb87ea70b47a..7726bbf3fe56 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -235,7 +235,7 @@ /mob/living/carbon/verb/mob_sleep() set name = "Sleep" - set category = "IC" + set category = VERB_CATEGORY_IC if(is_sleeping()) diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index ce50e9918484..e08567103dcd 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -1,5 +1,5 @@ /mob/living/carbon/human/verb/give(var/mob/living/carbon/target in valid_give_mobs()) - set category = "IC" + set category = VERB_CATEGORY_IC set name = "Give" // TODO : Change to incapacitated() on merge. diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 7841f8e36698..dc6a4f7a171a 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -1055,7 +1055,7 @@ /mob/living/carbon/human/verb/pose() set name = "Set Pose" set desc = "Sets a description which will be shown when someone examines you." - set category = "IC" + set category = VERB_CATEGORY_IC var/datum/gender/T = GLOB.gender_datums[get_visible_gender()] @@ -1066,7 +1066,7 @@ /mob/living/carbon/human/verb/set_flavor() set name = "Set Flavour Text" set desc = "Sets an extended description of your character's features." - set category = "IC" + set category = VERB_CATEGORY_IC var/HTML = "" HTML += "
" @@ -1307,7 +1307,7 @@ /mob/living/carbon/human/verb/toggle_gender_identity_vr() set name = "Set Gender Identity" set desc = "Sets the pronouns when examined and performing an emote." - set category = "IC" + set category = VERB_CATEGORY_IC var/new_gender_identity = input("Please select a gender Identity.") as null|anything in list(FEMALE, MALE, NEUTER, PLURAL, HERM) if(!new_gender_identity) return 0 @@ -1316,7 +1316,7 @@ /mob/living/carbon/human/verb/switch_tail_layer() set name = "Switch tail layer" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Switch tail layer on top." tail_alt = !tail_alt update_tail_showing() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index b3d354b9381a..59c9e65f598f 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1049,7 +1049,7 @@ organ.status |= ORGAN_BLEEDING /mob/living/carbon/human/verb/check_pulse() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Check pulse" set desc = "Approximately count somebody's pulse. Requires you to stand still at least 6 seconds." set src in view(1) @@ -1205,7 +1205,7 @@ return set_species(/datum/species/human, force = force) /mob/living/carbon/human/proc/bloody_doodle() - set category = "IC" + set category = VERB_CATEGORY_IC set name = "Write in blood" set desc = "Use blood on your hands to write a short message on the floor or a wall, murder mystery style." @@ -1399,7 +1399,7 @@ return 1 /mob/living/carbon/human/proc/relocate() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Relocate Joint" set desc = "Pop a joint back into place. Extremely painful." set src in view(1) @@ -1460,7 +1460,7 @@ /mob/living/carbon/human/verb/toggle_underwear() set name = "Toggle Underwear" set desc = "Shows/hides selected parts of your underwear." - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(stat) return var/datum/category_group/underwear/UWC = input(usr, "Choose underwear:", "Show/hide underwear") as null|anything in GLOB.global_underwear.categories @@ -1477,7 +1477,7 @@ /mob/living/carbon/human/verb/pull_punches() set name = "Pull Punches" set desc = "Try not to hurt them." - set category = "IC" + set category = VERB_CATEGORY_IC if(stat) return pulling_punches = !pulling_punches diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 44c0112a272f..56cf6cf52b3e 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -417,7 +417,7 @@ /mob/living/carbon/human/verb/check_attacks() set name = "Check Attacks" - set category = "IC" + set category = VERB_CATEGORY_IC set src = usr var/dat = "Known Attacks

" diff --git a/code/modules/mob/living/carbon/human/human_modular_limbs.dm b/code/modules/mob/living/carbon/human/human_modular_limbs.dm index 6c2691a049c9..d430cd66883b 100644 --- a/code/modules/mob/living/carbon/human/human_modular_limbs.dm +++ b/code/modules/mob/living/carbon/human/human_modular_limbs.dm @@ -139,7 +139,7 @@ // Add or remove robotic limbs; check refresh_modular_limb_verbs() above. /mob/living/carbon/human/proc/attach_limb_verb() set name = "Attach Limb" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Attach a replacement limb." var/obj/item/organ/external/E = get_active_held_item() @@ -168,7 +168,7 @@ /mob/living/carbon/human/proc/detach_limb_verb() set name = "Remove Limb" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Detach one of your limbs." var/list/detachable_limbs = get_modular_limbs(return_first_found = FALSE, validate_proc = /obj/item/organ/external/proc/can_remove_modular_limb) diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 4257e89145cc..3eeafaaa6b1f 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -4,7 +4,7 @@ /mob/living/carbon/human/proc/tie_hair() set name = "Tie Hair" set desc = "Style your hair." - set category = "IC" + set category = VERB_CATEGORY_IC if(incapacitated()) to_chat(src, SPAN_WARNING("You can't mess with your hair right now!")) @@ -176,7 +176,7 @@ /mob/living/carbon/human/proc/self_diagnostics() set name = "Self-Diagnostics" set desc = "Run an internal self-diagnostic to check for damage." - set category = "IC" + set category = VERB_CATEGORY_IC if(stat == DEAD) return @@ -217,7 +217,7 @@ /mob/living/carbon/human/proc/setmonitor_state() set name = "Set monitor display" set desc = "Set your monitor display" - set category = "IC" + set category = VERB_CATEGORY_IC if(stat == DEAD) return @@ -314,7 +314,7 @@ /mob/living/carbon/human/verb/toggle_eyes_layer() set name = "Switch Eyes/Monitor Layer" set desc = "Toggle rendering of eyes/monitor above markings." - set category = "IC" + set category = VERB_CATEGORY_IC if(stat) to_chat(src, SPAN_WARNING("You must be awake and standing to perform this action!")) @@ -392,7 +392,7 @@ /mob/living/carbon/human/proc/hide_tail() set name = "Toggle Hide Tail" set desc = "Hide or reveal your tail." - set category = "IC" + set category = VERB_CATEGORY_IC if(tail_style && !tail_style.can_be_hidden) return @@ -403,7 +403,7 @@ /mob/living/carbon/human/proc/hide_wings() set name = "Toggle Hide Wings" set desc = "Hide or reveal your wings." - set category = "IC" + set category = VERB_CATEGORY_IC if(wing_style && !wing_style.can_be_hidden) return @@ -414,7 +414,7 @@ /mob/living/carbon/human/proc/hide_horns() set name = "Toggle Hide Horns" set desc = "Hide or reveal your horns." - set category = "IC" + set category = VERB_CATEGORY_IC if(horn_style && !horn_style.can_be_hidden) return diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index c32a7104fb53..8b77562499d7 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1091,7 +1091,7 @@ if(noisy == TRUE && nutrition < 250 && prob(10)) var/sound/growlsound = sound(get_sfx("hunger_sounds")) var/growlmultiplier = 100 - (nutrition / 250 * 100) - playsound(src, growlsound, vol = growlmultiplier, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/client_preference/digestion_noises) + playsound(src, growlsound, vol = growlmultiplier, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/game_preference_toggle/vore_sounds/digestion_noises) // TODO: stomach and bloodstream organ. if(!isSynthetic()) @@ -1855,7 +1855,7 @@ if(!H || (H.robotic >= ORGAN_ROBOT)) return - if(pulse >= PULSE_2FAST || shock_stage >= 10 || (istype(get_turf(src), /turf/space) && is_preference_enabled(/datum/client_preference/play_ambiance))) + if(pulse >= PULSE_2FAST || shock_stage >= 10 || (istype(get_turf(src), /turf/space) && get_preference_toggle(/datum/game_preference_toggle/ambience/area_ambience))) //PULSE_THREADY - maximum value for pulse, currently it 5. //High pulse value corresponds to a fast rate of heartbeat. //Divided by 2, otherwise it is too slow. diff --git a/code/modules/mob/living/default_language.dm b/code/modules/mob/living/default_language.dm index e74cbd42a479..93bc61722b2d 100644 --- a/code/modules/mob/living/default_language.dm +++ b/code/modules/mob/living/default_language.dm @@ -3,7 +3,7 @@ /mob/living/verb/set_default_language(language as anything in languages) set name = "Set Default Language" - set category = "IC" + set category = VERB_CATEGORY_IC if (only_species_language && language != SScharacters.resolve_language_name(species_language)) to_chat(src, "You can only speak your species language, [src.species_language].") @@ -28,7 +28,7 @@ /mob/living/verb/check_default_language() set name = "Check Default Language" - set category = "IC" + set category = VERB_CATEGORY_IC if(default_language) to_chat(src, "You are currently speaking [default_language] by default.") diff --git a/code/modules/mob/living/inventory.dm b/code/modules/mob/living/inventory.dm index 9402e61f59ff..c976de7746d7 100644 --- a/code/modules/mob/living/inventory.dm +++ b/code/modules/mob/living/inventory.dm @@ -221,7 +221,7 @@ /mob/living/mode() set name = "Activate Held Object" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src = usr if(world.time <= next_click) // This isn't really a 'click' but it'll work for our purposes. diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 5c9b43483fa1..51241bb0c7e2 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -46,7 +46,7 @@ //mob verbs are faster than object verbs. See mob/verb/examine. /mob/living/verb/pulled(atom/movable/AM as mob|obj in oview(1)) set name = "Pull" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(AM.Adjacent(src)) start_pulling(AM) @@ -426,7 +426,7 @@ default behaviour is: /mob/living/proc/Examine_OOC() set name = "Examine Meta-Info (OOC)" - set category = "OOC" + set category = VERB_CATEGORY_OOC set src in view() // Making it so SSD people have prefs with fallback to original style. diff --git a/code/modules/mob/living/living_vr.dm b/code/modules/mob/living/living_vr.dm index 8e94f9f7c707..3466f9e54fc7 100644 --- a/code/modules/mob/living/living_vr.dm +++ b/code/modules/mob/living/living_vr.dm @@ -1,5 +1,5 @@ /mob/living/verb/customsay() - set category = "IC" + set category = VERB_CATEGORY_IC set name = "Customise Speech Verbs" set desc = "Customise the text which appears when you type- e.g. 'says', 'asks', 'exclaims'." diff --git a/code/modules/mob/living/mobility.dm b/code/modules/mob/living/mobility.dm index a43e085e4b90..806aff17988d 100644 --- a/code/modules/mob/living/mobility.dm +++ b/code/modules/mob/living/mobility.dm @@ -174,7 +174,7 @@ /mob/living/verb/lay_down() set name = "Rest" - set category = "IC" + set category = VERB_CATEGORY_IC to_chat(src, "You are now [resting_intentionally ? "attempting to stay upright." : "resting intentionally."]") toggle_intentionally_resting() diff --git a/code/modules/mob/living/resist.dm b/code/modules/mob/living/resist.dm index 4b73a7c3641f..6b01f7b48366 100644 --- a/code/modules/mob/living/resist.dm +++ b/code/modules/mob/living/resist.dm @@ -1,6 +1,6 @@ /mob/living/verb/resist() set name = "Resist" - set category = "IC" + set category = VERB_CATEGORY_IC if(!incapacitated(INCAPACITATION_KNOCKOUT) && canClick()) setClickCooldown(20) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 3a0496bfc653..97a6ebf8f52d 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -229,10 +229,6 @@ var/list/channel_to_radio_key = new //Autohiss handles auto-rolling tajaran R's and unathi S's/Z's message = handle_autohiss(message, speaking) - //autocorrect common typos - if(client?.is_preference_enabled(/datum/client_preference/autocorrect)) - message = autocorrect(message) - //Whisper vars var/w_scramble_range = 3 //The range at which you get ***as*th**wi**** var/w_adverb //An adverb prepended to the verb in whispers diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index eef605f58535..fa5eb18cd5c0 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -735,7 +735,7 @@ var/list/ai_verbs_default = list( // Pass lying down or getting up to our pet human, if we're in a hardsuit. /mob/living/silicon/ai/lay_down() set name = "Rest" - set category = "IC" + set category = VERB_CATEGORY_IC resting = 0 var/obj/item/hardsuit/hardsuit = src.get_hardsuit() diff --git a/code/modules/mob/living/silicon/ai/latejoin.dm b/code/modules/mob/living/silicon/ai/latejoin.dm index 318717d1eab2..eb0ec74e2d8e 100644 --- a/code/modules/mob/living/silicon/ai/latejoin.dm +++ b/code/modules/mob/living/silicon/ai/latejoin.dm @@ -2,7 +2,7 @@ GLOBAL_LIST_EMPTY(empty_playable_ai_cores) /mob/living/silicon/ai/verb/store_core() set name = "Store Core" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Enter intelligence storage. This is functionally equivalent to cryo or robotic storage, freeing up your job slot." if(SSticker && SSticker.mode && SSticker.mode.name == "AI malfunction") diff --git a/code/modules/mob/living/silicon/pai/verbs.dm b/code/modules/mob/living/silicon/pai/verbs.dm index 94fe7d628565..484b7a37c8d9 100644 --- a/code/modules/mob/living/silicon/pai/verbs.dm +++ b/code/modules/mob/living/silicon/pai/verbs.dm @@ -30,7 +30,7 @@ /mob/living/silicon/pai/lay_down() set name = "Rest" - set category = "IC" + set category = VERB_CATEGORY_IC // Pass lying down or getting up to our pet human, if we're in a hardsuit. if(src.loc == shell) @@ -63,7 +63,7 @@ /mob/living/silicon/pai/verb/wipe_software() set name = "Wipe Software" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Wipe your software. This is functionally equivalent to cryo or robotic storage, freeing up your job slot." // Make sure people don't kill themselves accidentally diff --git a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm index 22848219859a..29753b3839f0 100644 --- a/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm +++ b/code/modules/mob/living/silicon/robot/dogborg/dog_sleeper_vr.dm @@ -78,7 +78,7 @@ if(do_after(user, 30, target) && length(contents) < max_item_count) AM.forceMove(src) user.visible_message("[hound.name]'s [src.name] groans lightly as [target.name] slips inside.", "Your [src.name] groans lightly as [target] slips inside.") - playsound(hound, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/client_preference/eating_noises) + playsound(hound, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/game_preference_toggle/vore_sounds/eating_noises) if(analyzer && istype(target,/obj/item)) var/obj/item/tech_item = target for(var/T in tech_item.origin_tech) @@ -96,7 +96,7 @@ trashmouse.forceMove(src) trashmouse.update_perspective(src) user.visible_message("[hound.name]'s [src.name] groans lightly as [trashmouse] slips inside.", "Your [src.name] groans lightly as [trashmouse] slips inside.") - playsound(hound, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/client_preference/eating_noises) + playsound(hound, gulpsound, vol = 60, vary = 1, falloff = 0.1, preference = /datum/game_preference_toggle/vore_sounds/eating_noises) if(delivery) if(islist(deliverylists[delivery_tag])) deliverylists[delivery_tag] |= trashmouse @@ -118,7 +118,7 @@ START_PROCESSING(SSobj, src) user.visible_message("[hound.name]'s [src.name] groans lightly as [trashman] slips inside.", "Your [src.name] groans lightly as [trashman] slips inside.") message_admins("[key_name(hound)] has eaten [key_name(patient)] as a dogborg. ([hound ? "JMP" : "null"])") - playsound(hound, gulpsound, vol = 100, vary = 1, falloff = 0.1, preference = /datum/client_preference/eating_noises) + playsound(hound, gulpsound, vol = 100, vary = 1, falloff = 0.1, preference = /datum/game_preference_toggle/vore_sounds/eating_noises) if(delivery) if(islist(deliverylists[delivery_tag])) deliverylists[delivery_tag] |= trashman @@ -149,7 +149,7 @@ START_PROCESSING(SSobj, src) user.visible_message("[hound.name]'s [src.name] lights up as [H.name] slips inside.", "Your [src] lights up as [H] slips inside. Life support functions engaged.") message_admins("[key_name(hound)] has eaten [key_name(patient)] as a dogborg. ([hound ? "JMP" : "null"])") - playsound(hound, gulpsound, vol = 100, vary = 1, falloff = 0.1, preference = /datum/client_preference/eating_noises) + playsound(hound, gulpsound, vol = 100, vary = 1, falloff = 0.1, preference = /datum/game_preference_toggle/vore_sounds/eating_noises) /obj/item/dogborg/sleeper/proc/go_out(var/target) hound = src.loc @@ -491,11 +491,11 @@ 'sound/vore/death8.ogg', 'sound/vore/death9.ogg', 'sound/vore/death10.ogg') - playsound(hound, finisher, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/client_preference/digestion_noises) + playsound(hound, finisher, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/game_preference_toggle/vore_sounds/digestion_noises) to_chat(hound, "Your [src.name] is now clean. Ending self-cleaning cycle.") cleaning = 0 update_patient() - playsound(hound, 'sound/machines/ding.ogg', vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/client_preference/digestion_noises) + playsound(hound, 'sound/machines/ding.ogg', vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/game_preference_toggle/vore_sounds/digestion_noises) return if(prob(20)) @@ -512,7 +512,7 @@ 'sound/vore/digest10.ogg', 'sound/vore/digest11.ogg', 'sound/vore/digest12.ogg') - playsound(hound, churnsound, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/client_preference/digestion_noises) + playsound(hound, churnsound, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/game_preference_toggle/vore_sounds/digestion_noises) //If the timing is right, and there are items to be touched if(SSair.current_cycle%3==1 && length(touchable_items)) @@ -548,7 +548,7 @@ 'sound/vore/death8.ogg', 'sound/vore/death9.ogg', 'sound/vore/death10.ogg') - playsound(hound, deathsound, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/client_preference/digestion_noises) + playsound(hound, deathsound, vol = 100, vary = 1, falloff = 0.1, ignore_walls = TRUE, preference = /datum/game_preference_toggle/vore_sounds/digestion_noises) if(is_vore_predator(T)) for(var/belly in T.vore_organs) var/obj/belly/B = belly diff --git a/code/modules/mob/living/silicon/robot/drone/drone_say.dm b/code/modules/mob/living/silicon/robot/drone/drone_say.dm index 697c5a27cd26..b88330c5685f 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_say.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_say.dm @@ -32,7 +32,7 @@ for (var/mob/M in GLOB.player_list) if (istype(M, /mob/new_player)) continue - else if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears)) + else if(M.stat == DEAD && M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears)) if(M.client) to_chat(M, "[src] transmits, \"[message]\"") return 1 return ..(message, 0) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index a3dd2ce73494..f5ea6663dc93 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1220,7 +1220,7 @@ /mob/living/silicon/robot/mode() set name = "Activate Held Object" - set category = "IC" + set category = VERB_CATEGORY_IC set src = usr if(world.time <= next_click) // Hard check, before anything else, to avoid crashing @@ -1427,7 +1427,7 @@ /mob/living/silicon/robot/verb/robot_nom(var/mob/living/T in living_mobs(1)) set name = "Robot Nom" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Allows you to eat someone." if (stat != CONSCIOUS) @@ -1436,7 +1436,7 @@ /mob/living/silicon/robot/proc/rest_style() set name = "Switch Rest Style" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Select your resting pose." sitting = FALSE bellyup = FALSE @@ -1451,7 +1451,7 @@ /mob/living/silicon/robot/proc/ex_reserve_refill() set name = "Refill Extinguisher" - set category = "Object" + set category = VERB_CATEGORY_OBJECT var/datum/matter_synth/water = water_res for(var/obj/item/extinguisher/E in module.modules) if(E.reagents.total_volume < E.max_water) diff --git a/code/modules/mob/living/silicon/robot/robot_items.dm b/code/modules/mob/living/silicon/robot/robot_items.dm index 456654c7f8c6..6e40f348ffef 100644 --- a/code/modules/mob/living/silicon/robot/robot_items.dm +++ b/code/modules/mob/living/silicon/robot/robot_items.dm @@ -405,7 +405,7 @@ /obj/item/borg/combat/shield/verb/set_shield_level() set name = "Set shield level" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in range(0) var/N = input("How much damage should the shield absorb?") in list("10","20","30","40","50","60") diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 691cb0625ea2..7932630f2010 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -241,7 +241,7 @@ /mob/living/silicon/check_languages() set name = "Check Known Languages" - set category = "IC" + set category = VERB_CATEGORY_IC set src = usr var/dat = "Known Languages

" @@ -287,7 +287,7 @@ /mob/living/silicon/verb/pose() set name = "Set Pose" set desc = "Sets a description which will be shown when someone examines you." - set category = "IC" + set category = VERB_CATEGORY_IC pose = sanitize(input(usr, "This is [src]. It is...", "Pose", null) as text) @@ -296,7 +296,7 @@ /mob/living/silicon/verb/set_flavor() set name = "Set Flavour Text" set desc = "Sets an extended description of your character's features." - set category = "IC" + set category = VERB_CATEGORY_IC flavor_text = sanitize(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text) diff --git a/code/modules/mob/living/simple_mob/simple_mob_vr.dm b/code/modules/mob/living/simple_mob/simple_mob_vr.dm index b9da81ead8f8..73b8dab42235 100644 --- a/code/modules/mob/living/simple_mob/simple_mob_vr.dm +++ b/code/modules/mob/living/simple_mob/simple_mob_vr.dm @@ -252,7 +252,7 @@ /mob/living/simple_mob/verb/access_mob_radio_legacy() set name = "Access Mob Radio" - set category = "IC" + set category = VERB_CATEGORY_IC if(isnull(mob_radio)) to_chat(usr, SPAN_WARNING("You don't have a radio.")) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm index f32871312706..0944f22c199e 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer.dm @@ -265,5 +265,5 @@ for(var/mob/M in GLOB.player_list) if(istype(M, /mob/new_player)) continue - else if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears)) + else if(M.stat == DEAD && M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears)) to_chat(M, "[src.true_name] whispers to [host], \"[message]\"") diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_captive.dm b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_captive.dm index 231850e73b26..e65d580f316c 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_captive.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/borer/borer_captive.dm @@ -28,7 +28,7 @@ for (var/mob/M in GLOB.player_list) if (istype(M, /mob/new_player)) continue - else if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears)) + else if(M.stat == DEAD && M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears)) to_chat(M, "The captive mind of [src] whispers, \"[message]\"") /mob/living/captive_brain/emote(var/message) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm index 59b2b65d9a6f..d975c3380258 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm @@ -81,7 +81,7 @@ /mob/living/simple_mob/animal/passive/cat/verb/become_friends() set name = "Become Friends" - set category = "IC" + set category = VERB_CATEGORY_IC set src in view(1) var/mob/living/L = usr diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/fox_vr.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/fox_vr.dm index e1f93cd8db91..9f2c2ed24095 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/fox_vr.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/fox_vr.dm @@ -120,7 +120,7 @@ /mob/living/simple_mob/animal/passive/fox/renault/verb/become_friends() set name = "Become Friends" - set category = "IC" + set category = VERB_CATEGORY_IC set src in view(1) var/mob/living/L = usr @@ -179,7 +179,7 @@ /mob/living/simple_mob/animal/passive/fox/fluff/verb/friend() set name = "Become Friends" - set category = "IC" + set category = VERB_CATEGORY_IC set src in view(1) if(friend && usr == friend) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 74191dc0a1a8..3af0ca9ee2b0 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -44,11 +44,6 @@ qdel(hud_used) //remove the hud objects hud_used = new /datum/hud(src) - if(client.prefs && client.prefs.client_fps) - client.fps = client.prefs.client_fps - else - client.fps = 0 // Results in using the server FPS - next_move = 1 disconnect_time = null // Clear the disconnect time diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 5215b27ab157..cc40541682f3 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -309,7 +309,7 @@ */ /mob/verb/examinate(atom/A as mob|obj|turf in view()) //It used to be oview(12), but I can't really say why set name = "Examine" - set category = "IC" + set category = VERB_CATEGORY_IC if(isturf(A) && !(sight & SEE_TURFS) && !(A in view(client ? client.view : world.view, src))) // shift-click catcher may issue examinate() calls for out-of-sight turfs @@ -324,8 +324,8 @@ for(var/mob/M in viewers(4, src)) if(M == src || M.is_blind()) continue - if(M.client && M.client.is_preference_enabled(/datum/client_preference/examine_look)) - to_chat(M, SPAN_TINYNOTICE("\The [src] looks at \the [A].")) + // if(M.client && M.client.get_preference_toggle(/datum/client_preference/examine_look)) + to_chat(M, SPAN_TINYNOTICE("\The [src] looks at \the [A].")) do_examinate(A) @@ -356,7 +356,7 @@ */ /mob/verb/pointed(atom/A as mob|obj|turf in view()) set name = "Point To" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(!src || !isturf(src.loc) || !(A in view(14, src))) return 0 @@ -383,7 +383,7 @@ set name = "Set relative layer" set desc = "Set your relative layer to other mobs on the same layer as yourself" set src = usr - set category = "IC" + set category = VERB_CATEGORY_IC var/new_layer = input(src, "What do you want to shift your layer to? (-100 to 100)", "Set Relative Layer", clamp(relative_layer, -100, 100)) new_layer = clamp(new_layer, -100, 100) @@ -393,7 +393,7 @@ set name = "Move Behind" set desc = "Move behind of a mob with the same base layer as yourself" set src = usr - set category = "IC" + set category = VERB_CATEGORY_IC if(!client.throttle_verb()) return @@ -409,7 +409,7 @@ set name = "Move Infront" set desc = "Move infront of a mob with the same base layer as yourself" set src = usr - set category = "IC" + set category = VERB_CATEGORY_IC if(!client.throttle_verb()) return @@ -441,7 +441,7 @@ */ /mob/verb/mode() set name = "Activate Held Object" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src = usr return @@ -453,7 +453,7 @@ */ /mob/verb/memory() set name = "Notes" - set category = "IC" + set category = VERB_CATEGORY_IC if(mind) mind.show_memory(src) else @@ -464,7 +464,7 @@ */ /mob/verb/add_memory(msg as message) set name = "Add Note" - set category = "IC" + set category = VERB_CATEGORY_IC msg = sanitize(msg) @@ -562,7 +562,7 @@ */ /mob/verb/abandon_mob() set name = "Respawn" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Return to the lobby." // don't lose out on that sweet observer playtime @@ -612,13 +612,13 @@ */ /mob/verb/return_to_menu() set name = "Return to Menu" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Return to the lobby." return abandon_mob() /mob/verb/observe() set name = "Observe" - set category = "OOC" + set category = VERB_CATEGORY_OOC if(stat != DEAD || istype(src, /mob/new_player)) to_chat(usr, "You must be observing to use this!") @@ -815,7 +815,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) return (embedded.len > 0) /mob/proc/yank_out_object() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Yank out object" set desc = "Remove an embedded item at the cost of bleeding and pain." set src in view(1) @@ -924,7 +924,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) /mob/verb/face_direction() set name = "Face Direction" - set category = "IC" + set category = VERB_CATEGORY_IC set src = usr set_face_dir() @@ -1057,7 +1057,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) return TRUE /mob/MouseEntered(location, control, params) - if(usr != src && usr.is_preference_enabled(/datum/client_preference/mob_tooltips) && src.will_show_tooltip()) + if(usr != src && usr.get_preference_toggle(/datum/game_preference_toggle/game/mob_tooltips) && src.will_show_tooltip()) openToolTip(user = usr, tip_src = src, params = params, title = get_nametag_name(usr), content = get_nametag_desc(usr)) ..() @@ -1090,7 +1090,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) /mob/verb/local_diceroll(n as num) set name = "diceroll" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Roll a random number between 1 and a chosen number." set src = usr diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index fd9b6f16800c..487be9a11eae 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -302,7 +302,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) return // Can't talk in deadchat if you can't see it. for(var/mob/M in GLOB.player_list) - if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && M.client.holder.rights)) && M.is_preference_enabled(/datum/client_preference/show_dsay)) + if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && M.client.holder.rights)) && M.get_preference_toggle(/datum/game_preference_toggle/chat/dsay)) var/follow var/lname if(M.forbid_seeing_deadchat && !M.client.holder) @@ -318,7 +318,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) var/mob/observer/dead/DM if(istype(subject, /mob/observer/dead)) DM = subject - var/anonsay = DM?.is_preference_enabled(/datum/client_preference/anonymous_ghost_chat) + var/anonsay = DM?.get_preference_toggle(/datum/game_preference_toggle/presence/anonymous_ghost_chat) if(M.client.holder) // What admins see lname = "[keyname][(anonsay) ? "*" : (DM ? "" : "^")] ([name])" else @@ -333,7 +333,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) /proc/say_dead_object(var/message, var/obj/subject = null) for(var/mob/M in GLOB.player_list) - if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && M.client.holder.rights)) && M.is_preference_enabled(/datum/client_preference/show_dsay)) + if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && M.client.holder.rights)) && M.get_preference_toggle(/datum/game_preference_toggle/chat/dsay)) var/follow var/lname = "Game Master" if(M.forbid_seeing_deadchat && !M.client.holder) @@ -363,7 +363,7 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) C = M.original.client if(C) - if(!isnull(C.holder?.fakekey) || !C.is_preference_enabled(/datum/client_preference/announce_ghost_joinleave)) + if(!isnull(C.holder?.fakekey) || !C.get_preference_toggle(/datum/game_preference_toggle/presence/announce_ghost_joinleave)) return var/name if(C.mob) @@ -402,8 +402,8 @@ var/list/intents = list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM) if(source) var/atom/movable/screen/alert/notify_action/A = O.throw_alert("[REF(source)]_notify_action", /atom/movable/screen/alert/notify_action) if(A) - if(O.client.prefs && O.client.prefs.UI_style) - A.icon = ui_style2icon(O.client.prefs.UI_style) + if(O.get_preference_entry(/datum/game_preference_entry/dropdown/hud_style)) + A.icon = ui_style2icon(O.get_preference_entry(/datum/game_preference_entry/dropdown/hud_style)) if (header) A.name = header A.desc = message diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index 9eb197bb4018..0aa83c75b444 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -18,7 +18,6 @@ new_player_panel() spawn(40) if(client) - handle_privacy_poll() client.playtitlemusic() return ..() diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 122742c19416..1627c58d1cb9 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -35,6 +35,7 @@ var/output = "
" output +="
" output += "

Character Setup

" + output += "

Game Preferences

" if(!SSticker || SSticker.current_state <= GAME_STATE_PREGAME) if(ready) @@ -75,7 +76,7 @@ output += "
" - panel = new(src, "Welcome","Welcome", 210, 280, src) + panel = new(src, "Welcome","Welcome", 210, 325, src) panel.set_window_options("can_close=0") panel.set_content(output) panel.open() @@ -122,6 +123,14 @@ client.prefs.ShowChoices(src) return 1 + if(href_list["game_preferences"]) + if(!client.reject_age_unverified()) + return + if(!client.reject_on_initialization_block()) + return + client.preferences.ui_interact(src) + return 1 + if(href_list["ready"]) if(!client.reject_age_unverified()) return @@ -349,8 +358,6 @@ return var/savefile/F = get_server_news() if(F) - client.prefs.lastnews = md5(F["body"]) - SScharacters.queue_preferences_save(client.prefs) var/dat = "
" dat += "

[F["title"]]

" @@ -363,6 +370,10 @@ popup.set_content(dat) popup.open() + if(client.player.block_on_available()) + client.player.player_misc["lastnews"] = md5(F["body"]) + client.player.save() + /mob/new_player/proc/time_till_respawn() if(!ckey) return -1 // What? diff --git a/code/modules/mob/new_player/poll.dm b/code/modules/mob/new_player/poll.dm index f90ebdba3e3f..42626b9851f8 100644 --- a/code/modules/mob/new_player/poll.dm +++ b/code/modules/mob/new_player/poll.dm @@ -1,52 +1,3 @@ - -/mob/new_player/proc/handle_privacy_poll() - if(!SSdbcore.Connect()) - return - - var/voted = 0 - - var/datum/db_query/query = SSdbcore.RunQuery( - "SELECT * FROM [format_table_name("privacy")] WHERE ckey = :ckey", - list( - "ckey" = ckey - ) - ) - - while(query.NextRow()) - voted = 1 - break - - if(!voted) - privacy_poll() - -/mob/new_player/proc/privacy_poll() - var/output = "
Player poll" - output +="
" - output += "We would like to expand our stats gathering." - output += "
This however involves gathering data about player behavior, play styles, unique player numbers, play times, etc. Data like that cannot be gathered fully anonymously, which is why we're asking you how you'd feel if player-specific data was gathered. Prior to any of this actually happening, a privacy policy will be discussed, but before that can begin, we'd preliminarily like to know how you feel about the concept." - output +="
" - output += "How do you feel about the game gathering player-specific statistics? This includes statistics about individual players as well as in-game polling/opinion requests." - - output += "

Signed stats gathering" - output += "
Pick this option if you think usernames should be logged with stats. This allows us to have personalized stats as well as polls." - - output += "

Anonymous stats gathering" - output += "
Pick this option if you think only hashed (indecipherable) usernames should be logged with stats. This doesn't allow us to have personalized stats, as we can't tell who is who (hashed values aren't readable), we can however have ingame polls." - - output += "

No stats gathering" - output += "
Pick this option if you don't want player-specific stats gathered. This does not allow us to have player-specific stats or polls." - - output += "

Ask again later" - output += "
This poll will be brought up again next round." - - output += "

Don't ask again" - output += "
Only pick this if you are fine with whatever option wins." - - output += "

" - - src << browse(output,"window=privacypoll;size=600x500") - return - /datum/polloption var/optionid var/optiontext diff --git a/code/modules/mob/new_player/skill.dm b/code/modules/mob/new_player/skill.dm index 91addb4739b8..1efbfc1152f6 100644 --- a/code/modules/mob/new_player/skill.dm +++ b/code/modules/mob/new_player/skill.dm @@ -189,7 +189,7 @@ var/global/list/SKILL_PRE = list("Engineer" = SKILL_ENGINEER, "Roboticist" = SKI return /mob/living/carbon/human/verb/show_skills() - set category = "IC" + set category = VERB_CATEGORY_IC set name = "Show Own Skills" show_skill_window(src, src) diff --git a/code/modules/mob/observer/dead/dead.dm b/code/modules/mob/observer/dead/dead.dm index c2fa4371a2e4..f92102db5cd9 100644 --- a/code/modules/mob/observer/dead/dead.dm +++ b/code/modules/mob/observer/dead/dead.dm @@ -225,7 +225,7 @@ GLOBAL_LIST_EMPTY(observer_list) This is the proc mobs get to turn into a ghost. Forked from ghostize due to compatibility issues. */ /mob/living/verb/ghost() - set category = "OOC" + set category = VERB_CATEGORY_OOC set name = "Ghost" set desc = "Relinquish your life and enter the land of the dead." @@ -658,18 +658,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp // Give the ghost a cult icon which should be visible only to itself toggle_icon("cult") -/mob/observer/dead/verb/toggle_anonsay() - set category = "Ghost" - set name = "Toggle Anonymous Chat" - set desc = "Toggles showing your key in dead chat." - - client.toggle_preference(/datum/client_preference/anonymous_ghost_chat) - SScharacters.queue_preferences_save(client.prefs) - if(is_preference_enabled(/datum/client_preference/anonymous_ghost_chat)) - to_chat(src, "Your key won't be shown when you speak in dead chat.") - else - to_chat(src, "Your key will be publicly visible again.") - /mob/observer/dead/canface() return 1 @@ -717,7 +705,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/observer/dead/proc/ghost_whisper() set name = "Spectral Whisper" - set category = "IC" + set category = VERB_CATEGORY_IC if(is_manifest) //Only able to whisper if it's hit with a tome. var/list/options = list() diff --git a/code/modules/mob/observer/dead/free_vr.dm b/code/modules/mob/observer/dead/free_vr.dm index 0db6c2adfdec..3462b69d2bf7 100644 --- a/code/modules/mob/observer/dead/free_vr.dm +++ b/code/modules/mob/observer/dead/free_vr.dm @@ -8,7 +8,7 @@ var/global/list/prevent_respawns = list() /mob/observer/dead/verb/cleanup() set name = "Quit This Round" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Free your job slot, remove yourself from the manifest, and prevent respawning as this character for this round." var/confirm = alert("This will free up your job slot, remove you from the manifest, and allow you to respawn as this character. You can rejoin as another \ diff --git a/code/modules/mob/perspective.dm b/code/modules/mob/perspective.dm index 3495afeeaefd..37c0d2a8afe6 100644 --- a/code/modules/mob/perspective.dm +++ b/code/modules/mob/perspective.dm @@ -70,7 +70,7 @@ */ /mob/verb/cancel_camera() set name = "Cancel Camera View" - set category = "OOC" + set category = VERB_CATEGORY_OOC reset_perspective(no_optimizations = TRUE, apply = TRUE, forceful = TRUE) diff --git a/code/modules/mob/pulling.dm b/code/modules/mob/pulling.dm index 6d9d047f0fcb..fa5844bbe1ee 100644 --- a/code/modules/mob/pulling.dm +++ b/code/modules/mob/pulling.dm @@ -128,7 +128,7 @@ /mob/verb/stop_pulling_verb() set name = "Stop Pulling" - set category = "IC" + set category = VERB_CATEGORY_IC stop_pulling() /mob/stop_pulling() diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index c0f49fe8d772..85bc9b61c77c 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -14,20 +14,20 @@ /mob/verb/whisper(message as text) set name = "Whisper" - set category = "IC" + set category = VERB_CATEGORY_IC usr.say(message,whispering=1) /mob/verb/say_verb(message as text) set name = "Say" - set category = "IC" + set category = VERB_CATEGORY_IC set_typing_indicator(FALSE) usr.say(message) /mob/verb/me_verb(message as message) set name = "Me" - set category = "IC" + set category = VERB_CATEGORY_IC if(muffled) return me_verb_subtle(message) @@ -48,7 +48,7 @@ to_chat(src, "Deadchat is globally muted.") return - if(!is_preference_enabled(/datum/client_preference/show_dsay)) + if(!get_preference_toggle(/datum/game_preference_toggle/chat/dsay)) to_chat(src, "You have deadchat muted.") return diff --git a/code/modules/mob/say_vr.dm b/code/modules/mob/say_vr.dm index 90a21112b716..090f1843fe6c 100644 --- a/code/modules/mob/say_vr.dm +++ b/code/modules/mob/say_vr.dm @@ -4,7 +4,7 @@ /mob/verb/me_verb_subtle(message as message) //This would normally go in say.dm set name = "Subtle" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Emote to nearby people (and your pred/prey)" message = sanitize_or_reflect(message,src) // Reflect too-long messages (within reason) @@ -48,7 +48,7 @@ for(var/vismob in vis_mobs) var/mob/M = vismob if(istype(vismob, /mob/observer)) - if(M.client && !M.client.is_preference_enabled(/datum/client_preference/subtle_see)) + if(M.client && !M.client.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_subtle)) continue spawn(0) M.show_message(message, SAYCODE_TYPE_ALWAYS) @@ -70,7 +70,7 @@ /mob/verb/subtler_anti_ghost(message as message) //This would normally go in say.dm set name = "Subtler Anti Ghost" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Emote to nearby people (and your pred/prey), but ghosts can't see it." message = sanitize_or_reflect(message,src) // Reflect too-long messages (within reason) diff --git a/code/modules/mob/typing_indicator.dm b/code/modules/mob/typing_indicator.dm index 642e4ef0a4d2..1ec21b7e23c8 100644 --- a/code/modules/mob/typing_indicator.dm +++ b/code/modules/mob/typing_indicator.dm @@ -8,9 +8,6 @@ typing_indicator.appearance_flags |= RESET_COLOR | PIXEL_SCALE /mob/proc/set_typing_indicator(state) - if(!is_preference_enabled(/datum/client_preference/show_typing_indicator)) - state = FALSE - if(!state) if(!typing) return diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm index f2ddbc5e9e09..28fc9219d1e6 100644 --- a/code/modules/modular_computers/computers/modular_computer/interaction.dm +++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm @@ -9,7 +9,7 @@ // Forcibly shut down the device. To be used when something bugs out and the UI is nonfunctional. /obj/item/modular_computer/verb/emergency_shutdown() set name = "Forced Shutdown" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if(usr.incapacitated() || !istype(usr, /mob/living)) @@ -33,7 +33,7 @@ // Eject ID card from computer, if it has ID slot with card inside. /obj/item/modular_computer/verb/eject_id() set name = "Eject ID" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if(usr.incapacitated() || !istype(usr, /mob/living)) @@ -49,7 +49,7 @@ // Eject ID card from computer, if it has ID slot with card inside. /obj/item/modular_computer/verb/eject_usb() set name = "Eject Portable Storage" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) if(usr.incapacitated() || !istype(usr, /mob/living)) diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index fe8fc8bf9935..6fd20f3e8187 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -1,13 +1,13 @@ /mob/verb/up() set name = "Move Upwards" - set category = "IC" + set category = VERB_CATEGORY_IC if(zMove(UP)) to_chat(src, SPAN_NOTICE("You move upwards.")) /mob/verb/down() set name = "Move Downwards" - set category = "IC" + set category = VERB_CATEGORY_IC if(zMove(DOWN)) to_chat(src, SPAN_NOTICE("You move down.")) diff --git a/code/modules/multiz/structures/hoist.dm b/code/modules/multiz/structures/hoist.dm index 993a42465a9d..f2459acaf4bf 100644 --- a/code/modules/multiz/structures/hoist.dm +++ b/code/modules/multiz/structures/hoist.dm @@ -222,7 +222,7 @@ /obj/structure/hoist/verb/collapse_hoist() set name = "Collapse Hoist" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in range(1) if (!ishuman(usr)) diff --git a/code/modules/nifsoft/nif.dm b/code/modules/nifsoft/nif.dm index b8f29e5bd79c..fae85bb5c90a 100644 --- a/code/modules/nifsoft/nif.dm +++ b/code/modules/nifsoft/nif.dm @@ -694,7 +694,7 @@ GLOBAL_LIST_INIT(nif_id_lookup, init_nif_id_lookup()) /mob/living/carbon/human/proc/set_nif_examine() set name = "NIF Appearance" set desc = "If your NIF alters your appearance in some way, describe it here." - set category = "OOC" + set category = VERB_CATEGORY_OOC if(!nif) remove_verb(src, /mob/living/carbon/human/proc/set_nif_examine) diff --git a/code/modules/nifsoft/nif_tgui.dm b/code/modules/nifsoft/nif_tgui.dm index ad09f0c6535b..7fbb9231c3ff 100644 --- a/code/modules/nifsoft/nif_tgui.dm +++ b/code/modules/nifsoft/nif_tgui.dm @@ -86,7 +86,7 @@ */ /mob/living/carbon/human/proc/nif_menu() set name = "NIF Menu" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Open the NIF user interface." var/obj/item/nif/N = nif diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm index 95230b553240..e418080f2800 100644 --- a/code/modules/nifsoft/software/13_soulcatcher.dm +++ b/code/modules/nifsoft/software/13_soulcatcher.dm @@ -498,7 +498,7 @@ /mob/living/carbon/brain/caught_soul/resist() set name = "Resist" - set category = "IC" + set category = VERB_CATEGORY_IC to_chat(src,SPAN_WARNING("There's no way out! You're stuck in VR.")) @@ -603,7 +603,7 @@ /mob/living/carbon/human/proc/nsay(message as text) set name = "NSay" set desc = "Speak into your NIF's Soulcatcher." - set category = "IC" + set category = VERB_CATEGORY_IC src.nsay_act(message) @@ -633,7 +633,7 @@ /mob/living/carbon/human/proc/nme(message as message|null) set name = "NMe" set desc = "Emote into your NIF's Soulcatcher." - set category = "IC" + set category = VERB_CATEGORY_IC src.nme_act(message) diff --git a/code/modules/organs/internal/subtypes/eyes.dm b/code/modules/organs/internal/subtypes/eyes.dm index 25c71d50b2a1..f6fc2d69a4e4 100644 --- a/code/modules/organs/internal/subtypes/eyes.dm +++ b/code/modules/organs/internal/subtypes/eyes.dm @@ -35,7 +35,7 @@ /obj/item/organ/internal/eyes/proc/change_eye_color() set name = "Change Eye Color" set desc = "Changes your robotic eye color instantly." - set category = "IC" + set category = VERB_CATEGORY_IC set src in usr var/current_color = rgb(eye_colour[1],eye_colour[2],eye_colour[3]) diff --git a/code/modules/paperwork/carbonpaper.dm b/code/modules/paperwork/carbonpaper.dm index 4ed61dec5f3d..b4546383133a 100644 --- a/code/modules/paperwork/carbonpaper.dm +++ b/code/modules/paperwork/carbonpaper.dm @@ -27,7 +27,7 @@ /obj/item/paper/carbon/verb/removecopy() set name = "Remove carbon-copy" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if (copied == 0) diff --git a/code/modules/paperwork/paper/paper.dm b/code/modules/paperwork/paper/paper.dm index a2e7b6c01de5..dc438275981d 100644 --- a/code/modules/paperwork/paper/paper.dm +++ b/code/modules/paperwork/paper/paper.dm @@ -113,7 +113,7 @@ /obj/item/paper/verb/rename() set name = "Rename paper" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if((MUTATION_CLUMSY in usr.mutations) && prob(50)) diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index 97c67398702c..20a22984aa43 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -185,7 +185,7 @@ /obj/item/paper_bundle/verb/rename() set name = "Rename bundle" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr var/n_name = sanitizeSafe(input(usr, "What would you like to label the bundle?", "Bundle Labelling", null) as text, MAX_NAME_LEN) @@ -197,7 +197,7 @@ /obj/item/paper_bundle/verb/remove_all() set name = "Loose bundle" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr to_chat(usr, "You loosen the bundle.") diff --git a/code/modules/paperwork/papershredder.dm b/code/modules/paperwork/papershredder.dm index 53261b7c303d..bc34e1e48e3f 100644 --- a/code/modules/paperwork/papershredder.dm +++ b/code/modules/paperwork/papershredder.dm @@ -80,7 +80,7 @@ /obj/machinery/papershredder/verb/empty_contents() set name = "Empty bin" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in range(1) if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) diff --git a/code/modules/paperwork/pen.dm b/code/modules/paperwork/pen.dm index 804d2eea1a51..6c44c94cc9d3 100644 --- a/code/modules/paperwork/pen.dm +++ b/code/modules/paperwork/pen.dm @@ -286,7 +286,7 @@ /obj/item/pen/chameleon/verb/set_colour() set name = "Change Pen Colour" - set category = "Object" + set category = VERB_CATEGORY_OBJECT var/list/possible_colours = list ("Yellow", "Green", "Pink", "Blue", "Orange", "Cyan", "Red", "Invisible", "Black") var/selected_type = input("Pick new colour.", "Pen Colour", null, null) as null|anything in possible_colours diff --git a/code/modules/photography/camera.dm b/code/modules/photography/camera.dm index 84e03e4ae224..a3a68f0c5acc 100644 --- a/code/modules/photography/camera.dm +++ b/code/modules/photography/camera.dm @@ -21,7 +21,7 @@ /obj/item/camera/verb/change_size() set name = "Set Photo Focus" - set category = "Object" + set category = VERB_CATEGORY_OBJECT var/nsize = input("Photo Size","Pick a size of resulting photo.") as null|anything in list(1,3,5,7) if(nsize) size = nsize diff --git a/code/modules/photography/photo.dm b/code/modules/photography/photo.dm index fd7f1ead2e32..a596969f9470 100644 --- a/code/modules/photography/photo.dm +++ b/code/modules/photography/photo.dm @@ -123,7 +123,7 @@ // todo: refactor /obj/item/photo/verb/rename() set name = "Rename photo" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr var/n_name = sanitizeSafe(input(usr, "What would you like to label the photo?", "Photo Labelling", null) as text, MAX_NAME_LEN) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 4bf55418c237..21701f8a7d10 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -643,7 +643,7 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list( /obj/item/stack/cable_coil/verb/make_restraint() set name = "Make Cable Restraints" - set category = "Object" + set category = VERB_CATEGORY_OBJECT var/mob/M = usr if(CHECK_MOBILITY(M, MOBILITY_CAN_USE)) @@ -660,7 +660,7 @@ GLOBAL_LIST_INIT(possible_cable_coil_colours, list( /obj/item/stack/cable_coil/cyborg/verb/set_colour() set name = "Change Colour" - set category = "Object" + set category = VERB_CATEGORY_OBJECT var/selected_type = input("Pick new colour.", "Cable Colour", null, null) as null|anything in GLOB.possible_cable_coil_colours set_cable_color(selected_type, usr) diff --git a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm index 00d137e7fa6a..99856dd63b44 100644 --- a/code/modules/power/fusion/fuel_assembly/fuel_injector.dm +++ b/code/modules/power/fusion/fuel_assembly/fuel_injector.dm @@ -131,7 +131,7 @@ var/list/fuel_injectors = list() StopInjecting() /obj/machinery/fusion_fuel_injector/verb/rotate_clockwise() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Rotate Generator Clockwise" set src in view(1) @@ -141,7 +141,7 @@ var/list/fuel_injectors = list() src.setDir(turn(src.dir, 270)) /obj/machinery/fusion_fuel_injector/verb/rotate_counterclockwise() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Rotate Generator Counterclockwise" set src in view(1) diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index 55f00fb7aa43..5315b5560e40 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -294,7 +294,7 @@ GLOBAL_LIST_EMPTY(all_turbines) /obj/machinery/power/generator/verb/rotate_clockwise() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Rotate Generator Clockwise" set src in view(1) @@ -304,7 +304,7 @@ GLOBAL_LIST_EMPTY(all_turbines) src.setDir(turn(src.dir, 270)) /obj/machinery/power/generator/verb/rotate_counterclockwise() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Rotate Generator Counterclockwise" set src in view(1) diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 2d2291df609e..c1821021e778 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -30,7 +30,7 @@ /obj/machinery/power/emitter/verb/rotate_clockwise() set name = "Rotate Emitter Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (src.anchored || usr:stat) diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index 940f3dca0e7e..b7b72f899301 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -91,7 +91,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin /obj/structure/particle_accelerator/verb/rotate_clockwise() set name = "Rotate Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (src.anchored || usr:stat) @@ -102,7 +102,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin /obj/structure/particle_accelerator/verb/rotate_counterclockwise() set name = "Rotate Counter Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (src.anchored || usr:stat) @@ -266,7 +266,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin /obj/machinery/particle_accelerator/verb/rotate_clockwise() set name = "Rotate Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (src.anchored || usr:stat) @@ -277,7 +277,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin /obj/machinery/particle_accelerator/verb/rotate_counterclockwise() set name = "Rotate Counter-Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (src.anchored || usr:stat) diff --git a/code/modules/power/singularity/particle_accelerator/particle_smasher.dm b/code/modules/power/singularity/particle_accelerator/particle_smasher.dm index b9436c253a5a..a98c670f46a3 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_smasher.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_smasher.dm @@ -224,7 +224,7 @@ /obj/machinery/particle_smasher/verb/eject_contents() set src in view(1) - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject Particle Focus Contents" if(usr.incapacitated()) diff --git a/code/modules/preferences/_preferences.dm b/code/modules/preferences/_preferences.dm index c6f13140fbc7..4df40de85b35 100644 --- a/code/modules/preferences/_preferences.dm +++ b/code/modules/preferences/_preferences.dm @@ -45,7 +45,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) // todo: kick this out of prefs //! ## Non-Preference Stuff - var/warns = 0 var/muted = 0 var/last_ip var/last_id @@ -70,22 +69,10 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/list/skin //! ## Game Preferences - var/tgui_fancy = TRUE - var/tgui_lock = TRUE - /// Saved changlog filesize to detect if there was a change. - var/lastchangelog = "" - /// Whatever this is set to acts as 'reset' color and is thus unusable as an actual custom color. - var/ooccolor = "#010000" /// Special role selection. var/be_special = 0 /// Event role prefs flag. var/be_event_role = NONE - var/UI_style = UI_STYLE_DEFAULT - var/UI_style_color = "#ffffff" - var/UI_style_alpha = 255 - /// Style for popup tooltips. - var/tooltipstyle = "Midnight" - var/client_fps = 40 //! ## Character Preferences /// Our character's name @@ -227,9 +214,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/datum/category_collection/player_setup_collection/player_setup var/datum/browser/panel - /// Hash of last seen lobby news content. - var/lastnews - //! ## Character Directory Stuff /// Should we show in Character Directory. var/show_in_directory = 1 @@ -243,12 +227,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) /// Set character's suit sensor level. var/sensorpref = 5 - /// Should we automatically fit the viewport? - var/auto_fit_viewport = TRUE - - /// Should we be in the widescreen mode set by the config? - var/widescreenpref = TRUE // Exists now... - /datum/preferences/New(client/C) if(istype(C)) client = C @@ -274,12 +252,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) load_skin() sanitize_everything() player_setup.sanitize_setup() - client?.update_movement_keys() initialized = TRUE return - key_bindings = deep_copy_list(GLOB.hotkey_keybinding_list_by_key) // give them default keybinds and update their movement keys - client?.update_movement_keys(src) LAZYINITLIST(character) LAZYINITLIST(options) LAZYINITLIST(skin) @@ -451,35 +426,3 @@ GLOBAL_LIST_EMPTY(preferences_datums) panel = new(user, "Character Slots", "Character Slots", 300, 390, src) panel.set_content(dat) panel.open() - -//Vore noises. -/client/verb/toggle_eating_noises() - set name = "Eating Noises" - set category = "Vore" - set desc = "Toggles Vore Eating noises." - - var/pref_path = /datum/client_preference/eating_noises - - toggle_preference(pref_path) - - to_chat(src, "You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear eating related vore noises.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TEatNoise") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - -/client/verb/toggle_digestion_noises() - set name = "Digestion Noises" - set category = "Vore" - set desc = "Toggles Vore Digestion noises." - - var/pref_path = /datum/client_preference/digestion_noises - - toggle_preference(pref_path) - - to_chat(src, "You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear digestion related vore noises.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TDigestNoise") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/preferences/migration.dm b/code/modules/preferences/migration.dm index a40fabc77c00..e5842251e179 100644 --- a/code/modules/preferences/migration.dm +++ b/code/modules/preferences/migration.dm @@ -7,38 +7,7 @@ * - prefs - prefs if any; if null, we're probably doing a clientless migration. */ /datum/controller/subsystem/characters/proc/perform_global_migrations(savefile/S, current_version, list/errors, list/options, datum/preferences/prefs) - if(current_version < 13) - if(prefs) - addtimer(CALLBACK(prefs, TYPE_PROC_REF(/datum/preferences, force_reset_keybindings)), 5 SECONDS) - else - var/list/new_bindings = deep_copy_list(GLOB.hotkey_keybinding_list_by_key) // give them default keybinds - WRITE_FILE(S["key_bindings"], new_bindings) - if(current_version < 15) - var/list/language_prefixes - S["language_prefixes"] >> language_prefixes - if(!islist(language_prefixes)) - language_prefixes = list() - options[GLOBAL_DATA_LANGUAGE_PREFIX] = language_prefixes.Copy() - if(current_version < 16) - if(prefs.client) - var/list/pref_datum_entries - S["preferences"] >> pref_datum_entries - var/was_age_verified = ("AGE_VERIFIED" in pref_datum_entries) - if(was_age_verified) - var/datum/player_data/data = prefs?.client?.player - // alright well, this is evil, but whatever - // yes, this is a blocking proc - // this can do horrible things but hey, fuck the old age gate system and whoever allowed it to stand. - if(!isnull(data) && (SSdbcore.Connect() && data.block_on_available())) - if(data.player_flags & PLAYER_FLAG_AGE_VERIFIED) - else - data.player_flags |= PLAYER_FLAG_AGE_VERIFIED - var/datum/tgui/open_verify = SStgui.get_open_ui(prefs.client.mob, GLOB.age_verify_menu) - if(!isnull(open_verify)) - qdel(open_verify) - INVOKE_ASYNC(data, TYPE_PROC_REF(/datum/player_data, save)) - else - log_and_message_admins("Failed to automatically authorize age gating for player with savefile [prefs.path]") + return /** * @params diff --git a/code/modules/preferences/preference_setup/global/01_ui.dm b/code/modules/preferences/preference_setup/global/01_ui.dm deleted file mode 100644 index 800f67389b60..000000000000 --- a/code/modules/preferences/preference_setup/global/01_ui.dm +++ /dev/null @@ -1,96 +0,0 @@ -/datum/category_item/player_setup_item/player_global/ui - name = "UI" - sort_order = 1 - -/datum/category_item/player_setup_item/player_global/ui/load_preferences(var/savefile/S) - S["UI_style"] >> pref.UI_style - S["UI_style_color"] >> pref.UI_style_color - S["UI_style_alpha"] >> pref.UI_style_alpha - S["ooccolor"] >> pref.ooccolor - S["tooltipstyle"] >> pref.tooltipstyle - S["client_fps"] >> pref.client_fps - -/datum/category_item/player_setup_item/player_global/ui/save_preferences(var/savefile/S) - S["UI_style"] << pref.UI_style - S["UI_style_color"] << pref.UI_style_color - S["UI_style_alpha"] << pref.UI_style_alpha - S["ooccolor"] << pref.ooccolor - S["tooltipstyle"] << pref.tooltipstyle - S["client_fps"] << pref.client_fps - -/datum/category_item/player_setup_item/player_global/ui/sanitize_preferences() - pref.UI_style = sanitize_inlist(pref.UI_style, all_ui_styles, initial(pref.UI_style)) - pref.UI_style_color = sanitize_hexcolor(pref.UI_style_color, 6, 1, default = initial(pref.UI_style_color)) - pref.UI_style_alpha = sanitize_integer(pref.UI_style_alpha, 0, 255, initial(pref.UI_style_alpha)) - pref.ooccolor = sanitize_hexcolor(pref.ooccolor, 6, 1, initial(pref.ooccolor)) - pref.tooltipstyle = sanitize_inlist(pref.tooltipstyle, all_tooltip_styles, initial(pref.tooltipstyle)) - pref.client_fps = sanitize_integer(pref.client_fps, 0, MAX_CLIENT_FPS, initial(pref.client_fps)) - -/datum/category_item/player_setup_item/player_global/ui/content(datum/preferences/prefs, mob/user, data) - . = "UI Style: [pref.UI_style]
" - . += "Custom UI (recommended for White UI):
" - . += "-Color: [pref.UI_style_color] [color_square(hex = pref.UI_style_color)] reset
" - . += "-Alpha(transparency): [pref.UI_style_alpha]reset
" - . += "Tooltip Style: [pref.tooltipstyle]
" - . += "Client FPS: [pref.client_fps]
" - if(can_select_ooc_color(user)) - . += "OOC Color:" - if(pref.ooccolor == initial(pref.ooccolor)) - . += "Using Default
" - else - . += "[pref.ooccolor]
__
reset
" - -/datum/category_item/player_setup_item/player_global/ui/OnTopic(var/href,var/list/href_list, var/mob/user) - if(href_list["select_style"]) - var/UI_style_new = tgui_input_list(user, "Choose UI style.", "Character Preference", all_ui_styles, pref.UI_style) - if(!UI_style_new || !CanUseTopic(user)) return PREFERENCES_NOACTION - pref.UI_style = UI_style_new - return PREFERENCES_REFRESH - - else if(href_list["select_color"]) - var/UI_style_color_new = input(user, "Choose UI color, dark colors are not recommended!", "Global Preference", pref.UI_style_color) as color|null - if(isnull(UI_style_color_new) || !CanUseTopic(user)) return PREFERENCES_NOACTION - pref.UI_style_color = UI_style_color_new - return PREFERENCES_REFRESH - - else if(href_list["select_alpha"]) - var/UI_style_alpha_new = input(user, "Select UI alpha (transparency) level, between 50 and 255.", "Global Preference", pref.UI_style_alpha) as num|null - if(isnull(UI_style_alpha_new) || (UI_style_alpha_new < 50 || UI_style_alpha_new > 255) || !CanUseTopic(user)) return PREFERENCES_NOACTION - pref.UI_style_alpha = UI_style_alpha_new - return PREFERENCES_REFRESH - - else if(href_list["select_ooc_color"]) - var/new_ooccolor = input(user, "Choose OOC color:", "Global Preference") as color|null - if(new_ooccolor && can_select_ooc_color(user) && CanUseTopic(user)) - pref.ooccolor = new_ooccolor - return PREFERENCES_REFRESH - - else if(href_list["select_tooltip_style"]) - var/tooltip_style_new = tgui_input_list(user, "Choose tooltip style.", "Global Preference", all_tooltip_styles, pref.tooltipstyle) - if(!tooltip_style_new || !CanUseTopic(user)) return PREFERENCES_NOACTION - pref.tooltipstyle = tooltip_style_new - return PREFERENCES_REFRESH - - else if(href_list["select_client_fps"]) - var/fps_new = input(user, "Input Client FPS (1-200, 0 uses server FPS)", "Global Preference", pref.client_fps) as null|num - if(isnull(fps_new) || !CanUseTopic(user)) return PREFERENCES_NOACTION - if(fps_new < 0 || fps_new > MAX_CLIENT_FPS) return PREFERENCES_NOACTION - pref.client_fps = fps_new - if(pref.client) - pref.client.fps = fps_new - return PREFERENCES_REFRESH - - else if(href_list["reset"]) - switch(href_list["reset"]) - if("ui") - pref.UI_style_color = initial(pref.UI_style_color) - if("alpha") - pref.UI_style_alpha = initial(pref.UI_style_alpha) - if("ooc") - pref.ooccolor = initial(pref.ooccolor) - return PREFERENCES_REFRESH - - return ..() - -/datum/category_item/player_setup_item/player_global/ui/proc/can_select_ooc_color(var/mob/user) - return CONFIG_GET(flag/allow_admin_ooccolor) && check_rights(R_ADMIN, 0, user) diff --git a/code/modules/preferences/preference_setup/global/02_settings.dm b/code/modules/preferences/preference_setup/global/02_settings.dm index 55d7d570e6cb..b56e512aecf6 100644 --- a/code/modules/preferences/preference_setup/global/02_settings.dm +++ b/code/modules/preferences/preference_setup/global/02_settings.dm @@ -7,129 +7,10 @@ sort_order = 2 /datum/category_item/player_setup_item/player_global/settings/load_preferences(var/savefile/S) - S["lastchangelog"] >> pref.lastchangelog - S["lastnews"] >> pref.lastnews S["default_slot"] >> pref.default_slot - S["preferences"] >> pref.preferences_enabled - S["preferences_disabled"] >> pref.preferences_disabled /datum/category_item/player_setup_item/player_global/settings/save_preferences(var/savefile/S) - S["lastchangelog"] << pref.lastchangelog - S["lastnews"] << pref.lastnews S["default_slot"] << pref.default_slot - S["preferences"] << pref.preferences_enabled - S["preferences_disabled"] << pref.preferences_disabled /datum/category_item/player_setup_item/player_global/settings/sanitize_preferences() - // Ensure our preferences are lists. - if(!istype(pref.preferences_enabled, /list)) - pref.preferences_enabled = list() - if(!istype(pref.preferences_disabled, /list)) - pref.preferences_disabled = list() - - // Arrange preferences that have never been enabled/disabled. - var/list/client_preference_keys = list() - for(var/cp in get_client_preferences()) - var/datum/client_preference/client_pref = cp - client_preference_keys += client_pref.key - if((client_pref.key in pref.preferences_enabled) || (client_pref.key in pref.preferences_disabled)) - continue - - if(client_pref.enabled_by_default) - pref.preferences_enabled += client_pref.key - else - pref.preferences_disabled += client_pref.key - - // Clean out preferences that no longer exist. - for(var/key in pref.preferences_enabled) - if(!(key in client_preference_keys)) - pref.preferences_enabled -= key - for(var/key in pref.preferences_disabled) - if(!(key in client_preference_keys)) - pref.preferences_disabled -= key - - pref.lastchangelog = sanitize_istext(pref.lastchangelog, initial(pref.lastchangelog)) - pref.lastnews = sanitize_istext(pref.lastnews, initial(pref.lastnews)) pref.default_slot = sanitize_integer(pref.default_slot, 1, config_legacy.character_slots, initial(pref.default_slot)) - -/datum/category_item/player_setup_item/player_global/settings/content(datum/preferences/prefs, mob/user, data) - . = list() - . += "Preferences
" - . += "" - var/mob/pref_mob = preference_mob() - for(var/cp in get_client_preferences()) - var/datum/client_preference/client_pref = cp - if(!client_pref.may_toggle(pref_mob)) - continue - - . += "" - if(pref_mob.is_preference_enabled(client_pref.key)) - . += "" - else - . += "" - . += "" - - . += "
[client_pref.description]: [client_pref.enabled_description] [client_pref.disabled_description][client_pref.enabled_description] [client_pref.disabled_description]
" - return jointext(., "") - -/datum/category_item/player_setup_item/player_global/settings/OnTopic(var/href,var/list/href_list, var/mob/user) - var/mob/pref_mob = preference_mob() - if(href_list["toggle_on"]) - . = pref_mob.set_preference(href_list["toggle_on"], TRUE) - else if(href_list["toggle_off"]) - . = pref_mob.set_preference(href_list["toggle_off"], FALSE) - if(.) - return PREFERENCES_REFRESH - - return ..() - -/client/proc/is_preference_enabled(var/preference) - var/datum/client_preference/cp = get_client_preference(preference) - if(isnull(cp)) - return FALSE - return prefs?.initialized? (cp.key in prefs.preferences_enabled) : cp.enabled_by_default - -/client/proc/set_preference(var/preference, var/set_preference) - var/datum/client_preference/cp = get_client_preference(preference) - if(!cp) - return FALSE - preference = cp.key - - if(set_preference && !(preference in prefs.preferences_enabled)) - return toggle_preference(cp) - else if(!set_preference && (preference in prefs.preferences_enabled)) - return toggle_preference(cp) - -/client/proc/toggle_preference(var/preference, var/set_preference) - var/datum/client_preference/cp = get_client_preference(preference) - if(!cp) - return FALSE - preference = cp.key - - var/enabled - if(preference in prefs.preferences_disabled) - prefs.preferences_enabled |= preference - prefs.preferences_disabled -= preference - enabled = TRUE - . = TRUE - else if(preference in prefs.preferences_enabled) - prefs.preferences_enabled -= preference - prefs.preferences_disabled |= preference - enabled = FALSE - . = TRUE - if(.) - cp.toggled(mob, enabled) - -/mob/proc/is_preference_enabled(var/preference) - if(!client) - return FALSE - return client.is_preference_enabled(preference) - -/mob/proc/set_preference(var/preference, var/set_preference) - if(!client) - return FALSE - if(!client.prefs) - log_debug(SPAN_DEBUGWARNING("Client prefs found to be null for mob [src] and client [ckey], this should be investigated.")) - return FALSE - - return client.set_preference(preference, set_preference) diff --git a/code/modules/preferences/preference_setup/global/04_ooc.dm b/code/modules/preferences/preference_setup/global/04_ooc.dm index a4c18e08f961..46d7ea99ff39 100644 --- a/code/modules/preferences/preference_setup/global/04_ooc.dm +++ b/code/modules/preferences/preference_setup/global/04_ooc.dm @@ -9,7 +9,6 @@ /datum/category_item/player_setup_item/player_global/ooc/save_preferences(var/savefile/S) S["ignored_players"] << pref.ignored_players -/* /datum/category_item/player_setup_item/player_global/ooc/sanitize_preferences() if(isnull(pref.ignored_players)) pref.ignored_players = list() @@ -39,4 +38,3 @@ return PREFERENCES_REFRESH return ..() -*/ diff --git a/code/modules/preferences/preference_setup/global/language_prefix.dm b/code/modules/preferences/preference_setup/global/language_prefix.dm deleted file mode 100644 index b9910f2f97e2..000000000000 --- a/code/modules/preferences/preference_setup/global/language_prefix.dm +++ /dev/null @@ -1,66 +0,0 @@ -/datum/category_item/player_setup_item/player_global/language_prefix - name = "Language Prefix" - is_global = TRUE - save_key = GLOBAL_DATA_LANGUAGE_PREFIX - -/datum/category_item/player_setup_item/player_global/language_prefix/proc/valid_prefix(c) - return length(c) == 1 && !(c in list(";", ":", ".", "!", "*", "^")) && !contains_az09(c) - -/datum/category_item/player_setup_item/player_global/language_prefix/filter_data(datum/preferences/prefs, data, list/errors) - var/list/prefixes = data - prefixes = sanitize_islist(prefixes) - for(var/c in prefixes) - if(!valid_prefix(c)) - prefixes -= c - if(!length(prefixes)) - return default_value() - return prefixes - -/datum/category_item/player_setup_item/player_global/language_prefix/content(datum/preferences/prefs, mob/user, data) - var/list/prefixes = data - . = list() - . += "Language Keys
" - . += " [jointext(prefixes, "")] [href_simple(prefs, "change", "Change")] [href_simple(prefs, "reset", "Reset")]" - -/datum/category_item/player_setup_item/player_global/language_prefix/act(datum/preferences/prefs, mob/user, action, list/params) - switch(action) - if("change") - var/char - var/keys[0] - do - char = input("Enter a single special character.\nYou may re-select the same characters.\nThe following characters are already in use by radio: ; : .\nThe following characters are already in use by special say commands: ! * ^", "Enter Character - [3 - keys.len] remaining") as null|text - if(char) - if(length(char) > 1) - alert(user, "Only single characters allowed.", "Error", "Ok") - else if(char in list(";", ":", ".")) - alert(user, "Radio character. Rejected.", "Error", "Ok") - else if(char in list("!","*", "^")) - alert(user, "Say character. Rejected.", "Error", "Ok") - else if(contains_az09(char)) - alert(user, "Non-special character. Rejected.", "Error", "Ok") - else - keys.Add(char) - while(char && keys.len < 3) - - if(keys.len == 3) - write(prefs, keys) - return PREFERENCES_REFRESH - return PREFERENCES_HANDLED - if("reset") - write(prefs, config_legacy.language_prefixes.Copy()) - return PREFERENCES_REFRESH - return ..() - -/datum/category_item/player_setup_item/player_global/language_prefix/default_value(randomizing) - return config_legacy.language_prefixes.Copy() - -/datum/preferences/proc/get_language_prefixes() - var/list/L = get_global_data(GLOBAL_DATA_LANGUAGE_PREFIX) - return L.Copy() - -/datum/preferences/proc/get_primary_language_prefix() - var/list/L = get_global_data(GLOBAL_DATA_LANGUAGE_PREFIX) - return L[1] - -/datum/preferences/proc/is_language_prefix(c) - return c in get_global_data(GLOBAL_DATA_LANGUAGE_PREFIX) diff --git a/code/modules/preferences/preference_setup/global/setting_datums.dm b/code/modules/preferences/preference_setup/global/setting_datums.dm deleted file mode 100644 index 63afcec92f4a..000000000000 --- a/code/modules/preferences/preference_setup/global/setting_datums.dm +++ /dev/null @@ -1,365 +0,0 @@ -var/list/_client_preferences -var/list/_client_preferences_by_key -var/list/_client_preferences_by_type - -/proc/get_client_preferences() - if(!_client_preferences) - _client_preferences = list() - for(var/ct in subtypesof(/datum/client_preference)) - var/datum/client_preference/client_type = ct - if(initial(client_type.description)) - _client_preferences += new client_type() - return _client_preferences - -/proc/get_client_preference(var/datum/client_preference/preference) - if(istype(preference)) - return preference - if(ispath(preference)) - return get_client_preference_by_type(preference) - return get_client_preference_by_key(preference) - -/proc/get_client_preference_by_key(var/preference) - if(!_client_preferences_by_key) - _client_preferences_by_key = list() - for(var/ct in get_client_preferences()) - var/datum/client_preference/client_pref = ct - _client_preferences_by_key[client_pref.key] = client_pref - return _client_preferences_by_key[preference] - -/proc/get_client_preference_by_type(var/preference) - if(!_client_preferences_by_type) - _client_preferences_by_type = list() - for(var/ct in get_client_preferences()) - var/datum/client_preference/client_pref = ct - _client_preferences_by_type[client_pref.type] = client_pref - return _client_preferences_by_type[preference] - -/datum/client_preference - var/description - var/key - var/enabled_by_default = TRUE - var/enabled_description = "Yes" - var/disabled_description = "No" - -/datum/client_preference/proc/may_toggle(var/mob/preference_mob) - return TRUE - -/datum/client_preference/proc/toggled(var/mob/preference_mob, var/enabled) - return - -/********************* -* Player Preferences * -*********************/ - -/datum/client_preference/play_admin_midis - description ="Play admin midis" - key = "SOUND_MIDI" - -/datum/client_preference/play_lobby_music - description ="Play lobby music" - key = "SOUND_LOBBY" - -/datum/client_preference/play_lobby_music/toggled(var/mob/preference_mob, var/enabled) - if(!preference_mob.client || !preference_mob.client.media) - return - - if(enabled) - preference_mob.client.playtitlemusic() - else - preference_mob.client.media.stop_music() - -/datum/client_preference/play_ambiance - description ="Play ambience" - key = "SOUND_AMBIENCE" - -/datum/client_preference/play_ambiance/toggled(var/mob/preference_mob, var/enabled) - if(!enabled) - SEND_SOUND(preference_mob, sound(null, repeat = 0, wait = 0, volume = 0, channel = 1)) - SEND_SOUND(preference_mob, sound(null, repeat = 0, wait = 0, volume = 0, channel = 2)) -// Need to put it here because it should be ordered riiiight here. -/datum/client_preference/play_jukebox - description ="Play jukebox music" - key = "SOUND_JUKEBOX" - -/datum/client_preference/play_jukebox/toggled(var/mob/preference_mob, var/enabled) - if(!enabled) - preference_mob.stop_all_music() - else - preference_mob.update_music() - -/datum/client_preference/eating_noises - description = "Eating Noises" - key = "EATING_NOISES" - enabled_description = "Noisy" - disabled_description = "Silent" - -/datum/client_preference/digestion_noises - description = "Digestion Noises" - key = "DIGEST_NOISES" - enabled_description = "Noisy" - disabled_description = "Silent" - -/datum/client_preference/weather_sounds - description ="Weather sounds" - key = "SOUND_WEATHER" - enabled_description = "Audible" - disabled_description = "Silent" - -/datum/client_preference/supermatter_hum - description ="Supermatter hum" - key = "SOUND_SUPERMATTER" - enabled_description = "Audible" - disabled_description = "Silent" - -/datum/client_preference/ghost_ears - description ="Ghost ears" - key = "CHAT_GHOSTEARS" - enabled_description = "All Speech" - disabled_description = "Nearby" - -/datum/client_preference/ghost_sight - description ="Ghost sight" - key = "CHAT_GHOSTSIGHT" - enabled_description = "All Emotes" - disabled_description = "Nearby" - -/datum/client_preference/ghost_radio - description ="Ghost radio" - key = "CHAT_GHOSTRADIO" - enabled_description = "All Chatter" - disabled_description = "Nearby" - -/datum/client_preference/chat_tags - description ="Chat tags" - key = "CHAT_SHOWICONS" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/air_pump_noise - description ="Air Pump Ambient Noise" - key = "SOUND_AIRPUMP" - enabled_description = "Audible" - disabled_description = "Silent" - -/datum/client_preference/mob_tooltips - description ="Mob tooltips" - key = "MOB_TOOLTIPS" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/pickup_sounds - description = "Picked Up Item Sounds" - key = "SOUND_PICKED" - - enabled_description = "Enabled" - disabled_description = "Disabled" - -/datum/client_preference/drop_sounds - description = "Dropped Item Sounds" - key = "SOUND_DROPPED" - enabled_description = "Enabled" - disabled_description = "Disabled" - -/datum/client_preference/hotkeys_default - description ="Hotkeys Default" - key = "HUD_HOTKEYS" - enabled_description = "Enabled" - disabled_description = "Disabled" - enabled_by_default = FALSE // Backwards compatibility - -/datum/client_preference/subtle_see - description = "Subtle Emotes" - key = "SUBTLE_SEE" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/show_typing_indicator - description ="Typing indicator" - key = "SHOW_TYPING" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/show_typing_indicator/toggled(var/mob/preference_mob, var/enabled) - if(!enabled) - preference_mob.set_typing_indicator(FALSE) - -/datum/client_preference/show_ooc - description ="OOC chat" - key = "CHAT_OOC" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/show_looc - description ="LOOC chat" - key = "CHAT_LOOC" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/show_dsay - description ="Dead chat" - key = "CHAT_DEAD" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/check_mention - description ="Emphasize Name Mention" - key = "CHAT_MENTION" - enabled_description = "Emphasize" - disabled_description = "Normal" - -/datum/client_preference/show_progress_bar - description ="Progress Bar" - key = "SHOW_PROGRESS" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/browser_style - description = "Fake NanoUI Browser Style" - key = "BROWSER_STYLED" - enabled_description = "Fancy" - disabled_description = "Plain" - -/datum/client_preference/ambient_occlusion - description = "Fake Ambient Occlusion" - key = "AMBIENT_OCCLUSION_PREF" - enabled_by_default = FALSE - enabled_description = "On" - disabled_description = "Off" - -/datum/client_preference/ambient_occlusion/toggled(var/mob/preference_mob, var/enabled) - . = ..() - if(preference_mob.client) - preference_mob?.using_perspective?.planes?.sync_owner(preference_mob.client) - -/datum/client_preference/instrument_toggle - description ="Hear In-game Instruments" - key = "SOUND_INSTRUMENT" - -/datum/client_preference/anonymous_ghost_chat - description = "Anonymous Ghost Chat" - key = "ANON_GHOST_CHAT" - enabled_by_default = FALSE - enabled_description = "Hide ckey" - disabled_description = "Show ckey" - -/datum/client_preference/show_in_advanced_who - description = "Show my status in advanced who" - key = "SHOW_IN_ADVANCED_WHO" - enabled_by_default = TRUE - enabled_description = "Visible" - disabled_description = "Hidden" - -/datum/client_preference/announce_ghost_joinleave - description = "Announce joining/leaving as a ghost/observer" - key = "ANNOUNCE_GHOST_JOINLEAVE" - enabled_by_default = TRUE - enabled_description = "Announce" - disabled_description = "Silent" - -/datum/client_preference/help_intent_firing - description = "Allow firing on help intent" - key = "HELP_INTENT_SAFETY" - enabled_by_default = FALSE - enabled_description = "Allow" - disabled_description = "Forbid" - -/datum/client_preference/parallax - description = "Parallax (fancy space, disable for FPS issues" - key = "PARALLAX_ENABLED" - enabled_description = "Enabled" - disabled_description = "Disabled" - -/datum/client_preference/parallax/toggled(mob/preference_mob, enabled) - . = ..() - preference_mob?.client?.parallax_holder?.reset() -/datum/client_preference/overhead_chat - description = "Overhead Chat" - key = "OVERHEAD_CHAT" - enabled_description = "Show" - disabled_description = "Hide" - enabled_by_default = TRUE - -/******************** -* Staff Preferences * -********************/ -/datum/client_preference/admin/may_toggle(var/mob/preference_mob) - return check_rights(R_ADMIN, 0, preference_mob) - -/datum/client_preference/mod/may_toggle(var/mob/preference_mob) - return check_rights(R_MOD|R_ADMIN, 0, preference_mob) - -/datum/client_preference/debug/may_toggle(var/mob/preference_mob) - return check_rights(R_DEBUG|R_ADMIN, 0, preference_mob) - -/datum/client_preference/mod/show_attack_logs - description = "Attack Log Messages" - key = "CHAT_ATTACKLOGS" - enabled_description = "Show" - disabled_description = "Hide" - enabled_by_default = FALSE - -/datum/client_preference/debug/show_debug_logs - description = "Debug Log Messages" - key = "CHAT_DEBUGLOGS" - enabled_description = "Show" - disabled_description = "Hide" - enabled_by_default = FALSE - -/datum/client_preference/admin/show_chat_prayers - description = "Chat Prayers" - key = "CHAT_PRAYER" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/holder/may_toggle(var/mob/preference_mob) - return preference_mob && preference_mob.client && preference_mob.client.holder - -/datum/client_preference/holder/play_adminhelp_ping - description = "Adminhelps" - key = "SOUND_ADMINHELP" - enabled_description = "Hear" - disabled_description = "Silent" - -/datum/client_preference/holder/hear_radio - description = "Radio chatter" - key = "CHAT_RADIO" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/holder/show_rlooc - description ="Remote LOOC chat" - key = "CHAT_RLOOC" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/holder/obfuscate_stealth_dsay - description = "Obfuscate Stealthmin Dsay" - key = "OBFUSCATE_STEALTH_DSAY" - enabled_by_default = FALSE - enabled_description = "On" - disabled_description = "Off" - -/datum/client_preference/holder/stealth_ghost_mode - description = "Stealthmin Ghost Mode" - key = "STEALTH_GHOST_MODE" - enabled_by_default = FALSE - enabled_description = "Obfuscate Ghost" - disabled_description = "Normal Ghost" - -/datum/client_preference/autocorrect - description = "Autocorrect" - key = "AUTOCORRECT" - enabled_description = "Enabled" - disabled_description = "Disabled" - -/datum/client_preference/examine_look - description = "Examine Messages" - key = "EXAMINE_LOOK" - enabled_description = "Show" - disabled_description = "Hide" - -/datum/client_preference/language_indicator - description = "Language Indicators" - key = "LANGUAGE_INDICATOR" - enabled_description = "Show" - disabled_description = "Hide" diff --git a/code/modules/preferences/preference_setup/keybindings/keybindings.dm b/code/modules/preferences/preference_setup/keybindings/keybindings.dm deleted file mode 100644 index 57e92944ee40..000000000000 --- a/code/modules/preferences/preference_setup/keybindings/keybindings.dm +++ /dev/null @@ -1,214 +0,0 @@ -// todo: convert and make looking up keys BY BIND possible -/datum/preferences - /// Custom Keybindings - var/list/key_bindings = list() - /// Hotkeys mode - var/hotkeys = TRUE - -//Used in savefile update from 11, can be removed once that is no longer relevant. -/datum/preferences/proc/force_reset_keybindings() - var/choice = tgalert(client.mob, "Your basic keybindings need to be reset, emotes will remain as before. Would you prefer 'hotkey' or 'classic' mode?", "Reset keybindings", "Hotkey", "Classic") - hotkeys = (choice != "Classic") - var/list/oldkeys = key_bindings - key_bindings = (hotkeys) ? deep_copy_list(GLOB.hotkey_keybinding_list_by_key) : deep_copy_list(GLOB.classic_keybinding_list_by_key) - - for(var/key in oldkeys) - if(!key_bindings[key]) - key_bindings[key] = oldkeys[key] - client.update_movement_keys() - -/datum/category_group/player_setup_category/keybindings - name = "Keybindings" - sort_order = 7 - category_item_type = /datum/category_item/player_setup_item/keybinding - auto_split = FALSE - -/datum/category_item/player_setup_item/keybinding/hotkey_mode - name = "Hotkey Mode" - sort_order = 1 - -/datum/category_item/player_setup_item/keybinding/hotkey_mode/load_preferences(savefile/S) - S["hotkeys"] >> pref.hotkeys - -/datum/category_item/player_setup_item/keybinding/hotkey_mode/save_preferences(savefile/S) - WRITE_FILE(S["hotkeys"], pref.hotkeys) - -/datum/category_item/player_setup_item/keybinding/hotkey_mode/sanitize_preferences() - pref.hotkeys = sanitize_integer(pref.hotkeys, 0, 1, initial(pref.hotkeys)) - -/datum/category_item/player_setup_item/keybinding/hotkey_mode/content(datum/preferences/prefs, mob/user, data) - . += "Hotkey mode: [(pref.hotkeys) ? "Hotkeys" : "Default"]
" - . += "Keybindings mode controls how the game behaves with tab and map/input focus.
If it is on Hotkeys, the game will always attempt to force you to map focus, meaning keypresses are sent \ - directly to the map instead of the input. You will still be able to use the command bar, but you need to tab to do it every time you click on the game map.
\ - If it is on Input, the game will not force focus away from the input bar, and you can switch focus using TAB between these two modes: If the input bar is pink, that means that you are in non-hotkey mode, sending all keypresses of the normal \ - alphanumeric characters, punctuation, spacebar, backspace, enter, etc, typing keys into the input bar. If the input bar is white, you are in hotkey mode, meaning all keypresses go into the game's keybind handling system unless you \ - manually click on the input bar to shift focus there.
\ - Input mode is the closest thing to the old input system.
\ - IMPORTANT: While in input mode's non hotkey setting (tab toggled), Ctrl + KEY will send KEY to the keybind system as the key itself, not as Ctrl + KEY. This means Ctrl + T/W/A/S/D/all your familiar stuff still works, but you \ - won't be able to access any regular Ctrl binds.
" - -/datum/category_item/player_setup_item/keybinding/hotkey_mode/OnTopic(href, list/href_list, mob/user) - if(href_list["option"]) - switch(href_list["option"]) - if("hotkeys") - pref.hotkeys = !pref.hotkeys - user.client.set_macros() - return PREFERENCES_REFRESH - return ..() - -/datum/category_item/player_setup_item/keybinding/bindings - name = "Bindings" - sort_order = 2 - -/datum/category_item/player_setup_item/keybinding/bindings/load_preferences(savefile/S) - S["key_bindings"] >> pref.key_bindings - -/datum/category_item/player_setup_item/keybinding/bindings/save_preferences(savefile/S) - WRITE_FILE(S["key_bindings"], pref.key_bindings) - -/datum/category_item/player_setup_item/keybinding/bindings/sanitize_preferences() - pref.key_bindings = sanitize_islist(pref.key_bindings, list()) - for(var/key in pref.key_bindings) - var/list/L = pref.key_bindings[key] - for(var/kb in L) - if(!GLOB.keybindings_by_name[kb]) - L -= kb - if(!length(L)) - pref.key_bindings -= key - -/datum/category_item/player_setup_item/keybinding/bindings/content(datum/preferences/prefs, mob/user, data) - . = list() - var/list/key_bindings = pref.key_bindings //cache for speed or atleast my finger's sake.. - // Create an inverted list of keybindings -> key - var/list/user_binds = list() - for (var/key in key_bindings) - for(var/kb_name in key_bindings[key]) - user_binds[kb_name] += list(key) - - var/list/kb_categories = list() - // Group keybinds by category - for (var/name in GLOB.keybindings_by_name) - var/datum/keybinding/kb = GLOB.keybindings_by_name[name] - kb_categories[kb.category] += list(kb) - - . += "" - - for (var/category in kb_categories) - . += "

[category]

" - for (var/i in kb_categories[category]) - var/datum/keybinding/kb = i - if(!length(user_binds[kb.name])) - . += " Unbound" - var/list/default_keys = pref.hotkeys ? kb.hotkey_keys : kb.classic_keys - if(LAZYLEN(default_keys)) - . += "| Default: [default_keys.Join(", ")]" - . += "
" - else - var/bound_key = user_binds[kb.name][1] - . += " [bound_key]" - for(var/bound_key_index in 2 to length(user_binds[kb.name])) - bound_key = user_binds[kb.name][bound_key_index] - . += " | [bound_key]" - if(length(user_binds[kb.name]) < MAX_KEYS_PER_KEYBIND) - . += "| Add Secondary" - var/list/default_keys = pref.hotkeys ? kb.classic_keys : kb.hotkey_keys - if(LAZYLEN(default_keys)) - . += "| Default: [default_keys.Join(", ")]" - . += "
" - - . += "

" - . += "\[Reset to default\]" - . += "" - . = jointext(., null) - -/datum/category_item/player_setup_item/keybinding/bindings/OnTopic(href, list/href_list, mob/user) - if(href_list["option"]) - switch(href_list["option"]) - if("keybindings_capture") - var/datum/keybinding/kb = GLOB.keybindings_by_name[href_list["keybinding"]] - var/old_key = href_list["old_key"] - pref.CaptureKeybinding(user, kb, old_key, src) - return - - if("keybindings_set") - var/kb_name = href_list["keybinding"] - if(!kb_name) - user << browse(null, "window=capturekeypress") - return PREFERENCES_REFRESH - - var/clear_key = text2num(href_list["clear_key"]) - var/old_key = href_list["old_key"] - if(clear_key) - if(pref.key_bindings[old_key]) - pref.key_bindings[old_key] -= kb_name - if(!length(pref.key_bindings[old_key])) - pref.key_bindings -= old_key - user << browse(null, "window=capturekeypress") - SScharacters.queue_preferences_save(pref) - return PREFERENCES_REFRESH - - var/new_key = uppertext(href_list["key"]) - var/AltMod = text2num(href_list["alt"]) ? "Alt" : "" - var/CtrlMod = text2num(href_list["ctrl"]) ? "Ctrl" : "" - var/ShiftMod = text2num(href_list["shift"]) ? "Shift" : "" - var/numpad = text2num(href_list["numpad"]) ? "Numpad" : "" - // var/key_code = text2num(href_list["key_code"]) - - if(GLOB._kbMap[new_key]) - new_key = GLOB._kbMap[new_key] - - var/full_key - switch(new_key) - if("Alt") - full_key = "[new_key][CtrlMod][ShiftMod]" - if("Ctrl") - full_key = "[AltMod][new_key][ShiftMod]" - if("Shift") - full_key = "[AltMod][CtrlMod][new_key]" - else - full_key = "[AltMod][CtrlMod][ShiftMod][numpad][new_key]" - if(pref.key_bindings[old_key]) - pref.key_bindings[old_key] -= kb_name - if(!length(pref.key_bindings[old_key])) - pref.key_bindings -= old_key - pref.key_bindings[full_key] += list(kb_name) - pref.key_bindings[full_key] = sortList(pref.key_bindings[full_key]) - - user << browse(null, "window=capturekeypress") - user.client.update_movement_keys() - SScharacters.queue_preferences_save(pref) - - if("keybindings_reset") - var/choice = tgalert(user, "Would you prefer 'hotkey' or 'classic' defaults?", "Setup keybindings", "Hotkey", "Classic", "Cancel") - if(choice == "Cancel") - return PREFERENCES_REFRESH - pref.hotkeys = (choice == "Hotkey") - pref.key_bindings = (pref.hotkeys) ? deep_copy_list(GLOB.hotkey_keybinding_list_by_key) : deep_copy_list(GLOB.classic_keybinding_list_by_key) - user.client.update_movement_keys() - return PREFERENCES_REFRESH - return ..() - -/datum/preferences/proc/CaptureKeybinding(mob/user, datum/keybinding/kb, old_key, datum/category_item/player_setup_item/keybinding/bindings/host) - var/HTML = {" -
Keybinding: [kb.full_name]
[kb.description]

Press any key to change
Press ESC to clear
- - "} - winshow(user, "capturekeypress", TRUE) - var/datum/browser/popup = new(user, "capturekeypress", "
Keybindings
", 350, 300) - popup.set_content(HTML) - popup.open(FALSE) - onclose(user, "capturekeypress", src) diff --git a/code/modules/preferences/preferences_toggle_procs.dm b/code/modules/preferences/preferences_toggle_procs.dm index f1b5e8da6cc6..456c876ae279 100644 --- a/code/modules/preferences/preferences_toggle_procs.dm +++ b/code/modules/preferences/preferences_toggle_procs.dm @@ -1,346 +1,9 @@ -//Toggles for preferences, normal clients -/client/verb/toggle_ghost_ears() - set name = "Show/Hide Ghost Ears" - set category = "Preferences" - set desc = "Toggles between seeing all mob speech and nearby mob speech." - var/pref_path = /datum/client_preference/ghost_ears - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear all mob speech as a ghost.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TGEars") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_ghost_vision() - set name = "Show/Hide Ghost Vision" - set category = "Preferences" - set desc = "Toggles between seeing all mob emotes and nearby mob emotes." - - var/pref_path = /datum/client_preference/ghost_sight - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] see all emotes as a ghost.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TGVision") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_ghost_radio() - set name = "Show/Hide Radio Chatter" - set category = "Preferences" - set desc = "Toggles between seeing all radio chat and nearby radio chatter." - - var/pref_path = /datum/client_preference/ghost_radio - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear all radios as a ghost.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TGRadio") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_deadchat() - set name = "Show/Hide Deadchat" - set category = "Preferences" - set desc = "Toggles the dead chat channel." - - var/pref_path = /datum/client_preference/show_dsay - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear dead chat as a ghost.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TDeadChat") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_ooc() - set name = "Show/Hide OOC" - set category = "Preferences" - set desc = "Toggles global out of character chat." - - var/pref_path = /datum/client_preference/show_ooc - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(/datum/client_preference/show_ooc)) ? "now" : "no longer"] hear global out of character chat.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_looc() - set name = "Show/Hide LOOC" - set category = "Preferences" - set desc = "Toggles local out of character chat." - - var/pref_path = /datum/client_preference/show_looc - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear local out of character chat.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TLOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_typing() - set name = "Show/Hide Typing Indicator" - set category = "Preferences" - set desc = "Toggles the speech bubble typing indicator." - - var/pref_path = /datum/client_preference/show_typing_indicator - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] have the speech indicator.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TTIND") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_ahelp_sound() - set name = "Toggle Admin Help Sound" - set category = "Preferences" - set desc = "Toggles the ability to hear a noise broadcasted when you get an admin message." - - var/pref_path = /datum/client_preference/holder/play_adminhelp_ping - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] receive noise from admin messages.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TAHelp") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_lobby_music() - set name = "Toggle Lobby Music" - set category = "Preferences" - set desc = "Toggles the music in the lobby." - - var/pref_path = /datum/client_preference/play_lobby_music - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear music in the lobby.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TLobMusic") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_admin_midis() - set name = "Toggle Admin MIDIs" - set category = "Preferences" - set desc = "Toggles the music in the lobby." - - var/pref_path = /datum/client_preference/play_admin_midis - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear MIDIs from admins.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TAMidis") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_ambience() - set name = "Toggle Ambience" - set category = "Preferences" - set desc = "Toggles the playing of ambience." - - var/pref_path = /datum/client_preference/play_ambiance - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear ambient noise.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TAmbience") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_weather_sounds() - set name = "Toggle Weather Sounds" - set category = "Preferences" - set desc = "Toggles the ability to hear weather sounds while on a planet." - - var/pref_path = /datum/client_preference/weather_sounds - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear weather sounds.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TWeatherSounds") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_supermatter_hum() - set name = "Toggle SM Hum" // Avoiding using the full 'Supermatter' name to not conflict with the Setup-Supermatter adminverb. - set category = "Preferences" - set desc = "Toggles the ability to hear supermatter hums." - - var/pref_path = /datum/client_preference/supermatter_hum - - toggle_preference(pref_path) - - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear a hum from the supermatter.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TSupermatterHum") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_jukebox() - set name = "Toggle Jukebox" - set category = "Preferences" - set desc = "Toggles the playing of jukebox music." - - var/pref_path = /datum/client_preference/play_jukebox - - toggle_preference(pref_path) - - to_chat(src, "You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear jukebox music.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TJukebox") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_be_special(role in be_special_flags) - set name = "Toggle SpecialRole Candidacy" - set category = "Preferences" - set desc = "Toggles which special roles you would like to be a candidate for, during events." - - var/role_flag = be_special_flags[role] - if(!role_flag) return - - prefs.be_special ^= role_flag - SScharacters.queue_preferences_save(prefs) - - to_chat(src,"You will [(prefs.be_special & role_flag) ? "now" : "no longer"] be considered for [role] events (where possible).") - - feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_air_pump_hum() - set name = "Toggle Air Pump Noise" - set category = "Preferences" - set desc = "Toggles Air Pumps humming" - - var/pref_path = /datum/client_preference/air_pump_noise - - toggle_preference(pref_path) - - to_chat(src, "You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear air pumps hum, start, and stop.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TAirPumpNoise") - -/client/verb/toggle_pickup_sounds() - set name = "Toggle Picked Up Item Sounds" - set category = "Preferences" - set desc = "Toggles sounds when items are picked up or thrown." - - var/pref_path = /datum/client_preference/pickup_sounds - - toggle_preference(pref_path) - - to_chat(src, "You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear sounds when items are picked up or thrown.") - - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb", "TPickupSounds") - -/client/verb/toggle_mob_tooltips() - set name = "Toggle Mob Tooltips" - set category = "Preferences" - set desc = "Toggles displaying name/species over mobs when moused over." - - var/pref_path = /datum/client_preference/mob_tooltips - toggle_preference(pref_path) - SScharacters.queue_preferences_save(prefs) - - to_chat(src,"You will now [(is_preference_enabled(/datum/client_preference/mob_tooltips)) ? "see" : "not see"] mob tooltips.") - - feedback_add_details("admin_verb","TMobTooltips") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_hear_instruments() - set name = "Toggle Hear/Ignore Instruments" - set category = "Preferences" - set desc = "Hear In-game Instruments" - - var/pref_path = /datum/client_preference/instrument_toggle - toggle_preference(pref_path) - SScharacters.queue_preferences_save(prefs) - - to_chat(src, "You will [(is_preference_enabled(/datum/client_preference/instrument_toggle)) ? "now hear" : "no longer hear"] instruments being played.") - - feedback_add_details("admin_verb","THInstm") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/verb/toggle_overhead_chat() - set name = "Toggle Overhead Chat" - set category = "Preferences" - set desc = "Enable/Disable seeing overhead chat messages." - - var/pref_path = /datum/client_preference/overhead_chat - toggle_preference(pref_path) - SScharacters.queue_preferences_save(prefs) - - to_chat(src, "You will now [(is_preference_enabled(/datum/client_preference/overhead_chat)) ? "see" : "not see"] overhead chat messages..") - - feedback_add_details("admin_verb","TOHChat") - - -/client/verb/toggle_subtle_emotes() - set name = "Toggle Subtle Emotes" - set category = "Preferences" - set desc = "Toggle seeing subtle emotes as a ghost." - - var/pref_path = /datum/client_preference/subtle_see - toggle_preference(pref_path) - SScharacters.queue_preferences_save(prefs) - - to_chat(src, "You will now [(is_preference_enabled(/datum/client_preference/subtle_see)) ? "see" : "not see"] subtle emotes.") - - feedback_add_details("admin_verb","TSubtleEmote") -//Toggles for Staff -//Developers - -/client/proc/toggle_debug_logs() - set name = "Toggle Debug Logs" - set category = "Preferences" - set desc = "Toggles debug logs." - - var/pref_path = /datum/client_preference/debug/show_debug_logs - - if(check_rights(R_ADMIN|R_DEBUG)) - toggle_preference(pref_path) - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] receive debug logs.") - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -//Mods -/client/proc/toggle_attack_logs() - set name = "Toggle Attack Logs" - set category = "Preferences" - set desc = "Toggles attack logs." - - var/pref_path = /datum/client_preference/mod/show_attack_logs - - if(check_rights(R_ADMIN|R_MOD)) - toggle_preference(pref_path) - to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] receive attack logs.") - SScharacters.queue_preferences_save(prefs) - - feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +// todo: god fucking damnit why is this in this file? /mob/living/carbon/human/verb/toggle_pain_msg() set name = "Toggle Pain Messages" - set category = "Preferences" + set category = "OOC" set desc = "Toggles pain messages." set src = usr @@ -349,11 +12,10 @@ else src.painmsg = 1 to_chat(src,"You will [ (painmsg) ? "now" : "no longer"] see your own pain messages.") - feedback_add_details("admin_verb","painmsg") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /mob/living/carbon/human/verb/acting() set name = "Feign Impairment" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Allows user to manually enable drunkenness, stutter, jitter, etc." set src = usr diff --git a/code/modules/projectiles/dnalocking.dm b/code/modules/projectiles/dnalocking.dm index b5488db0fea1..cc76fa593cdb 100644 --- a/code/modules/projectiles/dnalocking.dm +++ b/code/modules/projectiles/dnalocking.dm @@ -33,7 +33,7 @@ /obj/item/gun/verb/give_dna() set name = "Give DNA" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr get_dna(usr) @@ -58,7 +58,7 @@ /obj/item/gun/verb/remove_dna() set name = "Remove DNA" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr clear_dna(usr) @@ -76,7 +76,7 @@ /obj/item/gun/verb/allow_dna() set name = "Toggle DNA Samples Allowance" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr toggledna(usr) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 0e1454a9ee0f..8d5ecefeb266 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -389,7 +389,7 @@ handle_click_safety(user) return - if(!user?.client?.is_preference_enabled(/datum/client_preference/help_intent_firing) && user.a_intent == INTENT_HELP) + if(!user?.client?.get_preference_toggle(/datum/game_preference_toggle/game/help_intent_firing) && user.a_intent == INTENT_HELP) to_chat(user, SPAN_WARNING("You refrain from firing [src] because your intent is set to help!")) return @@ -835,7 +835,7 @@ /obj/item/gun/verb/toggle_safety_verb() set src in usr - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Toggle Gun Safety" if(usr == loc) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 23d639e83642..717c55ad9750 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -318,7 +318,7 @@ //in case the weapon has firemodes and can't unload using attack_hand() /obj/item/gun/ballistic/verb/unload_gun() set name = "Unload Ammo" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(usr.stat || usr.restrained()) return diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index caeecb00832d..3977ec6de2ce 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -181,7 +181,7 @@ one_handed_penalty = 60 // The weapon itself is heavy, and the long barrel makes it hard to hold steady with just one hand. /obj/item/gun/energy/sniperrifle/verb/scope() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Use Scope" set popup_menu = 1 set src in usr @@ -217,7 +217,7 @@ var/scope_multiplier = 1.5 /obj/item/gun/energy/monorifle/verb/sights() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Aim Down Sights" set popup_menu = 1 set src in usr diff --git a/code/modules/projectiles/guns/energy/sizegun_vr.dm b/code/modules/projectiles/guns/energy/sizegun_vr.dm index c2940eb6c08b..a96008be2e08 100644 --- a/code/modules/projectiles/guns/energy/sizegun_vr.dm +++ b/code/modules/projectiles/guns/energy/sizegun_vr.dm @@ -42,7 +42,7 @@ /obj/item/gun/energy/sizegun/proc/select_size() set name = "Select Size" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) var/size_select = input("Put the desired size (25-200%)", "Set Size", size_set_to*100) as num diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index 439381e11d7e..11e1dd6ee286 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -64,7 +64,7 @@ /obj/item/gun/energy/floragun/verb/select_gene() set name = "Select Gene" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) var/genemask = input("Choose a gene to modify.") as null|anything in SSplants.plant_gene_datums diff --git a/code/modules/projectiles/guns/launcher/pneumatic.dm b/code/modules/projectiles/guns/launcher/pneumatic.dm index 1fcb4298d22b..9d43fcbb3fac 100644 --- a/code/modules/projectiles/guns/launcher/pneumatic.dm +++ b/code/modules/projectiles/guns/launcher/pneumatic.dm @@ -34,7 +34,7 @@ /obj/item/gun/launcher/pneumatic/verb/set_pressure() //set amount of tank pressure. set name = "Set Valve Pressure" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in range(0) var/N = input("Percentage of tank used per shot:","[src]") as null|anything in possible_pressure_amounts if (N) diff --git a/code/modules/projectiles/guns/projectile/boltaction.dm b/code/modules/projectiles/guns/projectile/boltaction.dm index aa7f9d1fbdac..e19910e122dd 100644 --- a/code/modules/projectiles/guns/projectile/boltaction.dm +++ b/code/modules/projectiles/guns/projectile/boltaction.dm @@ -213,7 +213,7 @@ scoped_accuracy = 100 /obj/item/gun/ballistic/shotgun/pump/scopedrifle/verb/scope() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Use Scope" set popup_menu = 1 diff --git a/code/modules/projectiles/guns/projectile/musket.dm b/code/modules/projectiles/guns/projectile/musket.dm index 78d65cdbeb9d..a17b875a4afc 100644 --- a/code/modules/projectiles/guns/projectile/musket.dm +++ b/code/modules/projectiles/guns/projectile/musket.dm @@ -33,7 +33,7 @@ if(!has_powder) to_chat(user, SPAN_WARNING("\The [src] is not loaded with gunpowder!")) return FALSE - if(!user?.client?.is_preference_enabled(/datum/client_preference/help_intent_firing) && user.a_intent == INTENT_HELP) + if(!user?.client?.get_preference_toggle(/datum/game_preference_toggle/game/help_intent_firing) && user.a_intent == INTENT_HELP) to_chat(user, SPAN_WARNING("You refrain from firing [src] because your intent is set to help!")) return FALSE if(safety_state == GUN_SAFETY_ON) diff --git a/code/modules/projectiles/guns/projectile/pistol.dm b/code/modules/projectiles/guns/projectile/pistol.dm index 8dbeb0d05d19..c2798f3b1202 100644 --- a/code/modules/projectiles/guns/projectile/pistol.dm +++ b/code/modules/projectiles/guns/projectile/pistol.dm @@ -29,7 +29,7 @@ /obj/item/gun/ballistic/colt/detective/verb/rename_gun() set name = "Name Gun" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Rename your gun. If you're Security." var/mob/M = usr @@ -48,7 +48,7 @@ /obj/item/gun/ballistic/colt/detective/verb/reskin_gun() set name = "Resprite gun" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Click to choose a sprite for your gun." var/mob/M = usr diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm index af530957c262..accf92724242 100644 --- a/code/modules/projectiles/guns/projectile/revolver.dm +++ b/code/modules/projectiles/guns/projectile/revolver.dm @@ -20,7 +20,7 @@ /obj/item/gun/ballistic/revolver/verb/spin_cylinder() set name = "Spin cylinder" set desc = "Fun when you're bored out of your skull." - set category = "Object" + set category = VERB_CATEGORY_OBJECT chamber_offset = 0 visible_message("\The [usr] spins the cylinder of \the [src]!", \ @@ -71,7 +71,7 @@ /obj/item/gun/ballistic/revolver/detective/verb/rename_gun() set name = "Name Gun" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Click to rename your gun. If you're the detective." var/mob/M = usr @@ -99,7 +99,7 @@ /obj/item/gun/ballistic/revolver/detective45/verb/rename_gun() set name = "Name Gun" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Rename your gun. If you're the Detective." var/mob/M = usr @@ -118,7 +118,7 @@ /obj/item/gun/ballistic/revolver/detective45/verb/reskin_gun() set name = "Resprite gun" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Click to choose a sprite for your gun." var/mob/M = usr @@ -215,7 +215,7 @@ /obj/item/gun/ballistic/revolver/lemat/verb/swap_firingmode() set name = "Swap Firing Mode" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Click to swap from one method of firing to another." var/mob/living/carbon/human/M = usr @@ -258,7 +258,7 @@ /obj/item/gun/ballistic/revolver/lemat/spin_cylinder() set name = "Spin cylinder" set desc = "Fun when you're bored out of your skull." - set category = "Object" + set category = VERB_CATEGORY_OBJECT chamber_offset = 0 visible_message("\The [usr] spins the cylinder of \the [src]!", \ diff --git a/code/modules/projectiles/guns/projectile/semiauto.dm b/code/modules/projectiles/guns/projectile/semiauto.dm index f69d83c0caa4..f93a515685b1 100644 --- a/code/modules/projectiles/guns/projectile/semiauto.dm +++ b/code/modules/projectiles/guns/projectile/semiauto.dm @@ -34,7 +34,7 @@ scoped_accuracy = 100 /obj/item/gun/ballistic/garand/sniper/verb/scope() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Use Scope" set popup_menu = 1 diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index 1d40202a040a..0e21977cc57a 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -81,7 +81,7 @@ /obj/item/gun/ballistic/shotgun/pump/combat/warden/verb/rename_gun() set name = "Name Gun" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Rename your gun. If you're the Warden." var/mob/M = usr @@ -100,7 +100,7 @@ /obj/item/gun/ballistic/shotgun/pump/combat/warden/verb/reskin_gun() set name = "Resprite gun" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set desc = "Click to choose a sprite for your gun." var/mob/M = usr diff --git a/code/modules/projectiles/guns/projectile/sniper.dm b/code/modules/projectiles/guns/projectile/sniper.dm index cc90ae00536c..1b5b38c2fd5e 100644 --- a/code/modules/projectiles/guns/projectile/sniper.dm +++ b/code/modules/projectiles/guns/projectile/sniper.dm @@ -69,7 +69,7 @@ ..() /obj/item/gun/ballistic/heavysniper/verb/scope() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Use Scope" set popup_menu = 1 @@ -105,7 +105,7 @@ icon_state = "SVD-empty" /obj/item/gun/ballistic/SVD/verb/scope() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Use Scope" set popup_menu = 1 diff --git a/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm b/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm index ff68d4742f18..5cc4e4759443 100644 --- a/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm +++ b/code/modules/projectiles/guns/projectile/sniper/collapsible_sniper.dm @@ -3,7 +3,7 @@ /obj/item/gun/ballistic/heavysniper/collapsible /obj/item/gun/ballistic/heavysniper/collapsible/verb/take_down() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Disassemble Rifle" var/mob/living/carbon/human/user = usr diff --git a/code/modules/projectiles/magazines/smartmag.dm b/code/modules/projectiles/magazines/smartmag.dm index 36f372c37b1f..9b2f96e96829 100644 --- a/code/modules/projectiles/magazines/smartmag.dm +++ b/code/modules/projectiles/magazines/smartmag.dm @@ -201,7 +201,7 @@ // This verb clears out the smart mag's copied data, but only if it's empty /obj/item/ammo_magazine/smart/verb/clear_ammo_data() set name = "Clear Ammo Data" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!istype(src.loc, /mob/living)) // Needs to be in your hands to reset diff --git a/code/modules/projectiles/targeting/targeting_mob.dm b/code/modules/projectiles/targeting/targeting_mob.dm index 7968b119b3d1..75ca52f4b2af 100644 --- a/code/modules/projectiles/targeting/targeting_mob.dm +++ b/code/modules/projectiles/targeting/targeting_mob.dm @@ -4,7 +4,7 @@ /mob/verb/toggle_gun_mode() set name = "Toggle Gun Mode" set desc = "Begin or stop aiming." - set category = "IC" + set category = VERB_CATEGORY_IC if(isliving(src)) var/mob/living/M = src diff --git a/code/modules/reagents/items/hypospray.dm b/code/modules/reagents/items/hypospray.dm index af5633b3c8ef..512cf86d455b 100644 --- a/code/modules/reagents/items/hypospray.dm +++ b/code/modules/reagents/items/hypospray.dm @@ -97,7 +97,7 @@ // todo: alt click context radials? /obj/item/hypospray/verb/set_transfer_amount() set name = "Set Injection Amount" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(!inject_adjustable) usr.action_feedback(SPAN_WARNING("[src] can't have its injection thresholds changed."), src) diff --git a/code/modules/reagents/machinery/dispenser/cartridge.dm b/code/modules/reagents/machinery/dispenser/cartridge.dm index 69ae493929e1..f60e72fb8463 100644 --- a/code/modules/reagents/machinery/dispenser/cartridge.dm +++ b/code/modules/reagents/machinery/dispenser/cartridge.dm @@ -19,7 +19,7 @@ /obj/item/reagent_containers/cartridge/dispenser/verb/set_label_verb() set name = "Set Label" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr var/new_label = input(usr, "Enter a new label.", "Label Cartridge", label) as text|null diff --git a/code/modules/reagents/machinery/reagent_dispenser.dm b/code/modules/reagents/machinery/reagent_dispenser.dm index 08a8af4cadd3..f78c043b66d7 100644 --- a/code/modules/reagents/machinery/reagent_dispenser.dm +++ b/code/modules/reagents/machinery/reagent_dispenser.dm @@ -41,7 +41,7 @@ /obj/structure/reagent_dispensers/verb/set_APTFT() //set amount_per_transfer_from_this set name = "Set transfer amount" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) var/N = input("Amount per transfer from this:","[src]") as null|anything in possible_transfer_amounts if (N) diff --git a/code/modules/reagents/machinery/reagent_dispenser/watercooler.dm b/code/modules/reagents/machinery/reagent_dispenser/watercooler.dm index eb4d408da469..9926b6417d6d 100644 --- a/code/modules/reagents/machinery/reagent_dispenser/watercooler.dm +++ b/code/modules/reagents/machinery/reagent_dispenser/watercooler.dm @@ -28,7 +28,7 @@ /obj/structure/reagent_dispensers/water_cooler/verb/rotate_clockwise() set name = "Rotate Cooler Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (src.anchored || usr:stat) diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 38fecf0e79d9..f290dc6c805e 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -36,7 +36,7 @@ /obj/item/reagent_containers/verb/set_APTFT() //set amount_per_transfer_from_this set name = "Set transfer amount" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in range(0) var/N = input("Amount per transfer from this:","[src]") as null|anything in possible_transfer_amounts if(N) diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index c494f1a72fe5..da54531817d8 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -83,7 +83,7 @@ /obj/item/reagent_containers/spray/verb/empty() set name = "Empty Tank" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if (alert(usr, "Are you sure you want to empty that?", "Empty Tank:", "Yes", "No") != "Yes") diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index 81926a4b64cb..56483c413aac 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -129,7 +129,7 @@ // flip and rotate verbs /obj/structure/disposalconstruct/verb/rotate() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Rotate Pipe" set src in view(1) @@ -144,7 +144,7 @@ update() /obj/structure/disposalconstruct/verb/flip() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Flip Pipe" set src in view(1) if(usr.stat) diff --git a/code/modules/resleeving/computers.dm b/code/modules/resleeving/computers.dm index 6510b5fbdf1d..a539e8c311a1 100644 --- a/code/modules/resleeving/computers.dm +++ b/code/modules/resleeving/computers.dm @@ -120,7 +120,7 @@ return ..() /obj/machinery/computer/transhuman/resleeving/verb/eject_mirror() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject Mirror" set src in oview(1) diff --git a/code/modules/resleeving/infomorph.dm b/code/modules/resleeving/infomorph.dm index c1461ace1e6c..13b11d6e4f93 100644 --- a/code/modules/resleeving/infomorph.dm +++ b/code/modules/resleeving/infomorph.dm @@ -325,7 +325,7 @@ var/list/infomorph_emotions = list( /mob/living/silicon/infomorph/lay_down() set name = "Rest" - set category = "IC" + set category = VERB_CATEGORY_IC resting = !resting icon_state = resting ? "[chassis]_rest" : "[chassis]" @@ -382,7 +382,7 @@ var/list/infomorph_emotions = list( /mob/living/silicon/infomorph/verb/wipe_software() set name = "Suspend Self" - set category = "OOC" + set category = VERB_CATEGORY_OOC set desc = "Wipe yourself from your hardware. This is functionally equivalent to cryo or robotic storage, freeing up your job slot." // Make sure people don't kill themselves accidentally diff --git a/code/modules/resleeving/machines.dm b/code/modules/resleeving/machines.dm index a0b901ebd0be..6eb21e0d84f8 100644 --- a/code/modules/resleeving/machines.dm +++ b/code/modules/resleeving/machines.dm @@ -618,7 +618,7 @@ /obj/machinery/transhuman/resleever/verb/get_out() set name = "EJECT Occupant" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != CONSCIOUS) return @@ -628,7 +628,7 @@ /obj/machinery/transhuman/resleever/verb/move_inside() set name = "Move INSIDE" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(usr.stat != CONSCIOUS || machine_stat & (NOPOWER|BROKEN)) return diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm index 4136e694e422..1d6e73970352 100644 --- a/code/modules/shieldgen/shield_capacitor.dm +++ b/code/modules/shieldgen/shield_capacitor.dm @@ -146,7 +146,7 @@ /obj/machinery/shield_capacitor/verb/rotate_clockwise() set name = "Rotate Capacitor Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if (src.anchored) diff --git a/code/modules/species/station/alraune.dm b/code/modules/species/station/alraune.dm index 827ecaba873c..1ea5df54cd93 100644 --- a/code/modules/species/station/alraune.dm +++ b/code/modules/species/station/alraune.dm @@ -373,7 +373,7 @@ /mob/living/carbon/human/proc/alraune_fruit_pick() set name = "Pick Fruit" set desc = "Pick fruit off of [src]." - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) //do_reagent_implant(usr) diff --git a/code/modules/tgui/module.dm b/code/modules/tgui/module.dm index 6aebc2669ea7..34413fb8a10d 100644 --- a/code/modules/tgui/module.dm +++ b/code/modules/tgui/module.dm @@ -8,8 +8,7 @@ * without having to deal with copypaste code * * todo: for now, we just use expected_type and typecast. we want to use pointers in the future. - * - * todo: there's no way to push custom data at the moment, which makes modules not too advantageous in certain cases. + * todo: maybe hold off on that pointer idea * * todo: /datum/tgui_module/push_ui_data() should route to host automatically if host registers modules. * todo: rework module registration system. /datum procs: register_ui_module(), unregister_ui_module() hooked to model del, for automatic inclusion in ui. diff --git a/code/modules/tgui/modules/general/cardmod.dm b/code/modules/tgui/modules/general/cardmod.dm index 579cc6a645a3..194e95514edc 100644 --- a/code/modules/tgui/modules/general/cardmod.dm +++ b/code/modules/tgui/modules/general/cardmod.dm @@ -409,7 +409,6 @@ expected_type = /datum/computer_file/program/card_mod var/datum/computer_file/program/program - /datum/tgui_module/card_mod/standard/id_computer/ntos/New(datum/host) . = ..() program = host diff --git a/code/modules/tgui/tgui.dm b/code/modules/tgui/tgui.dm index 8e806bb64c9b..e3c594ae0e52 100644 --- a/code/modules/tgui/tgui.dm +++ b/code/modules/tgui/tgui.dm @@ -65,7 +65,8 @@ */ /datum/tgui/New(mob/user, datum/src_object, interface, title, datum/tgui/parent_ui) log_tgui(user, - "new [interface] fancy [user?.client?.prefs.tgui_fancy]", + // "new [interface] fancy [user?.client?.prefs.tgui_fancy]", + "new [interface] fancy 1", src_object = src_object) src.user = user src.src_object = src_object @@ -112,7 +113,9 @@ if(!window.is_ready()) window.initialize( strict_mode = TRUE, - fancy = user.client.prefs.tgui_fancy, + // todo: do we need that lmao + // fancy = user.client.prefs.tgui_fancy, + fancy = TRUE, assets = list( get_asset_datum(/datum/asset/simple/tgui), )) @@ -275,8 +278,10 @@ "refreshing" = refreshing, "window" = list( "key" = window_key, - "fancy" = user.client.prefs.tgui_fancy, - "locked" = user.client.prefs.tgui_lock, + // "fancy" = user.client.prefs.tgui_fancy, + // "locked" = user.client.prefs.tgui_lock, + "fancy" = TRUE, + "locked" = TRUE, ), "client" = list( "ckey" = user.client.ckey, @@ -291,12 +296,12 @@ var/list/modules = list() // static first if(with_static_data) - json_data["static"] = src_object.ui_static_data(user, src, state) + json_data["static"] = src_object.ui_static_data(user, src) for(var/datum/module as anything in modules_registered) var/id = modules_registered[module] modules[id] = module.ui_static_data(user, src, TRUE) if(with_data) - json_data["data"] = src_object.ui_data(user, src, state) + json_data["data"] = src_object.ui_data(user, src) for(var/datum/module as anything in (with_static_data? modules_registered : modules_processed)) var/id = modules_registered[module] modules[id] = modules[id] | module.ui_data(user, src, TRUE) @@ -459,6 +464,8 @@ /** * Registers a datum as a module into this UI. * + * todo: why is 'interface' a param again..? + * * @params * * module - the module in question * * id - the id to use for the module diff --git a/code/modules/tgui/tgui_module_context.dm b/code/modules/tgui/tgui_module_context.dm new file mode 100644 index 000000000000..5c5f964c5cdb --- /dev/null +++ b/code/modules/tgui/tgui_module_context.dm @@ -0,0 +1,30 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + +/** + * holds the context of a module's embedding into an UI + */ +/datum/tgui_module_context + /// thing being controlled + var/datum/delegate + /// person doing the controlling + var/datum/event_args/actor/actor + /// the host ui + var/datum/tgui/ui + +#warn /datum/tgui/proc/register_functional_module(datum/target = src) + +/datum/tgui_module_context/New(datum/host, datum/delegate, datum/event_args/actor/actor, datum/tgui/ui) + src.delegate = delegate + src.host = host + src.actor = actor + src.ui = ui + + +/datum/tgui_module_context/proc/tgui_context() + return list( + "host" = ui.src_object, + ) + +// todo: this file is unticked and is basically a placeholder for modules v3 +// more in tgui_module_function.dm diff --git a/code/modules/tgui/tgui_module_function.dm b/code/modules/tgui/tgui_module_function.dm new file mode 100644 index 000000000000..de8daa7b9286 --- /dev/null +++ b/code/modules/tgui/tgui_module_function.dm @@ -0,0 +1,31 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + +/** + * holds the behavior of a module's embedding into an UI + */ +/datum/tgui_module_function + /// tgui interface + var/tgui_interface + +// todo: this file is unticked and is basically a placeholder for modules v3 +// tl;dr +// instead of the overhead of modules-per-datum +// why not singleton datum with context datums made and destroyde when uis are opened/closed? + +/datum/tgui_module_function/proc/static_data(datum/tgui_module_context/context) + return list( + "$tgui" = tgui_interface, + "$context" = context.tgui_context(), + ) + +/datum/tgui_module_function/proc/data(datum/tgui_module_context/context) + return list() + +/** + * remember to stop propagation if ..() is truthy. + * + * @return TRUE if handled + */ +/datum/tgui_module_function/proc/act(datum/tgui_module_context/context, action, list/params) + return FALSE diff --git a/code/modules/tgui_panel/external.dm b/code/modules/tgui_panel/external.dm index cb7c6cae293a..c112a8c147e7 100644 --- a/code/modules/tgui_panel/external.dm +++ b/code/modules/tgui_panel/external.dm @@ -10,7 +10,7 @@ */ /client/verb/fix_tgui_panel() set name = "Fix chat" - set category = "OOC" + set category = VERB_CATEGORY_OOC var/action log_tgui(src, "Started fixing.", context = "verb/fix_tgui_panel") diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index 238159f0e78a..ece092bb29bc 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -107,8 +107,8 @@ Notes: /proc/openToolTip(mob/user = null, atom/movable/tip_src = null, params = null, title = "", content = "", theme = "") if(istype(user)) if(user.client && user.client.tooltips) - if(!theme && user.client.prefs && user.client.prefs.tooltipstyle) - theme = lowertext(user.client.prefs.tooltipstyle) + if(!theme) + theme = lowertext(user.get_preference_entry(/datum/game_preference_entry/dropdown/tooltip_style)) if(!theme) theme = "midnight" user.client.tooltips.show(tip_src, params, title, content, theme) diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 7cfb2dd42153..48ff592cd33a 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -192,7 +192,7 @@ else soundfile = fancy_vore_sounds[vore_sound] if(soundfile) - playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/eating_noises) + playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/game_preference_toggle/vore_sounds/eating_noises) recent_sound = TRUE //Messages if it's a mob @@ -239,7 +239,7 @@ else soundfile = fancy_release_sounds[release_sound] if(soundfile) - playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/eating_noises) + playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/game_preference_toggle/vore_sounds/eating_noises) return count @@ -287,7 +287,7 @@ else soundfile = fancy_release_sounds[release_sound] if(soundfile) - playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/eating_noises) + playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/game_preference_toggle/vore_sounds/eating_noises) return 1 @@ -565,9 +565,9 @@ struggle_snuggle = sound(get_sfx("classic_struggle_sounds")) else struggle_snuggle = sound(get_sfx("fancy_prey_struggle")) - playsound(src, struggle_snuggle, vary = 1, vol = 75, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/digestion_noises) + playsound(src, struggle_snuggle, vary = 1, vol = 75, falloff = VORE_SOUND_FALLOFF, preference = /datum/game_preference_toggle/vore_sounds/digestion_noises) else - playsound(src, struggle_rustle, vary = 1, vol = 75, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/digestion_noises) + playsound(src, struggle_rustle, vary = 1, vol = 75, falloff = VORE_SOUND_FALLOFF, preference = /datum/game_preference_toggle/vore_sounds/digestion_noises) if(escapable) //If the stomach has escapable enabled. if(prob(escapechance)) //Let's have it check to see if the prey escapes first. @@ -650,7 +650,7 @@ else soundfile = fancy_vore_sounds[target.vore_sound] if(soundfile) - playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/client_preference/digestion_noises) + playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/game_preference_toggle/vore_sounds/digestion_noises) owner.updateVRPanel() for(var/mob/living/M in contents) M.updateVRPanel() diff --git a/code/modules/vore/eating/bellymodes_vr.dm b/code/modules/vore/eating/bellymodes_vr.dm index 0407ec859c74..de0c2e86500d 100644 --- a/code/modules/vore/eating/bellymodes_vr.dm +++ b/code/modules/vore/eating/bellymodes_vr.dm @@ -38,7 +38,7 @@ if(is_wet && wet_loop) // Is it a fleshy environment, and does the pred have a fleshy heartbeat loop to play? if(!M.client) continue - if(M.is_preference_enabled(/datum/client_preference/digestion_noises)) //then we check if the mob has sounds enabled at all + if(M.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) //then we check if the mob has sounds enabled at all var/sound/preyloop = sound('sound/vore/sunesound/prey/loop.ogg') M.playsound_local(get_turf(src),preyloop, 80,0, channel = CHANNEL_PREYLOOP) M.next_preyloop = (world.time + (52 SECONDS)) @@ -131,13 +131,13 @@ else items_preserved |= I if(prob(25)) //Less often than with normal digestion - if(L && L.client && L.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(L && L.client && L.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(L,prey_digest) play_sound = pick(pred_digest) else if(item_digest_mode == IM_DIGEST) digest_item(I) if(prob(25)) //Less often than with normal digestion - if(L && L.client && L.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(L && L.client && L.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(L,prey_digest) play_sound = pick(pred_digest) to_update = TRUE @@ -154,13 +154,13 @@ else items_preserved |= I if(prob(25)) //Less often than with normal digestion - if(L && L.client && L.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(L && L.client && L.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(L,prey_digest) play_sound = pick(pred_digest) else if(item_digest_mode == IM_DIGEST) digest_item(I) if(prob(25)) //Less often than with normal digestion - if(L && L.client && L.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(L && L.client && L.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(L,prey_digest) play_sound = pick(pred_digest) to_update = TRUE @@ -178,7 +178,7 @@ if(prob(50)) //Was SO OFTEN. AAAA. for(var/mob/M in contents) - if(M && M.client && M.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(M && M.client && M.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(M,prey_digest) play_sound = pick(pred_digest) @@ -208,7 +208,7 @@ to_chat(M,"" + digest_alert_prey + "") play_sound = pick(pred_death) - if(M && M.client && M.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(M && M.client && M.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(M,prey_death) if((mode_flags & DM_FLAG_LEAVEREMAINS) && M.digest_leave_remains) handle_remains_leaving(M) @@ -253,7 +253,7 @@ for (var/target in touchable_mobs) var/mob/living/M = target if(prob(10)) //Less often than gurgles. People might leave this on forever. - if(M && M.client && M.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(M && M.client && M.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(M,prey_digest) play_sound = pick(pred_digest) @@ -288,7 +288,7 @@ var/mob/living/M = target if(prob(10)) //Less often than gurgles. People might leave this on forever. - if(M && M.client && M.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(M && M.client && M.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(M,prey_digest) play_sound = pick(pred_digest) @@ -304,7 +304,7 @@ var/mob/living/M = target if(prob(10)) //Infinite gurgles! - if(M && M.client && M.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(M && M.client && M.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(M,prey_digest) play_sound = pick(pred_digest) @@ -323,7 +323,7 @@ var/mob/living/M = target if(prob(10)) - if(M && M.client && M.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(M && M.client && M.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(M,prey_digest) play_sound = pick(pred_digest) @@ -339,7 +339,7 @@ var/mob/living/M = target if(prob(10)) - if(M && M.client && M.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(M && M.client && M.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(M,prey_digest) play_sound = pick(pred_digest) @@ -356,7 +356,7 @@ if(prob(50)) //Wet heals! The secret is you can leave this on for gurgle noises for fun. for(var/mob/M in contents) - if(M && M.client && M.is_preference_enabled(/datum/client_preference/digestion_noises)) + if(M && M.client && M.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises)) SEND_SOUND(M,prey_digest) play_sound = pick(pred_digest) @@ -387,7 +387,7 @@ if(play_sound) LAZYCLEARLIST(hearing_mobs) for(var/mob/M in hearers(VORE_SOUND_RANGE, owner)) - if(!M.client || !(M.is_preference_enabled(/datum/client_preference/digestion_noises))) + if(!M.client || !(M.get_preference_toggle(/datum/game_preference_toggle/vore_sounds/digestion_noises))) continue LAZYADD(hearing_mobs, M) for(var/mob/M in hearing_mobs) //so we don't fill the whole room with the sound effect diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 9bd661c47b91..73bc3e8c5c53 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -314,7 +314,7 @@ // /mob/living/proc/lick(var/mob/living/tasted in living_mobs(1)) set name = "Lick" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Lick someone nearby!" set popup_menu = FALSE // Stop licking by accident! @@ -353,7 +353,7 @@ // This is just the above proc but switched about. /mob/living/proc/smell(mob/living/smelled in living_mobs(1)) set name = "Smell" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Smell someone nearby!" set popup_menu = FALSE @@ -743,7 +743,7 @@ /mob/living/proc/switch_scaling() set name = "Switch scaling mode" - set category = "Preferences" + set category = "OOC" set desc = "Switch sharp/fuzzy scaling for current mob." appearance_flags ^= PIXEL_SCALE diff --git a/code/modules/vore/eating/simple_animal_vr.dm b/code/modules/vore/eating/simple_animal_vr.dm index 354555af9b3f..e2f857215bf3 100644 --- a/code/modules/vore/eating/simple_animal_vr.dm +++ b/code/modules/vore/eating/simple_animal_vr.dm @@ -8,7 +8,7 @@ // /mob/living/simple_mob/proc/animal_nom(var/mob/living/T in living_mobs(1)) set name = "Animal Nom" - set category = "IC" + set category = VERB_CATEGORY_IC set desc = "Since you can't grab, you get a verb!" if (stat != CONSCIOUS) @@ -32,7 +32,7 @@ /mob/living/simple_mob/proc/toggle_digestion() set name = "Toggle Animal's Digestion" set desc = "Enables digestion on this mob for 20 minutes." - set category = "OOC" + set category = VERB_CATEGORY_OOC set src in oview(1) var/mob/living/carbon/human/user = usr @@ -58,7 +58,7 @@ /mob/living/simple_mob/proc/toggle_fancygurgle() set name = "Toggle Animal's Gurgle sounds" set desc = "Switches between Fancy and Classic sounds on this mob." - set category = "OOC" + set category = VERB_CATEGORY_OOC set src in oview(1) var/mob/living/user = usr //I mean, At least ghosts won't use it. diff --git a/code/modules/vore/fluffstuff/custom_clothes.dm b/code/modules/vore/fluffstuff/custom_clothes.dm index abcc7fca0e0d..608add366e06 100644 --- a/code/modules/vore/fluffstuff/custom_clothes.dm +++ b/code/modules/vore/fluffstuff/custom_clothes.dm @@ -440,7 +440,7 @@ /obj/item/clothing/suit/storage/fluff/jacket/verb/toggle() set name = "Toggle coat buttons" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in usr if(!CHECK_MOBILITY(usr, MOBILITY_CAN_USE)) diff --git a/code/modules/vore/fluffstuff/custom_items.dm b/code/modules/vore/fluffstuff/custom_items.dm index 055629a3d26e..6d71cdef762f 100644 --- a/code/modules/vore/fluffstuff/custom_items.dm +++ b/code/modules/vore/fluffstuff/custom_items.dm @@ -1202,7 +1202,7 @@ /mob/living/carbon/human/proc/use_reagent_implant_evian() set name = "Lay Egg" set desc = "Force Evian to lay an egg by squeezing into his lower body! This makes the lizard extremely embarrassed, and it looks funny." - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in view(1) //do_reagent_implant(usr) diff --git a/code/modules/vore/fluffstuff/guns/bsharpoon.dm b/code/modules/vore/fluffstuff/guns/bsharpoon.dm index f924a0bbbcd5..05b424e56af5 100644 --- a/code/modules/vore/fluffstuff/guns/bsharpoon.dm +++ b/code/modules/vore/fluffstuff/guns/bsharpoon.dm @@ -81,7 +81,7 @@ /obj/item/bluespace_harpoon/verb/chande_fire_mode(mob/user as mob) set name = "Change fire mode" - set category = "Object" + set category = VERB_CATEGORY_OBJECT set src in oview(1) if(transforming) return mode = !mode diff --git a/code/modules/xenoarcheaology/finds/talking.dm b/code/modules/xenoarcheaology/finds/talking.dm index da1c2deec98c..c6527c6dc84c 100644 --- a/code/modules/xenoarcheaology/finds/talking.dm +++ b/code/modules/xenoarcheaology/finds/talking.dm @@ -114,7 +114,7 @@ continue //skip monkeys and leavers if (istype(M, /mob/new_player)) continue - if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears)) + if(M.stat == DEAD && M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears)) listening|=M for(var/mob/M in listening) diff --git a/code/modules/xenoarcheaology/tools/suspension_generator.dm b/code/modules/xenoarcheaology/tools/suspension_generator.dm index d4b03f665773..555e3fb8b71b 100644 --- a/code/modules/xenoarcheaology/tools/suspension_generator.dm +++ b/code/modules/xenoarcheaology/tools/suspension_generator.dm @@ -179,7 +179,7 @@ /obj/machinery/suspension_gen/verb/rotate_counterclockwise() set src in view(1) set name = "Rotate suspension gen Counterclockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(anchored) to_chat(usr, SPAN_DANGER("You cannot rotate [src], it has been firmly fixed to the floor.")) @@ -189,7 +189,7 @@ /obj/machinery/suspension_gen/verb/rotate_clockwise() set src in view(1) set name = "Rotate suspension gen Clockwise" - set category = "Object" + set category = VERB_CATEGORY_OBJECT if(anchored) to_chat(usr, SPAN_DANGER("You cannot rotate [src], it has been firmly fixed to the floor.")) diff --git a/code/modules/xenobio/machinery/processor.dm b/code/modules/xenobio/machinery/processor.dm index 4c380937efc8..600a748c01c6 100644 --- a/code/modules/xenobio/machinery/processor.dm +++ b/code/modules/xenobio/machinery/processor.dm @@ -84,7 +84,7 @@ // Verb to remove everything. /obj/machinery/processor/verb/eject() - set category = "Object" + set category = VERB_CATEGORY_OBJECT set name = "Eject Processor" set src in oview(1) diff --git a/config/entries/cross_server.txt b/config/entries/cross_server.txt index ef0d152eaa0b..11dbfe700c8e 100644 --- a/config/entries/cross_server.txt +++ b/config/entries/cross_server.txt @@ -3,13 +3,5 @@ ## Our secret key - used to auth incoming messages # COMMS_KEY default_pwd -## allow sending out cross server bunker overrides -## TODO: remove / replace -ALLOW_CROSS_SERVER_BUNKER_OVERRIDE - -## List of cross server bunker overrides -## TODO: remove / replace -# CROSS_SERVER_BUNKER_OVERRIDE - ## Our server name in cross-server communications # CROSS_COMM_NAME Citadel Station 13 - RP diff --git a/config/entries/database.txt b/config/entries/database.txt index 2b6f24555983..8608646a50eb 100644 --- a/config/entries/database.txt +++ b/config/entries/database.txt @@ -1,6 +1,6 @@ ## Enables SQL/database usage ## WARNING: A lot of the codebase requires SQL. Not using this is a terrible idea. -#SQL_ENABLED +# SQL_ENABLED ## SQL address SQL_ADDRESS localhost diff --git a/interface/interface.dm b/interface/interface.dm index 17c258a024b4..a01ba32c036d 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -2,7 +2,7 @@ /client/verb/wiki(query as text) set name = "wiki" set desc = "Type what you want to know about. This will open the wiki on your web browser." - set category = "OOC" + set category = VERB_CATEGORY_OOC if(config_legacy.wikiurl) if(query) if(config_legacy.wikisearchurl) @@ -96,19 +96,20 @@ /client/verb/changelog() set name = "Changelog" - set category = "OOC" + set category = VERB_CATEGORY_OOC if(!GLOB.changelog_tgui) GLOB.changelog_tgui = new /datum/changelog() GLOB.changelog_tgui.ui_interact(usr) - if(prefs.lastchangelog != GLOB.changelog_hash) - prefs.lastchangelog = GLOB.changelog_hash - prefs.save_preferences() + + if(player.immediately_available() && player.player_misc["changelog_hash"] != GLOB.changelog_hash) + player.player_misc["changelog_hash"] = GLOB.changelog_hash + player.save() winset(src, "infowindow.changelog", "font-style=;") /client/verb/hotkeys_help() set name = "hotkeys-help" - set category = "OOC" + set category = VERB_CATEGORY_OOC var/admin = {" Admin: @@ -227,13 +228,3 @@ Any-Mode: (hotkey doesn't need to be on) to_chat(src, other) if(holder) to_chat(src, admin) - -/client/verb/skin_toggle_hotkeys() - set name = "Toggle Hotkeys" - set category = "Preferences" - set desc = "Toggle input control scheme" - set hidden = TRUE - - prefs.hotkeys = !prefs.hotkeys - set_macros() - diff --git a/interface/menus/_menus.dm b/interface/menus/_menus.dm index fb4416468326..43f9d2f0ef44 100644 --- a/interface/menus/_menus.dm +++ b/interface/menus/_menus.dm @@ -1,3 +1,6 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + //! skin menus /** * dynamic in-code menu system with blackjack and hookers diff --git a/interface/menus/main.dm b/interface/menus/main.dm index e233d3f25184..3f46b7ce946f 100644 --- a/interface/menus/main.dm +++ b/interface/menus/main.dm @@ -1,3 +1,6 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2023 Citadel Station developers. *// + GLOBAL_DATUM_INIT(main_window_menu, /datum/skin_menu/main, new) /datum/skin_menu/main diff --git a/tgui/docs/migration-to-v4-from-v3.md b/tgui/docs/migration-to-v4-from-v3.md deleted file mode 100644 index 6f047a6cc7ef..000000000000 --- a/tgui/docs/migration-to-v4-from-v3.md +++ /dev/null @@ -1,91 +0,0 @@ -# tgui Migration Guide to v4 from v3 - -## The Easy Part - -- Copy and replace the following files in bulk: - - `code/__DEFINES/tgui.dm` - - `code/controllers/subsystem/tgui.dm` - - `code/modules/tgui/**` - - `tgui/**` - - Except: `tgui/packages/tgui/interfaces` - - Manually resolve conflicts for files that were touched outside the - `interfaces` folder. -- Copy the updated `log_tgui` proc from: - - `code/__HELPERS/_logging.dm` - -If you have a dual nano/tgui setup, then make sure to rename all ui procs -on `/datum`, such as `ui_interact` to `tgui_interact`, to avoid namespace -clashing. Usual stuff. - -## Update `ui_interact` proc signatures - -First of all, tgui states need to move from `ui_interact` to `ui_state`. - -One way of doing it, is to just cherry pick those procs from upstream. - -If you want to search and replace manually, search for `state = GLOB`, and -extract those things into `ui_state` procs like so: - -```dm -.../ui_state(mob/user) - return GLOB.default_state -``` - -Then reduce `ui_interact` until you finish with something like this: - -```dm -.../ui_interact(mob/user, datum/tgui/ui) - ui = SStgui.try_update_ui(user, src, ui) - if(!ui) - ui = new(user, src, "FooBar", "Foo Bar UI", 600, 400) - ui.open() -``` - -## Update asset delivery code - -Remove all asset code that injects stylesheets by modifying tgui's `basehtml`. -You no longer need to do that. - -Find all occurences of `asset.send(user)` in `ui_interact`, and refactor those -snippets to the following proc: - -```dm -.../ui_assets(mob/user) - return list( - get_asset_datum(/datum/asset/simple/foobar), - ) -``` - -## Check `ui_act` for new bugs - -Code behind `ui_act` was recently refactored to use JSON-encoded payloads -instead of just strings. Since it can now carry numbers and other complex -types, you should check that the code is type agnostic and does not break -due to an assumption that every parameter is a string. - -One of such offenders is the personal crafting interface, where it needlessly -compares parameters to `""` and `"0"`. You can now replace this code with -simple assignments, because an empty category will now be properly `null` -instead of an empty string. - -## Backend data changes - -Interfaces that relied on `config.window.id`, must now use -`window.__windowId__`, which is a global constant unique for the page -the script is running on (so you can be sure it never changes). - -In case of `ByondUi`, this parameter can be completely omitted, because -parent will always default to the current window id. - -Affected interfaces: - -- `CameraConsole` -- Any interface that uses the `ByondUi` component - ---- - -That's all folks! - -There is a lot of stuff that was refactored under the hood, but normal UI -stuff wouldn't and shouldn't touch it, so you should be good with just -going through the checklist above. diff --git a/tgui/packages/common/keyboard.ts b/tgui/packages/common/keyboard.ts new file mode 100644 index 000000000000..6ee810623f1f --- /dev/null +++ b/tgui/packages/common/keyboard.ts @@ -0,0 +1,354 @@ +//* This file is explicitly licensed under the MIT license. *// +//* Copyright (c) 2024 silicons *// + +/** + * IE lacks these defines so we have to package it ourselves + * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/location + * this is event.location on a KeyboardEvent + */ +export enum IEKeyboardEventLocation { + Standard = 0, + Left = 1, + Right = 2, + Numpad = 3, +} + +export enum IEKeyboardEventKeycode { + BACKSPACE = 8, + TAB = 9, + ENTER = 13, + SHIFT = 16, + CTRL = 17, + ALT = 18, + PAUSE = 19, + CAPSLOCK = 20, + ESCAPE = 27, + SPACE = 32, + PAGEUP = 33, + PAGEDOWN = 34, + END = 35, + HOME = 36, + LEFT = 37, + UP = 38, + RIGHT = 39, + DOWN = 40, + INSERT = 45, + DELETE = 46, + KEY_0 = 48, + KEY_1 = 49, + KEY_2 = 50, + KEY_3 = 51, + KEY_4 = 52, + KEY_5 = 53, + KEY_6 = 54, + KEY_7 = 55, + KEY_8 = 56, + KEY_9 = 57, + KEY_A = 65, + KEY_B = 66, + KEY_C = 67, + KEY_D = 68, + KEY_E = 69, + KEY_F = 70, + KEY_G = 71, + KEY_H = 72, + KEY_I = 73, + KEY_J = 74, + KEY_K = 75, + KEY_L = 76, + KEY_M = 77, + KEY_N = 78, + KEY_O = 79, + KEY_P = 80, + KEY_Q = 81, + KEY_R = 82, + KEY_S = 83, + KEY_T = 84, + KEY_U = 85, + KEY_V = 86, + KEY_W = 87, + KEY_X = 88, + KEY_Y = 89, + KEY_Z = 90, + F1 = 112, + F2 = 113, + F3 = 114, + F4 = 115, + F5 = 116, + F6 = 117, + F7 = 118, + F8 = 119, + F9 = 120, + F10 = 121, + F11 = 122, + F12 = 123, + SEMICOLON = 186, + EQUAL = 187, + COMMA = 188, + MINUS = 189, + PERIOD = 190, + SLASH = 191, + LEFT_BRACKET = 219, + BACKSLASH = 220, + RIGHT_BRACKET = 221, + QUOTE = 222, +} + +export const IEKeyboardEventKeycodeToBYOND = [ + "", // [0] + "", // [1] + "", // [2] + "", // [3] + "", // [4] + "", // [5] + "", // [6] + "", // [7] + "Back", // [8] + "Tab", // [9] + "", // [10] + "", // [11] + "", // [12] + "Return", // [13] + "", // [14] + "", // [15] + "Shift", // [16] + "Ctrl", // [17] + "Alt", // [18] + "", // [19] + "Capslock", // [20] + "", // [21] + "", // [22] + "", // [23] + "", // [24] + "", // [25] + "", // [26] + "Escape", // [27] + "", // [28] + "", // [29] + "", // [30] + "", // [31] + "Space", // [32] + "Northeast", // [33] + "Southeast", // [34] + "Southwest", // [35] + "Northwest", // [36] + "West", // [37] + "North", // [38] + "East", // [39] + "South", // [40] + "", // [41] + "", // [42] + "", // [43] + "", // [44] - PRINTSCREEN + "Insert", // [45] + "Delete", // [46] + "", // [47] + "0", // [48] + "1", // [49] + "2", // [50] + "3", // [51] + "4", // [52] + "5", // [53] + "6", // [54] + "7", // [55] + "8", // [56] + "9", // [57] + "", // [58] + "", // [59] + "", // [60] + "", // [61] + "", // [62] + "", // [63] + "", // [64] + "A", // [65] + "B", // [66] + "C", // [67] + "D", // [68] + "E", // [69] + "F", // [70] + "G", // [71] + "H", // [72] + "I", // [73] + "J", // [74] + "K", // [75] + "L", // [76] + "M", // [77] + "N", // [78] + "O", // [79] + "P", // [80] + "Q", // [81] + "R", // [82] + "S", // [83] + "T", // [84] + "U", // [85] + "V", // [86] + "W", // [87] + "X", // [88] + "Y", // [89] + "Z", // [90] + "", // [91] Windows Key (Windows) or Command Key (Mac) + "", // [92] + "", // [93] + "", // [94] + "", // [95] + "", // [96] + "", // [97] + "", // [98] + "", // [99] + "", // [100] + "", // [101] + "", // [102] + "", // [103] + "", // [104] + "", // [105] + "", // [106] + "", // [107] + "", // [108] + "", // [109] + "", // [110] + "", // [111] + "F1", // [112] + "F2", // [113] + "F3", // [114] + "F4", // [115] + "F5", // [116] + "F6", // [117] + "F7", // [118] + "F8", // [119] + "F9", // [120] + "F10", // [121] + "F11", // [122] + "F12", // [123] + "", // [124] + "", // [125] + "", // [126] + "", // [127] + "", // [128] + "", // [129] + "", // [130] + "", // [131] + "", // [132] + "", // [133] + "", // [134] + "", // [135] + "", // [136] + "", // [137] + "", // [138] + "", // [139] + "", // [140] + "", // [141] + "", // [142] + "", // [143] + "", // [144] + "", // [145] + "", // [146] + "", // [147] + "", // [148] + "", // [149] + "", // [150] + "", // [151] + "", // [152] + "", // [153] + "", // [154] + "", // [155] + "", // [156] + "", // [157] + "", // [158] + "", // [159] + "", // [160] + "", // [161] + "", // [162] + "", // [163] + "", // [164] + "", // [165] + "", // [166] + "", // [167] + "", // [168] + "", // [169] + "", // [170] + "", // [171] + "", // [172] + "", // [173] + "", // [174] + "", // [175] + "", // [176] + "", // [177] + "", // [178] + "", // [179] + "", // [180] + "", // [181] + "", // [182] + "", // [183] + "", // [184] + "", // [185] + ";", // [186] + "=", // [187] + ",", // [188] + "-", // [189] + ".", // [190] + "/", // [191] + "", // [192] + "", // [193] + "", // [194] + "", // [195] + "", // [196] + "", // [197] + "", // [198] + "", // [199] + "", // [200] + "", // [201] + "", // [202] + "", // [203] + "", // [204] + "", // [205] + "", // [206] + "", // [207] + "", // [208] + "", // [209] + "", // [210] + "", // [211] + "", // [212] + "", // [213] + "", // [214] + "", // [215] + "", // [216] + "", // [217] + "", // [218] + "[", // [219] + "\\", // [220] + "]", // [221] + "'", // [222] + "", // [223] + "", // [224] + "", // [225] + "", // [226] + "", // [227] + "", // [228] + "", // [229] + "", // [230] + "", // [231] + "", // [232] + "", // [233] + "", // [234] + "", // [235] + "", // [236] + "", // [237] + "", // [238] + "", // [239] + "", // [240] + "", // [241] + "", // [242] + "", // [243] + "", // [244] + "", // [245] + "", // [246] + "", // [247] + "", // [248] + "", // [249] + "", // [250] + "", // [251] + "", // [252] + "", // [253] + "", // [254] + "", // [255] +]; diff --git a/tgui/packages/tgui-panel/themes.js b/tgui/packages/tgui-panel/themes.js index 8306ecb39a63..fbb2172fed0f 100644 --- a/tgui/packages/tgui-panel/themes.js +++ b/tgui/packages/tgui-panel/themes.js @@ -38,7 +38,9 @@ export const setClientTheme = name => { // the race against statbrowser init. let stat_theme = name === "light"? "light" : "dark"; clearTimeout(setClientThemeTimer); - Byond.command(`.output statbrowser:set_theme ${stat_theme}`); + setTimeout(() => { + Byond.command(`.output statbrowser:set_theme ${stat_theme}`); + }, 500); setClientThemeTimer = setTimeout(() => { Byond.command(`.output statbrowser:set_theme ${stat_theme}`); }, 5000); diff --git a/tgui/packages/tgui-polyfill/10-misc.js b/tgui/packages/tgui-polyfill/10-misc.js index 5a1849e13558..4a72f8482fbb 100644 --- a/tgui/packages/tgui-polyfill/10-misc.js +++ b/tgui/packages/tgui-polyfill/10-misc.js @@ -53,6 +53,20 @@ }; } + if(!Array.prototype['at']) { + Array.prototype.at = function(index) { + if((index >= this.length) || (index < (-this.length))) { + return undefined; + } + if(index >= 0){ + return this[index]; + } + else { + return this[this.length + index]; + } + } + } + // Inferno needs Int32Array, and it is not covered by core-js. if (!window.Int32Array) { window.Int32Array = Array; diff --git a/tgui/packages/tgui/backend.ts b/tgui/packages/tgui/backend.ts index 83a76d0f89bf..a9048379bd01 100644 --- a/tgui/packages/tgui/backend.ts +++ b/tgui/packages/tgui/backend.ts @@ -60,7 +60,6 @@ export const backendReducer = (state = initialState, action) => { ...payload.static, ...payload.data, }; - // Merge module data // Merge modules const modules = { ...state.modules, @@ -118,11 +117,10 @@ export const backendReducer = (state = initialState, action) => { }; for (let id of Object.keys(payload)) { const data = payload[id]; - const merged = { - ...modules[data], + modules[id] = { + ...modules[id], ...data, }; - modules[id] = merged; } // Return new state return { @@ -188,6 +186,7 @@ export const backendMiddleware = store => { if (type === 'modules') { store.dispatch(backendModuleData(payload)); + return; } if (type === 'suspend') { @@ -276,13 +275,20 @@ export const backendMiddleware = store => { }; }; -export type actFunctionType = (action: string, payload?: object) => void; +export type actFunctionType = (action: string, payload?: object, route_id?: string | null) => void; /** * Sends an action to `ui_act` on `src_object` that this tgui window * is associated with. + * + * todo: overhaul module system + * + * @params + * * action - action string + * * payload - payload object; this is the list/params byond-side + * * route_id - route via ui_route() with given id instead of ui_act() */ -export const sendAct: actFunctionType = (action: string, payload: object = {}) => { +export const sendAct: actFunctionType = (action: string, payload: object = {}, route_id?: string | null) => { // Validate that payload is an object const isObject = typeof payload === 'object' && payload !== null @@ -291,7 +297,10 @@ export const sendAct: actFunctionType = (action: string, payload: object = {}) = logger.error(`Payload for act() must be an object, got this:`, payload); return; } - Byond.sendMessage('act/' + action, payload); + if (route_id) { + payload['$m_id'] = route_id; + } + Byond.sendMessage((route_id? 'mod/' : 'act/') + action, payload); }; type BackendContext = { @@ -317,6 +326,7 @@ type BackendContext = { }, modules: Record, shared: Record, + computeCache: Record, suspending: boolean, suspended: boolean, }; @@ -394,6 +404,31 @@ export const useLocalState = ( ]; }; +/** + * Gets a computation, that should be cached. + * Used to do initial pre-processing of data. + * + * todo: rethink this when we go to react or otherwise rework tgui, this is shitcode-y + * todo: this is a bad idea. you know why? + * todo: yeah funny thing this persists across window reloads due to store/state + * todo: being global. fuck. + * todo: we need like a proper hook that doesn't persist. + */ +// export const useComputedOnce = ( +// context: any, key: string, valueClosure: () => T +// ): T => { +// const { store } = context; +// const state = selectBackend(store.getState()); +// if (state.computeCache?.[key]) { +// return state.computeCache[key]; +// } +// state.computeCache = { +// ...state.computeCache, +// }; +// state.computeCache[key] = valueClosure(); +// return state.computeCache[key]; +// }; + /** * Allocates state on Redux store, and **shares** it with other clients * in the game. @@ -511,3 +546,11 @@ export const constructModuleAct = (id: string, ref: string): actFunctionType => Byond.sendMessage('mod/' + action, sent); }; }; + +/** + * Extracts module data from context + */ +export const getModuleData = (context, id: string): TData => { + let backend = useBackend(context); + return backend.modules[id]; +}; diff --git a/tgui/packages/tgui/components/Box.tsx b/tgui/packages/tgui/components/Box.tsx index f5503e5482f3..b1fa29e84994 100644 --- a/tgui/packages/tgui/components/Box.tsx +++ b/tgui/packages/tgui/components/Box.tsx @@ -1,4 +1,8 @@ /** + * Basic CSS box. + * This is the basic component used for formatting/whatnot. + * You should use this instead of
unless you're doing very low level work. + * * @file * @copyright 2020 Aleksej Komarov * @license MIT @@ -10,53 +14,72 @@ import { ChildFlags, VNodeFlags } from 'inferno-vnode-flags'; import { CSS_COLORS } from '../constants'; import { ComponentProps } from './Component'; +// a css value for a numerical unit, +// or a number to translate into units automatically, +export type BoxUnit = string | number; +// a box unit, or none to have the box automatically sized +// boolean is included so the pattern of '!!truthy && 5' can work; boolean values are simply ignored +export type BoxUnitProp = BoxUnit | null | undefined | boolean; +// a box string prop, so BoxUnit but without number +export type BoxStringProp = string | null | undefined | boolean; + +/** + * Box props basically have all the HTML / CSS props, thanks to being the base + * definition of, well, everything given this is a wrapper class. + * + * Things that use Box often can/should override/'augment' some of these, + * but all of this is here so typescript knows what is/isn't valid. + */ export type BoxProps = ComponentProps & { [key: string]: any; - as?: string; + as?: keyof InfernoHTML; className?: string | undefined; position?: string | BooleanLike; overflow?: string | BooleanLike; overflowX?: string | BooleanLike; overflowY?: string | BooleanLike; - top?: string | BooleanLike; - bottom?: string | BooleanLike; - left?: string | BooleanLike; - right?: string | BooleanLike; - width?: string | BooleanLike; - minWidth?: string | BooleanLike; - maxWidth?: string | BooleanLike; - height?: string | BooleanLike; - minHeight?: string | BooleanLike; - maxHeight?: string | BooleanLike; - fontSize?: string | BooleanLike; - fontFamily?: string; - lineHeight?: string | BooleanLike; + top?: BoxUnitProp; + bottom?: BoxUnitProp; + left?: BoxUnitProp; + right?: BoxUnitProp; + width?: BoxUnitProp; + minWidth?: BoxUnitProp; + maxWidth?: BoxUnitProp; + height?: BoxUnitProp; + minHeight?: BoxUnitProp; + maxHeight?: BoxUnitProp; + fontSize?: BoxUnitProp; + fontFamily?: string | null; + lineHeight?: BoxUnitProp; opacity?: number; - textAlign?: string | BooleanLike; - verticalAlign?: string | BooleanLike; + textAlign?: BoxStringProp; + verticalAlign?: string; inline?: BooleanLike; bold?: BooleanLike; italic?: BooleanLike; nowrap?: BooleanLike; preserveWhitespace?: BooleanLike; - m?: string | BooleanLike; - mx?: string | BooleanLike; - my?: string | BooleanLike; - mt?: string | BooleanLike; - mb?: string | BooleanLike; - ml?: string | BooleanLike; - mr?: string | BooleanLike; - p?: string | BooleanLike; - px?: string | BooleanLike; - py?: string | BooleanLike; - pt?: string | BooleanLike; - pb?: string | BooleanLike; - pl?: string | BooleanLike; - pr?: string | BooleanLike; - color?: string | BooleanLike; - textColor?: string | BooleanLike; - backgroundColor?: string | BooleanLike; + m?: BoxUnitProp; + mx?: BoxUnitProp; + my?: BoxUnitProp; + mt?: BoxUnitProp; + mb?: BoxUnitProp; + ml?: BoxUnitProp; + mr?: BoxUnitProp; + p?: BoxUnitProp; + px?: BoxUnitProp; + py?: BoxUnitProp; + pt?: BoxUnitProp; + pb?: BoxUnitProp; + pl?: BoxUnitProp; + pr?: BoxUnitProp; + color?: BoxStringProp; + textColor?: BoxStringProp; + backgroundColor?: BoxStringProp; fillPositionedParent?: BooleanLike; + //* baseline DOM / InfernoNode properties start *// + // anything put in here is directly injected into the element as a style + // this overrides provided style variables style?: CSSProperties; } diff --git a/tgui/packages/tgui/components/LabeledList.tsx b/tgui/packages/tgui/components/LabeledList.tsx index 4f47eab43348..e232e24090c9 100644 --- a/tgui/packages/tgui/components/LabeledList.tsx +++ b/tgui/packages/tgui/components/LabeledList.tsx @@ -6,7 +6,7 @@ import { BooleanLike, classes, pureComponentHooks } from 'common/react'; import { InfernoNode } from 'inferno'; -import { Box, unit } from './Box'; +import { Box, BoxStringProp, unit } from './Box'; import { ComponentProps } from './Component'; import { Divider } from './Divider'; @@ -28,9 +28,9 @@ LabeledList.defaultHooks = pureComponentHooks; type LabeledListItemProps = { readonly className?: string | BooleanLike; readonly label?: string | InfernoNode | BooleanLike; - readonly labelColor?: string | BooleanLike; - readonly color?: string | BooleanLike; - readonly textAlign?: string | BooleanLike; + readonly labelColor?: BoxStringProp; + readonly color?: BoxStringProp; + readonly textAlign?: BoxStringProp; readonly buttons?: InfernoNode, /** @deprecated */ readonly content?: any, @@ -77,7 +77,7 @@ const LabeledListItem = (props: LabeledListItemProps) => { colSpan={buttons ? undefined : 2} verticalAlign={verticalAlign}> {content} - {children} + {children || null} {buttons && ( diff --git a/tgui/packages/tgui/components/Table.js b/tgui/packages/tgui/components/Table.tsx similarity index 68% rename from tgui/packages/tgui/components/Table.js rename to tgui/packages/tgui/components/Table.tsx index 545e26f5934f..092a230bdfa4 100644 --- a/tgui/packages/tgui/components/Table.js +++ b/tgui/packages/tgui/components/Table.tsx @@ -4,10 +4,14 @@ * @license MIT */ -import { classes, pureComponentHooks } from 'common/react'; -import { computeBoxClassName, computeBoxProps } from './Box'; +import { BooleanLike, classes, pureComponentHooks } from 'common/react'; +import { BoxProps, computeBoxClassName, computeBoxProps } from './Box'; -export const Table = props => { +interface TableProps extends BoxProps { + readonly collapsing?: BooleanLike; +} + +export const Table = (props: TableProps) => { const { className, collapsing, @@ -32,7 +36,11 @@ export const Table = props => { Table.defaultHooks = pureComponentHooks; -export const TableRow = props => { +interface TableRowProps extends BoxProps { + readonly header?: BooleanLike; +} + +export const TableRow = (props: TableRowProps) => { const { className, header, @@ -52,7 +60,12 @@ export const TableRow = props => { TableRow.defaultHooks = pureComponentHooks; -export const TableCell = props => { +interface TableCellProps extends BoxProps { + readonly header?: BooleanLike; + readonly collapsing?: BooleanLike; +} + +export const TableCell = (props: TableCellProps) => { const { className, collapsing, diff --git a/tgui/packages/tgui/components/index.js b/tgui/packages/tgui/components/index.js index 121d2bfa4e21..1cdb24ba67af 100644 --- a/tgui/packages/tgui/components/index.js +++ b/tgui/packages/tgui/components/index.js @@ -24,7 +24,7 @@ export { Grid } from './Grid'; export { Icon } from './Icon'; export { InfinitePlane } from './InfinitePlane'; export { Input } from './Input'; -export { KeyListener } from './KeyListener'; +export { KeyListener } from './keyboard/KeyListener'; export { Knob } from './Knob'; export { LabeledControls } from './LabeledControls'; export { LabeledList } from './LabeledList'; diff --git a/tgui/packages/tgui/components/KeyListener.tsx b/tgui/packages/tgui/components/keyboard/KeyListener.tsx similarity index 88% rename from tgui/packages/tgui/components/KeyListener.tsx rename to tgui/packages/tgui/components/keyboard/KeyListener.tsx index 46b527653654..b55b96f5891e 100644 --- a/tgui/packages/tgui/components/KeyListener.tsx +++ b/tgui/packages/tgui/components/keyboard/KeyListener.tsx @@ -1,6 +1,6 @@ import { Component } from "inferno"; -import { KeyEvent } from "../events"; -import { listenForKeyEvents } from "../hotkeys"; +import { KeyEvent } from "../../events"; +import { listenForKeyEvents } from "../../hotkeys"; type KeyListenerProps = Partial<{ onKey: (key: KeyEvent) => void, diff --git a/tgui/packages/tgui/index.js b/tgui/packages/tgui/index.js index c57319e9cd11..99ed89910a55 100644 --- a/tgui/packages/tgui/index.js +++ b/tgui/packages/tgui/index.js @@ -64,10 +64,7 @@ const setupApp = () => { if (module.hot) { setupHotReloading(); module.hot.accept([ - './components', - './debug', - './layouts', - './routes', + '.', ], () => { renderApp(); }); diff --git a/tgui/packages/tgui/interfaces/GamePreferences/GamePreferenceEntry.tsx b/tgui/packages/tgui/interfaces/GamePreferences/GamePreferenceEntry.tsx new file mode 100644 index 000000000000..e3997657388d --- /dev/null +++ b/tgui/packages/tgui/interfaces/GamePreferences/GamePreferenceEntry.tsx @@ -0,0 +1,180 @@ +/** + * @file + * @license MIT + */ +import { BooleanLike } from "common/react"; +import { InfernoNode } from "inferno"; +import { Button, Collapsible, ColorBox, Dropdown, Input, NumberInput, Section, Stack, Tooltip } from "../../components"; +import { ByondAtomColor, ByondColorString, ColorPicker } from "../common/Color"; + +interface GamePreferenceEntryProps { + readonly schema: GamePreferenceEntrySchema; + readonly value: any; + readonly setValue: (v: any) => void; +} + +export type GamePreferenceEntrySchema = + PreferenceNumberEntrySchema | + PreferenceStringEntrySchema | + PreferenceToggleEntrySchema | + PreferenceDropdownEntrySchema | + PreferenceSimpleColorEntrySchema; + +interface PreferenceBaseEntrySchema { + key: string; + category: string; + subcategory: string; + name: string; + desc: string; + priority: number; + defaultValue: any; +} + +interface PreferenceNumberEntrySchema extends PreferenceBaseEntrySchema { + type: "number"; + minValue: number | null; + maxValue: number | null; + roundTo: number | null; + defaultValue: number; +} + +interface PreferenceStringEntrySchema extends PreferenceBaseEntrySchema { + type: "string"; + minLength: number; + maxLength: number; + defaultValue: string; +} + +interface PreferenceToggleEntrySchema extends PreferenceBaseEntrySchema { + type: "toggle"; + enabledName: string; + disabledName: string; + defaultValue: BooleanLike; +} + +interface PreferenceDropdownEntrySchema extends PreferenceBaseEntrySchema { + type: "dropdown"; + options: string[]; + defaultValue: string; +} + +interface PreferenceSimpleColorEntrySchema extends PreferenceBaseEntrySchema { + type: "simpleColor"; + defaultValue: ByondAtomColor; +} + +export const GamePreferenceEntry = (props: GamePreferenceEntryProps, context) => { + let innerContent: InfernoNode = null; + switch (props.schema.type) { + case 'number': + innerContent = ( + + ); + break; + case 'string': + innerContent = ( + + ); + break; + case 'toggle': + innerContent = ( + + ); + break; + case 'dropdown': + innerContent = ( + + ); + break; + case 'simpleColor': + innerContent = ( + + ); + break; + } + return ( + + + + + {props.schema.name} + + + + + ); +}; + +const computeGamePreferenceCategoryCache = (entries: GamePreferenceEntrySchema[]): Record => { + let computed: Record = {}; + entries.forEach((entry) => { + if (!computed[entry.category]) { + computed[entry.category] = []; + } + if (!computed[entry.category].includes(entry.subcategory)) { + computed[entry.category].push(entry.subcategory); + } + }); + Object.values(computed).forEach((arr) => arr.sort((a, b) => a.localeCompare(b))); + return computed; +}; + +export const GamePreferences = (props, context) => { + const { act, data } = useBackend(context); + + let categoryCache = computeGamePreferenceCategoryCache(data.entries); + let [activeCategory, setActiveCategory] = useLocalState(context, "prefsCategoryActive", Object.keys(categoryCache)[0]); + let [activeMiddleware, setActiveMiddleware] = useLocalState(context, "prefsMiddlewareActive", null); + + // sigh + // this is shitcode + // todo: refactor game prefs ui again + const [activeCapture, setActiveCapture] = useLocalState(context, 'activeKeyCapture', null); + + return ( + + {/* inject active capture vnode */} + {activeCapture} + + + + + + + + + + + + + + + ); +}; + +const GamePreferencesBody = (props, context) => { + const { act, data } = useBackend(context); + + let categoryCache = computeGamePreferenceCategoryCache(data.entries); + let [activeCategory, setActiveCategory] = useLocalState(context, "prefsCategoryActive", Object.keys(categoryCache)[0]); + let [activeMiddleware, setActiveMiddleware] = useLocalState(context, "prefsMiddlewareActive", null); + + // todo: this is so fucking awful bros please don't make the same mistake on character setup. + if (activeMiddleware && (typeof activeMiddleware === 'string')) { + let middlewareData = getModuleData(context, activeMiddleware); + switch (activeMiddleware) { + case 'keybindings': + return ( + act('addBind', { + ...key, + replaceKey: replacing, + keybind: id, + }, activeMiddleware)} + removeBind={(id, key) => act('removeBind', { keybind: id, key: key }, activeMiddleware)} + setHotkeyMode={(on) => act('hotkeys', { value: on }, activeMiddleware)} + {...middlewareData as GamePreferenceKeybindMiddlware} /> + ); + case 'toggles': + return ( + act('toggle', { key: key, val: val }, 'toggles')} + {...middlewareData as GamePreferenceTogglesMiddleware} /> + ); + } + } + + return ( +
+ + {categoryCache[activeCategory].map((subcat) => ( + +

{subcat}

+
+ + {data.entries.filter((e) => e.category === activeCategory && e.subcategory === subcat).map((entry) => ( + + act('set', { key: entry.key, value: val })} /> + + ))} + +
+ ))} +
+
+ ); +}; + +const GamePreferenceHeader = (props, context) => { + return ( + + + + + + + ); +}; + +const GamePreferenceFooter = (props: { + readonly activeCategory: string, + readonly activeMiddleware: string | null +}, context) => { + const { act, data } = useBackend(context); + return ( +
+ + + + act('save')} + content="Save" /> + + + + + act('discard')} + content="Discard" /> + + + + + + act('reset', props.activeCategory? { category: props.activeCategory } : {}, props.activeMiddleware)} + content="Reset to Default" /> + + + +
+ ); +}; diff --git a/tgui/packages/tgui/interfaces/PaiInterface.tsx b/tgui/packages/tgui/interfaces/PaiInterface.tsx index f31e5a51348b..504151dcbf78 100644 --- a/tgui/packages/tgui/interfaces/PaiInterface.tsx +++ b/tgui/packages/tgui/interfaces/PaiInterface.tsx @@ -441,7 +441,7 @@ const RecordRow = (props) => { return ( {filteredRecord?.map((value) => { - return {value}; + return {value}; })} ); diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/ambient_occlusion.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/ambient_occlusion.tsx deleted file mode 100644 index 4884c07377fb..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/ambient_occlusion.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { CheckboxInput, FeatureToggle } from "../base"; - -export const ambientocclusion: FeatureToggle = { - name: "Enable ambient occlusion", - category: "GAMEPLAY", - description: "Enable ambient occlusion, light shadows around characters.", - component: CheckboxInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/auto_fit_viewport.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/auto_fit_viewport.tsx deleted file mode 100644 index 5339de43d15a..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/auto_fit_viewport.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { CheckboxInput, FeatureToggle } from "../base"; - -export const auto_fit_viewport: FeatureToggle = { - name: "Auto fit viewport", - category: "UI", - component: CheckboxInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/darkened_flash.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/darkened_flash.tsx deleted file mode 100644 index 706b17877059..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/darkened_flash.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { multiline } from "common/string"; -import { CheckboxInput, FeatureToggle } from "../base"; - -export const darkened_flash: FeatureToggle = { - name: "Enable darkened flashes", - category: "GAMEPLAY", - description: multiline` - When toggled, being flashed will show a dark screen rather than a - bright one. - `, - component: CheckboxInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/fov_darkness.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/fov_darkness.tsx deleted file mode 100644 index 1315cc88fba8..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/fov_darkness.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { Feature, FeatureNumberInput } from "../base"; - -export const fov_darkness: Feature = { - name: "Field of view darkness", - category: "GAMEPLAY", - description: "The density of darkness of field of vision cones you may have by wearing restrictive eye cover.", - component: FeatureNumberInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/fps.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/fps.tsx deleted file mode 100644 index 55c091a9714f..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/fps.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { Dropdown, NumberInput, Stack } from "../../../../../components"; -import { Feature, FeatureNumericData, FeatureValueProps } from "../base"; - -type FpsServerData = FeatureNumericData & { - recommended_fps: number; -} - -const FpsInput = ( - props: FeatureValueProps -) => { - const { handleSetValue, serverData } = props; - - let recommened = `Recommended`; - if (serverData) { - recommened += ` (${serverData.recommended_fps})`; - } - - return ( - - - { - if (value === recommened) { - handleSetValue(-1); - } else { - handleSetValue(serverData?.recommended_fps || 60); - } - }} - width="100%" - options={[ - recommened, - "Custom", - ]} - /> - - - - {serverData && props.value !== -1 && ( { - props.handleSetValue(value); - }} - minValue={1} - maxValue={serverData.maximum} - value={props.value} - />)} - - - ); -}; - -export const clientfps: Feature = { - name: "FPS", - category: "GAMEPLAY", - component: FpsInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/hotkeys.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/hotkeys.tsx deleted file mode 100644 index 73cc3c9de16e..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/hotkeys.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { CheckboxInputInverse, FeatureToggle } from "../base"; - -export const hotkeys: FeatureToggle = { - name: "Classic hotkeys", - category: "GAMEPLAY", - description: "When enabled, will revert to the legacy hotkeys, using the input bar rather than popups.", - component: CheckboxInputInverse, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/preferred_map.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/preferred_map.tsx deleted file mode 100644 index 3acfad00445a..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/preferred_map.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { multiline } from "common/string"; -import { Feature, FeatureDropdownInput } from "../base"; - -export const preferred_map: Feature = { - name: "Preferred map", - category: "GAMEPLAY", - description: multiline` - During map rotation, prefer this map be chosen. - This does not affect the map vote, only random rotation when a vote - is not held. - `, - component: FeatureDropdownInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/runechat.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/runechat.tsx deleted file mode 100644 index d85a814d8add..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/runechat.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { CheckboxInput, FeatureNumberInput, FeatureNumeric, FeatureToggle } from "../base"; - -export const chat_on_map: FeatureToggle = { - name: "Enable Runechat", - category: "RUNECHAT", - description: "Chat messages will show above heads.", - component: CheckboxInput, -}; - -export const see_chat_non_mob: FeatureToggle = { - name: "Enable Runechat on objects", - category: "RUNECHAT", - description: "Chat messages will show above objects when they speak.", - component: CheckboxInput, -}; - -export const see_rc_emotes: FeatureToggle = { - name: "Enable Runechat emotes", - category: "RUNECHAT", - description: "Emotes will show above heads.", - component: CheckboxInput, -}; - -export const max_chat_length: FeatureNumeric = { - name: "Max chat length", - category: "RUNECHAT", - description: "The maximum length a Runechat message will show as.", - component: FeatureNumberInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/scaling_method.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/scaling_method.tsx deleted file mode 100644 index 114cc80ef5e8..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/scaling_method.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { createDropdownInput, Feature } from "../base"; - -export const scaling_method: Feature = { - name: "Scaling method", - category: "UI", - component: createDropdownInput({ - blur: "Bilinear", - distort: "Nearest Neighbor", - normal: "Point Sampling", - }), -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/screentips.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/screentips.tsx deleted file mode 100644 index b397388aa3da..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/screentips.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { multiline } from "common/string"; -import { FeatureColorInput, Feature, FeatureChoiced, FeatureDropdownInput } from "../base"; - -export const screentip_color: Feature = { - name: "Screentips color", - category: "UI", - description: multiline` - The color of screen tips, the text you see when hovering over something. - `, - component: FeatureColorInput, -}; - -export const screentip_pref: FeatureChoiced = { - name: "Enable screentips", - category: "UI", - description: multiline` - Enables screen tips, the text you see when hovering over something. - When set to "Only with tips", will only show when there is more information - than just the name, such as what right-clicking it does. - `, - component: FeatureDropdownInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/tgui.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/tgui.tsx deleted file mode 100644 index 837d00f770c7..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/tgui.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { CheckboxInput, FeatureToggle } from '../base'; - -export const tgui_fancy: FeatureToggle = { - name: 'Enable fancy TGUI', - category: 'UI', - description: 'Makes TGUI windows look better, at the cost of compatibility.', - component: CheckboxInput, -}; - -export const tgui_input: FeatureToggle = { - name: 'Input: Enable TGUI', - category: 'UI', - description: 'Renders input boxes in TGUI.', - component: CheckboxInput, -}; - -export const tgui_input_large: FeatureToggle = { - name: 'Input: Larger buttons', - category: 'UI', - description: 'Makes TGUI buttons less traditional, more functional.', - component: CheckboxInput, -}; - -export const tgui_input_swapped: FeatureToggle = { - name: 'Input: Swap Submit/Cancel buttons', - category: 'UI', - description: 'Makes TGUI buttons less traditional, more functional.', - component: CheckboxInput, -}; - -export const tgui_lock: FeatureToggle = { - name: 'Lock TGUI to main monitor', - category: 'UI', - description: 'Locks TGUI windows to your main monitor.', - component: CheckboxInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/tooltips.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/tooltips.tsx deleted file mode 100644 index d3147a01a1f2..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/tooltips.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { multiline } from "common/string"; -import { CheckboxInput, Feature, FeatureNumberInput, FeatureToggle } from "../base"; - -export const enable_tips: FeatureToggle = { - name: "Enable tooltips", - category: "TOOLTIPS", - description: multiline` - Do you want to see tooltips when hovering over items? - `, - component: CheckboxInput, -}; - -export const tip_delay: Feature = { - name: "Tooltip delay (in milliseconds)", - category: "TOOLTIPS", - description: multiline` - How long should it take to see a tooltip when hovering over items? - `, - component: FeatureNumberInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/ui_style.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/ui_style.tsx deleted file mode 100644 index 83a315bccac1..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/ui_style.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { classes } from "common/react"; -import { FeatureChoiced, FeatureChoicedServerData, FeatureValueProps, sortChoices } from "../base"; -import { Box, Dropdown, Stack } from "../../../../../components"; - -const UIStyleInput = ( - props: FeatureValueProps -) => { - const { serverData, value } = props; - if (!serverData) { - return null; - } - - const { icons } = serverData; - - if (!icons) { - return (ui_style had no icons!); - } - - const choices = Object.fromEntries( - Object.entries(icons) - .map(([name, icon]) => { - return [name, ( - - - - - - - {name} - - - )]; - }) - ); - - return ( - { - return { - displayText: label, - value: dataValue, - }; - })} - /> - ); -}; - -export const UI_style: FeatureChoiced = { - name: "UI Style", - category: "UI", - component: UIStyleInput, -}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/widescreen.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/widescreen.tsx deleted file mode 100644 index e4d7595775ee..000000000000 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/widescreen.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import { CheckboxInput, FeatureToggle } from "../base"; - -export const widescreenpref: FeatureToggle = { - name: "Enable widescreen", - category: "UI", - component: CheckboxInput, -}; diff --git a/tgui/packages/tgui/interfaces/items/Crayon.tsx b/tgui/packages/tgui/interfaces/items/Crayon.tsx index e27c2e92c1cb..546da97699b2 100644 --- a/tgui/packages/tgui/interfaces/items/Crayon.tsx +++ b/tgui/packages/tgui/interfaces/items/Crayon.tsx @@ -1,3 +1,7 @@ +/** + * @file + * @license MIT + */ import { BooleanLike } from "common/react"; import { useBackend, useLocalState } from "../../backend"; import { Box, Button, Dimmer, Flex, Icon, LabeledList, Modal, NumberInput, Section, Stack } from "../../components"; diff --git a/tgui/packages/tgui/interfaces/machines/AirAlarm.tsx b/tgui/packages/tgui/interfaces/machines/AirAlarm.tsx index 72c589f610f5..aa96ab63b5c0 100644 --- a/tgui/packages/tgui/interfaces/machines/AirAlarm.tsx +++ b/tgui/packages/tgui/interfaces/machines/AirAlarm.tsx @@ -252,7 +252,7 @@ const AirAlarmControlHome = (props, context) => { icon={atmos_alarm ? 'exclamation-triangle' : 'exclamation'} - color={atmos_alarm && 'caution'} + color={!!atmos_alarm && 'caution'} content="Area Atmosphere Alarm" onClick={() => act(atmos_alarm ? 'reset' : 'alarm')} /> diff --git a/tgui/packages/tgui/interfaces/AgeVerifyMenu.tsx b/tgui/packages/tgui/interfaces/ui/UIAgeVerifyMenu.tsx similarity index 94% rename from tgui/packages/tgui/interfaces/AgeVerifyMenu.tsx rename to tgui/packages/tgui/interfaces/ui/UIAgeVerifyMenu.tsx index f8e3aa8310d6..90961bbdc70b 100644 --- a/tgui/packages/tgui/interfaces/AgeVerifyMenu.tsx +++ b/tgui/packages/tgui/interfaces/ui/UIAgeVerifyMenu.tsx @@ -1,6 +1,6 @@ -import { useBackend, useLocalState } from "../backend"; -import { Button, NoticeBox, Section, Stack } from "../components"; -import { Window } from "../layouts"; +import { useBackend, useLocalState } from "../../backend"; +import { Button, NoticeBox, Section, Stack } from "../../components"; +import { Window } from "../../layouts"; const MONTH_DAYS_LOOKUP: number[] = [ 31, @@ -62,7 +62,7 @@ const validDays = (month: number, year: number) => { return ret; }; -export const AgeVerifyMenu = (props, context) => { +export const UIAgeVerifyMenu = (props, context) => { let { data, act } = useBackend(context); let [month, setMonth] = useLocalState(context, "month", null); let [day, setDay] = useLocalState(context, "day", null); diff --git a/tgui/packages/tgui/interfaces/AbductorConsole.js b/tgui/packages/tgui/interfaces/unused/AbductorConsole.js similarity index 95% rename from tgui/packages/tgui/interfaces/AbductorConsole.js rename to tgui/packages/tgui/interfaces/unused/AbductorConsole.js index 921c73beed21..ae1ef52c4ce5 100644 --- a/tgui/packages/tgui/interfaces/AbductorConsole.js +++ b/tgui/packages/tgui/interfaces/unused/AbductorConsole.js @@ -1,7 +1,7 @@ -import { useBackend, useSharedState } from '../backend'; -import { Button, LabeledList, NoticeBox, Section, Tabs } from '../components'; -import { Window } from '../layouts'; -import { GenericUplink } from "./Uplink/GenericUplink"; +import { useBackend, useSharedState } from '../../backend'; +import { Button, LabeledList, NoticeBox, Section, Tabs } from '../../components'; +import { Window } from '../../layouts'; +import { GenericUplink } from "../Uplink/GenericUplink"; export const AbductorConsole = (props, context) => { const [tab, setTab] = useSharedState(context, 'tab', 1); diff --git a/tgui/packages/tgui/interfaces/Achievements.js b/tgui/packages/tgui/interfaces/unused/Achievements.js similarity index 96% rename from tgui/packages/tgui/interfaces/Achievements.js rename to tgui/packages/tgui/interfaces/unused/Achievements.js index a4ac21b657f1..4d7a9ebf6b10 100644 --- a/tgui/packages/tgui/interfaces/Achievements.js +++ b/tgui/packages/tgui/interfaces/unused/Achievements.js @@ -1,6 +1,6 @@ -import { useBackend, useLocalState } from '../backend'; -import { Box, Flex, Icon, Table, Tabs } from '../components'; -import { Window } from '../layouts'; +import { useBackend, useLocalState } from '../../backend'; +import { Box, Flex, Icon, Table, Tabs } from '../../components'; +import { Window } from '../../layouts'; export const Achievements = (props, context) => { const { data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/Adminhelp.tsx b/tgui/packages/tgui/interfaces/unused/Adminhelp.tsx similarity index 96% rename from tgui/packages/tgui/interfaces/Adminhelp.tsx rename to tgui/packages/tgui/interfaces/unused/Adminhelp.tsx index 1d2fcb741aaa..f161358b0088 100644 --- a/tgui/packages/tgui/interfaces/Adminhelp.tsx +++ b/tgui/packages/tgui/interfaces/unused/Adminhelp.tsx @@ -1,7 +1,7 @@ import { BooleanLike } from "common/react"; -import { useBackend, useLocalState } from "../backend"; -import { TextArea, Stack, Button, NoticeBox, Input, Box } from "../components"; -import { Window } from "../layouts"; +import { useBackend, useLocalState } from "../../backend"; +import { TextArea, Stack, Button, NoticeBox, Input, Box } from "../../components"; +import { Window } from "../../layouts"; type AdminhelpData = { adminCount: number, diff --git a/tgui/packages/tgui/interfaces/AdventureBrowser.tsx b/tgui/packages/tgui/interfaces/unused/AdventureBrowser.tsx similarity index 94% rename from tgui/packages/tgui/interfaces/AdventureBrowser.tsx rename to tgui/packages/tgui/interfaces/unused/AdventureBrowser.tsx index 377f56cbb599..53b997aced08 100644 --- a/tgui/packages/tgui/interfaces/AdventureBrowser.tsx +++ b/tgui/packages/tgui/interfaces/unused/AdventureBrowser.tsx @@ -1,8 +1,8 @@ -import { useBackend, useLocalState } from '../backend'; -import { Button, LabeledList, Section, Box, NoticeBox, Table } from '../components'; -import { Window } from '../layouts'; -import { AdventureDataProvider, AdventureScreen } from './ExodroneConsole'; -import { formatTime } from '../format'; +import { useBackend, useLocalState } from '../../backend'; +import { Button, LabeledList, Section, Box, NoticeBox, Table } from '../../components'; +import { Window } from '../../layouts'; +import { AdventureDataProvider, AdventureScreen } from '../ExodroneConsole'; +import { formatTime } from '../../format'; type Adventure = { ref: string; diff --git a/tgui/packages/tgui/interfaces/AnomalyRefinery.js b/tgui/packages/tgui/interfaces/unused/AnomalyRefinery.js similarity index 97% rename from tgui/packages/tgui/interfaces/AnomalyRefinery.js rename to tgui/packages/tgui/interfaces/unused/AnomalyRefinery.js index 4e793d45baa0..eaf5a711d241 100644 --- a/tgui/packages/tgui/interfaces/AnomalyRefinery.js +++ b/tgui/packages/tgui/interfaces/unused/AnomalyRefinery.js @@ -1,4 +1,4 @@ -import { useBackend, useSharedState } from '../backend'; +import { useBackend, useSharedState } from '../../backend'; import { Button, Icon, @@ -7,9 +7,9 @@ import { Stack, LabeledList, Box, -} from '../components'; -import { Window } from '../layouts'; -import { GasmixParser } from './common/GasmixParser'; +} from '../../components'; +import { Window } from '../../layouts'; +import { GasmixParser } from '../common/GasmixParser'; export const AnomalyRefinery = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/AtmosControlPanel.js b/tgui/packages/tgui/interfaces/unused/AtmosControlPanel.js similarity index 96% rename from tgui/packages/tgui/interfaces/AtmosControlPanel.js rename to tgui/packages/tgui/interfaces/unused/AtmosControlPanel.js index 3e2141c0fcff..4fd098481506 100644 --- a/tgui/packages/tgui/interfaces/AtmosControlPanel.js +++ b/tgui/packages/tgui/interfaces/unused/AtmosControlPanel.js @@ -1,8 +1,8 @@ import { map, sortBy } from 'common/collections'; import { flow } from 'common/fp'; -import { useBackend } from '../backend'; -import { Box, Button, Flex, Section, Table } from '../components'; -import { Window } from '../layouts'; +import { useBackend } from '../../backend'; +import { Box, Button, Flex, Section, Table } from '../../components'; +import { Window } from '../../layouts'; export const AtmosControlPanel = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/AtmosHandbook.tsx b/tgui/packages/tgui/interfaces/unused/AtmosHandbook.tsx similarity index 98% rename from tgui/packages/tgui/interfaces/AtmosHandbook.tsx rename to tgui/packages/tgui/interfaces/unused/AtmosHandbook.tsx index ae756df77997..b2c397858e76 100644 --- a/tgui/packages/tgui/interfaces/AtmosHandbook.tsx +++ b/tgui/packages/tgui/interfaces/unused/AtmosHandbook.tsx @@ -1,7 +1,7 @@ // todo: this here is a reminder that we need a popup atmos guide that you can pull up. -import { Modal, Section } from "../components"; -import { FullGasContext } from "./common/Atmos"; +import { Modal, Section } from "../../components"; +import { FullGasContext } from "../common/Atmos"; interface AtmosGuideProps { // gas context to pull from - must be full diff --git a/tgui/packages/tgui/interfaces/Bepis.js b/tgui/packages/tgui/interfaces/unused/Bepis.js similarity index 97% rename from tgui/packages/tgui/interfaces/Bepis.js rename to tgui/packages/tgui/interfaces/unused/Bepis.js index 6bd7a12d678e..431776642e85 100644 --- a/tgui/packages/tgui/interfaces/Bepis.js +++ b/tgui/packages/tgui/interfaces/unused/Bepis.js @@ -1,6 +1,6 @@ -import { useBackend } from '../backend'; -import { Box, Button, Grid, LabeledList, NumberInput, Section } from '../components'; -import { Window } from '../layouts'; +import { useBackend } from '../../backend'; +import { Box, Button, Grid, LabeledList, NumberInput, Section } from '../../components'; +import { Window } from '../../layouts'; export const Bepis = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/BluespaceArtillery.js b/tgui/packages/tgui/interfaces/unused/BluespaceArtillery.js similarity index 95% rename from tgui/packages/tgui/interfaces/BluespaceArtillery.js rename to tgui/packages/tgui/interfaces/unused/BluespaceArtillery.js index 87d8716c72e0..34875d9c79a2 100644 --- a/tgui/packages/tgui/interfaces/BluespaceArtillery.js +++ b/tgui/packages/tgui/interfaces/unused/BluespaceArtillery.js @@ -1,6 +1,6 @@ -import { useBackend } from '../backend'; -import { Box, Button, LabeledList, NoticeBox, Section } from '../components'; -import { Window } from '../layouts'; +import { useBackend } from '../../backend'; +import { Box, Button, LabeledList, NoticeBox, Section } from '../../components'; +import { Window } from '../../layouts'; export const BluespaceArtillery = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/BluespaceLocator.js b/tgui/packages/tgui/interfaces/unused/BluespaceLocator.js similarity index 93% rename from tgui/packages/tgui/interfaces/BluespaceLocator.js rename to tgui/packages/tgui/interfaces/unused/BluespaceLocator.js index 889a6ef57824..2cffd93e0ba0 100644 --- a/tgui/packages/tgui/interfaces/BluespaceLocator.js +++ b/tgui/packages/tgui/interfaces/unused/BluespaceLocator.js @@ -1,6 +1,6 @@ -import { useBackend, useSharedState } from '../backend'; -import { Icon, ProgressBar, Tabs } from '../components'; -import { Window } from '../layouts'; +import { useBackend, useSharedState } from '../../backend'; +import { Icon, ProgressBar, Tabs } from '../../components'; +import { Window } from '../../layouts'; const directionToIcon = { north: 0, diff --git a/tgui/packages/tgui/interfaces/BluespaceSender.js b/tgui/packages/tgui/interfaces/unused/BluespaceSender.js similarity index 95% rename from tgui/packages/tgui/interfaces/BluespaceSender.js rename to tgui/packages/tgui/interfaces/unused/BluespaceSender.js index 80ea5ee54bb2..bd464f5befda 100644 --- a/tgui/packages/tgui/interfaces/BluespaceSender.js +++ b/tgui/packages/tgui/interfaces/unused/BluespaceSender.js @@ -1,10 +1,10 @@ import { filter, sortBy } from 'common/collections'; import { flow } from 'common/fp'; import { toFixed } from 'common/math'; -import { useBackend } from '../backend'; -import { Button, Divider, LabeledList, NumberInput, ProgressBar, Section, Stack, Box } from '../components'; -import { getGasColor, getGasLabel } from '../constants'; -import { Window } from '../layouts'; +import { useBackend } from '../../backend'; +import { Button, Divider, LabeledList, NumberInput, ProgressBar, Section, Stack, Box } from '../../components'; +import { getGasColor, getGasLabel } from '../../constants'; +import { Window } from '../../layouts'; const mappedTopMargin = "2%"; diff --git a/tgui/packages/tgui/interfaces/BluespaceVendor.js b/tgui/packages/tgui/interfaces/unused/BluespaceVendor.js similarity index 96% rename from tgui/packages/tgui/interfaces/BluespaceVendor.js rename to tgui/packages/tgui/interfaces/unused/BluespaceVendor.js index 5db5e5c70660..ed13e5b53ea9 100644 --- a/tgui/packages/tgui/interfaces/BluespaceVendor.js +++ b/tgui/packages/tgui/interfaces/unused/BluespaceVendor.js @@ -2,10 +2,10 @@ import { filter, sortBy } from 'common/collections'; import { flow } from 'common/fp'; import { toFixed } from 'common/math'; import { multiline } from 'common/string'; -import { useBackend } from '../backend'; -import { Button, Divider, LabeledList, NumberInput, ProgressBar, Section, Stack } from '../components'; -import { getGasColor, getGasLabel } from '../constants'; -import { Window } from '../layouts'; +import { useBackend } from '../../backend'; +import { Button, Divider, LabeledList, NumberInput, ProgressBar, Section, Stack } from '../../components'; +import { getGasColor, getGasLabel } from '../../constants'; +import { Window } from '../../layouts'; export const BluespaceVendor = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/AntagInfoBrainwashed.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoBrainwashed.tsx similarity index 93% rename from tgui/packages/tgui/interfaces/AntagInfoBrainwashed.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoBrainwashed.tsx index 7b33922d4420..974f29b5e2b5 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoBrainwashed.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoBrainwashed.tsx @@ -1,7 +1,7 @@ -import { useBackend } from '../backend'; -import { Icon, Section, Stack } from '../components'; +import { useBackend } from '../../../backend'; +import { Icon, Section, Stack } from '../../../components'; import { BooleanLike } from 'common/react'; -import { Window } from '../layouts'; +import { Window } from '../../../layouts'; type Objective = { count: number; diff --git a/tgui/packages/tgui/interfaces/AntagInfoBrother.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoBrother.tsx similarity index 90% rename from tgui/packages/tgui/interfaces/AntagInfoBrother.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoBrother.tsx index d4a7c382d5ff..8cb815bc34e2 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoBrother.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoBrother.tsx @@ -1,7 +1,7 @@ -import { useBackend } from '../backend'; -import { Section, Stack } from '../components'; +import { useBackend } from '../../../backend'; +import { Section, Stack } from '../../../components'; import { BooleanLike } from 'common/react'; -import { Window } from '../layouts'; +import { Window } from '../../../layouts'; type Objective = { count: number; diff --git a/tgui/packages/tgui/interfaces/AntagInfoChangeling.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoChangeling.tsx similarity index 98% rename from tgui/packages/tgui/interfaces/AntagInfoChangeling.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoChangeling.tsx index e6ed41d59185..1d524715623e 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoChangeling.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoChangeling.tsx @@ -1,7 +1,7 @@ import { multiline } from 'common/string'; -import { useBackend, useSharedState } from '../backend'; -import { Box, Button, Dimmer, Dropdown, Section, Stack } from '../components'; -import { Window } from '../layouts'; +import { useBackend, useSharedState } from '../../../backend'; +import { Box, Button, Dimmer, Dropdown, Section, Stack } from '../../../components'; +import { Window } from '../../../layouts'; const hivestyle = { fontWeight: 'bold', diff --git a/tgui/packages/tgui/interfaces/AntagInfoDemon.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoDemon.tsx similarity index 96% rename from tgui/packages/tgui/interfaces/AntagInfoDemon.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoDemon.tsx index 7a9838f289a6..0922f4162bc9 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoDemon.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoDemon.tsx @@ -1,7 +1,7 @@ -import { useBackend } from '../backend'; -import { Box, Section, Stack } from '../components'; +import { useBackend } from '../../../backend'; +import { Box, Section, Stack } from '../../../components'; import { BooleanLike } from 'common/react'; -import { Window } from '../layouts'; +import { Window } from '../../../layouts'; const jauntstyle = { color: 'lightblue', diff --git a/tgui/packages/tgui/interfaces/AntagInfoGangmember.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoGangmember.tsx similarity index 95% rename from tgui/packages/tgui/interfaces/AntagInfoGangmember.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoGangmember.tsx index 5b0e09c286c3..040284d04f0a 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoGangmember.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoGangmember.tsx @@ -1,6 +1,6 @@ -import { useBackend } from '../backend'; -import { BlockQuote, Icon, Section, Stack } from '../components'; -import { Window } from '../layouts'; +import { useBackend } from '../../../backend'; +import { BlockQuote, Icon, Section, Stack } from '../../../components'; +import { Window } from '../../../layouts'; type Info = { antag_name: string; diff --git a/tgui/packages/tgui/interfaces/AntagInfoGeneric.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoGeneric.tsx similarity index 90% rename from tgui/packages/tgui/interfaces/AntagInfoGeneric.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoGeneric.tsx index a07848d24bcd..7931dd0b8399 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoGeneric.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoGeneric.tsx @@ -1,7 +1,7 @@ -import { useBackend } from '../backend'; -import { Section, Stack } from '../components'; +import { useBackend } from '../../../backend'; +import { Section, Stack } from '../../../components'; import { BooleanLike } from 'common/react'; -import { Window } from '../layouts'; +import { Window } from '../../../layouts'; type Objective = { count: number; diff --git a/tgui/packages/tgui/interfaces/AntagInfoHeretic.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoHeretic.tsx similarity index 98% rename from tgui/packages/tgui/interfaces/AntagInfoHeretic.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoHeretic.tsx index 29f3ea6c2eee..ce6d9fce321a 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoHeretic.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoHeretic.tsx @@ -1,6 +1,6 @@ -import { useBackend, useLocalState } from '../backend'; -import { Section, Stack, Box, Tabs, Button, BlockQuote } from '../components'; -import { Window } from '../layouts'; +import { useBackend, useLocalState } from '../../../backend'; +import { Section, Stack, Box, Tabs, Button, BlockQuote } from '../../../components'; +import { Window } from '../../../layouts'; import { BooleanLike } from 'common/react'; const hereticRed = { diff --git a/tgui/packages/tgui/interfaces/AntagInfoMalf.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoMalf.tsx similarity index 96% rename from tgui/packages/tgui/interfaces/AntagInfoMalf.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoMalf.tsx index bd48edf47b19..dc42b7b3da12 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoMalf.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoMalf.tsx @@ -1,9 +1,9 @@ -import { useBackend, useLocalState } from '../backend'; +import { useBackend, useLocalState } from '../../../backend'; import { multiline } from 'common/string'; -import { GenericUplink, Item } from './Uplink/GenericUplink'; -import { BlockQuote, Button, Section, Stack, Tabs } from '../components'; +import { GenericUplink, Item } from '../../Uplink/GenericUplink'; +import { BlockQuote, Button, Section, Stack, Tabs } from '../../../components'; import { BooleanLike } from 'common/react'; -import { Window } from '../layouts'; +import { Window } from '../../../layouts'; const allystyle = { fontWeight: 'bold', diff --git a/tgui/packages/tgui/interfaces/AntagInfoMorph.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoMorph.tsx similarity index 94% rename from tgui/packages/tgui/interfaces/AntagInfoMorph.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoMorph.tsx index 563058853162..f2b15147ae91 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoMorph.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoMorph.tsx @@ -1,5 +1,5 @@ -import { BlockQuote, Stack } from '../components'; -import { Window } from '../layouts'; +import { BlockQuote, Stack } from '../../../components'; +import { Window } from '../../../layouts'; const goodstyle = { color: 'lightgreen', diff --git a/tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoNightmare.tsx similarity index 96% rename from tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoNightmare.tsx index 18bebc8aa56e..028a4a3f524d 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoNightmare.tsx @@ -1,5 +1,5 @@ -import { BlockQuote, LabeledList, Section, Stack } from '../components'; -import { Window } from '../layouts'; +import { BlockQuote, LabeledList, Section, Stack } from '../../../components'; +import { Window } from '../../../layouts'; const tipstyle = { color: 'white', diff --git a/tgui/packages/tgui/interfaces/AntagInfoSeparatist.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoSeparatist.tsx similarity index 95% rename from tgui/packages/tgui/interfaces/AntagInfoSeparatist.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoSeparatist.tsx index 24aace7d50d2..6ffb1f3de39a 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoSeparatist.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoSeparatist.tsx @@ -1,6 +1,6 @@ -import { useBackend } from '../backend'; -import { Icon, Section, Stack } from '../components'; -import { Window } from '../layouts'; +import { useBackend } from '../../../backend'; +import { Icon, Section, Stack } from '../../../components'; +import { Window } from '../../../layouts'; type Objective = { count: number; diff --git a/tgui/packages/tgui/interfaces/AntagInfoThief.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoThief.tsx similarity index 94% rename from tgui/packages/tgui/interfaces/AntagInfoThief.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoThief.tsx index f3ed4da39fce..4eca3234e13a 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoThief.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoThief.tsx @@ -1,7 +1,7 @@ import { BooleanLike } from 'common/react'; -import { useBackend } from '../backend'; -import { Section, Stack } from '../components'; -import { Window } from '../layouts'; +import { useBackend } from '../../../backend'; +import { Section, Stack } from '../../../components'; +import { Window } from '../../../layouts'; type Objective = { count: number; diff --git a/tgui/packages/tgui/interfaces/AntagInfoTraitor.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoTraitor.tsx similarity index 97% rename from tgui/packages/tgui/interfaces/AntagInfoTraitor.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoTraitor.tsx index 4e8f881e9d5b..e430afd9f0f1 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoTraitor.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoTraitor.tsx @@ -1,8 +1,8 @@ -import { useBackend } from '../backend'; +import { useBackend } from '../../../backend'; import { multiline } from 'common/string'; -import { BlockQuote, Button, Dimmer, Section, Stack } from '../components'; +import { BlockQuote, Button, Dimmer, Section, Stack } from '../../../components'; import { BooleanLike } from 'common/react'; -import { Window } from '../layouts'; +import { Window } from '../../../layouts'; const allystyle = { fontWeight: 'bold', diff --git a/tgui/packages/tgui/interfaces/AntagInfoWizard.tsx b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoWizard.tsx similarity index 96% rename from tgui/packages/tgui/interfaces/AntagInfoWizard.tsx rename to tgui/packages/tgui/interfaces/unused/antag/AntagInfoWizard.tsx index d33123b947af..5a924940a465 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoWizard.tsx +++ b/tgui/packages/tgui/interfaces/unused/antag/AntagInfoWizard.tsx @@ -1,7 +1,7 @@ -import { useBackend } from '../backend'; -import { Section, Stack } from '../components'; +import { useBackend } from '../../../backend'; +import { Section, Stack } from '../../../components'; import { BooleanLike } from 'common/react'; -import { Window } from '../layouts'; +import { Window } from '../../../layouts'; const teleportstyle = { color: 'yellow', diff --git a/tgui/packages/tgui/interfaces/AccountingConsole.js b/tgui/packages/tgui/interfaces/unused/economy/AccountingConsole.js similarity index 93% rename from tgui/packages/tgui/interfaces/AccountingConsole.js rename to tgui/packages/tgui/interfaces/unused/economy/AccountingConsole.js index 41c2fa1c35b3..16207c6b9841 100644 --- a/tgui/packages/tgui/interfaces/AccountingConsole.js +++ b/tgui/packages/tgui/interfaces/unused/economy/AccountingConsole.js @@ -1,7 +1,7 @@ -import { BlockQuote, Collapsible, LabeledList, Modal, Section, Tabs } from '../components'; -import { useBackend } from '../backend'; -import { useLocalState } from '../backend'; -import { Window } from '../layouts'; +import { BlockQuote, Collapsible, LabeledList, Modal, Section, Tabs } from '../../../components'; +import { useBackend } from '../../../backend'; +import { useLocalState } from '../../../backend'; +import { Window } from '../../../layouts'; export const AccountingConsole = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/AccountsTerminal.js b/tgui/packages/tgui/interfaces/unused/economy/AccountsTerminal.js similarity index 97% rename from tgui/packages/tgui/interfaces/AccountsTerminal.js rename to tgui/packages/tgui/interfaces/unused/economy/AccountsTerminal.js index ca6051c66be9..b0da022d06c7 100644 --- a/tgui/packages/tgui/interfaces/AccountsTerminal.js +++ b/tgui/packages/tgui/interfaces/unused/economy/AccountsTerminal.js @@ -1,6 +1,6 @@ -import { useBackend, useSharedState } from "../backend"; -import { Box, Button, LabeledList, Input, Section, Table, Tabs } from "../components"; -import { Window } from "../layouts"; +import { useBackend, useSharedState } from "../../../backend"; +import { Box, Button, LabeledList, Input, Section, Table, Tabs } from "../../../components"; +import { Window } from "../../../layouts"; export const AccountsTerminal = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/BlackMarketUplink.js b/tgui/packages/tgui/interfaces/unused/economy/BlackMarketUplink.js similarity index 95% rename from tgui/packages/tgui/interfaces/BlackMarketUplink.js rename to tgui/packages/tgui/interfaces/unused/economy/BlackMarketUplink.js index 00223f582421..08b5e4176632 100644 --- a/tgui/packages/tgui/interfaces/BlackMarketUplink.js +++ b/tgui/packages/tgui/interfaces/unused/economy/BlackMarketUplink.js @@ -1,7 +1,7 @@ -import { useBackend } from '../backend'; -import { AnimatedNumber, Box, Button, Modal, Section, Stack, Tabs } from '../components'; -import { formatMoney } from '../format'; -import { Window } from '../layouts'; +import { useBackend } from '../../../backend'; +import { AnimatedNumber, Box, Button, Modal, Section, Stack, Tabs } from '../../../components'; +import { formatMoney } from '../../../format'; +import { Window } from '../../../layouts'; export const BlackMarketUplink = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/Pda.js b/tgui/packages/tgui/interfaces/unused/pda/Pda.js similarity index 95% rename from tgui/packages/tgui/interfaces/Pda.js rename to tgui/packages/tgui/interfaces/unused/pda/Pda.js index e7787da71d7f..ebd73a90c9f5 100644 --- a/tgui/packages/tgui/interfaces/Pda.js +++ b/tgui/packages/tgui/interfaces/unused/pda/Pda.js @@ -1,11 +1,11 @@ -import { useBackend, useLocalState } from "../backend"; -import { Box, Button, Flex, Icon, LabeledList, Section } from "../components"; -import { Window } from "../layouts"; +import { useBackend, useLocalState } from "../../../backend"; +import { Box, Button, Flex, Icon, LabeledList, Section } from "../../../components"; +import { Window } from "../../../layouts"; /* This is all basically stolen from routes.js. */ -import { routingError } from "../routes"; +import { routingError } from "../../../routes"; -const requirePdaInterface = require.context('./pda', false, /\.js$/); +const requirePdaInterface = require.context('./cartridges', false, /\.js$/); const getPdaApp = name => { let appModule; diff --git a/tgui/packages/tgui/interfaces/pda/pda_atmos_scan.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_atmos_scan.js similarity index 91% rename from tgui/packages/tgui/interfaces/pda/pda_atmos_scan.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_atmos_scan.js index a6a76a70eff6..3e84ebcc242d 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_atmos_scan.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_atmos_scan.js @@ -1,7 +1,7 @@ import { filter } from 'common/collections'; import { decodeHtmlEntities } from 'common/string'; -import { useBackend } from "../../backend"; -import { Box, LabeledList } from "../../components"; +import { useBackend } from "../../../../backend"; +import { Box, LabeledList } from "../../../../components"; const getItemColor = (value, min2, min1, max1, max2) => { if (value < min2) { diff --git a/tgui/packages/tgui/interfaces/pda/pda_janitor.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_janitor.js similarity index 95% rename from tgui/packages/tgui/interfaces/pda/pda_janitor.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_janitor.js index a98026a343b8..e772f5fcc02c 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_janitor.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_janitor.js @@ -1,5 +1,5 @@ -import { useBackend } from "../../backend"; -import { Box, LabeledList, Section } from "../../components"; +import { useBackend } from "../../../../backend"; +import { Box, LabeledList, Section } from "../../../../components"; export const pda_janitor = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/pda/pda_main_menu.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_main_menu.js similarity index 94% rename from tgui/packages/tgui/interfaces/pda/pda_main_menu.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_main_menu.js index ee08d11b1f62..71bdbe8b8e4c 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_main_menu.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_main_menu.js @@ -1,6 +1,6 @@ import { Fragment } from 'inferno'; -import { useBackend } from "../../backend"; -import { Box, Button, LabeledList, Section } from "../../components"; +import { useBackend } from "../../../../backend"; +import { Box, Button, LabeledList, Section } from "../../../../components"; export const pda_main_menu = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/pda/pda_manifest.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_manifest.js similarity index 53% rename from tgui/packages/tgui/interfaces/pda/pda_manifest.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_manifest.js index 48a0054bc801..dcd26a43b981 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_manifest.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_manifest.js @@ -1,6 +1,6 @@ -import { useBackend } from "../../backend"; -import { Box } from "../../components"; -import { CrewManifestContent } from '../CrewManifest'; +import { useBackend } from "../../../../backend"; +import { Box } from "../../../../components"; +import { CrewManifestContent } from '../../../CrewManifest'; export const pda_manifest = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/pda/pda_medical.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_medical.js similarity index 96% rename from tgui/packages/tgui/interfaces/pda/pda_medical.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_medical.js index 585aeb76f55a..06df567e2c33 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_medical.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_medical.js @@ -1,5 +1,5 @@ -import { useBackend } from "../../backend"; -import { Box, Button, LabeledList, Section } from "../../components"; +import { useBackend } from "../../../../backend"; +import { Box, Button, LabeledList, Section } from "../../../../components"; export const pda_medical = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/pda/pda_messenger.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_messenger.js similarity index 97% rename from tgui/packages/tgui/interfaces/pda/pda_messenger.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_messenger.js index baf7abf02205..b3fdc729ed79 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_messenger.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_messenger.js @@ -1,7 +1,7 @@ import { decodeHtmlEntities } from 'common/string'; import { filter } from 'common/collections'; -import { useBackend, useLocalState } from "../../backend"; -import { Box, Button, LabeledList, Section } from "../../components"; +import { useBackend, useLocalState } from "../../../../backend"; +import { Box, Button, LabeledList, Section } from "../../../../components"; export const pda_messenger = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/pda/pda_news.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_news.js similarity index 96% rename from tgui/packages/tgui/interfaces/pda/pda_news.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_news.js index 1801922f9810..50fc733c4795 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_news.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_news.js @@ -1,7 +1,7 @@ import { decodeHtmlEntities } from 'common/string'; import { Fragment } from 'inferno'; -import { useBackend } from "../../backend"; -import { Box, Button, Section } from "../../components"; +import { useBackend } from "../../../../backend"; +import { Box, Button, Section } from "../../../../components"; // Stolen wholesale from communicators. // TGUITODO: Merge PDA & Communicator shared code once both are in diff --git a/tgui/packages/tgui/interfaces/pda/pda_notekeeper.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_notekeeper.js similarity index 83% rename from tgui/packages/tgui/interfaces/pda/pda_notekeeper.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_notekeeper.js index d66a892ebe9f..af5d77560a55 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_notekeeper.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_notekeeper.js @@ -1,6 +1,6 @@ /* eslint react/no-danger: "off" */ -import { useBackend } from "../../backend"; -import { Box, Button, Section } from "../../components"; +import { useBackend } from "../../../../backend"; +import { Box, Button, Section } from "../../../../components"; export const pda_notekeeper = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/pda/pda_power.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_power.js similarity index 52% rename from tgui/packages/tgui/interfaces/pda/pda_power.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_power.js index fc34d75c5ce4..abe68d8d59ad 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_power.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_power.js @@ -1,8 +1,8 @@ -import { useBackend } from "../../backend"; -import { PowerMonitorContent } from '../PowerMonitor'; +import { useBackend } from "../../../../backend"; +import { PowerMonitorContent } from '../../../PowerMonitor'; export const pda_power = (props, context) => { const { act, data } = useBackend(context); return ; -}; \ No newline at end of file +}; diff --git a/tgui/packages/tgui/interfaces/pda/pda_security.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_security.js similarity index 95% rename from tgui/packages/tgui/interfaces/pda/pda_security.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_security.js index f2a39dec87b8..9e88d2806e7d 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_security.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_security.js @@ -1,5 +1,5 @@ -import { useBackend } from "../../backend"; -import { Box, Button, LabeledList, Section } from "../../components"; +import { useBackend } from "../../../../backend"; +import { Box, Button, LabeledList, Section } from "../../../../components"; export const pda_security = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/pda/pda_signaller.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_signaller.js similarity index 61% rename from tgui/packages/tgui/interfaces/pda/pda_signaller.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_signaller.js index a7788084feed..cfa4bc679318 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_signaller.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_signaller.js @@ -1,4 +1,4 @@ -import { SignalerContent } from '../Signaler'; +import { SignalerContent } from '../../../Signaler'; export const pda_signaller = (props, context) => { return ; diff --git a/tgui/packages/tgui/interfaces/pda/pda_status_display.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_status_display.js similarity index 92% rename from tgui/packages/tgui/interfaces/pda/pda_status_display.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_status_display.js index 60bc56eabe28..fbd9fb8ccdd6 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_status_display.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_status_display.js @@ -1,5 +1,5 @@ -import { useBackend } from "../../backend"; -import { Box, Button, LabeledList } from "../../components"; +import { useBackend } from "../../../../backend"; +import { Box, Button, LabeledList } from "../../../../components"; export const pda_status_display = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/interfaces/pda/pda_supply.js b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_supply.js similarity index 91% rename from tgui/packages/tgui/interfaces/pda/pda_supply.js rename to tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_supply.js index 2a38446bce48..cdafdd2579bf 100644 --- a/tgui/packages/tgui/interfaces/pda/pda_supply.js +++ b/tgui/packages/tgui/interfaces/unused/pda/cartridges/pda_supply.js @@ -1,5 +1,5 @@ -import { useBackend } from "../../backend"; -import { Box, LabeledList, Section } from "../../components"; +import { useBackend } from "../../../../backend"; +import { Box, LabeledList, Section } from "../../../../components"; export const pda_supply = (props, context) => { const { act, data } = useBackend(context); diff --git a/tgui/packages/tgui/styles/base.scss b/tgui/packages/tgui/styles/base.scss index 6c4e85659e6d..d9b6cca6aa3e 100644 --- a/tgui/packages/tgui/styles/base.scss +++ b/tgui/packages/tgui/styles/base.scss @@ -19,6 +19,21 @@ $unit: 12px; $font-size: 1 * $unit !default; $border-radius: 0.16em !default; +// base css layer +$layer-base: 0; +// interface-in-interface +$layer-program: 1; +// popup for subwindows +$layer-program-popup: 2; +// modal for subwindows +$layer-program-modal: 3; +// popup for base window +$layer-base-popup: 4; +// modal for base window +$layer-base-modal: 5; +// urgent modal for base window +$layer-base-interrupt: 6; + @function em($px) { @return 1em * math.div($px, $unit); } diff --git a/tgui/packages/tgui/styles/base.ts b/tgui/packages/tgui/styles/base.ts new file mode 100644 index 000000000000..98ba9560b301 --- /dev/null +++ b/tgui/packages/tgui/styles/base.ts @@ -0,0 +1,9 @@ +enum TGUI_CSS_LAYERS { + Base = 0, + Subwindow = 1, + SubwindowPopup = 2, + SubwindowModal = 3, + BasePopup = 4, + BaseModal = 5, + AlwaysOnTop = 6, +} diff --git a/tgui/packages/tgui/styles/components/Dimmer.scss b/tgui/packages/tgui/styles/components/Dimmer.scss index 32a43ce509e2..f1db5d145277 100644 --- a/tgui/packages/tgui/styles/components/Dimmer.scss +++ b/tgui/packages/tgui/styles/components/Dimmer.scss @@ -4,6 +4,8 @@ */ $background-dimness: 0.75 !default; +@use '../base.scss' as base; + .Dimmer { // Align everything in the middle. // A fat middle finger for anything less than IE11. @@ -18,5 +20,5 @@ $background-dimness: 0.75 !default; right: 0; // Dim everything around it background-color: rgba(0, 0, 0, $background-dimness); - z-index: 1; + z-index: base.$layer-base-interrupt; } diff --git a/tgui/public/tgui-polyfill.min.js b/tgui/public/tgui-polyfill.min.js index 91be6dc87655..d3f71c209449 100644 --- a/tgui/public/tgui-polyfill.min.js +++ b/tgui/public/tgui-polyfill.min.js @@ -1 +1 @@ -(function(window,document){var version="3.7.3";var options=window.html5||{};var reSkip=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;var saveClones=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;var supportsHtml5Styles;var expando="_html5shiv";var expanID=0;var expandoData={};var supportsUnknownElements;(function(){try{var a=document.createElement("a");a.innerHTML="";supportsHtml5Styles="hidden"in a;supportsUnknownElements=a.childNodes.length==1||function(){document.createElement("a");var frag=document.createDocumentFragment();return typeof frag.cloneNode=="undefined"||typeof frag.createDocumentFragment=="undefined"||typeof frag.createElement=="undefined"}()}catch(e){supportsHtml5Styles=true;supportsUnknownElements=true}})();function addStyleSheet(ownerDocument,cssText){var p=ownerDocument.createElement("p"),parent=ownerDocument.getElementsByTagName("head")[0]||ownerDocument.documentElement;p.innerHTML="x";return parent.insertBefore(p.lastChild,parent.firstChild)}function getElements(){var elements=html5.elements;return typeof elements=="string"?elements.split(" "):elements}function addElements(newElements,ownerDocument){var elements=html5.elements;if(typeof elements!="string"){elements=elements.join(" ")}if(typeof newElements!="string"){newElements=newElements.join(" ")}html5.elements=elements+" "+newElements;shivDocument(ownerDocument)}function getExpandoData(ownerDocument){var data=expandoData[ownerDocument[expando]];if(!data){data={};expanID++;ownerDocument[expando]=expanID;expandoData[expanID]=data}return data}function createElement(nodeName,ownerDocument,data){if(!ownerDocument){ownerDocument=document}if(supportsUnknownElements){return ownerDocument.createElement(nodeName)}if(!data){data=getExpandoData(ownerDocument)}var node;if(data.cache[nodeName]){node=data.cache[nodeName].cloneNode()}else if(saveClones.test(nodeName)){node=(data.cache[nodeName]=data.createElem(nodeName)).cloneNode()}else{node=data.createElem(nodeName)}return node.canHaveChildren&&!reSkip.test(nodeName)&&!node.tagUrn?data.frag.appendChild(node):node}function createDocumentFragment(ownerDocument,data){if(!ownerDocument){ownerDocument=document}if(supportsUnknownElements){return ownerDocument.createDocumentFragment()}data=data||getExpandoData(ownerDocument);var clone=data.frag.cloneNode(),i=0,elems=getElements(),l=elems.length;for(;i3?getModifier(init):null,key=String(init.key),chr=String(init.char),location=init.location,keyCode=init.keyCode||(init.keyCode=key)&&key.charCodeAt(0)||0,charCode=init.charCode||(init.charCode=chr)&&chr.charCodeAt(0)||0,bubbles=init.bubbles,cancelable=init.cancelable,repeat=init.repeat,locale=init.locale,view=init.view||window,args;if(!init.which)init.which=init.keyCode;if("initKeyEvent"in out){out.initKeyEvent(type,bubbles,cancelable,view,ctrlKey,altKey,shiftKey,metaKey,keyCode,charCode)}else if(0>>0);var proto=Element.prototype;var querySelector=proto.querySelector;var querySelectorAll=proto.querySelectorAll;proto.querySelector=function qS(css){return find(this,querySelector,css)};proto.querySelectorAll=function qSA(css){return find(this,querySelectorAll,css)};function find(node,method,css){node.setAttribute(dataScope,null);var result=method.call(node,String(css).replace(/(^|,\s*)(:scope([ >]|$))/g,(function($0,$1,$2,$3){return $1+"["+dataScope+"]"+($3||" ")})));node.removeAttribute(dataScope);return result}})()}})(window);(function(global){"use strict";var DOMMap=global.WeakMap||function(){var counter=0,dispatched=false,drop=false,value;function dispatch(key,ce,shouldDrop){drop=shouldDrop;dispatched=false;value=undefined;key.dispatchEvent(ce)}function Handler(value){this.value=value}Handler.prototype.handleEvent=function handleEvent(e){dispatched=true;if(drop){e.currentTarget.removeEventListener(e.type,this,false)}else{value=this.value}};function DOMMap(){counter++;this.__ce__=new Event("@DOMMap:"+counter+Math.random())}DOMMap.prototype={constructor:DOMMap,"delete":function del(key){return dispatch(key,this.__ce__,true),dispatched},get:function get(key){dispatch(key,this.__ce__,false);var v=value;value=undefined;return v},has:function has(key){return dispatch(key,this.__ce__,false),dispatched},set:function set(key,value){dispatch(key,this.__ce__,true);key.addEventListener(this.__ce__.type,new Handler(value),false);return this}};return DOMMap}();function Dict(){}Dict.prototype=(Object.create||Object)(null);function createEventListener(type,callback,options){function eventListener(e){if(eventListener.once){e.currentTarget.removeEventListener(e.type,callback,eventListener);eventListener.removed=true}if(eventListener.passive){e.preventDefault=createEventListener.preventDefault}if(typeof eventListener.callback==="function"){eventListener.callback.call(this,e)}else if(eventListener.callback){eventListener.callback.handleEvent(e)}if(eventListener.passive){delete e.preventDefault}}eventListener.type=type;eventListener.callback=callback;eventListener.capture=!!options.capture;eventListener.passive=!!options.passive;eventListener.once=!!options.once;eventListener.removed=false;return eventListener}createEventListener.preventDefault=function preventDefault(){};var Event=global.CustomEvent,dE=global.dispatchEvent,aEL=global.addEventListener,rEL=global.removeEventListener,counter=0,increment=function(){counter++},indexOf=[].indexOf||function indexOf(value){var length=this.length;while(length--){if(this[length]===value){break}}return length},getListenerKey=function(options){return"".concat(options.capture?"1":"0",options.passive?"1":"0",options.once?"1":"0")},augment;try{aEL("_",increment,{once:true});dE(new Event("_"));dE(new Event("_"));rEL("_",increment,{once:true})}catch(o_O){}if(counter!==1){(function(){var dm=new DOMMap;function createAEL(aEL){return function addEventListener(type,handler,options){if(options&&typeof options!=="boolean"){var info=dm.get(this),key=getListenerKey(options),i,tmp,wrap;if(!info)dm.set(this,info=new Dict);if(!(type in info))info[type]={handler:[],wrap:[]};tmp=info[type];i=indexOf.call(tmp.handler,handler);if(i<0){i=tmp.handler.push(handler)-1;tmp.wrap[i]=wrap=new Dict}else{wrap=tmp.wrap[i]}if(!(key in wrap)){wrap[key]=createEventListener(type,handler,options);aEL.call(this,type,wrap[key],wrap[key].capture)}}else{aEL.call(this,type,handler,options)}}}function createREL(rEL){return function removeEventListener(type,handler,options){if(options&&typeof options!=="boolean"){var info=dm.get(this),key,i,tmp,wrap;if(info&&type in info){tmp=info[type];i=indexOf.call(tmp.handler,handler);if(-1>>0;if(typeof callback!=="function"){throw new TypeError(callback+" is not a function")}if(arguments.length>1){T=thisArg}k=0;while(k";supportsHtml5Styles="hidden"in a;supportsUnknownElements=a.childNodes.length==1||function(){document.createElement("a");var frag=document.createDocumentFragment();return typeof frag.cloneNode=="undefined"||typeof frag.createDocumentFragment=="undefined"||typeof frag.createElement=="undefined"}()}catch(e){supportsHtml5Styles=true;supportsUnknownElements=true}})();function addStyleSheet(ownerDocument,cssText){var p=ownerDocument.createElement("p"),parent=ownerDocument.getElementsByTagName("head")[0]||ownerDocument.documentElement;p.innerHTML="x";return parent.insertBefore(p.lastChild,parent.firstChild)}function getElements(){var elements=html5.elements;return typeof elements=="string"?elements.split(" "):elements}function addElements(newElements,ownerDocument){var elements=html5.elements;if(typeof elements!="string"){elements=elements.join(" ")}if(typeof newElements!="string"){newElements=newElements.join(" ")}html5.elements=elements+" "+newElements;shivDocument(ownerDocument)}function getExpandoData(ownerDocument){var data=expandoData[ownerDocument[expando]];if(!data){data={};expanID++;ownerDocument[expando]=expanID;expandoData[expanID]=data}return data}function createElement(nodeName,ownerDocument,data){if(!ownerDocument){ownerDocument=document}if(supportsUnknownElements){return ownerDocument.createElement(nodeName)}if(!data){data=getExpandoData(ownerDocument)}var node;if(data.cache[nodeName]){node=data.cache[nodeName].cloneNode()}else if(saveClones.test(nodeName)){node=(data.cache[nodeName]=data.createElem(nodeName)).cloneNode()}else{node=data.createElem(nodeName)}return node.canHaveChildren&&!reSkip.test(nodeName)&&!node.tagUrn?data.frag.appendChild(node):node}function createDocumentFragment(ownerDocument,data){if(!ownerDocument){ownerDocument=document}if(supportsUnknownElements){return ownerDocument.createDocumentFragment()}data=data||getExpandoData(ownerDocument);var clone=data.frag.cloneNode(),i=0,elems=getElements(),l=elems.length;for(;i3?getModifier(init):null,key=String(init.key),chr=String(init.char),location=init.location,keyCode=init.keyCode||(init.keyCode=key)&&key.charCodeAt(0)||0,charCode=init.charCode||(init.charCode=chr)&&chr.charCodeAt(0)||0,bubbles=init.bubbles,cancelable=init.cancelable,repeat=init.repeat,locale=init.locale,view=init.view||window,args;if(!init.which)init.which=init.keyCode;if("initKeyEvent"in out){out.initKeyEvent(type,bubbles,cancelable,view,ctrlKey,altKey,shiftKey,metaKey,keyCode,charCode)}else if(0>>0);var proto=Element.prototype;var querySelector=proto.querySelector;var querySelectorAll=proto.querySelectorAll;proto.querySelector=function qS(css){return find(this,querySelector,css)};proto.querySelectorAll=function qSA(css){return find(this,querySelectorAll,css)};function find(node,method,css){node.setAttribute(dataScope,null);var result=method.call(node,String(css).replace(/(^|,\s*)(:scope([ >]|$))/g,(function($0,$1,$2,$3){return $1+"["+dataScope+"]"+($3||" ")})));node.removeAttribute(dataScope);return result}})()}})(window);(function(global){"use strict";var DOMMap=global.WeakMap||function(){var counter=0,dispatched=false,drop=false,value;function dispatch(key,ce,shouldDrop){drop=shouldDrop;dispatched=false;value=undefined;key.dispatchEvent(ce)}function Handler(value){this.value=value}Handler.prototype.handleEvent=function handleEvent(e){dispatched=true;if(drop){e.currentTarget.removeEventListener(e.type,this,false)}else{value=this.value}};function DOMMap(){counter++;this.__ce__=new Event("@DOMMap:"+counter+Math.random())}DOMMap.prototype={constructor:DOMMap,"delete":function del(key){return dispatch(key,this.__ce__,true),dispatched},get:function get(key){dispatch(key,this.__ce__,false);var v=value;value=undefined;return v},has:function has(key){return dispatch(key,this.__ce__,false),dispatched},set:function set(key,value){dispatch(key,this.__ce__,true);key.addEventListener(this.__ce__.type,new Handler(value),false);return this}};return DOMMap}();function Dict(){}Dict.prototype=(Object.create||Object)(null);function createEventListener(type,callback,options){function eventListener(e){if(eventListener.once){e.currentTarget.removeEventListener(e.type,callback,eventListener);eventListener.removed=true}if(eventListener.passive){e.preventDefault=createEventListener.preventDefault}if(typeof eventListener.callback==="function"){eventListener.callback.call(this,e)}else if(eventListener.callback){eventListener.callback.handleEvent(e)}if(eventListener.passive){delete e.preventDefault}}eventListener.type=type;eventListener.callback=callback;eventListener.capture=!!options.capture;eventListener.passive=!!options.passive;eventListener.once=!!options.once;eventListener.removed=false;return eventListener}createEventListener.preventDefault=function preventDefault(){};var Event=global.CustomEvent,dE=global.dispatchEvent,aEL=global.addEventListener,rEL=global.removeEventListener,counter=0,increment=function(){counter++},indexOf=[].indexOf||function indexOf(value){var length=this.length;while(length--){if(this[length]===value){break}}return length},getListenerKey=function(options){return"".concat(options.capture?"1":"0",options.passive?"1":"0",options.once?"1":"0")},augment;try{aEL("_",increment,{once:true});dE(new Event("_"));dE(new Event("_"));rEL("_",increment,{once:true})}catch(o_O){}if(counter!==1){(function(){var dm=new DOMMap;function createAEL(aEL){return function addEventListener(type,handler,options){if(options&&typeof options!=="boolean"){var info=dm.get(this),key=getListenerKey(options),i,tmp,wrap;if(!info)dm.set(this,info=new Dict);if(!(type in info))info[type]={handler:[],wrap:[]};tmp=info[type];i=indexOf.call(tmp.handler,handler);if(i<0){i=tmp.handler.push(handler)-1;tmp.wrap[i]=wrap=new Dict}else{wrap=tmp.wrap[i]}if(!(key in wrap)){wrap[key]=createEventListener(type,handler,options);aEL.call(this,type,wrap[key],wrap[key].capture)}}else{aEL.call(this,type,handler,options)}}}function createREL(rEL){return function removeEventListener(type,handler,options){if(options&&typeof options!=="boolean"){var info=dm.get(this),key,i,tmp,wrap;if(info&&type in info){tmp=info[type];i=indexOf.call(tmp.handler,handler);if(-1>>0;if(typeof callback!=="function"){throw new TypeError(callback+" is not a function")}if(arguments.length>1){T=thisArg}k=0;while(k=this.length||index<-this.length){return undefined}if(index>=0){return this[index]}else{return this[this.length+index]}}}if(!window.Int32Array){window.Int32Array=Array}})(); \ No newline at end of file