- aggiunta icona programma
- aggiunte a lua funzioni che accedono direttamente ad ini programma e funzione file exists
This commit is contained in:
@@ -25,12 +25,16 @@ Public Module Lua_General
|
||||
Friend func_EntIs64bit As LuaFunction = AddressOf Lua_EntIs64bit
|
||||
Friend func_EntOutLog As LuaFunction = AddressOf Lua_EntOutLog
|
||||
Friend func_EntExistsDirectory As LuaFunction = AddressOf Lua_EntExistsDirectory
|
||||
Friend func_EntFileExists As LuaFunction = AddressOf Lua_EntFileExists
|
||||
Friend func_EntCopyFile As LuaFunction = AddressOf Lua_EntCopyFile
|
||||
Friend func_EntGetIniFile As LuaFunction = AddressOf Lua_EntGetIniFile
|
||||
Friend func_EntGetDataDir As LuaFunction = AddressOf Lua_EntGetDataDir
|
||||
Friend func_EntGetNumberFromIni As LuaFunction = AddressOf Lua_EntGetNumberFromIni
|
||||
Friend func_EntGetStringFromIni As LuaFunction = AddressOf Lua_EntGetStringFromIni
|
||||
Friend func_EntWriteStringToIni As LuaFunction = AddressOf Lua_EntWriteStringToIni
|
||||
Friend func_EntGetMainNumberFromIni As LuaFunction = AddressOf Lua_EntGetMainNumberFromIni
|
||||
Friend func_EntGetMainStringFromIni As LuaFunction = AddressOf Lua_EntGetMainStringFromIni
|
||||
Friend func_EntWriteMainStringToIni As LuaFunction = AddressOf Lua_EntWriteMainStringToIni
|
||||
Friend func_EntSplitString As LuaFunction = AddressOf Lua_EntSplitString
|
||||
Friend func_EntSleep As LuaFunction = AddressOf Lua_EntSleep
|
||||
Friend func_EntDeleteFile As LuaFunction = AddressOf Lua_EntDeleteFile
|
||||
@@ -86,6 +90,25 @@ Public Module Lua_General
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
Private Function Lua_EntFileExists(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
' 1 parametro : sDir
|
||||
Dim sFilePath As String = ""
|
||||
LuaCheckParam(state, 1, sFilePath)
|
||||
LuaClearStack(state)
|
||||
Dim bResult As Boolean
|
||||
Try
|
||||
' verifico esistenza direttorio
|
||||
bResult = File.Exists(sFilePath)
|
||||
Catch ex As Exception
|
||||
bResult = False
|
||||
EgtOutLog("Lua_EntExistsDirectory on " & sFilePath & " failed! " & ex.Message)
|
||||
End Try
|
||||
' restituisco il risultato
|
||||
LuaSetParam(state, bResult)
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
Private Function Lua_EntCopyFile(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
' 2 parametri : sFile, sNewFile
|
||||
@@ -197,6 +220,55 @@ Public Module Lua_General
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
Private Function Lua_EntGetMainNumberFromIni(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
' 4 parametri: sSec, sKey, dDef, sIniFile
|
||||
Dim sSec As String = ""
|
||||
Dim sKey As String = ""
|
||||
Dim dDef As Integer = 0
|
||||
LuaCheckParam(state, 1, sSec)
|
||||
LuaCheckParam(state, 2, sKey)
|
||||
LuaCheckParam(state, 3, dDef)
|
||||
LuaClearStack(state)
|
||||
Dim dResult As Double = GetMainPrivateProfileDouble(sSec, sKey, dDef)
|
||||
' restituisco il risultato
|
||||
LuaSetParam(state, dResult)
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
Private Function Lua_EntGetMainStringFromIni(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
' 4 parametri: sSec, sKey, sDef, sIniFile
|
||||
Dim sSec As String = ""
|
||||
Dim sKey As String = ""
|
||||
Dim sDef As String = 0
|
||||
LuaCheckParam(state, 1, sSec)
|
||||
LuaCheckParam(state, 2, sKey)
|
||||
LuaCheckParam(state, 3, sDef)
|
||||
LuaClearStack(state)
|
||||
Dim sResult As String = ""
|
||||
GetMainPrivateProfileString(sSec, sKey, sDef, sResult)
|
||||
' restituisco il risultato
|
||||
LuaSetParam(state, sResult)
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
Private Function Lua_EntWriteMainStringToIni(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
' 4 parametri: sSec, sKey, sVal, sIniFile
|
||||
Dim sSec As String = ""
|
||||
Dim sKey As String = ""
|
||||
Dim sVal As Integer = 0
|
||||
LuaCheckParam(state, 1, sSec)
|
||||
LuaCheckParam(state, 2, sKey)
|
||||
LuaCheckParam(state, 3, sVal)
|
||||
LuaClearStack(state)
|
||||
Dim bResult As Boolean = WriteMainPrivateProfileString(sSec, sKey, sVal)
|
||||
' restituisco il risultato
|
||||
LuaSetParam(state, bResult)
|
||||
Return 1
|
||||
End Function
|
||||
|
||||
Private Function Lua_EntSplitString(ByVal p As IntPtr) As Integer
|
||||
Dim state = Lua.FromIntPtr(p)
|
||||
' 4 parametri: sSec, sKey, sVal, sIniFile
|
||||
@@ -433,12 +505,16 @@ Public Module Lua_General
|
||||
state.Register("EntIs64bit", func_EntIs64bit)
|
||||
state.Register("EntOutLog", func_EntOutLog)
|
||||
state.Register("EntExistsDirectory", func_EntExistsDirectory)
|
||||
state.Register("EntFileExists", func_EntFileExists)
|
||||
state.Register("EntCopyFile", func_EntCopyFile)
|
||||
state.Register("EntGetIniFile", func_EntGetIniFile)
|
||||
state.Register("EntGetDataDir", func_EntGetDataDir)
|
||||
state.Register("EntGetNumberFromIni", func_EntGetNumberFromIni)
|
||||
state.Register("EntGetStringFromIni", func_EntGetStringFromIni)
|
||||
state.Register("EntWriteStringToIni", func_EntWriteStringToIni)
|
||||
state.Register("EntGetMainNumberFromIni", func_EntGetMainNumberFromIni)
|
||||
state.Register("EntGetMainStringFromIni", func_EntGetMainStringFromIni)
|
||||
state.Register("EntWriteMainStringToIni", func_EntWriteMainStringToIni)
|
||||
state.Register("EntSplitString", func_EntSplitString)
|
||||
state.Register("EntSleep", func_EntSleep)
|
||||
state.Register("EntFileLength", func_EntFileLength)
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Grid.Column="0"
|
||||
Width="22"
|
||||
Height="22"
|
||||
Margin="4"
|
||||
Source="/Resources/Icon.png" />
|
||||
Width="32"
|
||||
Height="32"
|
||||
Source="/Resources/Effector.ico" />
|
||||
<ContentControl Grid.Column="1"
|
||||
Content="{Binding ContentMenu}"/>
|
||||
<TextBlock Grid.Column="2"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
@@ -262,6 +262,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Icon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Effector.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<Import Project="..\packages\KeraLua.1.4.1\build\net46\KeraLua.targets" Condition="Exists('..\packages\KeraLua.1.4.1\build\net46\KeraLua.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
||||
Reference in New Issue
Block a user