Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add button to log resource id #306

Open
wants to merge 1 commit into
base: 1.0.6.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Plugins/ChunkResExplorerPlugin/FrostyChunkResEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public class FrostyChunkResEditor : FrostyBaseEditor
private const string PART_ResExportMenuItem = "PART_ResExportMenuItem";
private const string PART_ResImportMenuItem = "PART_ResImportMenuItem";
private const string PART_RevertMenuItem = "PART_RevertMenuItem";
private const string PART_LogIDMenuItem = "PART_LogIDMenuItem";
private const string PART_ChunkFilter = "PART_ChunkFilter";
private const string PART_ChunkModified = "PART_ChunkModified";

Expand Down Expand Up @@ -151,6 +152,9 @@ public override void OnApplyTemplate()
mi = GetTemplateChild(PART_RevertMenuItem) as MenuItem;
mi.Click += ResRevertMenuItem_Click;

mi = GetTemplateChild(PART_LogIDMenuItem) as MenuItem;
mi.Click += ResLogIDMenuItem_Click;

Loaded += FrostyChunkResEditor_Loaded;
chunksListBox.SelectionChanged += ChunksListBox_SelectionChanged;
chunkFilterTextBox.LostFocus += ChunkFilterTextBox_LostFocus;
Expand Down Expand Up @@ -343,6 +347,13 @@ private void ResExportMenuItem_Click(object sender, RoutedEventArgs e)
}
}

private void ResLogIDMenuItem_Click(object sender, RoutedEventArgs e)
{
ResAssetEntry selectedAsset = resExplorer.SelectedAsset as ResAssetEntry;

logger?.Log("Resource ID for {0}: {1}", selectedAsset.Filename, selectedAsset.ResRid.ToString("x").ToUpper());
}

public void ImportChunk()
{
ChunkAssetEntry selectedAsset = chunksListBox.SelectedItem as ChunkAssetEntry;
Expand Down
5 changes: 5 additions & 0 deletions Plugins/ChunkResExplorerPlugin/Themes/Generic.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@
<Image Source="/FrostyEditor;component/Images/Revert.png" Opacity="0.5"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="PART_LogIDMenuItem" Header="Log ID">
<MenuItem.Icon>
<Image Source="/FrostyEditor;component/Images/Properties.png" Opacity="0.5"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</core:FrostyDataExplorer.AssetContextMenu>
</core:FrostyDataExplorer>
Expand Down