From c5b571f798ae03c502d0d43aba92da75c52a3107 Mon Sep 17 00:00:00 2001 From: eaxvac Date: Sun, 10 Jun 2018 01:41:00 +0800 Subject: [PATCH] Show portal type description under bottom right status strip when selecting portals in Map.wz --- .../HaRepackerMainPanel.Designer.cs | 11 ++++- .../HaRepackerMainPanel.cs | 49 +++++++++++++------ .../HaRepackerMainPanel.resx | 14 +++++- .../HaRepackerMainPanel.zh-CHT.resx | 22 ++++----- .../Properties/Resources.Designer.cs | 9 ++++ HaRepackerLib/Properties/Resources.ja.resx | 3 ++ HaRepackerLib/Properties/Resources.ko.resx | 3 ++ HaRepackerLib/Properties/Resources.resx | 3 ++ .../Properties/Resources.zh-CHS.resx | 3 ++ .../Properties/Resources.zh-CHT.resx | 3 ++ 10 files changed, 91 insertions(+), 29 deletions(-) diff --git a/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.Designer.cs b/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.Designer.cs index 9c77ba0a..d2b65801 100644 --- a/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.Designer.cs +++ b/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.Designer.cs @@ -54,6 +54,7 @@ private void InitializeComponent() this.btnClose = new System.Windows.Forms.ToolStripButton(); this.btnOptions = new System.Windows.Forms.ToolStripButton(); this.MainDockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel(); + this.toolStripStatusLabel_additionalInfo = new System.Windows.Forms.ToolStripStatusLabel(); ((System.ComponentModel.ISupportInitialize)(this.MainSplitContainer)).BeginInit(); this.MainSplitContainer.Panel1.SuspendLayout(); this.MainSplitContainer.Panel2.SuspendLayout(); @@ -174,7 +175,8 @@ private void InitializeComponent() this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.selectionLabel, this.mainProgressBar, - this.secondaryProgressBar}); + this.secondaryProgressBar, + this.toolStripStatusLabel_additionalInfo}); resources.ApplyResources(this.statusStrip, "statusStrip"); this.statusStrip.Name = "statusStrip"; // @@ -259,6 +261,12 @@ private void InitializeComponent() resources.ApplyResources(this.MainDockPanel, "MainDockPanel"); this.MainDockPanel.Name = "MainDockPanel"; // + // toolStripStatusLabel_additionalInfo + // + this.toolStripStatusLabel_additionalInfo.Margin = new System.Windows.Forms.Padding(200, 3, 0, 2); + this.toolStripStatusLabel_additionalInfo.Name = "toolStripStatusLabel_additionalInfo"; + resources.ApplyResources(this.toolStripStatusLabel_additionalInfo, "toolStripStatusLabel_additionalInfo"); + // // HaRepackerMainPanel // resources.ApplyResources(this, "$this"); @@ -312,5 +320,6 @@ private void InitializeComponent() public System.Windows.Forms.ToolStrip findStrip; public TreeViewMS.TreeViewMS DataTree; private WeifenLuo.WinFormsUI.Docking.DockPanel MainDockPanel; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel_additionalInfo; } } diff --git a/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.cs b/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.cs index f5152f13..2cc84ef4 100644 --- a/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.cs +++ b/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.cs @@ -90,6 +90,7 @@ private void ShowObjectValue(WzObject obj) mp3Player.SoundProperty = null; nameBox.Text = obj is WzFile ? ((WzFile)obj).Header.Copyright : obj.Name; nameBox.ButtonEnabled = false; + toolStripStatusLabel_additionalInfo.Text = "-"; // Reset additional info to default if (obj is WzFile || obj is WzDirectory || obj is WzImage || obj is WzNullProperty || obj is WzSubProperty || obj is WzConvexProperty) { @@ -128,7 +129,7 @@ private void ShowObjectValue(WzObject obj) saveImageButton.Visible = true; changeSoundButton.Visible = false; saveSoundButton.Visible = false; - } + } else if (obj is WzUOLProperty) { nameBox.Visible = true; @@ -150,8 +151,7 @@ private void ShowObjectValue(WzObject obj) saveImageButton.Visible = true; textPropBox.Size = new Size(textPropBox.Size.Width, 50); - } - else + } else { canvasPropBox.Visible = false; @@ -190,6 +190,24 @@ private void ShowObjectValue(WzObject obj) saveImageButton.Visible = false; changeSoundButton.Visible = false; saveSoundButton.Visible = false; + + if (obj is WzStringProperty) + { + WzStringProperty stringObj = (WzStringProperty)obj; + + // Portal type name display + if (stringObj.Name == "pn") // "pn" = portal name + { + if (MapleLib.WzLib.WzStructure.Data.Tables.PortalTypeNames.ContainsKey(obj.GetString())) + { + toolStripStatusLabel_additionalInfo.Text = + string.Format(Properties.Resources.MainAdditionalInfo_PortalType, MapleLib.WzLib.WzStructure.Data.Tables.PortalTypeNames[obj.GetString()]); + } else + { + toolStripStatusLabel_additionalInfo.Text = string.Format(Properties.Resources.MainAdditionalInfo_PortalType, obj.GetString()); + } + } + } } else if (obj is WzVectorProperty) { @@ -244,7 +262,7 @@ private static void ParseOnDataTreeSelectedItem(WzNode selectedNode) /// private void saveImageButton_Click(object sender, EventArgs e) { - if (!(DataTree.SelectedNode.Tag is WzCanvasProperty) && !(DataTree.SelectedNode.Tag is WzUOLProperty)) + if (!(DataTree.SelectedNode.Tag is WzCanvasProperty) && !(DataTree.SelectedNode.Tag is WzUOLProperty)) { return; } @@ -709,8 +727,7 @@ private void changeImageButton_Click(object sender, EventArgs e) // Add undo actions //actions.Add(UndoRedoManager.ObjectRemoved((WzNode)parentCanvasNode, childInlinkNode)); childInlinkNode.Delete(); // Delete '_inlink' node - } - else if (selectedWzCanvas.HaveOutlinkProperty()) // if its an inlink property, remove that before updating base image. + } else if (selectedWzCanvas.HaveOutlinkProperty()) // if its an inlink property, remove that before updating base image. { selectedWzCanvas.RemoveProperty(selectedWzCanvas[WzCanvasProperty.OutlinkPropertyName]); @@ -725,7 +742,7 @@ private void changeImageButton_Click(object sender, EventArgs e) } selectedWzCanvas.PngProperty.SetPNG(bmp); - + // Updates selectedWzCanvas.ParentImage.Changed = true; canvasPropBox.Image = bmp; @@ -818,7 +835,7 @@ public void DoRemoveImageResource() foreach (WzNode node in DataTree.SelectedNodes) { WzObject wzObj = (WzObject)node.Tag;// CloneWzObject((WzObject)node.Tag); - + } } @@ -1091,11 +1108,11 @@ private void btnFindAll_Click(object sender, EventArgs e) dsr.searchResultsBox.Items.Add(result); dsr.Show(MainDockPanel); dsr.DockState = DockState.DockBottom; - // searchResults.AutoHide = false; - // searchResults.Visible = true; - // searchResultsContainer.Visible = true; - // dockSite8.Visible = true; - // panelDockContainer1.Visible = true; +// searchResults.AutoHide = false; +// searchResults.Visible = true; +// searchResultsContainer.Visible = true; +// dockSite8.Visible = true; +// panelDockContainer1.Visible = true; findBox.Focus(); } @@ -1132,9 +1149,9 @@ private void searchResultsContainer_VisibleChanged(object sender, System.EventAr private WzNode GetNodeByName(TreeNodeCollection collection, string name) { - foreach (WzNode node in collection) - if (node.Text == name) - return node; + foreach (WzNode node in collection) + if (node.Text == name) + return node; return null; } diff --git a/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.resx b/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.resx index f414e69a..092851cd 100644 --- a/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.resx +++ b/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.resx @@ -137,7 +137,7 @@ AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRl - bXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAAAAAAEAAAAQAgAAAAAAAAAL + bXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAAAAAAIAAAAQAgAAAAAAAAAL @@ -552,6 +552,12 @@ 150, 25 + + 19, 26 + + + - + 0, 671 @@ -771,6 +777,12 @@ System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + toolStripStatusLabel_additionalInfo + + + System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + HaRepackerMainPanel diff --git a/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.zh-CHT.resx b/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.zh-CHT.resx index 3ed159bb..bc3e16a9 100644 --- a/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.zh-CHT.resx +++ b/HaRepackerLib/Controls/HaRepackerMainPanels/HaRepackerMainPanel.zh-CHT.resx @@ -165,17 +165,17 @@ - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG - YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 - 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw - bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc - VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 - c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 - Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo - mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ - kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D - TgDQASA1MVpwzwAAAABJRU5ErkJggg== + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAgNJREFUOE+lkutLk2EYxvePhJaHShFBUTEPiCieQOmDiEZgrEbpYGiCQxkqA80I + RUkUEZ0YRMS+DDI70MkTmzJnDc8iU8QT2mAEItnle90wHwTDyBduXnie5/rd133Q4ZKfAJqHFs9E08A8 + zD1emDpmYXjqRlnTFIrMk8iuGkNaxWekGEaQrHecBfw+/vPXODw6hj9whN2fh/Bt/8LSRgA3cxr/DeBZ + 9kvmTNMoHGNbIrYN+3Aj23IxgJkpds0doP3VstgmsNexhutZ9QrAms8T0zYzU5xXM46kcjsmvfvoeL2i + AeoUgA07T8yaaZuZKab1rzN74jgys1YB2O2gmBZzH49LODXrrJlnzEzxe9cOLH1ziMioVgCOiuIFX0CE + Q+/WYf+yieiCFrRp9tkwxnP7Kt5MbKGm6wfC000KwDlTXNLgEvHMkh+Db32o7fYivtQm1l9+3IBOp5P7 + yjYPwlKNCsAluWudxgvtknb5t9oWcL/VLU2Mvd2JFq3uqs7vAtE/ceNayiMF4KiYMSjmY2O7B4Ua+NaD + YQGEJumRbvyG1IcfBHI12aAAXM8R57aIWTNrLLY4tfNPiCvpR1SeVeu6WWzHFD6THSDwFMDdpmUG62NJ + PKM4Or9ZxBxb8H8l7g5CEu8pAOfM3WanSeeS8CFHxW4zM2umbWamOCShXAH+/wNOANABIDUxWnDPAAAA + AElFTkSuQmCC diff --git a/HaRepackerLib/Properties/Resources.Designer.cs b/HaRepackerLib/Properties/Resources.Designer.cs index 7b1f7582..b981e85d 100644 --- a/HaRepackerLib/Properties/Resources.Designer.cs +++ b/HaRepackerLib/Properties/Resources.Designer.cs @@ -228,6 +228,15 @@ internal static string MainAddInt { } } + /// + /// Looks up a localized string similar to Portal Type: {0}. + /// + internal static string MainAdditionalInfo_PortalType { + get { + return ResourceManager.GetString("MainAdditionalInfo_PortalType", resourceCulture); + } + } + /// /// Looks up a localized string similar to Add link. /// diff --git a/HaRepackerLib/Properties/Resources.ja.resx b/HaRepackerLib/Properties/Resources.ja.resx index 2b36da1f..e2c965fc 100644 --- a/HaRepackerLib/Properties/Resources.ja.resx +++ b/HaRepackerLib/Properties/Resources.ja.resx @@ -250,4 +250,7 @@ Select MP3 File + + ポータルタイプ:{0} + \ No newline at end of file diff --git a/HaRepackerLib/Properties/Resources.ko.resx b/HaRepackerLib/Properties/Resources.ko.resx index 14f99324..a72bd055 100644 --- a/HaRepackerLib/Properties/Resources.ko.resx +++ b/HaRepackerLib/Properties/Resources.ko.resx @@ -250,4 +250,7 @@ Select MP3 File + + 포털 유형 : {0} + \ No newline at end of file diff --git a/HaRepackerLib/Properties/Resources.resx b/HaRepackerLib/Properties/Resources.resx index 55827911..ba60dc67 100644 --- a/HaRepackerLib/Properties/Resources.resx +++ b/HaRepackerLib/Properties/Resources.resx @@ -250,4 +250,7 @@ Select MP3 File + + Portal Type: {0} + \ No newline at end of file diff --git a/HaRepackerLib/Properties/Resources.zh-CHS.resx b/HaRepackerLib/Properties/Resources.zh-CHS.resx index 04a2f312..980d53b8 100644 --- a/HaRepackerLib/Properties/Resources.zh-CHS.resx +++ b/HaRepackerLib/Properties/Resources.zh-CHS.resx @@ -222,4 +222,7 @@ 选择MP3文件 + + 门户类型:{0} + \ No newline at end of file diff --git a/HaRepackerLib/Properties/Resources.zh-CHT.resx b/HaRepackerLib/Properties/Resources.zh-CHT.resx index cd38c412..5f63770c 100644 --- a/HaRepackerLib/Properties/Resources.zh-CHT.resx +++ b/HaRepackerLib/Properties/Resources.zh-CHT.resx @@ -213,4 +213,7 @@ 圖片 (*.jpg;*.bmp;*.png;*.gif;*.tiff) + + 門戶類型:{0} + \ No newline at end of file