HLVSPL/help.CB

77 lines
1.9 KiB
Text
Raw Normal View History

2022-07-23 10:58:34 +03:00
Function help()
//N<>ytet<65><74>n vihun kuva
ShowObject hlpvihu, ON
ClearText
Locate mainmargin, 3
//Ladataan tiedoston sis<69>lt<6C>
file = OpenToRead("Help")
While Not EOF(file)
AddText Str(ReadLine(file))
Wend
CloseFile file
//V<>litt<74>m<EFBFBD>n poistumisen esto
ClearKeys
ClearMouse
Repeat
Nappi_Poista()
//Lis<69>t<EFBFBD><74>n vihuteksti tarvittaessa
If MouseWX() > ObjectX(hlpvihu) - ObjectSizeX(hlpvihu) / 2 - 3 And MouseWY() > ObjectY(hlpvihu) - ObjectSizeY(hlpvihu) / 2 - 3 And MouseWX() < ObjectX(hlpvihu) + ObjectSizeX(hlpvihu) / 2 + 3 And MouseWY() < ObjectY(hlpvihu) + ObjectSizeY(hlpvihu) / 2 + 3 Then
Nappi_Lisaa(MouseX() - TextWidth("Outo sininen otus") / 2 - 40, MouseY() + ImageHeight(hiiri) / 2, TextWidth("Outo sininen otus") + 20, 20, "Outo sininen otus")
EndIf
//Pelinaloitus
Nappi_Lisaa(ScreenWidth() - ScreenWidth() / 3, ScreenHeight() - mainmargin - 45, ScreenWidth() / 3 - mainmargin, 20, "Aloita Peli")
Nappi_Lisaa(ScreenWidth() - ScreenWidth() / 3, ScreenHeight() - mainmargin - 20, ScreenWidth() / 3 - mainmargin, 20, "Takaisin")
Nappi_Piirra()
//Tarkistetaan n<>pp<70>imist<73>
If KeyHit(cbkeyreturn) Then
PlaySound btthit
ClearText
ClearKeys
ClearMouse
SetFont font
ShowObject hlpvihu, OFF
Return True
ElseIf KeyHit(cbkeybackspace) Then
ClearText
ClearObjects
PlaySound btthit
loadbasicres()
Return False
EndIf
//Tarkistetaan nappulat
Select Nappi_Paivita()
Case "Aloita Peli"
PlaySound btthit
ClearText
ClearKeys
ClearMouse
SetFont font
ShowObject hlpvihu, OFF
Return True
Case "Takaisin"
ClearText
ClearObjects
PlaySound btthit
loadbasicres()
Return False
EndSelect
DrawScreen
Forever
//Poistutaan
PlaySound btthit
ClearText
ClearKeys
ClearMouse
SetFont font
ShowObject hlpvihu, OFF
EndFunction