-
Notifications
You must be signed in to change notification settings - Fork 0
/
ButtonHandlers.t
77 lines (54 loc) · 1.62 KB
/
ButtonHandlers.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
% Button File - code to handle button events
% Intro Window Procedures
%Displays Instructions
procedure QuitInstructionsWindowButtonPressed
fork click
isInstructionsWindowOpen := false
GUI.Quit
delay (100)
GUI.ResetQuit
delay (100)
end QuitInstructionsWindowButtonPressed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure QuitOthelloWindowButtonPressed
fork click
GUI.CloseWindow (wininID)
end QuitOthelloWindowButtonPressed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure playagainbuttonpressed
fork click
GUI.CloseWindow (winoutID)
fork introMusic
Window.Show (wininID)
Window.SetActive (wininID)
end playagainbuttonpressed
procedure quitgame
fork click
GUI.CloseWindow (winoutID)
GUI.CloseWindow (wininID)
Music.PlayFileStop
end quitgame
procedure QuitIntroWindowButtonPressed
fork click
GUI.CloseWindow (wininID)
Music.PlayFileStop
end QuitIntroWindowButtonPressed
procedure displaySoundButtonPressed
fork click
toggleMusicOff
end displaySoundButtonPressed
procedure changeNames
% Open the window
winnameID := Window.Open ("position:top;center,graphics:400;400,title:Change Player Name")
%program to show a logo picture
var pic : int := Pic.FileNew ("files/images/introscreenbackground.jpg")
Pic.Draw (pic, 0, 0, 0)
var p1, p2 : string := ""
put "Enter name for Player 1 (black)"
get p1
PlayerOneName := p1
put "Enter name for Player 2 (white)"
get p2
PlayerTwoName := p2
Window.Close (winnameID)
end changeNames