;;; Bombs Settings;;; Created by ARV;; started 01-06-1994; BLITZ2 Version : 01-06-1994; last modified 04-01-1995; =======================================; ======================================= TheSettings{ *bombptr.gameVars, *biptr.OSInput} theArrow.selectarrowtype(); Opens a screen and window for selecting game options.TheSettings *bombptr; Initialize  i.b=0  9 i 2=0 theArrow(i)\xpos = 190 " theArrow(i)\xpos = 244  theArrow(i)\ypos = 50+20*((i)/2) theArrow(i)\state = 0  i  2, 2, "BOMBS GAME SETTINGS"  $8| $200  2, 0, 10, 320, -10, $8| $1000, "SETTINGS", 0, 1  1 7  3  150,20:݁ "min max"  10,40:݁ "Width of grid :"  10,60:݁ "Height of grid :"  10,80:݁ "Display-width :"  10,100:݁ "Display-height :"  10,120:݁ "Percent bombs :"  1  i=0  9 theArrow(i) i 2=0 > 22, \xpos,\ypos " > 27, \xpos,\ypos   i; Now follows a simple event loop *biptr\ev = 0 keep.b=  DrawArrows.SettingsEvents GetUserInput{ *biptr}  *biptr\ev  $8 ; Left Mouse Button  *biptr\code  $68 ; LMB Down  HandleArrows  $E8 ; LMB Up  SettingsEvents  $69 ; RMB Down; Can implement a jump to either min or max value here; if an arrow was clicked on with the RMB  $E9 ; RMB Up  SettingsEvents    $200 ; Close gadget keep=   SettingsEvents   keep; Get out of here +  2 +  2  .HandleArrows; Reset all arrows to state 0  i=0  9 theArrow(i) \state = 0; Check for an arrow being hit (*biptr\iMouseX>=\xpos) B (*biptr\iMouseX<\xpos+10) (*biptr\iMouseY>=\ypos) B (*biptr\iMouseY<\ypos+10) \state = 1 arrowHit.b = i "<>5  ChangeSettings  DrawArrows 7 4 \state = 0    i .ChangeSettings; Do the useful bit here *bombptr  arrowHit  0 \wide = \wide-1  MinWidth  1 \wide = \wide+1  MaxWidth  2 \high = \high-1  MinHeight  3 \high = \high+1  MaxHeight  4 \displayWide = \displayWide-1  MinDispWidth  5 \displayWide = \displayWide+1  MaxDispWidth  6 \displayHigh = \displayHigh-1  MinDispHeight  7 \displayHigh = \displayHigh+1  MaxDispHeight  8 \percentageBombs = \percentageBombs-1  MinPercent  9 \percentageBombs = \percentageBombs+1  MaxPercent   ; All gosubs below were just to make it easy to write; These can now be called in sequence, top to bottom; No need to call them one at a time (unless you want to get confused).DrawArrows theArrow(arrowHit) \state = 0 \xpos,\ypos, \xpos+9,\ypos+9, 0 arrowHit 2=0 > 22, \xpos,\ypos " > 27, \xpos,\ypos  *bombptr  MinWidth  MaxWidth  MinHeight  MaxHeight  MinDispWidth  MaxDispWidth  MinDispHeight  MaxDispHeight  MinPercent  MaxPercent .MinWidth \wide<#minWide ! \wide = #minWide: arrowHit=0 ! 2  142,40:݁ " "  166,40:݁ #minWide .MaxWidth maxVar.l = #maxSquares/\high maxVar>#maxWide ! maxVar = #maxWide \wide>maxVar ! \wide = maxVar: arrowHit=1 ! 2  262,40:݁ " "  286-(܏(݃(maxVar)))*8,40:݁ maxVar  206,40:݁ " "  230-(܏(݃(\wide)))*8,40: 2:݁ \wide: 1 .MinHeight \high<#minHigh ! \high = #minHigh: arrowHit=2 ! 2  142,60:݁ " "  166,60:݁ #minHigh .MaxHeight maxVar = #maxSquares/\wide maxVar>#maxHigh ! maxVar = #maxHigh \high>maxVar ! \high = maxVar: arrowHit=3 ! 2  262,60:݁ " "  286-(܏(݃(maxVar)))*8,60:݁ maxVar  206,60:݁ " "  230-(܏(݃(\high)))*8,60: 2:݁ \high: 1 .MinDispWidth \displayWide<#minDisplayWide ! \displayWide = #minDisplayWide: arrowHit=4 ! 2  142,80:݁ " "  166,80:݁ #minDisplayWide .MaxDispWidth maxVar = #maxDisplayWide maxVar>\wide ! maxVar = \wide \displayWide>maxVar ! \displayWide = maxVar: arrowHit=5 ! 2  262,80:݁ " "  286-(܏(݃(maxVar)))*8,80:݁ maxVar  206,80:݁ " "  230-(܏(݃(\displayWide)))*8,80: 2:݁ \displayWide: 1 .MinDispHeight \displayHigh<#minDisplayHigh ! \displayHigh = #minDisplayHigh: arrowHit=6 ! 2  142,100:݁ " "  166,100:݁ #minDisplayHigh .MaxDispHeight maxVar = #maxDisplayHigh maxVar>\high ! maxVar = \high \displayHigh> maxVar ! \displayHigh = maxVar: arrowHit=7 ! 2  262,100:݁ " "  286-(܏(݃(maxVar)))*8,100:݁ maxVar  206,100:݁ " "  230-(܏(݃(\displayHigh)))*8,100: 2:݁ \displayHigh: 1 .MinPercent \percentageBombs<#minPercentageBombs ! \percentageBombs = #minPercentageBombs: arrowHit=8 ! 2  142,120:݁ " "  166,120:݁ #minPercentageBombs .MaxPercent maxVar = #maxPercentageBombs \percentageBombs>#maxPercentageBombs ! \percentageBombs = #maxPercentageBombs: arrowHit=9 ! 2  262,120:݁ " "  286-(܏(݃(maxVar)))*8,120:݁ #maxPercentageBombs  206,120:݁ " "  230-(܏(݃(\percentageBombs)))*8,120: 2:݁ \percentageBombs: 1   ;TheSettings; =======================================; =======================================