Rev 2 | Rev 19 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 12 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | CurDecisionScene, LastDecisionScene: PSceneDef; |
39 | CurDecisionScene, LastDecisionScene: PSceneDef; |
40 | procedure TryExit; |
40 | procedure TryExit; |
41 | procedure PrevDecisionScene; |
41 | procedure PrevDecisionScene; |
42 | protected |
42 | protected |
43 | GameData: TGameBinFile; |
43 | GameData: TGameBinFile; |
44 | function FindScene(ASceneID: integer): PSceneDef; |
- | |
45 | procedure Wait(AMilliseconds: integer); |
44 | procedure Wait(AMilliseconds: integer); |
46 | procedure PlayScene(scene: PSceneDef; goToDecision: boolean); |
45 | procedure PlayScene(scene: PSceneDef; goToDecision: boolean); |
47 | public |
46 | public |
48 | procedure PerformAction(action: PActionDef); |
47 | procedure PerformAction(action: PActionDef); |
49 | property PictureShowCallback: TShowPictureCallback read FPictureShowCallback write FPictureShowCallback; |
48 | property PictureShowCallback: TShowPictureCallback read FPictureShowCallback write FPictureShowCallback; |
Line 81... | Line 80... | ||
81 | finally |
80 | finally |
82 | FreeAndNil(fs); |
81 | FreeAndNil(fs); |
83 | end; |
82 | end; |
84 | end; |
83 | end; |
85 | 84 | ||
86 | function TGame.FindScene(ASceneID: integer): PSceneDef; |
- | |
87 | var |
- | |
88 | i: integer; |
- | |
89 | begin |
- | |
90 | for i := 0 to GameData.numScenes - 1 do |
- | |
91 | begin |
- | |
92 | if GameData.scenes[i].szSceneFolder = Format('SC%.2d', [ASceneID]) then |
- | |
93 | begin |
- | |
94 | result := @GameData.scenes[i]; |
- | |
95 | exit; |
- | |
96 | end; |
- | |
97 | end; |
- | |
98 | result := nil; |
- | |
99 | end; |
- | |
100 | - | ||
101 | procedure TGame.TryExit; |
85 | procedure TGame.TryExit; |
102 | begin |
86 | begin |
103 | if Assigned(ExitCallback) then ExitCallback(Self); |
87 | if Assigned(ExitCallback) then ExitCallback(Self); |
104 | end; |
88 | end; |
105 | 89 | ||
Line 117... | Line 101... | ||
117 | PrevDecisionScene |
101 | PrevDecisionScene |
118 | else if action^.nextSceneID = SCENEID_ENDGAME then |
102 | else if action^.nextSceneID = SCENEID_ENDGAME then |
119 | TryExit |
103 | TryExit |
120 | else |
104 | else |
121 | begin |
105 | begin |
122 | nextScene := FindScene(action^.nextSceneID); |
106 | nextScene := GameData.FindScene(action^.nextSceneID); |
123 | if Assigned(nextScene) then |
107 | if Assigned(nextScene) then |
124 | PlayScene(nextScene, action^.sceneSegment=1) |
108 | PlayScene(nextScene, action^.sceneSegment=SEGMENT_DECISION) |
125 | (* |
109 | (* |
126 | else |
110 | else |
127 | raise Exception.CreateFmt('Scene %d was not found in GAME.BIN', [action^.nextSceneID]); |
111 | raise Exception.CreateFmt('Scene %d was not found in GAME.BIN', [action^.nextSceneID]); |
128 | *) |
112 | *) |
129 | end; |
113 | end; |