Merge branch 'master' into form-slider-bar-transfer-value-on-commit

This commit is contained in:
Bartłomiej Dach 2024-10-07 07:21:23 +02:00
commit 1854e1c2f9
No known key found for this signature in database
5 changed files with 40 additions and 6 deletions

View File

@ -133,10 +133,7 @@ jobs:
dotnet-version: "8.0.x"
- name: Install .NET Workloads
run: dotnet workload install maui-ios
- name: Select Xcode 16
run: sudo xcode-select -s /Applications/Xcode_16.app/Contents/Developer
run: dotnet workload install ios --from-rollback-file https://raw.githubusercontent.com/ppy/osu-framework/refs/heads/master/workloads.json
- name: Build
run: dotnet build -c Debug osu.iOS

View File

@ -177,7 +177,7 @@ private double computeSpeedValue(ScoreInfo score, OsuDifficultyAttributes attrib
double relevantAccuracy = attributes.SpeedNoteCount == 0 ? 0 : (relevantCountGreat * 6.0 + relevantCountOk * 2.0 + relevantCountMeh) / (attributes.SpeedNoteCount * 6.0);
// Scale the speed value with accuracy and OD.
speedValue *= (0.95 + Math.Pow(attributes.OverallDifficulty, 2) / 750) * Math.Pow((accuracy + relevantAccuracy) / 2.0, (14.5 - Math.Max(attributes.OverallDifficulty, 8)) / 2);
speedValue *= (0.95 + Math.Pow(attributes.OverallDifficulty, 2) / 750) * Math.Pow((accuracy + relevantAccuracy) / 2.0, (14.5 - attributes.OverallDifficulty) / 2);
// Scale the speed value with # of 50s to punish doubletapping.
speedValue *= Math.Pow(0.99, countMeh < totalHits / 500.0 ? 0 : countMeh - totalHits / 500.0);

View File

@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -26,6 +27,8 @@ public partial class DrawableOsuMenuItem : Menu.DrawableMenuItem
public const int TEXT_SIZE = 17;
public const int TRANSITION_LENGTH = 80;
public BindableBool ShowCheckbox { get; } = new BindableBool();
private TextContainer text;
private HotkeyDisplay hotkey;
private HoverClickSounds hoverClickSounds;
@ -72,6 +75,7 @@ protected override void LoadComplete()
{
base.LoadComplete();
ShowCheckbox.BindValueChanged(_ => updateState());
Item.Action.BindDisabledChanged(_ => updateState(), true);
FinishTransforms();
}
@ -138,6 +142,8 @@ private void updateState()
text.BoldText.FadeOut(TRANSITION_LENGTH, Easing.OutQuint);
text.NormalText.FadeIn(TRANSITION_LENGTH, Easing.OutQuint);
}
text.CheckboxContainer.Alpha = ShowCheckbox.Value ? 1 : 0;
}
protected sealed override Drawable CreateContent() => text = CreateTextContainer();

View File

@ -42,6 +42,25 @@ private void load(AudioManager audio)
sampleClose = audio.Samples.Get(@"UI/dropdown-close");
}
protected override void Update()
{
base.Update();
bool showCheckboxes = false;
foreach (var drawableItem in ItemsContainer)
{
if (drawableItem.Item is StatefulMenuItem)
showCheckboxes = true;
}
foreach (var drawableItem in ItemsContainer)
{
if (drawableItem is DrawableOsuMenuItem osuItem)
osuItem.ShowCheckbox.Value = showCheckboxes;
}
}
protected override void AnimateOpen()
{
if (!TopLevelMenu && !wasOpened)

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Specialized;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
@ -19,6 +20,7 @@
using osu.Game.Overlays;
using osu.Game.Resources.Localisation.Web;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterfaceV2
{
@ -76,7 +78,7 @@ private void load()
Spacing = new Vector2(5),
Child = button = new RoundedButton
{
Action = () => Colours.Add(Colour4.White),
Action = addNewColour,
Size = new Vector2(70),
Text = "+",
}
@ -112,6 +114,16 @@ protected override void OnHoverLost(HoverLostEvent e)
updateState();
}
private void addNewColour()
{
Color4 startingColour = Colours.Count > 0
? Colours.Last()
: Colour4.White;
Colours.Add(startingColour);
flow.OfType<ColourButton>().Last().TriggerClick();
}
private void updateState()
{
background.Colour = colourProvider.Background5;