Revise RSBox slot display order

Revises prepended box name to better indicate left/right
Closes #4429
This commit is contained in:
Kurt 2025-01-27 11:59:36 -06:00
parent f63ad4372e
commit 2592dfec19
2 changed files with 15 additions and 4 deletions

View File

@ -134,6 +134,18 @@ private byte[] GetInnerData()
// Storage
public override int GetPartyOffset(int slot) => -1;
public override int GetBoxOffset(int box) => Box + 8 + (SIZE_STORED * box * 30);
public override int GetBoxSlotOffset(int box, int slot)
{
// Boxes are a 12x5 grid instead of the usual 6x5
// Without some swizzling, a box is the first 30 slots of the box data.
// Convert the box/slot back to a 0,59 number
int row = slot / 6;
int col = slot % 6;
if (box % 2 == 1) // right side
col += 6;
int boxSlot = (row * 12) + col;
return GetBoxOffset(box &~1) + (boxSlot * SIZE_STORED);
}
public override int CurrentBox
{
@ -159,9 +171,8 @@ private int GetBoxWallpaperOffset(int box)
public string GetBoxName(int box)
{
// Tweaked for the 1-30/31-60 box showing
int lo = (30 *(box%2)) + 1;
int hi = 30*((box % 2) + 1);
string boxName = $"[{lo:00}-{hi:00}] ";
var dir = box % 2 == 0 ? "◖" : "◗";
string boxName = $"[{dir}] ";
box /= 2;
var span = GetBoxNameSpan(box);

View File

@ -534,7 +534,7 @@ public bool IsAnySlotLockedInBox(int BoxStart, int BoxEnd)
#region Storage Offsets and Indexing
public abstract int GetBoxOffset(int box);
public int GetBoxSlotOffset(int box, int slot) => GetBoxOffset(box) + (slot * SIZE_BOXSLOT);
public virtual int GetBoxSlotOffset(int box, int slot) => GetBoxOffset(box) + (slot * SIZE_BOXSLOT);
public PKM GetBoxSlotAtIndex(int box, int slot) => GetBoxSlot(GetBoxSlotOffset(box, slot));
public void GetBoxSlotFromIndex(int index, out int box, out int slot)