Skip to content

Add Duration Remaining as a percentage and the ability to scale it from max potential duration if using random - #78

Merged
LucHeart merged 2 commits into
OpenShock:developfrom
kekkels:develop
Oct 20, 2026
Merged

LucHeart merged 2 commits into
OpenShock:developfrom
kekkels:develop

Conversation

@kekkels

@kekkels kekkels commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

As it says adds a new parameter _DurationRemaining as a 0-1f to track duration remaining so you can do progress bars and stuff on shaders. also adds a similar meta Any_DurationRemaining to track any active shockers.

Adds a scaling option to chose whether it will scale from 1 to 0 or if it will start from (StartDuration/MaxDuration) to 0.

feel free to cut the comments down if you so choose I know it's a bit more verbose than the rest of the code even after i already trimmed it.

Summary by CodeRabbit

  • New Features
    • Added a “Scale duration remaining to max” setting to control how shock duration countdowns are scaled.
    • Added duration-remaining OSC values for individual shock groups and the aggregate _Any state. Values count down from 1 to 0 during a shock.
  • Documentation
    • Documented the countdown behavior and how the aggregate value is calculated.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c38d8b1-0f9c-4f75-99c1-5f8b0ba4c1a5
📥 Commits

Reviewing files that changed from the base of the PR and between 7197e7b and d1003a6.

📒 Files selected for processing: 6
  • README.md
  • ShockOsc/Config/BehaviourConf.cs
  • ShockOsc/Models/ProgramGroup.cs
  • ShockOsc/Services/OscHandler.cs
  • ShockOsc/Services/ShockOsc.cs
  • ShockOsc/Ui/Pages/Dash/Tabs/ConfigTab.razor

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The change adds duration-remaining OSC parameters for individual shockers and the aggregate _Any state. A configuration setting controls whether values scale to the configured maximum duration. The Configuration tab exposes the setting, and the README documents the parameters.

Changes: Duration Remaining OSC Output

Layer / File(s) Summary
Duration scaling setting
ShockOsc/Config/BehaviourConf.cs, ShockOsc/Ui/Pages/Dash/Tabs/ConfigTab.razor
BehaviourConf adds ScaleDurationRemainingToMax, defaulting to false. The Configuration tab adds a Timing switch bound to this setting.
Duration parameter and OSC output
ShockOsc/Models/ProgramGroup.cs, ShockOsc/Services/ShockOsc.cs, ShockOsc/Services/OscHandler.cs, README.md
The OSC output reports normalized remaining duration for active local shocks and includes active remote shocks in the _Any aggregate. Scaling uses the configured maximum when enabled. The README describes the individual and aggregate parameters.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Suggested reviewers: lucheart

Merge Risk: ⚪ Minimal · up to d1003

No confirmed duration-output issue blocks merging. Same-group overlapping shocks remain worth checking during normal validation.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 4 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main changes: adding duration remaining as a percentage and scaling it against the maximum potential duration for random durations.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 4 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@LucHeart
LucHeart merged commit 789a5ea into OpenShock:develop Oct 20, 2026
2 checks passed
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