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

Merge Upstream 20.01.2025 (2) #1030

Merged
merged 4 commits into from
Jan 20, 2025
Merged

Merge Upstream 20.01.2025 (2) #1030

merged 4 commits into from
Jan 20, 2025

Conversation

ss220app[bot]
Copy link

@ss220app ss220app bot commented Jan 20, 2025

This pull request merges upstream/master. Resolve possible conflicts manually and make sure all the changes are applied correctly.

Changelog

🆑 tgstation
qol: Торговым автоматам добавлен новый дизайн с двумя вариантами расположения: Список и Сетка (по умолчанию используется Список).
/:cl:

Summary by Sourcery

New Features:

  • Introduce a new design for vending machines with two layout options: list and grid.

AyIong and others added 3 commits January 20, 2025 08:25
## About The Pull Request
Vending UI redesign, using ImageButton component.
By default list layout is used, you can switch to grid if you want,
unfortunately there is no setting yet

## Why It's Good For The Game
You don't have to aim for the blue price button to buy/vend anything
Plus, looks better and more cohesive, imho

<details><summary> Comparison, everyone loves them though, right?
</summary>

| Before | After | Grid |
| - | - | - |
|
![image](https://github.com/user-attachments/assets/76742fe6-0500-453e-9c95-6766606c3f64)
|
![image](https://github.com/user-attachments/assets/afe5d623-0953-4d94-a4aa-67bf82a0f9fb)
|
![image](https://github.com/user-attachments/assets/8f2b7701-bda0-431a-9311-96c5221f8ebf)
|

</details>

## Changelog

:cl:
qol: Vending machines got new design with 2 layouts: List and Grid (List
by default)
/:cl:
## About The Pull Request
On the 516, when hovering over the cropped text, the transposed text
does not expand the background
It's a small fix for that.

| Before | After |
| - | - |
|
![image](https://github.com/user-attachments/assets/7fb94a56-5796-4652-92ba-a8ba6a0f9824)
|
![image](https://github.com/user-attachments/assets/f7f17185-7d1d-4db7-8602-65c639faebb5)
|
Copy link

sourcery-ai bot commented Jan 20, 2025

Reviewer's Guide by Sourcery

This pull request merges the upstream master branch into the current branch. It includes a new vending machine layout with list and grid options.

Class diagram for updated vending machine components

classDiagram
  class Vending {
    -width: number
    -height: number
    +render()
  }

  class UserDetails {
    +render()
  }

  class ProductDisplay {
    -stockSearch: string
    -toggleLayout: boolean
    +setToggleLayout()
    +render()
  }

  class Product {
    -colorable: boolean
    -free: boolean
    -discount: boolean
    -remaining: number
    +render()
  }

  class ProductGrid {
    +render()
  }

  class ProductList {
    +render()
  }

  Vending --> UserDetails
  Vending --> ProductDisplay
  ProductDisplay --> Product
  Product --> ProductGrid
  Product --> ProductList

  note for Product "New component that handles both grid and list layouts"
  note for ProductDisplay "Added layout toggle functionality"
Loading

File-Level Changes

Change Details Files
Updated vending machine window layout and styles.
  • Adjusted the window width and height.
  • Modified the user details section to display user information in a NoticeBox.
  • Added a toggle button to switch between list and grid layouts.
  • Refactored the product display to use a Product component instead of a table.
  • Implemented ProductGrid and ProductList components for different layouts.
  • Modified the ProductColorSelect component to use a transparent background.
  • Added a ProductPrice component to display the price of a product.
  • Removed the ProductStock component.
  • Added a new ImageButton component to display the product image.
tgui/packages/tgui/interfaces/Vending.tsx
Added a new changelog file.
  • Added a new changelog file for the vending machine changes.
html/changelogs/AutoChangeLog-pr-89137.yml
Modified the statbrowser css file.
  • Modified the grid-item:hover .grid-item-text to have a height of 100%.
html/statbrowser.css

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

@github-actions github-actions bot added TGUI Добавление или изменение существующего интерфейса на базе фреймворка TGUI 🙏 Слияние с восходящим потоком О великий восходящий поток, спасибо что приносишь нам свои дары контента и багфиксов labels Jan 20, 2025
@ss220app ss220app bot added the 📜 CL валиден Этот чейнджлог будет успешно опубликован label Jan 20, 2025
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.

We have skipped reviewing this pull request. It seems to have been created by a bot (hey, ss220app[bot]!). We assume it knows what it's doing!

@AyIong AyIong changed the title Merge Upstream 20.01.2025 Merge Upstream 20.01.2025 (2) Jan 20, 2025
Copy link

This PR causes following conflicts on translate branch:

tgui/packages/tgui/interfaces/Vending.tsx
++<<<<<<< HEAD
 +  return (
 +    <NoticeBox m={0} color={user && 'blue'}>
 +      <Stack align="center">
 +        <Stack.Item>
 +          <Icon name="id-card" size={1.5} />
 +        </Stack.Item>
 +        <Stack.Item>
 +          {user
 +            ? `${user.name || 'Unknown'} | ${user.job}`
 +            : 'No ID detected! Contact the Head of Personnel.'}
 +        </Stack.Item>
 +      </Stack>
 +    </NoticeBox>
 +  );
++||||||| aa82cd08971
++  if (!user) {
++    return (
++      <Section>
++        <NoticeBox>No ID detected! Contact the Head of Personnel.</NoticeBox>
++      </Section>
++    );
++  } else {
++    return (
++      <Section>
++        <Stack>
++          <Stack.Item>
++            <Icon name="id-card" size={3} mr={1} />
++          </Stack.Item>
++          <Stack.Item>
++            <LabeledList>
++              <LabeledList.Item label="User">{user.name}</LabeledList.Item>
++              <LabeledList.Item label="Occupation">
++                {user.job || 'Unemployed'}
++              </LabeledList.Item>
++            </LabeledList>
++          </Stack.Item>
++        </Stack>
++      </Section>
++    );
++  }
++=======
+   if (!user) {
+     return (
+       <Section>
+         <NoticeBox>
+           ID-карта не обнаружена! Обратитесь к главе персонала.
+         </NoticeBox>
+       </Section>
+     );
+   } else {
+     return (
+       <Section>
+         <Stack>
+           <Stack.Item>
+             <Icon name="id-card" size={3} mr={1} />
+           </Stack.Item>
+           <Stack.Item>
+             <LabeledList>
+               <LabeledList.Item label="Пользователь">
+                 {user.name}
+               </LabeledList.Item>
+               <LabeledList.Item label="Должность">
+                 {JOBS_RU[user.job] || user.job || 'Без работы'}
+               </LabeledList.Item>
+             </LabeledList>
+           </Stack.Item>
+         </Stack>
+       </Section>
+     );
+   }
++>>>>>>> origin/translate
++<<<<<<< HEAD
++||||||| aa82cd08971
++/** Displays a colored indicator for remaining stock */
++const ProductStock = (props) => {
++  const { custom, product, remaining } = props;
++
++  return (
++    <Box
++      color={
++        (remaining <= 0 && 'bad') ||
++        (!custom && remaining <= product.max_amount / 2 && 'average') ||
++        'good'
++      }
++    >
++      {remaining} left
++    </Box>
++  );
++};
++
++=======
+ /** Displays a colored indicator for remaining stock */
+ const ProductStock = (props) => {
+   const { custom, product, remaining } = props;
+ 
+   return (
+     <Box
+       color={
+         (remaining <= 0 && 'bad') ||
+         (!custom && remaining <= product.max_amount / 2 && 'average') ||
+         'good'
+       }
+     >
+       {remaining} ост.
+     </Box>
+   );
+ };
+ 
++>>>>>>> origin/translate
++<<<<<<< HEAD
 +    standardPrice = 'Free';
++||||||| aa82cd08971
++    standardPrice = 'FREE';
++=======
+     standardPrice = 'БЕСПЛАТНО';
++>>>>>>> origin/translate

@AyIong AyIong merged commit 8e7e684 into master Jan 20, 2025
23 of 24 checks passed
ss220app bot added a commit that referenced this pull request Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙏 Слияние с восходящим потоком О великий восходящий поток, спасибо что приносишь нам свои дары контента и багфиксов 📜 CL валиден Этот чейнджлог будет успешно опубликован TGUI Добавление или изменение существующего интерфейса на базе фреймворка TGUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants