Skip to content

Commit

Permalink
0.18.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Buizz committed Jul 14, 2024
1 parent 5c24b40 commit c6a6b22
Show file tree
Hide file tree
Showing 18 changed files with 257 additions and 52 deletions.
12 changes: 12 additions & 0 deletions EUD Editor 3/App.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="EUD_Editor_3.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
Expand Down Expand Up @@ -36,4 +41,11 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<userSettings>
<EUD_Editor_3.MySettings>
<setting name="RecentFileList" serializeAs="String">
<value />
</setting>
</EUD_Editor_3.MySettings>
</userSettings>
</configuration>
36 changes: 15 additions & 21 deletions EUD Editor 3/Class/Data/MapData.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Imports System.IO
Imports System.Text

Public Class MapData
Public ReadOnly Property LoadComplete As Boolean
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
16 changes: 14 additions & 2 deletions EUD Editor 3/Class/Data/ProjectData/Load.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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("테스트 버전은 다른 버전의 세이브 파일을 열 수 없습니다")
Expand Down
25 changes: 25 additions & 0 deletions EUD Editor 3/Class/Data/ProjectData/ProjectData.vb
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -309,6 +321,7 @@ Public Class ProjectData
IsMapLoading = False
tIsDirty = True
SaveData.OpenMapName = value
TextEncoding = Nothing
_MapData = New MapData(SaveData.OpenMapName)

IsMapLoading = _MapData.LoadComplete
Expand All @@ -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
Expand Down
12 changes: 12 additions & 0 deletions EUD Editor 3/Class/Data/ProjectData/SavableData.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Imports System.IO
Imports System.Text

<Serializable()>
Public Class SaveableData
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions EUD Editor 3/Data/Lua/TriggerEditor/Upgrade.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions EUD Editor 3/Language/en-US.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<sys:String x:Key="LastVersion">You are using the latest version of EUD Editor.</sys:String>
<sys:String x:Key="NotFoundServer">The server is not responding.</sys:String>

<sys:String x:Key="Encoding">Encoding</sys:String>

<sys:String x:Key="TempFileLoc">Temp file location</sys:String>
<sys:String x:Key="TempFileLoc0">Data Folder</sys:String>
<sys:String x:Key="TempFileLoc1">Map file folder</sys:String>
Expand Down
2 changes: 2 additions & 0 deletions EUD Editor 3/Language/ko-KR.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<sys:String x:Key="LastVersion">현재 최신 버전입니다.</sys:String>
<sys:String x:Key="NotFoundServer">서버가 응답이 없습니다.</sys:String>

<sys:String x:Key="Encoding">인코딩</sys:String>

<sys:String x:Key="TempFileLoc">임시 파일 위치</sys:String>
<sys:String x:Key="TempFileLoc0">Data폴더</sys:String>
<sys:String x:Key="TempFileLoc1">맵 파일 폴더</sys:String>
Expand Down
5 changes: 4 additions & 1 deletion EUD Editor 3/MainWindow/MainWindowD.xaml.vb
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -171,5 +175,4 @@ Public Class MainWindowD
End If
End Sub


End Class
2 changes: 1 addition & 1 deletion EUD Editor 3/Module/Tools/ArgManager.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
29 changes: 28 additions & 1 deletion EUD Editor 3/Module/Tools/Tool.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down
7 changes: 7 additions & 0 deletions EUD Editor 3/Module/Tools/WindowControl.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading

0 comments on commit c6a6b22

Please sign in to comment.