Glider4/Glider_405/Sources/G-IdleInput.p

1 line
12 KiB
OpenEdge ABL
Raw Normal View History

unit IdleInput; interface uses SMS, Balloons, Palettes, Globals, GlobalUtils, FileInNOut, IdleUtils, PlayUtils, PlaySetUp; procedure StartNewGame; function GetGame: Boolean; procedure HandleMenu (theMenu, theItem: integer); procedure DoMouseDown; procedure DoKeyDown; procedure DoDiskEvent; procedure DoOSEvent; {=================================} implementation {=================================} procedure StartNewGame; var i: Integer; tempRect: Rect; firstIs: string[32]; begin if (not smsIsActive) then SMSInit; smsIsActive := TRUE; if (is4Channel) then SMSSetMode(4) else SMSSetMode(2); if (not GetHouse) then Exit(StartNewGame); firstIs := thisHouse.firstFile; if (firstIs <> housesName) and (firstIs <> '') and (firstIs <> 'nil') then begin GenericAlert(kErrNotFirstHouse); housesName := firstIs; if (not OpenHouse) then begin GenericAlert(kErrExitSansHouse); Exit(StartNewGame); end; DoClose(houseVolNum); {$IFC DemoVersion} if (thisHouse.timeStamp <> 16) then begin GenericAlert(kErrNotDemoHouse); Exit(StartNewGame); end; {$ENDC} thisHouse.firstFile := ''; if (not WriteHouse) then ; end; firstFileName := housesName; HideMenuBar; if (screenBits.bounds.bottom > 382) then begin SetPort(GrafPtr(mainWndo)); PenNormal; ClipRect(fullArea); SetRect(tempRect, -rightOffset, -downOffset, 512 + 2 * rightOffset, -downOffset + 20); FillRect(tempRect, black); ClipRect(wholeArea); end; if (inColor) then SetPort(GrafPtr(virginCPtr)) else SetPort(offVirginPort); with scoreList do begin changed := FALSE; rank := 20; end; roomAt := 1; roomsPassed := 1; roomScore := 0; suppScore := 0; rollScore := 0; GetDateTime(workingGameNumber); sideYouCantExit := whoCares; loopsThruRoom := 0; bassLoop := 0; playBassTime := kBonusTimeToBeat div kBassFract + kMinBassLoop; for i := 1 to 40 do roomVisits[i] := FALSE; if (ozmaFlags[3]) then begin mortals := 50; refuseHigh := TRUE; end else begin mortals := 5; refuseHigh := FALSE; end; for i := 0 to 3 do ozmaFlags[i] := FALSE; enteredLeft := TRUE; with theGlider do begin isRight := TRUE; bands := 0; forVel := 4; energy := 0; end; ResetGlider; playing := TRUE; pausing := FALSE; hasMirror := FALSE; hasWindow := FALSE; hasToast := FALSE; scoreIsRolling := FALSE; floatPoints.out := FALSE; ReadyRoom; gameName := ''; DisableItem(GetMenu(mGame), iLoadHouse); EnableItem(GetMenu(mGame), iEndGame); DisableItem(GetMenu(mGame), iLoadGame); {$IFC not DemoVersion} EnableItem(GetMenu(mGame), iSaveGame); EnableItem(GetMenu(mGame), iSaveGameAs); {$ENDC} DisableItem(GetMenu(mOption), iHiScores); SetPort(GrafPtr(mainWndo)); PenNormal; TextFont(0); TextSize(12); TextMode(patOr); if (inColor) then SetPort(GrafPtr(virginCPtr)) else SetPort(offVirginPort); SetCursor(noCursor^^); DissBlocks; FlushEvents(everyEvent, 0); end; {=================================} procedure DoLoadHouse; var killed: Boolean; begin {$IFC not DemoVersion} if DoOpen(kHouseType) then begin demoMode := Randomize(lastDemo) + 1; HideMenuBar; StartNewGame; end; {$ENDC} end; {=================================} procedure DoEndGame; begin SetItem(GetMenu(mGame), iBegin, 'Begin Game<6D>'); WrapItUp; DrawMenuBar; end; {=================================} function GetGame; var tempRect: Rect; begin GetGame := FALSE; if (not ReadGame) then Exit(GetGame); if (not smsIsActive) then SMSInit; smsIsActive := TRUE; if (is4Channel) then SMSSetMode(4) else SMSSetMode(2); demoMode := Randomize(lastDemo) + 1; HideMenuBar; if (screenBits.bounds.bottom > 382) then begin SetPort(GrafPtr(mainWndo)); PenNormal; ClipRect(fullArea); SetRect(tempRect, -rightOffset, -downOffset, 512 + 2 * rightOffset, -downOffset + 20); FillRect(tempRect, black); ClipRect(wholeArea); end; if (inColo