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

Hidden tiles #5102

Merged
merged 8 commits into from
May 16, 2024
Merged

Hidden tiles #5102

merged 8 commits into from
May 16, 2024

Conversation

TheShuEd
Copy link
Contributor

@TheShuEd TheShuEd commented May 4, 2024

A small addition that allows you to hide some tiles from the spawn menu. This is useful for downstrimes, disabling the ability to see standard tiles, but not causing huge problems with cutting them from everywhere they are used.

@TheShuEd
Copy link
Contributor Author

TheShuEd commented May 4, 2024

I wonder how I should initialize this field in an object that is not in the engine?

@TheShuEd
Copy link
Contributor Author

TheShuEd commented May 4, 2024

requires space-wizards/space-station-14#27666

Copy link
Member

@PJB3005 PJB3005 left a comment

Choose a reason for hiding this comment

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

I'd rename the property to EditorHidden or something, so people don't mistake it for a rendering property or something.

@TheShuEd
Copy link
Contributor Author

TheShuEd commented May 4, 2024

Done

@TheShuEd TheShuEd requested a review from PJB3005 May 4, 2024 21:55
@@ -146,6 +146,8 @@ private void BuildTileList(string? searchStr = null)

foreach (var entry in _shownTiles)
{
if (entry.EditorHidden) continue;
Copy link
Member

Choose a reason for hiding this comment

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

Didn't realize this on the first pass: it's probably better to do this filter before the name filter and sort, i.e. put it on line 133 with a .Where().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, but tomorrow. Im sleeping now

@TheShuEd TheShuEd requested a review from PJB3005 May 5, 2024 09:42
Comment on lines 138 to 139
(Loc.GetString(s.Name).Contains(searchStr, StringComparison.CurrentCultureIgnoreCase) ||
s.ID.Contains(searchStr, StringComparison.OrdinalIgnoreCase)) && !s.EditorHidden);
Copy link
Member

Choose a reason for hiding this comment

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

Doing it like this only applies the hidden when you have a search string.

@PJB3005 PJB3005 merged commit e30e963 into space-wizards:master May 16, 2024
2 of 3 checks passed
@TheShuEd TheShuEd deleted the 04-05-2024-tile-hidden branch May 21, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants