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

[TM] Update Intercom #1767

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

Conversation

m-dzianishchyts
Copy link
Collaborator

@m-dzianishchyts m-dzianishchyts commented Jan 25, 2025

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

Портирует с ТГ спрайт интеркома.
Добавляет таймер, по которому микрофон интеркома отключается, если не используется (не применимо при использовании боргом или ИИ).
Позволяет настроить радиус работы интеркома в его интерфейсе.

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

Красивый спрайт с оверлеями, сокращение случайного спама в каналах.

Изображения изменений

Spoiler

image
image

Тестирование

Разобрал и собрал интерком - во всех состояниях норм спрайт.
Подергал микрофон, поговорил - отключился в нужное время.
Дальше ТМ.

Changelog

🆑 Maxiemar
add: Микрофон интеркома теперь автоматически отключается через скорое время, если в него не говорить.
tweak: Включение микрофона интеркома действиями робота или ИИ не приводят к его последующему отключению.
imageadd: Портирован спрайт интеркома с ТГ.
add: Радиус действия интеркома теперь может быть настроен в его интерфейсе.
/:cl:

Summary by Sourcery

Update the intercom sprite and add a microphone auto-off timer.

New Features:

  • Implement a timer that automatically disables the intercom microphone when not in use.

Tests:

  • Test the intercom functionality and the new microphone timer.

Summary by Sourcery

Update the intercom to use the new radio API, add a microphone auto-off timer, and allow range configuration.

New Features:

  • Added a timer that automatically disables the intercom microphone when not in use by a human.

Tests:

  • Tested the intercom functionality and the new microphone timer.

Copy link

sourcery-ai bot commented Jan 25, 2025

Reviewer's Guide by Sourcery

This pull request updates the intercom sprite, adds a microphone auto-off timer, and allows the intercom's range to be configured in its UI.

Sequence diagram for intercom microphone auto-off behavior

sequenceDiagram
    actor User
    participant I as Intercom
    participant T as Timer

    User->>I: Toggle broadcast on
    I->>T: Start mic timer
    Note over I,T: Timer set for 20 seconds

    alt User speaks
        User->>I: Talk into intercom
        I->>T: Reset timer
    else Timer expires
        T->>I: Disable mic
        I->>I: Set broadcasting = false
        I->>I: Update icon
    end
Loading

Class diagram for updated Radio and Intercom classes

classDiagram
    class Radio {
      +max_hear_range: number
      +has_fixed_hear_range: bool
      +overlay_speaker_idle: string
      +overlay_speaker_active: string
      +overlay_mic_idle: string
      +overlay_mic_active: string
      +Initialize()
      +ToggleReception(user)
      +ToggleBroadcast(user)
      +update_overlays()
    }

    class Intercom {
      +icon_frame: string
      +icon_postfix_open: string
      +icon_postfix_off: string
      +mic_timeout: number
      +start_mic_timer()
      +disable_mic()
      +update_icon_state()
    }

    Radio <|-- Intercom
    note for Radio "Added new overlay and range controls"
    note for Intercom "Added auto-off timer for microphone"
Loading

File-Level Changes

Change Details Files
Updated the intercom sprite and its overlays.
  • Added new icons for the intercom.
  • Added overlays for speaker and microphone states.
  • Adjusted the pixel offsets for directional intercoms.
modular_ss220/aesthetics/_aesthetics.dme
modular_ss220/objects/_objects.dme
modular_ss220/objects/code/intercom.dm
modular_ss220/aesthetics/intercom/code/intercom.dm
Implemented a timer to automatically disable the intercom microphone when not in use.
  • Added a timer that disables the microphone after a period of inactivity.
  • The timer is reset when the user speaks into the microphone.
  • The timer is not used when the intercom is used by a borg or AI.
modular_ss220/objects/code/intercom.dm
Added the ability to configure the intercom's range in its UI.
  • Added a range slider to the intercom UI.
  • The range can be adjusted up to a maximum value.
  • The range is saved and restored when the intercom is reassembled.
  • Added a new UI for the radio devices.
  • Added a new 'range' action to the radio UI.
code/game/objects/items/devices/radio/radio_objects.dm
tgui/packages/tgui/interfaces/Radio220.tsx
modular_ss220/objects/code/radio.dm
Refactored radio UI and logic.
  • Added user argument to ToggleBroadcast and ToggleReception procs.
  • Use initial value for toggling speaker.
  • Return TRUE if the action was handled in ui_act.
code/game/objects/items/devices/radio/radio_objects.dm
modular_ss220/objects/code/radio.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

@m-dzianishchyts m-dzianishchyts changed the title Update Intercom [TM] Update Intercom Jan 25, 2025
@github-actions github-actions bot added :trollface: Фича Новая функция, фишка или механика. Абсолютно точно новые баги. :feelsgood: Частичная модульность Не всегда получается всё впихнуть в модуль, увы. 🖌️ Спрайты Вы заработали свою миска-рис и кошко-жена. Партия гордится вами! labels Jan 25, 2025
@ss220app ss220app bot added the 📜 CL валиден Этот чейнджлог будет успешно опубликован label Jan 25, 2025
@m-dzianishchyts m-dzianishchyts added the 📃 Требуется изменение WIKI Эти изменения необходимо внести на нашу WIKI. label Jan 25, 2025
@Legendaxe
Copy link

Тестовы коммент

@Drsmail
Copy link

Drsmail commented Jan 26, 2025

Мне как игроку на ИИ не очень нравится, что микрофон будет выключатся сам. Иногда оставляю его в нужном мне режиме в интересных местах. И ты вроде что-то ещё говорил про уменьшение радиуса, хотя там и так не всегда было слышно.

@m-dzianishchyts
Copy link
Collaborator Author

Мне как игроку на ИИ не очень нравится, что микрофон будет выключатся сам. Иногда оставляю его в нужном мне режиме в интересных местах. И ты вроде что-то ещё говорил про уменьшение радиуса, хотя там и так не всегда было слышно.

Это сделано, чтобы сократить количество случайного шума в канале. Когда интерком с большим радиусом всегда включен, он захватывает много ненужных разговоров. В целом силиконам могу сделать включение без таймаута, а в интерфейс интеркома добавить слайдер для выбора радиуса

@Drsmail
Copy link

Drsmail commented Jan 26, 2025

Мне как игроку на ИИ не очень нравится, что микрофон будет выключатся сам. Иногда оставляю его в нужном мне режиме в интересных местах. И ты вроде что-то ещё говорил про уменьшение радиуса, хотя там и так не всегда было слышно.

Это сделано, чтобы сократить количество случайного шума в канале. Когда интерком с большим радиусом всегда включен, он захватывает много ненужных разговоров. В целом силиконам могу сделать включение без таймаута, а в интерфейс интеркома добавить слайдер для выбора радиуса

Меня бы это решение полностью устроило бы. Главное, чтобы можно было слушать разговоры людей в комнате нормально.

@github-actions github-actions bot added Merge Conflict Ну блять... TGUI Кто-то решил потрогать интерфейсы. labels Jan 27, 2025
@m-dzianishchyts
Copy link
Collaborator Author

Для ревью интерфейса приглашается депутат партии ТГУИ

@github-actions github-actions bot removed the Merge Conflict Ну блять... label Jan 27, 2025
@AyIong
Copy link
Collaborator

AyIong commented Jan 27, 2025

Для ревью интерфейса приглашается депутат партии ТГУИ

💀

@m-dzianishchyts m-dzianishchyts marked this pull request as draft January 28, 2025 09:46
@github-actions github-actions bot added the Merge Conflict Ну блять... label Jan 30, 2025
@github-actions github-actions bot removed the Merge Conflict Ну блять... label Feb 1, 2025
@m-dzianishchyts m-dzianishchyts marked this pull request as ready for review February 1, 2025 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:feelsgood: Частичная модульность Не всегда получается всё впихнуть в модуль, увы. 📃 Требуется изменение WIKI Эти изменения необходимо внести на нашу WIKI. 🖌️ Спрайты Вы заработали свою миска-рис и кошко-жена. Партия гордится вами! 📜 CL валиден Этот чейнджлог будет успешно опубликован Testmerge Required TGUI Кто-то решил потрогать интерфейсы. :trollface: Фича Новая функция, фишка или механика. Абсолютно точно новые баги.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants