@@ -161,7 +161,7 @@ private void AddGridRow(DataGridView grid, object wzObject)
161
161
162
162
if ( wzObject is WzImage image )
163
163
{
164
- if ( image . WzFileParent . Name == "Npc.wz" )
164
+ if ( image . WzFileParent . Name . StartsWith ( "Npc" ) )
165
165
{
166
166
// NPC icon breadcrumb like: '{ID}/stand/0'
167
167
// and also sometimes contains a link STRING property instead of using UOL
@@ -179,7 +179,7 @@ private void AddGridRow(DataGridView grid, object wzObject)
179
179
if ( image == null ) return ;
180
180
}
181
181
icon = ( WzCanvasProperty ) image . GetFromPath ( "stand/0" ) ;
182
- } else if ( image . WzFileParent . Name == "Mob.wz" )
182
+ } else if ( image . WzFileParent . Name . StartsWith ( "Mob" ) )
183
183
{
184
184
// Mob icon breadcrumb like: '{ID}/(move|stand)/0'
185
185
// where the 'move' or 'stand' sub property may not exist
@@ -216,7 +216,7 @@ private void AddGridRow(DataGridView grid, object wzObject)
216
216
}
217
217
} else if ( wzObject is WzSubProperty subProperty )
218
218
{
219
- if ( subProperty . WzFileParent . Name == "Skill.wz" )
219
+ if ( subProperty . WzFileParent . Name . StartsWith ( "Skill" ) )
220
220
{
221
221
ID = int . Parse ( subProperty . Name ) ;
222
222
name = StringUtility . GetSkill ( subProperty . Name ) ;
@@ -639,12 +639,20 @@ private void BtnWzLoad_Click(object sender, EventArgs e)
639
639
{
640
640
_StringWZ = new WzFile ( stringWzPath + ".wz" , mapleVersion ) ;
641
641
_StringWZ . ParseWzFile ( ) ;
642
- } else if ( Directory . Exists ( stringWzPath ) )
642
+ }
643
+ else if ( Directory . Exists ( stringWzPath ) )
643
644
{ // KMS
645
+ _StringWZ = new WzFile ( stringWzPath , mapleVersion ) ;
644
646
WzDirectory dir = new WzDirectory ( "String" , _StringWZ ) ;
645
647
_StringWZ . WzDirectory = dir ;
646
648
RecursivelyLoadDirectory ( dir , stringWzPath , mapleVersion ) ;
647
649
}
650
+ else
651
+ {
652
+ MessageBox . Show ( "Failed to load String data in the specified directory" , "File not found" , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
653
+ DisposeWzFiles ( ) ;
654
+ return ;
655
+ }
648
656
StringUtility = new WzStringUtility ( _StringWZ ) ;
649
657
LoadWzData ( mapleVersion , folderPath ) ;
650
658
}
@@ -665,17 +673,37 @@ private void ComboLoadType_SelectedIndexChanged(object sender, EventArgs e)
665
673
/// upon clicking the save button, store data of the current opened grid.
666
674
/// Some tabs may have another TabControl in which that Control contains a Grid control.
667
675
/// </summary>
668
- private void BtnSave_Click ( object sender , EventArgs e )
676
+ private void BtnSave_Click ( object sender , EventArgs ev )
669
677
{
670
- var control = TabControlMain . SelectedTab . Controls [ 0 ] ;
671
- if ( control is DataGridView grid ) // no child tabs and contains 1 child Control (DataGridView)
672
- GridIOUtility . ExportGrid ( grid , TabControlMain . SelectedTab . Text ) ;
673
- else if ( control is TabControl tab ) // sub-categories (e.g. Equips.Hairs, Equips.Faces)
674
- {
675
- control = tab . SelectedTab ; // The selected child Tab (e.g. Equips.Hairs)
676
- GridIOUtility . ExportGrid ( ( DataGridView ) control . Controls [ 0 ] , TabControlMain . SelectedTab . Text ) ; // The DataGridView contained in the TabPage control
678
+ MouseEventArgs e = ( MouseEventArgs ) ev ;
679
+ switch ( e . Button ) {
680
+ case MouseButtons . Left :
681
+ {
682
+ var control = TabControlMain . SelectedTab . Controls [ 0 ] ;
683
+ if ( control is DataGridView grid ) // no child tabs and contains 1 child Control (DataGridView)
684
+ GridIOUtility . ExportGrid ( grid , TabControlMain . SelectedTab . Text ) ;
685
+ else if ( control is TabControl tab ) // sub-categories (e.g. Equips.Hairs, Equips.Faces)
686
+ {
687
+ control = tab . SelectedTab ; // The selected child Tab (e.g. Equips.Hairs)
688
+ GridIOUtility . ExportGrid ( ( DataGridView ) control . Controls [ 0 ] , TabControlMain . SelectedTab . Text ) ; // The DataGridView contained in the TabPage control
689
+ }
690
+ MessageBox . Show ( "Bin save complete!" ) ;
691
+ break ;
692
+ }
693
+ case MouseButtons . Right :
694
+ {
695
+ var control = TabControlMain . SelectedTab . Controls [ 0 ] ;
696
+ if ( control is DataGridView grid ) // no child tabs and contains 1 child Control (DataGridView)
697
+ GridIOUtility . ExportGridImages ( grid , TabControlMain . SelectedTab . Text ) ;
698
+ else if ( control is TabControl tab ) // sub-categories (e.g. Equips.Hairs, Equips.Faces)
699
+ {
700
+ control = tab . SelectedTab ; // The selected child Tab (e.g. Equips.Hairs)
701
+ GridIOUtility . ExportGridImages ( ( DataGridView ) control . Controls [ 0 ] , TabControlMain . SelectedTab . Text ) ; // The DataGridView contained in the TabPage control
702
+ }
703
+ MessageBox . Show ( "Image save complete!" ) ;
704
+ break ;
705
+ }
677
706
}
678
- MessageBox . Show ( "Save complete!" ) ;
679
707
}
680
708
681
709
#region tab change events
0 commit comments