-
-
Notifications
You must be signed in to change notification settings - Fork 104
Added: TickFrequencyDouble to SliderControlParamsAttribute #813
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
Conversation
51f1c3e to
730bc97
Compare
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. WalkthroughIntroduces 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ 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. Comment |
1b141c4 to
c397b79
Compare
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
e98b6bf to
958bedf
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this 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
TickFrequencyproperty, 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 CS0618around 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.TickFrequencywill 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
|
@coderabbitai full-review |
|
✅ Actions performedFull review triggered. |
Address PR feedback by adding #pragma warning disable/restore CS0618 around intentional usage of obsolete TickFrequency property.
Summary
TickFrequencyDoubleproperty (double) toSliderControlParamsAttributewhich takes precedence overTickFrequencywhen set to a value > 0TickFrequency(int) as[Obsolete]with appropriate documentationtickFrequencyDoubleat the end (for binary backwards compatibility)Reloaded.Mod.Interfacesversion to 2.5.0Usage
Implementation Notes
TickFrequencyDoubleusesdouble(notdouble?) because nullable types aren't valid attribute parameters0- whenTickFrequencyDouble > 0, it takes precedence overTickFrequencyCompatibility
TickFrequencycontinue to work