Skip to content

Conversation

@Sewer56
Copy link
Member

@Sewer56 Sewer56 commented Jan 25, 2026

Summary

  • Added TickFrequencyDouble property (double) to SliderControlParamsAttribute which takes precedence over TickFrequency when set to a value > 0
  • Marked existing TickFrequency (int) as [Obsolete] with appropriate documentation
  • Added new constructor parameter tickFrequencyDouble at the end (for binary backwards compatibility)
  • Bumped Reloaded.Mod.Interfaces version to 2.5.0

Usage

// Old way (integer only, now obsolete)
[SliderControlParams(minimum: 0, maximum: 1, tickFrequency: 1)]

// New way (supports decimal values, e.g. 0.01 increments)
[SliderControlParams(minimum: 0, maximum: 1, TickFrequencyDouble = 0.01)]

Implementation Notes

  • TickFrequencyDouble uses double (not double?) because nullable types aren't valid attribute parameters
  • Sentinel value is 0 - when TickFrequencyDouble > 0, it takes precedence over TickFrequency
  • New parameter added at end of constructor to maintain binary backwards compatibility

Compatibility

  • Binary backwards compatible: Old mods using TickFrequency continue to work
  • Source backwards compatible: Existing code compiles with only a deprecation warning

@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

Warning

Rate limit exceeded

@Sewer56 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 14 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

Introduces TickFrequencyDouble (double) on SliderControlParamsAttribute and marks the existing integer TickFrequency obsolete. Constructor overloads were added/adjusted for backward compatibility and defaulting behavior. Property grid/editor logic now uses TickFrequencyDouble when > 0, falling back to TickFrequency. Project/package versions were bumped (Launcher 1.30.0, Loader 1.30.0, Interfaces 2.5.0). A test config property demonstrating TickFrequencyDouble was added and the changelog template was replaced with a 1.30.0 entry.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding TickFrequencyDouble to SliderControlParamsAttribute.
Description check ✅ Passed The description is well-documented and directly related to the changeset, providing clear summary, usage examples, implementation notes, and compatibility information.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sewer56 Sewer56 force-pushed the add-double-slider branch 2 times, most recently from 1b141c4 to c397b79 Compare January 25, 2026 03:08
Previously, TickFrequency was limited to whole numbers (int), so you couldn't place a tick every 0.5 units. Now you can use TickFrequencyDouble instead.

- Added TickFrequencyDouble property (double) which takes precedence when > 0
- Marked existing TickFrequency as obsolete (binary/source backwards compatible)
- New parameter added at end of constructor for binary compatibility
- Uses 0 as sentinel value (TickFrequencyDouble > 0 means use it)
- Added test case in TestModControlParams
@Sewer56
Copy link
Member Author

Sewer56 commented Jan 25, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@source/Reloaded.Mod.Interfaces/Structs/ControlAttribute.cs`:
- Around line 47-53: Add the missing public API entries for the new
TickFrequencyDouble property and the new constructor overload by updating
PublicAPI.Unshipped.txt: declare the getter and setter for
Reloaded.Mod.Interfaces.Structs.SliderControlParamsAttribute.TickFrequencyDouble
(-> double and -> void) and add the full constructor signature for
SliderControlParamsAttribute that includes the tickFrequencyDouble parameter
(the signature ending with double tickFrequencyDouble = 0 -> void) so the public
API file matches the added property and constructor overload.
🧹 Nitpick comments (2)
source/Reloaded.Mod.Interfaces/Structs/ControlAttribute.cs (1)

131-132: Consider suppressing the obsolete warning for internal assignment.

Line 131 assigns to the obsolete TickFrequency property, which will trigger warning CS0618 during compilation (as indicated by static analysis). Since this internal assignment is intentional for backward compatibility, consider adding a #pragma warning disable CS0618 around the assignment.

💡 Suggested fix
+#pragma warning disable CS0618 // Type or member is obsolete
         TickFrequency = tickFrequency;
+#pragma warning restore CS0618
         TickFrequencyDouble = tickFrequencyDouble;
source/Reloaded.Mod.Launcher/Controls/PropertyGridEx.cs (1)

479-479: Suppress the obsolete warning for intentional fallback access.

Accessing SliderControlParams.TickFrequency will trigger warning CS0618 since it's marked obsolete. Since this fallback is intentional for backward compatibility, consider suppressing the warning locally.

💡 Suggested fix
+#pragma warning disable CS0618 // TickFrequency is obsolete - intentional fallback for backward compatibility
             TickFrequency = SliderControlParams.TickFrequencyDouble > 0 ? SliderControlParams.TickFrequencyDouble : SliderControlParams.TickFrequency,
+#pragma warning restore CS0618

@Sewer56
Copy link
Member Author

Sewer56 commented Jan 25, 2026

@coderabbitai full-review

@coderabbitai
Copy link

coderabbitai bot commented Jan 25, 2026

@Sewer56: I will perform a full review of all the changes in this PR.

✅ Actions performed

Full review triggered.

@Sewer56 Sewer56 merged commit 5e41e5d into master Jan 25, 2026
3 checks passed
@Sewer56 Sewer56 deleted the add-double-slider branch January 25, 2026 14:02
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.

2 participants