mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-02 16:58:08 -05:00
Box Layout fixes (#2449)
* Enforce box name length in Box Layout * Fix G4 box renaming * Fix G7 box renaming
This commit is contained in:
@@ -80,7 +80,7 @@ public int Counter
|
||||
|
||||
public override void SetBoxName(int box, string value)
|
||||
{
|
||||
const int maxlen = BOX_NAME_LEN / 2;
|
||||
const int maxlen = 8;
|
||||
if (value.Length > maxlen)
|
||||
value = value.Substring(0, maxlen); // Hard cap
|
||||
int offset = GetBoxNameOffset(box);
|
||||
|
||||
@@ -47,7 +47,7 @@ public int Unknown
|
||||
|
||||
public override void SetBoxName(int box, string value)
|
||||
{
|
||||
const int maxlen = BOX_NAME_LEN / 2;
|
||||
const int maxlen = 8;
|
||||
if (value.Length > maxlen)
|
||||
value = value.Substring(0, maxlen); // Hard cap
|
||||
int offset = GetBoxNameOffset(box);
|
||||
|
||||
@@ -47,7 +47,7 @@ public string GetBoxName(int box)
|
||||
public void SetBoxName(int box, string value)
|
||||
{
|
||||
var data = SAV.SetString(value, strlen, strlen, 0);
|
||||
var offset = GetBoxNameOffset(box) + (SAV6.LongStringLength * box);
|
||||
var offset = GetBoxNameOffset(box - 1) + (SAV6.LongStringLength);
|
||||
SAV.SetData(data, offset);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ public SAV_BoxLayout(SaveFile sav, int box)
|
||||
LoadUnlockedCount();
|
||||
|
||||
LB_BoxSelect.SelectedIndex = box;
|
||||
TB_BoxName.MaxLength = SAV.Generation >= 6 ? 14 : 8;
|
||||
editing = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user