Skip to content

Commit

Permalink
1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Entr0py404 committed Dec 14, 2023
1 parent dc5f8b6 commit a7e12c4
Show file tree
Hide file tree
Showing 11 changed files with 225 additions and 126 deletions.
10 changes: 8 additions & 2 deletions GDev Asset Store Tool/AssetInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ Public Class AssetInfo
For Each PNG_file As String In AllAnimationFiles

If CountCharacter(Path.GetFileName(PNG_file), CChar("_")) >= 2 Then
ThisObjectname = Path.GetFileName(PNG_file)
ThisObjectname = ThisObjectname.Substring(0, ThisObjectname.IndexOf("_"))
ThisObjectName = Path.GetFileName(PNG_file)
ThisObjectName = ThisObjectName.Substring(0, ThisObjectName.IndexOf("_"))

AnimationName = Path.GetFileName(PNG_file)
AnimationName = AnimationName.Substring(AnimationName.IndexOf("_") + 1)
Expand Down Expand Up @@ -257,4 +257,10 @@ Public Class AssetInfo
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
End Sub

'LineEndsWithNumber()
Function LineEndsWithNumber(line As String) As Boolean
' Use IsNumeric to check if the last character is a number
Return IsNumeric(line.LastOrDefault())
End Function
End Class
11 changes: 11 additions & 0 deletions GDev Asset Store Tool/FileNameValidator.vb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ Public Class FileNameValidator
'Console.WriteLine("PNG_file: " + PNG_file)
If Not RegexValidWords.IsMatch(PNG_FileNameNoExt) Or RegexInvalidWords.IsMatch(PNG_FileNameNoExt) Or CountCharacter(PNG_FileNameNoExt, CChar("_")) > 2 Or PNG_FileFull.ToLower.EndsWith(".png.png") Or Not Char.IsLetter(PNG_FileNameNoExt.First) And Not PNG_FileNameNoExt.ToLower.StartsWith("9patch_") Then
TempListOfFiles.Add(PNG_FileFull)


ElseIf CountCharacter(PNG_FileFull, CChar("_")) = 2 And Not PNG_FileNameNoExt.ToLower.StartsWith("9patch_") And Not LineEndsWithNumber(PNG_FileNameNoExt) Then
TempListOfFiles.Add("Animation does not end with a frame number. | " + PNG_FileFull)


ElseIf CountCharacter(PNG_FileFull, CChar("_")) = 1 Then
Dim AllAnimationFiles As New List(Of String)()
AllAnimationFiles.AddRange(Directory.GetFiles(Path.GetDirectoryName(PNG_file), "*.png", SearchOption.TopDirectoryOnly).Where(Function(x) Path.GetFileName(x).StartsWith(PNG_FileNameNoExt + "_"))) 'Check if there are any files starting with sprite name _
Expand Down Expand Up @@ -311,6 +317,11 @@ Public Class FileNameValidator
End Using
End Function

'LineEndsWithNumber()
Function LineEndsWithNumber(line As String) As Boolean
' Use IsNumeric to check if the last character is a number
Return IsNumeric(line.LastOrDefault())
End Function
'
'Window Handle Code
'
Expand Down
1 change: 1 addition & 0 deletions GDev Asset Store Tool/MetadataGenerator.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions GDev Asset Store Tool/MetadataGenerator.resx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@
<metadata name="ImageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>853, 17</value>
</metadata>
<metadata name="ToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>432, 56</value>
</metadata>
<metadata name="ContextMenuStrip_FastColoredTextBox_Selected_File.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>400, 17</value>
</metadata>
Expand Down
15 changes: 11 additions & 4 deletions GDev Asset Store Tool/MetadataGenerator.vb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Public Class MetadataGenerator
tBF_Str = tBF_Str.TrimEnd(CChar("."))
TextBox_TimeBetweenFrames.Text = tBF_Str


Label_MetadataFileToGen.Text = "" ' Clear the metadata file label

' Check if the "Looped Animation Keywords.txt" file exists
Expand Down Expand Up @@ -119,10 +118,10 @@ Public Class MetadataGenerator
End If
End Sub

' NumericUpDown_FPS - ValueChanged
Private Sub NumericUpDown_FPS_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown_FPS.ValueChanged
'NumericUpDown_FPS - TextChanged
Private Sub NumericUpDown_FPS_TextChanged(sender As Object, e As EventArgs) Handles NumericUpDown_FPS.TextChanged
' Check if the NumericUpDown control has focus to avoid recursive triggering
If NumericUpDown_FPS.Focused Then
If NumericUpDown_FPS.Focused And NumericUpDown_FPS.Value > -1 Then
' Calculate the time between frames based on the new FPS value
NumericUpDown_TimeBetweenFrames.Value = 1 / NumericUpDown_FPS.Value

Expand All @@ -139,6 +138,14 @@ Public Class MetadataGenerator
End If
End Sub

'NumericUpDown_FPS - KeyDown
Private Sub NumericUpDown_FPS_KeyDown(sender As Object, e As KeyEventArgs) Handles NumericUpDown_FPS.KeyDown
If e.KeyData = Keys.Enter Then
e.Handled = True
e.SuppressKeyPress = True
End If
End Sub

' Button_Replay - Click
Private Sub Button_Replay_Click(sender As Object, e As EventArgs) Handles Button_Replay.Click
' Reset the AnimationLoopCounter to -1 to restart the animation from the beginning
Expand Down
2 changes: 1 addition & 1 deletion GDev Asset Store Tool/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ Imports System.Runtime.InteropServices
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("1.0.0.0")>
<Assembly: AssemblyFileVersion("1.4.1.0")>
<Assembly: AssemblyFileVersion("1.5.0.0")>
<Assembly: NeutralResourcesLanguage("")>
137 changes: 69 additions & 68 deletions GDev Asset Store Tool/PackageMaker.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a7e12c4

Please sign in to comment.