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

Title Screen polish #919

Merged
merged 19 commits into from
Jan 5, 2025
Merged

Conversation

AyIong
Copy link
Collaborator

@AyIong AyIong commented Dec 26, 2024

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

Полировка и фикс багов.
Пока план такой:

  • Пофиксить рандомно отсутствующее у рандомных игроков изображение в лобби
  • Попробовать показывать админские кнопки раньше (Может использовать сигналы?)
  • Впиндюрить куда-то логотип
  • Добавить преф, который позволит вернуть внешку как на паре
  • ???

Summary by Sourcery

Add a preference for selecting lobby style.

New Features:

  • Allow users to select a lobby style from their preferences.

Tests:

  • Fix randomly missing images in the lobby.

@github-actions github-actions bot added the 🔧 Фикс Перенос бага в другое место. label Dec 26, 2024
@github-actions github-actions bot added the TGUI Добавление или изменение существующего интерфейса на базе фреймворка TGUI label Dec 26, 2024
@AyIong AyIong marked this pull request as ready for review December 29, 2024 12:39
@Furrior
Copy link
Collaborator

Furrior commented Dec 29, 2024

@sourcery-ai review

Copy link

sourcery-ai bot commented Dec 29, 2024

Reviewer's Guide by Sourcery

This PR polishes the title screen and fixes some bugs. It introduces a new preference for lobby style, allowing players to choose between "default" and "minimalistic" styles. The PR also adds the SS220 logo to the title screen and fixes a bug where images were randomly missing for some players in the lobby. Admin buttons are now displayed earlier, improving the admin experience.

Sequence diagram for title screen loading

sequenceDiagram
    participant C as Client
    participant TS as TitleScreen
    participant P as Preferences
    participant A as Assets

    C->>TS: Request title screen
    TS->>P: Get lobby style preference
    P-->>TS: Return selected style
    TS->>A: Load style assets
    A-->>TS: Return assets
    TS->>C: Show styled title screen
    Note over C,TS: Admin buttons shown earlier
    C->>TS: Admin interaction
    TS-->>C: Update admin UI
Loading

Class diagram for title screen changes

classDiagram
    class TitleScreen {
        -title_css
        -screen_image
        +show_to(viewer)
        +hide_from(viewer)
        +get_title_html(viewer, user, styles)
    }

    class PreferenceSystem {
        +lobby_style: ChoicedPreference
    }

    class AvailableStyles {
        +default: string
        +minimalistic: string
    }

    TitleScreen --> PreferenceSystem: uses
    TitleScreen --> AvailableStyles: references
Loading

File-Level Changes

Change Details Files
Added a new preference for lobby style.
  • Created a new preference option that allows users to select their preferred lobby style.
  • Added a new minimalistic lobby style.
  • Added the preference to the in-game preferences menu.
  • Updated the title screen code to use the selected lobby style.
modular_bandastation/title_screen/code/title_screen_datum.dm
modular_bandastation/title_screen/code/title_screen_pref_middleware.dm
tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/bandastation/lobby_style.tsx
modular_bandastation/title_screen/html/title_screen_minimalistic.css
modular_bandastation/title_screen/code/title_screen_html.dm
Added the SS220 logo to the title screen.
  • Included the SS220 logo image in the assets.
  • Added the logo to the title screen HTML.
modular_bandastation/title_screen/code/asset_lobby.dm
modular_bandastation/title_screen/code/title_screen_html.dm
Fixed a bug where images were randomly missing for some players in the lobby.
  • Added error handling for images to prevent them from disappearing.
  • Implemented a retry mechanism to reload missing images.
modular_bandastation/title_screen/code/title_screen_html.dm
Improved admin experience by displaying admin buttons earlier.
  • Admin buttons are now displayed as soon as the title screen is ready.
  • Removed the delay in displaying admin buttons.
modular_bandastation/title_screen/code/new_player.dm
modular_bandastation/title_screen/code/title_screen_subsystem.dm
Removed unnecessary defines and updated default CSS.
  • Removed MAX_STATION_TRAIT_BUTTONS_VERTICAL define as it is no longer used.
  • Updated default CSS to improve visuals and fix some minor issues.
modular_bandastation/title_screen/code/_title_screen_defines.dm
modular_bandastation/title_screen/html/title_screen_default.css
Updated title screen controls and added emoji parsing to notice.
  • Added user as parameter to set_title_image proc for logging purposes.
  • Added emoji parsing to title screen notice.
modular_bandastation/title_screen/code/title_screen_controls.dm
modular_bandastation/title_screen/code/title_screen_subsystem.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.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a 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. You can also use
    this command to specify where the summary should be inserted.

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

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @AyIong - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider standardizing on either English or Russian for comments and variable names to improve code readability and maintainability
  • The two CSS files share a lot of common styles - consider extracting these into a shared base stylesheet to reduce duplication
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Gaxeer Gaxeer merged commit 867aa2a into ss220club:master Jan 5, 2025
25 checks passed
@AyIong AyIong deleted the title-screen-fixes-and-changes branch January 5, 2025 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TGUI Добавление или изменение существующего интерфейса на базе фреймворка TGUI 🔧 Фикс Перенос бага в другое место.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants