Skip to content

Replayerui improvements#204

Open
NSGolova wants to merge 3 commits into
1408supportfrom
replayerui-improvements
Open

Replayerui improvements#204
NSGolova wants to merge 3 commits into
1408supportfrom
replayerui-improvements

Conversation

@NSGolova

Copy link
Copy Markdown
Contributor

No description provided.

@Hermanest Hermanest self-requested a review June 25, 2026 21:13
using UnityEngine;

namespace BeatLeader.Replayer.Binding {
internal static class ReplayControlsActions {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very weird decision, hotkeys are built around zenject, so you can simply create a separate service to unify logic

/// <summary>
/// Whether seeking/speed control via the VR controller thumbsticks is enabled.
/// </summary>
public bool Enabled { get; set; } = true;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's rename it to VrControlsEnabled for clarity

public bool CurvatureEnabled { get; set; }
public bool AttachToHand { get; set; }
public bool AttachToRightHand { get; set; }
public SerializablePose HandOffset { get; set; } = new(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove default values, they're already applied in ConfigDefaults

public KeyCode PauseHotkey { get; set; }
public KeyCode RewindForwardHotkey { get; set; }
public KeyCode RewindBackwardHotkey { get; set; }
public KeyCode SpeedUpHotkey { get; set; } = KeyCode.Plus;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove default values

}
}

internal class SettingsControlsTabs {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Split into separate components and stop using AI for everything

public void Setup(FloatingScreen screen, Camera camera, ReplayerFloatingUISettings settings) {
public void Setup(
FloatingScreen screen,
ToolbarWithSettings mainUi,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of directly relying on that specific type, let's use events e.g. MainUiStateChangedEvent

_screen = screen;
_mainUi = mainUi;
_settings = settings;
screen.gameObject.GetOrAddComponent<FloatingScreenHandFollower>().Setup(settings, menuControllersManager);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a ui component, you shouldn't initialize unrelated scripts here

}
}

private void LateUpdate() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why checking state in each frame?

var handTransform = GetHandTransform(settings);
if (handTransform == null) return;

if (!_attached || transform.parent != handTransform) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alongside the update cycle this is very expensive as it creates a native wrapper on each Transform instance equality comparison

using UnityEngine;

namespace BeatLeader.UI.Replayer {
internal class FloatingScreenHandFollower : MonoBehaviour {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After refining apply in ReplayerFloatingUIBinder

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