diff options
| author | pfg github <[email protected]> | 2015-03-08 09:18:40 -0700 |
|---|---|---|
| committer | pfg github <[email protected]> | 2015-03-08 09:18:40 -0700 |
| commit | a3db778746af40eb9f9ec2cccfb3c935164600f5 (patch) | |
| tree | 6fd5220c1283aeb448d4b67c8c122f78d2a7a8dc /ShiftOS/NewAPI.vb | |
| parent | bfd7c782b02bce11bb07cc228e5d0775ad0d98d5 (diff) | |
| download | shiftos-a3db778746af40eb9f9ec2cccfb3c935164600f5.tar.gz shiftos-a3db778746af40eb9f9ec2cccfb3c935164600f5.tar.bz2 shiftos-a3db778746af40eb9f9ec2cccfb3c935164600f5.zip | |
Full Source
Diffstat (limited to 'ShiftOS/NewAPI.vb')
| -rw-r--r-- | ShiftOS/NewAPI.vb | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/ShiftOS/NewAPI.vb b/ShiftOS/NewAPI.vb new file mode 100644 index 0000000..0ff7e43 --- /dev/null +++ b/ShiftOS/NewAPI.vb @@ -0,0 +1,79 @@ +Module NewAPI + Private Command As String + Private NewModForm As New ModForm + + Public Sub UseCode(ByVal Path As String) + Dim sr As System.IO.StreamReader + + sr = My.Computer.FileSystem.OpenTextFileReader(Path) + Dim linenum As Integer = IO.File.ReadAllLines(Path).Length + Dim i As Integer = 1 + While i <= linenum + Command = sr.ReadLine() + DoCommandAPI() + i = i + 1 + End While + sr.Close() + End Sub + + Private Sub DoCommandAPI() + If Command Like "infobox = *" Then + Try + Dim Message As String = Command.Substring(10) + infobox.showinfo("Message from a ShiftOS Mod Files", Message) + Catch ex As Exception + infobox.showinfo("Critical Modification Application Error", "A critical error occured whilst trying to add to your codepoint value - please contact the developer of your mod") + End Try + ElseIf Command Like "codepoints.add = *" Then + Try + Dim CodePointsToAdd As Integer = Command.Substring(17) + ShiftOSDesktop.codepoints = ShiftOSDesktop.codepoints + CodePointsToAdd + Catch ex As Exception + infobox.showinfo("Critical Modification Application Error", "A critical error occured whilst trying to add to your codepoint value - please contact the developer of your mod") + End Try + ElseIf Command Like "bitnotes.add = *" Then + Try + Dim BitNotesToAdd As Integer = Command.Substring(15) + ShiftOSDesktop.bitnotebalance = ShiftOSDesktop.bitnotebalance + BitNotesToAdd + Catch ex As Exception + infobox.showinfo("Critical Modification Application Error", "A critical error occured whilst trying to add to your codepoint value - please contact the developer of your mod") + End Try + ElseIf Command Like "window.create" Then + Try + NewModForm.Show() + Catch ex As Exception + infobox.showinfo("Critical Modification Application Error", "A critical error occured whilst trying to add to your codepoint value - please contact the developer of your mod") + End Try + ElseIf Command Like "label.create = *" Then + Try + NewModForm.CreateLabel(Command.Substring(15)) + Catch ex As Exception + infobox.showinfo("Critical Modification Application Error", "A critical error occured whilst trying to add to your codepoint value - please contact the developer of your mod") + End Try + ElseIf Command Like "label.select = *" Then + Try + NewModForm.SelectLabel(Command.Substring(15)) + Catch ex As Exception + infobox.showinfo("Critical Modification Application Error", "A critical error occured whilst trying to add to your codepoint value - please contact the developer of your mod") + End Try + ElseIf Command Like "SelectedLabel.Location.X = *" Then + Try + NewModForm.MoveSelectedLabelLocationX(Command.Substring(27)) + Catch ex As Exception + infobox.showinfo("Critical Modification Application Error", "A critical error occured whilst trying to add to your codepoint value - please contact the developer of your mod") + End Try + ElseIf Command Like "SelectedLabel.Location.Y = *" Then + Try + NewModForm.MoveSelectedLabelLocationY(Command.Substring(27)) + Catch ex As Exception + infobox.showinfo("Critical Modification Application Error", "A critical error occured whilst trying to add to your codepoint value - please contact the developer of your mod") + End Try + ElseIf Command Like "SelectedLabel.Text = *" Then + Try + NewModForm.SelectedLabelText(Command.Substring(21)) + Catch ex As Exception + infobox.showinfo("Critical Modification Application Error", "A critical error occured whilst trying to add to your codepoint value - please contact the developer of your mod") + End Try + End If + End Sub +End Module |
