Msbt editor fixes
This commit is contained in:
parent
a49315e029
commit
9a70890924
Binary file not shown.
@ -45,10 +45,12 @@ namespace FirstPlugin.Forms
|
|||||||
{
|
{
|
||||||
if (ShowLabels)
|
if (ShowLabels)
|
||||||
{
|
{
|
||||||
foreach (var text in msbt.header.Label1.Labels)
|
foreach (var lbl in msbt.header.Label1.Labels)
|
||||||
{
|
{
|
||||||
string listText = text.Name;
|
ListViewItem item = new ListViewItem();
|
||||||
listViewCustom1.Items.Add(listText);
|
item.Text = lbl.Name;
|
||||||
|
item.Tag = msbt.header.Text2.TextData[(int)lbl.Index];
|
||||||
|
listViewCustom1.Items.Add(item);
|
||||||
}
|
}
|
||||||
listViewCustom1.Sorting = SortOrder.Ascending;
|
listViewCustom1.Sorting = SortOrder.Ascending;
|
||||||
listViewCustom1.Sort();
|
listViewCustom1.Sort();
|
||||||
@ -57,12 +59,15 @@ namespace FirstPlugin.Forms
|
|||||||
{
|
{
|
||||||
foreach (var text in msbt.header.Text2.TextData)
|
foreach (var text in msbt.header.Text2.TextData)
|
||||||
{
|
{
|
||||||
|
ListViewItem item = new ListViewItem();
|
||||||
string listText = text.GetTextLabel(ShowPreviewText, msbt.header.StringEncoding);
|
string listText = text.GetTextLabel(ShowPreviewText, msbt.header.StringEncoding);
|
||||||
|
|
||||||
if (listText.Length > 25)
|
if (listText.Length > 25)
|
||||||
listText = $"{listText.Substring(0, 25)}......";
|
listText = $"{listText.Substring(0, 25)}......";
|
||||||
|
|
||||||
listViewCustom1.Items.Add(listText);
|
item.Text = listText;
|
||||||
|
item.Tag = text;
|
||||||
|
listViewCustom1.Items.Add(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,17 +80,14 @@ namespace FirstPlugin.Forms
|
|||||||
|
|
||||||
if (listViewCustom1.SelectedItems.Count > 0)
|
if (listViewCustom1.SelectedItems.Count > 0)
|
||||||
{
|
{
|
||||||
int index = listViewCustom1.SelectedIndices[0];
|
var item = listViewCustom1.SelectedItems[0];
|
||||||
if (ShowLabels)
|
if (item.Tag is MSBT.StringEntry)
|
||||||
{
|
{
|
||||||
index = (int)activeMessageFile.header.Label1.Labels[index].Index;
|
var msbtString = (MSBT.StringEntry)item.Tag;
|
||||||
}
|
|
||||||
var textSection = activeMessageFile.header.Text2;
|
editTextTB.Text = msbtString.GetText(activeMessageFile.header.StringEncoding);
|
||||||
if (textSection != null)
|
originalTextTB.Text = msbtString.GetText(activeMessageFile.header.StringEncoding);
|
||||||
{
|
hexEditor1.LoadData(msbtString.Data);
|
||||||
editTextTB.Text = textSection.TextData[index].GetText(activeMessageFile.header.StringEncoding);
|
|
||||||
originalTextTB.Text = textSection.OriginalTextData[index].GetText(activeMessageFile.header.StringEncoding);
|
|
||||||
hexEditor1.LoadData(textSection.TextData[index].Data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,6 +161,18 @@ namespace Toolbox.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Bitmap CaptureScreenshot(int width, int height, bool enableAlpha)
|
||||||
|
{
|
||||||
|
GLControl control = null;
|
||||||
|
if (GL_ControlModern != null)
|
||||||
|
control = GL_ControlModern;
|
||||||
|
else
|
||||||
|
control = GL_ControlLegacy;
|
||||||
|
|
||||||
|
Bitmap bitmap = new Bitmap(width, height);
|
||||||
|
return bitmap;
|
||||||
|
}
|
||||||
|
|
||||||
public void LoadCustomMenuItem(ToolStripMenuItem menu)
|
public void LoadCustomMenuItem(ToolStripMenuItem menu)
|
||||||
{
|
{
|
||||||
foreach (ToolStripMenuItem item in stContextMenuStrip1.Items)
|
foreach (ToolStripMenuItem item in stContextMenuStrip1.Items)
|
||||||
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user