Skip to content

Commit

Permalink
新增音樂Bgm列表
Browse files Browse the repository at this point in the history
  • Loading branch information
Elem8100 committed Jun 27, 2021
1 parent a02a7aa commit c438d0a
Show file tree
Hide file tree
Showing 4 changed files with 597 additions and 498 deletions.
9 changes: 8 additions & 1 deletion MapleStoryDB2/DataGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ public DataViewer(GridType gridType)
Columns.AddRange(ID, Icon, Info);

This comment has been minimized.

Copy link
@Elem8100

Elem8100 Jun 27, 2021

Author Owner

music

break;

case GridType.Music:
RowTemplate.Height = 40;
Name.Width = 800;
Columns.AddRange(Name);
break;

}

if (!System.Windows.Forms.SystemInformation.TerminalServerSession)
Expand All @@ -269,7 +275,8 @@ public enum GridType
Morph,
Familiar,
DamageSkin,
Reactor
Reactor,
Music
}

public static class DataGridViewExtension
Expand Down
78 changes: 71 additions & 7 deletions MapleStoryDB2/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,8 +1248,40 @@ void LoadReactor()
Grid.Sort(Grid.Columns[0], System.ComponentModel.ListSortDirection.Ascending);

}
DataViewer[] DataGrid = new DataViewer[39];
DataViewer[] TempGrid = new DataViewer[39];
void LoadMusic()
{
foreach (var img in Arc.SoundWz.Nodes())
{
if (LeftStr(img.Text, 3) != "Bgm")
continue;
foreach (var Iter in Arc.SoundWz.GetNode(img.Text).Nodes )
{
Grid.Rows.Add(Iter.GetPath());
}

}

if (Arc.Sound2Wz != null)
{
foreach (var img in Arc.Sound2Wz.Nodes())
{
if (LeftStr(img.Text, 3) == "Bgm" || LeftStr(img.Text, 4) == "PL_3" || LeftStr(img.Text, 4) == "PL_B" || LeftStr(img.Text, 4) == "PL_C" || LeftStr(img.Text, 4) == "PL_M")
{

foreach (var Iter in Arc.Sound2Wz.GetNode(img.Text).Nodes)
{
if(Iter.Value is Wz_Sound)
Grid.Rows.Add(Iter.GetPath());
}
}

}
}

Grid.Sort(Grid.Columns[0], System.ComponentModel.ListSortDirection.Ascending);
}
DataViewer[] DataGrid = new DataViewer[40];
DataViewer[] TempGrid = new DataViewer[40];
bool FirstLoadBIN = false;
void LoadBIN()
{
Expand Down Expand Up @@ -1431,6 +1463,9 @@ string GetWzFileName()
case 38:
return "Reactor.wz";
break;
case 39:
return "Sound.wz";
break;
}
return "";
}
Expand Down Expand Up @@ -1526,6 +1561,9 @@ private void LoadButton_Click(object sender, EventArgs e)
LoadReactor();
break;

case 39:
LoadMusic();
break;

}

Expand Down Expand Up @@ -1602,9 +1640,9 @@ private void SelectFolderBox_Click(object sender, EventArgs e)
if (FileExists(FolderPath + "\\string.wz"))
{

// Wz_Structure.DefaultEncoding = true;
// Wz_Structure.DefaultEncoding = Encoding.Default;
// Wz_Structure.DefaultAutoDetectExtFiles = false;
// Wz_Structure.DefaultImgCheckDisabled =true;
Wz_Structure.DefaultImgCheckDisabled =true;
Arc.MobWz = new Wz_Structure();
Arc.MapWz = new Wz_Structure();
Arc.SkillWz = new Wz_Structure();
Expand Down Expand Up @@ -2104,7 +2142,7 @@ void SetGrid()
{
if (e.RowIndex == -1) return;
if (e.RowIndex >= Grid.RowCount) return;
if (tabIndex == 38 || tabIndex==35) return;
if (tabIndex == 38 || tabIndex== 35 ) return;
string SelectID = "";
if (Grid.Rows[e.RowIndex].Cells[0].Value is string)
{
Expand All @@ -2120,8 +2158,27 @@ void SetGrid()
ShowMap(imgNode);
}
else if(tabIndex==39)
{
Wz_Sound sound = null;
if (Arc.SoundWz.GetNode(SelectID)!=null)
sound= (Wz_Sound)Arc.SoundWz.GetNode(SelectID).Value;
else if(Arc.Sound2Wz!=null && Arc.Sound2Wz.GetNode(SelectID) != null)
sound = (Wz_Sound)Arc.Sound2Wz.GetNode(SelectID).Value;
soundPlayer.UnLoad();
byte[] data = sound.ExtractSound();
if (data == null || data.Length <= 0)
{
return;
}
soundPlayer.PreLoad(data);
soundPlayer.Play();
}
else
{
if (tabIndex == 39) return;
var Node = PluginManager.FindWz(GetIDPath(SelectID));
ToolTip2.quickView(Node);
ToolTip2.tooltipQuickView.Visible = true;
Expand All @@ -2142,7 +2199,7 @@ void SetGrid()
{
if (e.RowIndex == -1) return;
if (e.RowIndex >= SearchGrid.RowCount) return;
if (tabIndex == 38 || tabIndex == 35) return;
if (tabIndex == 38 || tabIndex == 35 || tabIndex==39) return;
string SelectID = "";
if (SearchGrid.Rows[e.RowIndex].Cells[0].Value is string)
{
Expand Down Expand Up @@ -2241,7 +2298,7 @@ private void Form1_Load(object sender, EventArgs e)
Un4seen.Bass.BASSError error = soundPlayer.GetLastError();
MessageBox.Show("Bass初始化失败!\r\n\r\nerrorCode : " + (int)error + "(" + error + ")", "虫子");
}
for (int i = 0; i <= 38; i++)
for (int i = 0; i <= 39; i++)
{
switch (i)
{
Expand Down Expand Up @@ -2337,6 +2394,13 @@ private void Form1_Load(object sender, EventArgs e)
TempGrid[i].Parent = tabControl1.TabPages[i];
break;

case 39:
DataGrid[i] = new DataViewer(GridType.Music);
DataGrid[i].Parent = tabControl1.TabPages[i];
TempGrid[i] = new DataViewer(GridType.Music);
TempGrid[i].Parent = tabControl1.TabPages[i];
break;



}
Expand Down
19 changes: 16 additions & 3 deletions MapleStoryDB2/Form1.designer.cs

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

Loading

0 comments on commit c438d0a

Please sign in to comment.