Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autohiss preference #1105

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Autohiss preference #1105

wants to merge 25 commits into from

Conversation

larentoun
Copy link
Collaborator

@larentoun larentoun commented Jan 31, 2025

Что этот PR делает

Добавлена возможность отключения автошипения в настройках персонажа и в игре через панель IC.

Почему это хорошо для игры

Я хочу шипеть по-своему, да и ТТСу бывает плохо, когда стакается шипение друг на друга (шанс автошипения 100%)

Changelog

🆑
add: Добавлена возможность отключения автошипения в настройках персонажа и в игре через панель IC ("Переключить модификатор речи"). Автошипение привязывается к разуму персонажа. Рекомендуется оставлять включенным. На текущий момент автошипение можно выключить у языка ящера и у мухи. Вульпы и таяры следующие.
/:cl:

@github-actions github-actions bot added the TGUI Добавление или изменение существующего интерфейса на базе фреймворка TGUI label Jan 31, 2025
@ss220app ss220app bot added the 📜 CL валиден Этот чейнджлог будет успешно опубликован label Jan 31, 2025
@ss220club ss220club deleted a comment from sourcery-ai bot Jan 31, 2025
@Gaxeer
Copy link
Collaborator

Gaxeer commented Jan 31, 2025

Перенеси в модуль autohiss и разбей по разным файлам. Префы к префам, компоненты к компонентам

@Gaxeer Gaxeer added the 🛑 Do Not Merge Почему это висит лучше уточнить в дискорде. 220 проклятий тому кто зальёт это! label Jan 31, 2025
@Gaxeer
Copy link
Collaborator

Gaxeer commented Jan 31, 2025

не мержить до тех пор, пока @Dekupich не сможет пофиксить в таярах конфликт. Он будет свободен вечером

code/modules/surgery/organs/internal/tongue/_tongue.dm Outdated Show resolved Hide resolved
code/game/machinery/dna_infuser/organ_sets/fly_organs.dm Outdated Show resolved Hide resolved
modular_bandastation/autohiss/code/autohiss_mind.dm Outdated Show resolved Hide resolved
modular_bandastation/autohiss/code/autohiss_mind.dm Outdated Show resolved Hide resolved
modular_bandastation/autohiss/code/autohiss_carbon.dm Outdated Show resolved Hide resolved
@larentoun larentoun marked this pull request as draft February 1, 2025 16:12
@larentoun larentoun marked this pull request as ready for review February 2, 2025 07:01
@larentoun larentoun requested a review from Gaxeer February 2, 2025 07:01
Copy link

sourcery-ai bot commented Feb 2, 2025

Reviewer's Guide by Sourcery

This pull request introduces a toggleable autohiss feature, which allows players to disable automatic hissing sounds. The feature is implemented by adding a toggle to the speechmod component and a preference to control it.

Sequence diagram for toggling autohiss

sequenceDiagram
    actor User
    participant M as Mob
    participant SM as SpeechMod
    participant Mind as Mind

    User->>M: Toggle speechmods
    M->>M: get_effecting_speechmods()
    M->>SM: get_parent_name()
    M->>Mind: toggle_speechmode(speechmod)
    Mind-->>User: Display toggle status message
Loading

Class diagram for speechmod component changes

classDiagram
    class SpeechMod {
        +toggleable: bool
        +targeted: mob
        +set_target_mob(mob)
        +add_to_speechmods_list(mob, list)
        +get_parent_name()
        +handle_speech(source, args)
        +update_mob_verb(status)
    }

    class Mind {
        +disabled_speechmode_parent_types: list
        +toggle_speechmode(speechmod)
    }

    class Mob {
        +get_effecting_speechmods()
        +toggle_speechmods()
    }

    SpeechMod --> Mind: uses
    Mob --> SpeechMod: has

    note for SpeechMod "New toggleable property
and related methods"
    note for Mind "Stores disabled
speechmod types"
Loading

File-Level Changes

Change Details Files
Added a toggleable option to the speechmod component.
  • Added a toggleable variable to the speechmod component.
  • Modified the Initialize proc to accept the toggleable parameter.
  • Added a set_target_mob proc to handle signal registration and unregistration.
  • Modified the handle_speech proc to check if the speechmod is disabled.
  • Added a update_mob_verb proc to add or remove the toggle verb.
  • Modified the Destroy proc to remove the toggle verb.
  • Added toggleable = TRUE to the speechmod component initialization for fly and lizard tongues.
code/datums/components/speechmod.dm
code/game/machinery/dna_infuser/organ_sets/fly_organs.dm
code/modules/surgery/organs/internal/tongue/_tongue.dm
modular_bandastation/autohiss/code/autohiss_speechmod_component.dm
Added a preference to control the autohiss feature.
  • Added a new autohiss_enabled preference toggle.
  • Added a check to ensure the preference is only accessible for species with mutant tongues.
  • Added a signal handler to disable the speechmod on mind transfer if the preference is disabled.
tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/species_features.tsx
modular_bandastation/autohiss/code/autohiss_prefs.dm
Added a verb to toggle speech modifiers.
  • Added a get_effecting_speechmods proc to get all speechmod components.
  • Added a toggle_speechmods verb to toggle speech modifiers.
modular_bandastation/autohiss/code/autohiss_carbon.dm
Added a mind variable to store disabled speech modifiers.
  • Added a disabled_speechmode_parent_types variable to the mind datum.
  • Added a toggle_speechmode proc to toggle speech modifiers.
modular_bandastation/autohiss/code/autohiss_mind.dm
Added a signal for getting speech modifiers.
  • Added a COMSIG_MOB_GET_AFFECTING_SPEECHMODS define.
  • Added a COMSIG_MOB_GET_AFFECTING_SPEECHMODS undef.
modular_bandastation/autohiss/code/~define.dm
modular_bandastation/autohiss/code/~undefs.dm

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

This PR has been inactive for long enough to be automatically marked as stale. This means it is at risk of being auto closed in ~ 7 days, please address any outstanding review items and ensure your PR is finished, if these are all true and you are auto-staled anyway, you need to actively ask maintainers if your PR will be merged. Once you have done any of the previous actions then you should request a maintainer remove the stale label on your PR, to reset the stale timer. If you feel no maintainer will respond in that time, you may wish to close this PR youself, while you seek maintainer comment, as you will then be able to reopen the PR yourself

@github-actions github-actions bot added the 💩 Stale Кажется всем похуй на этот ПР. Жизнь сурова... label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💩 Stale Кажется всем похуй на этот ПР. Жизнь сурова... 📜 CL валиден Этот чейнджлог будет успешно опубликован 🛑 Do Not Merge Почему это висит лучше уточнить в дискорде. 220 проклятий тому кто зальёт это! TGUI Добавление или изменение существующего интерфейса на базе фреймворка TGUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants