Skip to content

Commit

Permalink
Исправлен дизайн
Browse files Browse the repository at this point in the history
  • Loading branch information
VaIeroK committed Jun 7, 2022
1 parent c2b75ec commit 99d4553
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 68 deletions.
110 changes: 55 additions & 55 deletions OGF tool/OgfEditor.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 23 additions & 13 deletions OGF tool/OgfEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -787,28 +787,38 @@ private void OpenFile(string filename)
TabControl.Controls.Add(UserDataPage);
UserDataPage.Controls.Clear();

UserDataPage.Controls.Add(UserDataBox);
UserDataPage.Controls.Add(CreateUserdataButton);
CreateUserdataButton.Visible = false;
UserDataBox.Visible = false;

if (xr_loader.find_chunk((int)OGF.OGF4_S_USERDATA, false, true))
{
UserDataPage.Controls.Add(UserDataBox);
UserDataBox.Visible = true;
OGF_V.usertdata = new UserData();
OGF_V.usertdata.pos = xr_loader.chunk_pos;
OGF_V.usertdata.data = xr_loader.read_stringZ();
OGF_V.usertdata.old_size = OGF_V.usertdata.data.Length + 1;
}
else
UserDataPage.Controls.Add(CreateUserdataButton);
CreateUserdataButton.Visible = true;

xr_loader.SetStream(r.BaseStream);

// Motion Refs
TabControl.Controls.Add(MotionRefsPage);
MotionRefsPage.Controls.Clear();

MotionRefsPage.Controls.Add(MotionRefsBox);
MotionRefsPage.Controls.Add(CreateMotionRefsButton);
CreateMotionRefsButton.Visible = false;
MotionRefsBox.Visible = false;

bool v3 = xr_loader.find_chunk((int)OGF.OGF4_S_MOTION_REFS, false, true);

if (v3 || xr_loader.find_chunk((int)OGF.OGF4_S_MOTION_REFS2, false, true))
{
MotionRefsPage.Controls.Add(MotionRefsBox);

MotionRefsBox.Visible = true;
OGF_V.refs = new MotionRefs();
OGF_V.refs.pos = xr_loader.chunk_pos;
OGF_V.refs.refs0 = new List<string>();
Expand All @@ -835,7 +845,7 @@ private void OpenFile(string filename)
}
}
else
MotionRefsPage.Controls.Add(CreateMotionRefsButton);
CreateMotionRefsButton.Visible = true;

xr_loader.SetStream(r.BaseStream);

Expand Down Expand Up @@ -1261,17 +1271,17 @@ private void viewToolStripMenuItem_Click(object sender, EventArgs e)

private void CreateUserdataButton_Click(object sender, EventArgs e)
{
UserDataPage.Controls.Clear();
UserDataPage.Controls.Add(UserDataBox);
CreateUserdataButton.Visible = false;
UserDataBox.Visible = true;
OGF_V.usertdata = new UserData();
OGF_V.usertdata.need_create = true;
}

private void CreateMotionRefsButton_Click(object sender, EventArgs e)
{
m_model_type = 3;
MotionRefsPage.Controls.Clear();
MotionRefsPage.Controls.Add(MotionRefsBox);
CreateMotionRefsButton.Visible = false;
MotionRefsBox.Visible = true;
OGF_V.refs = new MotionRefs();
OGF_V.refs.need_create = true;
}
Expand All @@ -1296,8 +1306,8 @@ private void TabControl_SelectedIndexChanged(object sender, EventArgs e)
{
if (UserDataBox.Text == "")
{
UserDataPage.Controls.Clear();
UserDataPage.Controls.Add(CreateUserdataButton);
CreateUserdataButton.Visible = true;
UserDataBox.Visible = false;
OGF_V.usertdata = null;
}
break;
Expand All @@ -1309,8 +1319,8 @@ private void TabControl_SelectedIndexChanged(object sender, EventArgs e)
if (MotionBox.Text == "")
m_model_type = 10;

MotionRefsPage.Controls.Clear();
MotionRefsPage.Controls.Add(CreateMotionRefsButton);
CreateMotionRefsButton.Visible = true;
MotionRefsBox.Visible = false;
OGF_V.refs = null;
}
break;
Expand Down

0 comments on commit 99d4553

Please sign in to comment.