Public Start As Boolean Public Cil As Boolean Public Cesta Public Aktualni Public Vykresli As Boolean Private Sub Command1_Click() Vykresli = Not Vykresli End Sub Private Sub Form_Load() For q = 1 To 620 I(q).Picture = P(0).Picture I(q).Tag = "A" Next P_Click 1 Cesta = App.Path End Sub Private Sub I_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) 'Start & CÝl If Button = 1 And Aktualni = 19 Then If Start = True Then MsgBox ("Start byl ji× vytvo°en!"): Exit Sub Start = True End If If Button = 2 And I(Index).Tag = "T" Then Start = False If Button = 1 And Aktualni = 18 Then If Cil = True Then MsgBox ("Start byl ji× vytvo°en!"): Exit Sub Cil = True End If If Button = 2 And I(Index).Tag = "S" Then Cil = False '// If Button = 1 Then I(Index).Picture = Akt.Picture: I(Index).Tag = Chr(Aktualni + 65) If Button = 2 Then I(Index).Picture = P(0).Picture: I(Index).Tag = "A" 'Teleport If Button = 1 And Aktualni = 20 Then St: q = InputBox("Zadejte ŔÝslo pole pro cÝl transportu: (1-620)") If q < 1 Or q > 620 Then GoTo St I(Index).Tag = "U" & q End If End Sub Private Sub I_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) Cis.Caption = "LÝslo pole: " & Index & " * " & I(Index).Tag If Vykresli = True Then I_MouseDown Index, 1, Shift, X, Y End Sub Private Sub Nacti_Click() Fil.Path = Cesta Fil.Refresh opn.Visible = True Frame5.Enabled = False Fil.SetFocus End Sub Private Sub P_Click(Index As Integer) Aktualni = Index Akt.Picture = P(Index).Picture End Sub Private Sub Uloz_Click() Ulo.Visible = True Frame5.Enabled = False Jmeno.SelStart = 0: Jmeno.SelLength = Len(Jmeno.Text) Jmeno.SetFocus End Sub Public Sub Ulozit() If Start = False Then MsgBox ("Nebyl vytvo°en start!"): Exit Sub If Cil = False Then MsgBox ("Nebyl vytvo°en cÝl!"): Exit Sub Dim TXT As String Dim Dodatky As String, q As Integer TXT = "": Dodatky = "" For q = 1 To 620 If Len(I(q).Tag) > 1 Then 'Teleport & dalÜÝ Dodatky = Dodatky & q & I(q).Tag + "#" End If TXT = TXT + Left(I(q).Tag, 1) Next If Trim(Dir(Fil.Path + "\" + Fil.FileName)) <> "" Then q = MsgBox("P°ejete si danou mapu p°epsat?", vbQuestion + vbYesNo) If q = vbNo Then Exit Sub End If TXT = TXT & "|" & Dodatky On Error GoTo Chyb Open Cesta + "\" + Jmeno.Text + ".mpk" For Output As #1 Print #1, TXT Close #1 Exit Sub Chyb: MsgBox ("Soubor nelze ulo×it!") End Sub Public Sub NactiMapu(TXT, Dodatky) Dim q As Integer, z As String * 1 For q = 1 To 620 z = Mid(TXT, q, 1) I(q).Picture = P(Asc(z) - 65).Picture I(q).Tag = z Next Dim Mezi As String, o As Integer Dod: If Dodatky = "#" Then GoTo Dod2 For q = 1 To Len(Dodatky) z = Mid(Dodatky, q, 1) If z = "#" Then q1 = Left(Dodatky, q - 1) q2 = Right(Dodatky, Len(Dodatky) - q) For o = 1 To Len(q1) If Mid(q1, o, 1) = "U" Then Mezi = Left(q1, o - 1) q1 = Mid(q1, o + 1) Exit For End If Next I(Val(Mezi)).Tag = "U" & q1 Dodatky = q2 GoTo Dod End If Next Dod2: Start = True Cil = True End Sub Private Sub Ulozmapu_Click() Ulo.Visible = False Frame5.Enabled = True If Jmeno.Text = "" Then MsgBox ("ChybnÚ jmÚno!"): Exit Sub Ulozit End Sub Private Sub Zpet1_Click() opn.Visible = False Frame5.Enabled = True End Sub Private Sub Zpet2_Click() Ulo.Visible = False Frame5.Enabled = True End Sub Private Sub ZvolMapu_Click() Frame5.Enabled = True opn.Visible = False 'On Error GoTo Chy Dim TXT As String, Dodatky As String Open Fil.Path + "\" + Fil.FileName For Input As #1 Input #1, TXT Close #1 Dim q As Integer Dodatky = Right(TXT, Len(TXT) - 621) TXT = Left(TXT, 620) Jmeno.Text = Left(Fil.FileName, Len(Fil.FileName) - 4) NactiMapu TXT, Dodatky Exit Sub Chy: MsgBox ("Soubor nelze otev°Ýt!") End Sub