From c6a6b228db44fe000e01a75fca0c607e7e45c103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A0=95=ED=9B=88?= Date: Sun, 14 Jul 2024 14:17:28 +0900 Subject: [PATCH] 0.18.0.0 --- EUD Editor 3/App.config | 12 ++++ EUD Editor 3/Class/Data/MapData.vb | 36 +++++------- EUD Editor 3/Class/Data/ProjectData/Load.vb | 16 ++++- .../Class/Data/ProjectData/ProjectData.vb | 25 ++++++++ .../Class/Data/ProjectData/SavableData.vb | 12 ++++ .../Data/Lua/TriggerEditor/Upgrade.lua | 6 +- EUD Editor 3/Language/en-US.xaml | 2 + EUD Editor 3/Language/ko-KR.xaml | 2 + EUD Editor 3/MainWindow/MainWindowD.xaml.vb | 5 +- EUD Editor 3/Module/Tools/ArgManager.vb | 2 +- EUD Editor 3/Module/Tools/Tool.vb | 29 +++++++++- EUD Editor 3/Module/Tools/WindowControl.vb | 7 +++ EUD Editor 3/My Project/Settings.Designer.vb | 50 ++++++++++------ EUD Editor 3/My Project/Settings.settings | 12 ++-- EUD Editor 3/UserContorl/ProjectControl.xaml | 4 ++ .../UserContorl/ProjectControl.xaml.vb | 19 ++++++ EUD Editor 3/Window/SettingWindows.xaml | 12 ++++ EUD Editor 3/Window/SettingWindows.xaml.vb | 58 +++++++++++++++++++ 18 files changed, 257 insertions(+), 52 deletions(-) diff --git a/EUD Editor 3/App.config b/EUD Editor 3/App.config index b306958c..c3e87a90 100644 --- a/EUD Editor 3/App.config +++ b/EUD Editor 3/App.config @@ -1,5 +1,10 @@  + + +
+ + @@ -36,4 +41,11 @@ + + + + + + + diff --git a/EUD Editor 3/Class/Data/MapData.vb b/EUD Editor 3/Class/Data/MapData.vb index 8dbe1537..e9816dbf 100644 --- a/EUD Editor 3/Class/Data/MapData.vb +++ b/EUD Editor 3/Class/Data/MapData.vb @@ -1,4 +1,5 @@ Imports System.IO +Imports System.Text Public Class MapData Public ReadOnly Property LoadComplete As Boolean @@ -562,8 +563,11 @@ Public Class MapData Dim f As Boolean = SearchCHK("STRx", binary) If f Then - size = binary.ReadUInt32 + If pjData.TextEncoding Is Nothing Then + pjData.TextEncoding = System.Text.Encoding.UTF8 + End If + size = binary.ReadUInt32 Dim BasePos As UInteger = mem.Position Dim strCount As UInteger = binary.ReadUInt32() Dim lastPos As UInteger = mem.Position @@ -573,20 +577,22 @@ Public Class MapData Dim StartPos As UInteger = binary.ReadUInt32() mem.Position = BasePos + StartPos - While (binary.ReadByte <> 0) End While Dim Bytecount As Integer = mem.Position - (BasePos + StartPos) - mem.Position = BasePos + StartPos - Dim str As String = System.Text.Encoding.UTF8.GetString(binary.ReadBytes(Bytecount - 1)) - - Strings.Add(str) + Dim b As Byte() = binary.ReadBytes(Bytecount - 1) + Dim strstartext As String = pjData.TextEncoding.GetString(b) + Strings.Add(strstartext) lastPos += 4 Next Else + If pjData.TextEncoding Is Nothing Then + pjData.TextEncoding = System.Text.Encoding.GetEncoding(0) + End If + SearchCHK("STR ", binary) size = binary.ReadUInt32 @@ -599,36 +605,27 @@ Public Class MapData For i = 0 To strCount - 1 '사이즈 만큼 반복 mem.Position = lastPos - Dim StartPos As UInteger = binary.ReadUInt16() - mem.Position = BasePos + StartPos While (binary.ReadByte <> 0) End While Dim Bytecount As Integer = mem.Position - (BasePos + StartPos) - mem.Position = BasePos + StartPos - Strings.Add(System.Text.Encoding.GetEncoding(0).GetString(binary.ReadBytes(Bytecount - 1))) + Dim b As Byte() = binary.ReadBytes(Bytecount - 1) + Dim strstartext As String = pjData.TextEncoding.GetString(b) + Strings.Add(strstartext) lastPos += 2 Next End If - - If True Then SearchCHK("SPRP", binary) size = binary.ReadUInt32 - _MapName = binary.ReadUInt16 _MapDes = binary.ReadUInt16 End If - - - - - binary.Close() mem.Close() Else @@ -641,18 +638,15 @@ Public Class MapData Dat = New SCDatFiles(True) Strings = New List(Of String) _WavIndex = New List(Of Integer) - Dim hmpq As UInteger Dim hfile As UInteger Dim buffer() As Byte Dim filesize As UInteger Dim size As Integer - Dim pdwread As IntPtr StormLib.SFileOpenArchive(MapName, 0, 0, hmpq) Dim openFilename As String = "staredit\scenario.chk" - StormLib.SFileOpenFileEx(hmpq, openFilename, 0, hfile) If hfile <> 0 Then filesize = StormLib.SFileGetFileSize(hfile, filesize) diff --git a/EUD Editor 3/Class/Data/ProjectData/Load.vb b/EUD Editor 3/Class/Data/ProjectData/Load.vb index bf4802a5..1b92f3af 100644 --- a/EUD Editor 3/Class/Data/ProjectData/Load.vb +++ b/EUD Editor 3/Class/Data/ProjectData/Load.vb @@ -34,8 +34,18 @@ Partial Public Class ProjectData End If End Sub + Public Shared Sub LoadWithCheckOepn(tFilename As String, ByRef _pjdata As ProjectData) + If Tool.IsProjectLoad() Then + '꺼야됨 + If Not _pjdata.CloseFile Then + Exit Sub + End If + End If - Private Shared Sub TeFrileRefresh(teFile As TEFile) + Load(tFilename, _pjdata) + End Sub + + Private Shared Sub TeFileRefresh(teFile As TEFile) For i = 0 To teFile.FileCount - 1 teFile.Files(i).LoadInit() Next @@ -48,6 +58,8 @@ Partial Public Class ProjectData FilePath = DataPath End If + Tool.AddRecentFile(FilePath) + Dim stm As Stream = System.IO.File.Open(DataPath, FileMode.Open, FileAccess.Read) Try @@ -62,7 +74,7 @@ Partial Public Class ProjectData stm.Close() Dim mainTEFile As TEFile = _pjdata.TEData.PFIles - TeFrileRefresh(mainTEFile) + TeFileRefresh(mainTEFile) 'If _pjdata.SaveData.LastVersion.ToString <> pgData.Version.ToString Then ' Tool.ErrorMsgBox("테스트 버전은 다른 버전의 세이브 파일을 열 수 없습니다") diff --git a/EUD Editor 3/Class/Data/ProjectData/ProjectData.vb b/EUD Editor 3/Class/Data/ProjectData/ProjectData.vb index 108dbb83..eca0ce40 100644 --- a/EUD Editor 3/Class/Data/ProjectData/ProjectData.vb +++ b/EUD Editor 3/Class/Data/ProjectData/ProjectData.vb @@ -1,5 +1,6 @@ Imports System.IO Imports System.Runtime.Serialization.Formatters.Binary +Imports System.Text Imports System.Windows.Threading Imports MaterialDesignThemes.Wpf.Transitions Imports Newtonsoft.Json @@ -143,6 +144,17 @@ Public Class ProjectData End Get End Property + Public Property TextEncoding As Encoding + Get + Return SaveData.TextEncoding + End Get + Set(value As Encoding) + SaveData.TextEncoding = value + End Set + End Property + + + Public ReadOnly Property EngStat_txt(index As Integer, Optional isScript As Boolean = False) As String Get @@ -309,6 +321,7 @@ Public Class ProjectData IsMapLoading = False tIsDirty = True SaveData.OpenMapName = value + TextEncoding = Nothing _MapData = New MapData(SaveData.OpenMapName) IsMapLoading = _MapData.LoadComplete @@ -318,6 +331,18 @@ Public Class ProjectData End If End Set End Property + + Public Sub ReloadMap() + IsMapLoading = False + tIsDirty = True + _MapData = New MapData(SaveData.OpenMapName) + + IsMapLoading = _MapData.LoadComplete + If Not IsMapLoading Then + SaveData.OpenMapName = "" + End If + End Sub + Public Property SaveMapName As String Get Return SaveData.SaveMapName diff --git a/EUD Editor 3/Class/Data/ProjectData/SavableData.vb b/EUD Editor 3/Class/Data/ProjectData/SavableData.vb index 989f6ab3..98151344 100644 --- a/EUD Editor 3/Class/Data/ProjectData/SavableData.vb +++ b/EUD Editor 3/Class/Data/ProjectData/SavableData.vb @@ -1,4 +1,5 @@ Imports System.IO +Imports System.Text Public Class SaveableData @@ -74,6 +75,17 @@ Public Class SaveableData End Property + Private _encoding As Encoding = Nothing + Public Property TextEncoding As Encoding + Get + Return _encoding + End Get + Set(value As Encoding) + _encoding = value + End Set + End Property + + Private mViewLog As Boolean Public Property ViewLog As Boolean diff --git a/EUD Editor 3/Data/Lua/TriggerEditor/Upgrade.lua b/EUD Editor 3/Data/Lua/TriggerEditor/Upgrade.lua index c055db5d..33009ded 100644 --- a/EUD Editor 3/Data/Lua/TriggerEditor/Upgrade.lua +++ b/EUD Editor 3/Data/Lua/TriggerEditor/Upgrade.lua @@ -111,7 +111,7 @@ function CurrentUpgrade(Upgrade, Player, Comparison, Amount) --업그레이드/U if IsNumber(Amount) then rstr = string.format("MemoryXEPD(EPD(0x%X), %s, 0x%X, %s)", ROffset, Comparison, Amount * math.pow(256, Mod), Mask) else - rstr = string.format("MemoryXEPD(EPD(0x%X), %s, 0x%X, %s)", ROffset, Comparison, Amount .. " * " .. math.pow(256, Mod), Mask) + rstr = string.format("MemoryXEPD(EPD(0x%X), %s, %s, %s)", ROffset, Comparison, Amount .. " * " .. math.pow(256, Mod), Mask) end else @@ -249,7 +249,7 @@ function SetUpgradeMax(Upgrade, Player, Modifier, Amount) --업그레이드/Upgr if IsNumber(Amount) then rstr = string.format("SetMemoryXEPD(EPD(0x%X), %s, 0x%X, %s)", ROffset, Modifier, Amount * math.pow(256, Mod), Mask) else - rstr = string.format("SetMemoryXEPD(EPD(0x%X), %s, 0x%X, %s)", ROffset, Modifier, Amount .. " * " .. math.pow(256, Mod), Mask) + rstr = string.format("SetMemoryXEPD(EPD(0x%X), %s, %s, %s)", ROffset, Modifier, Amount .. " * " .. math.pow(256, Mod), Mask) end else @@ -313,7 +313,7 @@ function CurrentUpgradeMax(Upgrade, Player, Comparison, Amount) --업그레이 if IsNumber(Amount) then rstr = string.format("MemoryXEPD(EPD(0x%X), %s, 0x%X, %s)", ROffset, Comparison, Amount * math.pow(256, Mod), Mask) else - rstr = string.format("MemoryXEPD(EPD(0x%X), %s, 0x%X, %s)", ROffset, Comparison, Amount .. " * " .. math.pow(256, Mod), Mask) + rstr = string.format("MemoryXEPD(EPD(0x%X), %s, %s, %s)", ROffset, Comparison, Amount .. " * " .. math.pow(256, Mod), Mask) end else diff --git a/EUD Editor 3/Language/en-US.xaml b/EUD Editor 3/Language/en-US.xaml index ca4dbbbe..42d28b69 100644 --- a/EUD Editor 3/Language/en-US.xaml +++ b/EUD Editor 3/Language/en-US.xaml @@ -30,6 +30,8 @@ You are using the latest version of EUD Editor. The server is not responding. + Encoding + Temp file location Data Folder Map file folder diff --git a/EUD Editor 3/Language/ko-KR.xaml b/EUD Editor 3/Language/ko-KR.xaml index 81cc256c..9da6137d 100644 --- a/EUD Editor 3/Language/ko-KR.xaml +++ b/EUD Editor 3/Language/ko-KR.xaml @@ -30,6 +30,8 @@ 현재 최신 버전입니다. 서버가 응답이 없습니다. + 인코딩 + 임시 파일 위치 Data폴더 맵 파일 폴더 diff --git a/EUD Editor 3/MainWindow/MainWindowD.xaml.vb b/EUD Editor 3/MainWindow/MainWindowD.xaml.vb index ae4822f9..d695a342 100644 --- a/EUD Editor 3/MainWindow/MainWindowD.xaml.vb +++ b/EUD Editor 3/MainWindow/MainWindowD.xaml.vb @@ -1,6 +1,10 @@ Imports System.Windows.Threading Imports System.Windows.Interop Imports System.ComponentModel +Imports Microsoft.WindowsAPICodePack +Imports net.r_eg.Conari.Extension +Imports System.Runtime.InteropServices +Imports System.IO Public Class MainWindowD Private BackGroundWorker As BackgroundWorker @@ -171,5 +175,4 @@ Public Class MainWindowD End If End Sub - End Class diff --git a/EUD Editor 3/Module/Tools/ArgManager.vb b/EUD Editor 3/Module/Tools/ArgManager.vb index 7fda43fc..af672b00 100644 --- a/EUD Editor 3/Module/Tools/ArgManager.vb +++ b/EUD Editor 3/Module/Tools/ArgManager.vb @@ -134,7 +134,7 @@ Module ArgManager Dim tstr As String = pjData.CodeLabel(SCDatFiles.DatFiles.Location, i) - strs.Add(tstr & "⫥" & "[" & i & "] " & tstr) + strs.Add(tstr & "⫥" & "[" & i + 1 & "] " & tstr) Next Return strs.ToArray Case "TrgSwitch" diff --git a/EUD Editor 3/Module/Tools/Tool.vb b/EUD Editor 3/Module/Tools/Tool.vb index c5e08744..631233be 100644 --- a/EUD Editor 3/Module/Tools/Tool.vb +++ b/EUD Editor 3/Module/Tools/Tool.vb @@ -103,18 +103,45 @@ Namespace Tool End If End Function + Public Sub AddRecentFile(path As String) + Dim filestr As String = My.Settings.RecentFileList + Dim rlist As New List(Of String) + If filestr = "" Then + rlist.Add(path) + Else + rlist.AddRange(filestr.Split("?")) + If rlist.Contains(path) Then + rlist.Remove(path) + rlist.Insert(0, path) + Else + rlist.Insert(0, path) + End If + End If + If rlist.Count > 11 Then + rlist.RemoveAt(rlist.Count - 1) + End If + My.Settings.RecentFileList = String.Join("?", rlist) + My.Settings.Save() + End Sub + Public Function GetRecentFileList() As List(Of String) + Dim filestr As String = My.Settings.RecentFileList + Dim rlist As New List(Of String) + If filestr <> "" Then + rlist.AddRange(filestr.Split("?")) + End If - + Return rlist + End Function diff --git a/EUD Editor 3/Module/Tools/WindowControl.vb b/EUD Editor 3/Module/Tools/WindowControl.vb index eb181809..0b594a60 100644 --- a/EUD Editor 3/Module/Tools/WindowControl.vb +++ b/EUD Editor 3/Module/Tools/WindowControl.vb @@ -309,6 +309,13 @@ Namespace WindowMenu End If End Sub + Public Sub LoadWithFile(filename As String) + If Not pgData.IsCompilng Then + ProjectData.LoadWithCheckOepn(filename, pjData) + ProjectControlBinding.PropertyChangedPack() + End If + End Sub + Public Sub Load() If Not pgData.IsCompilng Then ProjectData.Load(False, pjData) diff --git a/EUD Editor 3/My Project/Settings.Designer.vb b/EUD Editor 3/My Project/Settings.Designer.vb index 6cc256ec..35aacb71 100644 --- a/EUD Editor 3/My Project/Settings.Designer.vb +++ b/EUD Editor 3/My Project/Settings.Designer.vb @@ -12,15 +12,16 @@ Option Strict On Option Explicit On - - _ -Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) +Namespace My + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings) + #Region "My.Settings 자동 저장 기능" #If _MyType = "WindowsForms" Then Private Shared addedHandler As Boolean @@ -35,10 +36,10 @@ Partial Friend NotInheritable Class MySettings End Sub #End If #End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - + + Public Shared ReadOnly Property [Default]() As MySettings + Get + #If _MyType = "WindowsForms" Then If Not addedHandler Then SyncLock addedHandlerLockObject @@ -49,10 +50,23 @@ Partial Friend NotInheritable Class MySettings End SyncLock End If #End If - Return defaultInstance - End Get - End Property -End Class + Return defaultInstance + End Get + End Property + + _ + Public Property RecentFileList() As String + Get + Return CType(Me("RecentFileList"),String) + End Get + Set + Me("RecentFileList") = value + End Set + End Property + End Class +End Namespace Namespace My @@ -62,9 +76,9 @@ Namespace My Friend Module MySettingsProperty _ - Friend ReadOnly Property Settings() As Global.EUD_Editor_3.MySettings + Friend ReadOnly Property Settings() As Global.EUD_Editor_3.My.MySettings Get - Return Global.EUD_Editor_3.MySettings.Default + Return Global.EUD_Editor_3.My.MySettings.Default End Get End Property End Module diff --git a/EUD Editor 3/My Project/Settings.settings b/EUD Editor 3/My Project/Settings.settings index 40ed9fdb..3c7fb2e2 100644 --- a/EUD Editor 3/My Project/Settings.settings +++ b/EUD Editor 3/My Project/Settings.settings @@ -1,7 +1,9 @@  - - - - - + + + + + + + \ No newline at end of file diff --git a/EUD Editor 3/UserContorl/ProjectControl.xaml b/EUD Editor 3/UserContorl/ProjectControl.xaml index 5db91940..6d1336b3 100644 --- a/EUD Editor 3/UserContorl/ProjectControl.xaml +++ b/EUD Editor 3/UserContorl/ProjectControl.xaml @@ -36,6 +36,10 @@