Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
.MatchEndForward(
new CodeMatch(OpCodes.Bne_Un),
new CodeMatch(OpCodes.Ldarg_0))
.ThrowIfInvalid()
.ThrowIfInvalid("placeholder string: required by Harmony")
.CreateLabel(out var destination)
.MatchStartBackwards(new CodeMatch(OpCodes.Bne_Un))
.InsertAndAdvance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
new CodeMatch(i => i.opcode == OpCodes.Callvirt && ((MethodBase)i.operand).Name == $"get_{nameof(ObstacleController.width)}"),
new CodeMatch(OpCodes.Conv_R4),
new CodeMatch())
.ThrowIfInvalid()
.ThrowIfInvalid("placeholder string: required by Harmony")
.Insert(Transpilers.EmitDelegate<Func<float, float>>(obstacleWidth =>
{
if (!Plugin.active || obstacleWidth is < 1000 and > -1000)
Expand Down Expand Up @@ -129,8 +129,8 @@ private static void Prefix(ObstacleData obstacleData, ref ObstacleSpawnData obst
obstacleHeight = height;
break;
}

obstacleHeight *= StaticBeatmapObjectSpawnMovementData.layerHeight;
//this value isnt provided by the game anymore, plus it was a static value anyway, and from my brief testing, positioning seems to be fine
obstacleHeight *= 0.6f;

obstacleSpawnData = new ObstacleSpawnData(obstacleSpawnData.moveOffset, obstacleSpawnData.obstacleWidth, obstacleHeight);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
new CodeMatch(OpCodes.Ldloc_S),
new CodeMatch(OpCodes.Callvirt),
new CodeMatch(OpCodes.Ldelem_Ref))
.ThrowIfInvalid()
.ThrowIfInvalid("placeholder string: required by Harmony")
.Insert(
new CodeInstruction(OpCodes.Ldc_I4_0),
new CodeInstruction(OpCodes.Ldc_I4_3),
Expand Down Expand Up @@ -154,7 +154,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
new CodeMatch(OpCodes.Ldelem),
new CodeMatch(OpCodes.Ldc_R4),
new CodeMatch(OpCodes.Call))
.ThrowIfInvalid()
.ThrowIfInvalid("placeholder string: required by Harmony")
.Insert(new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(Math), nameof(Math.Abs), new[] { typeof(int) })))
.InstructionEnumeration();
}
Expand Down
8 changes: 4 additions & 4 deletions MappingExtensions/HarmonyPatches/PrecisePlacementPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ private static void Postfix(ref float __result, NoteLineLayer lineLayer)
{
return;
}

const float delta = StaticBeatmapObjectSpawnMovementData.kTopLinesYPos - StaticBeatmapObjectSpawnMovementData.kUpperLinesYPos;
//these values arent provided by the game anymore, plus they were static values anyway, and from my brief testing, positioning seems to be fine
const float delta = 1.45f - 0.85f;
var layer = (int)lineLayer;
if (layer is >= 1000 or <= -1000)
{
__result = StaticBeatmapObjectSpawnMovementData.kUpperLinesYPos - delta - delta + layer * delta / 1000;
__result = 0.85f - delta - delta + layer * delta / 1000;
}
else if (layer is > 2 or < 0)
{
__result = StaticBeatmapObjectSpawnMovementData.kUpperLinesYPos - delta + layer * delta;
__result = 0.85f - delta + layer * delta;
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions MappingExtensions/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"gameVersion": "1.40.0",
"id": "MappingExtensions",
"name": "MappingExtensions",
"version": "1.7.6",
"version": "1.7.7",
"dependsOn": {
"BSIPA": "^4.3.0",
"SongCore": "^3.15.1",
"BS Utils": "^1.12.3"
"BSIPA": "^4.3.7",
"SongCore": "^3.16.0",
"BS Utils": "^1.14.3"
},
"links": {
"project-source": "https://github.com/Kylemc1413/MappingExtensions",
Expand Down