feat: add date-based achievement filtering and lock visible button#604
Open
ImBIOS wants to merge 1 commit into
Open
feat: add date-based achievement filtering and lock visible button#604ImBIOS wants to merge 1 commit into
ImBIOS wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds achievement-list tooling in SAM’s game manager UI to support filtering achievements by unlock date and quickly locking all currently displayed achievements, plus build changes aimed at .NET 8 SDK compatibility for net48 WinForms projects.
Changes:
- Adds a “Lock Visible” toolbar button to bulk-uncheck the currently displayed achievements.
- Adds a date filter toggle + date picker, and applies date-based filtering during achievement list population.
- Updates
SAM.GameandSAM.Pickerproject files with resource-generation settings and a resources extension package reference.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| SAM.Picker/SAM.Picker.csproj | Adds preserialized resource generation property and System.Resources.Extensions package reference. |
| SAM.Game/SAM.Game.csproj | Adds preserialized resource generation property and System.Resources.Extensions package reference. |
| SAM.Game/Manager.Designer.cs | Adds WinForms toolbar controls for “Lock Visible” and date filtering (toggle + picker). |
| SAM.Game/Manager.cs | Implements date filtering in GetAchievements() and adds event handlers for the new toolbar controls. |
Files not reviewed (1)
- SAM.Game/Manager.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)
SAM.Game/Manager.Designer.cs:77
_ToolStripSeparator2is instantiated twice (once before_MatchingStringLabeland again later with the other separators). The first instantiation is immediately overwritten and never used; remove the redundant assignment to avoid confusing / fragile designer code.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+490
to
+499
| // Date filtering | ||
| if (this._DateFilterCheckBox.Checked) | ||
| { | ||
| var innerPicker = (System.Windows.Forms.DateTimePicker)this._DateFilterPicker.Control; | ||
| var filterDate = innerPicker.Value.Date; | ||
|
|
||
| // Only show achievements that were unlocked on the selected date | ||
| if (isAchieved == false || unlockTime <= 0 || | ||
| DateTimeOffset.FromUnixTimeSeconds(unlockTime).LocalDateTime.Date != filterDate) | ||
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add date-based achievement filtering and a "Lock Visible" button to enable bulk un-achieving of all achievements unlocked on a specific date.
Context
Currently, SAM has no way to filter achievements by their unlock date. Users who want to un-achieve all achievements unlocked on a specific date must manually scroll through the list, identify them by the "Unlock Time" column, and uncheck each one individually. This is tedious and error-prone, especially for games with many achievements.
Closes #603
Changes
New UI Controls (Achievement Toolbar)
Logic Changes
GetAchievements()that compares each achievement'sunlockTime(Unix timestamp) against the selected date (converted to local date)OnLockVisiblehandler unchecks all visible itemsOnDateFilterToggleenables/disables the date picker and refreshes the listOnDateFilterChangedrefreshes the list when the date changes (only when filter is active)Build Fixes
GenerateResourceUsePreserializedResourcesproperty andSystem.Resources.ExtensionsNuGet package to bothSAM.GameandSAM.Pickercsproj files to fix building with .NET 8 SDKUse Cases
Testing
dotnet build SAM.sln -c DebugFiles Changed
SAM.Game/Manager.Designer.cs— New UI controls in toolbarSAM.Game/Manager.cs— Date filtering logic + event handlersSAM.Game/SAM.Game.csproj— Build fix for .NET 8 SDKSAM.Picker/SAM.Picker.csproj— Build fix for .NET 8 SDK