Rev 12 | Rev 18 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 12 | Rev 14 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, |
18 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, |
19 | Dialogs, StdCtrls, Spin, Grids, GameBinStruct, ComCtrls, ExtCtrls, MPlayer, |
19 | Dialogs, StdCtrls, Spin, Grids, GameBinStruct, ComCtrls, ExtCtrls, MPlayer, |
20 | Menus; |
20 | Menus; |
21 | 21 | ||
22 | const |
22 | const |
23 | CUR_VER = '2017-10-04'; |
23 | CUR_VER = '2017-10-08'; |
24 | 24 | ||
25 | type |
25 | type |
26 | TForm1 = class(TForm) |
26 | TForm1 = class(TForm) |
27 | ListBox1: TListBox; |
27 | ListBox1: TListBox; |
28 | Button1: TButton; |
28 | Button1: TButton; |
Line 1052... | Line 1052... | ||
1052 | var |
1052 | var |
1053 | fileName: string; |
1053 | fileName: string; |
1054 | begin |
1054 | begin |
1055 | if ListBox3.ItemIndex = -1 then exit; |
1055 | if ListBox3.ItemIndex = -1 then exit; |
1056 | fileName := IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + ListBox3.Items[ListBox3.ItemIndex]; |
1056 | fileName := IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + ListBox3.Items[ListBox3.ItemIndex]; |
- | 1057 | ||
1057 | Image3.Visible := FileExists(FileName); |
1058 | if not FileExists(FileName) then |
- | 1059 | begin |
|
1058 | if not FileExists(FileName) then exit; |
1060 | Image3.Visible := false; |
- | 1061 | exit; |
|
- | 1062 | end; |
|
- | 1063 | ||
- | 1064 | try |
|
1059 | Image3.Picture.LoadFromFile(Filename); |
1065 | Image3.Picture.LoadFromFile(Filename); |
1060 | AspectRatio(Image3, Panel3); |
1066 | AspectRatio(Image3, Panel3); |
- | 1067 | Image3.Visible := true; |
|
- | 1068 | except |
|
- | 1069 | Image3.Visible := false; |
|
- | 1070 | // It could also be a sound file, so we do not show errors |
|
- | 1071 | end; |
|
1061 | end; |
1072 | end; |
1062 | 1073 | ||
1063 | procedure TForm1.ListBox3DblClick(Sender: TObject); |
1074 | procedure TForm1.ListBox3DblClick(Sender: TObject); |
1064 | var |
1075 | var |
1065 | fileName: string; |
1076 | fileName: string; |
Line 1166... | Line 1177... | ||
1166 | procedure TForm1.RecalcUnusedFiles; |
1177 | procedure TForm1.RecalcUnusedFiles; |
1167 | var |
1178 | var |
1168 | i, idx: integer; |
1179 | i, idx: integer; |
1169 | SR: TSearchRec; |
1180 | SR: TSearchRec; |
1170 | ext: string; |
1181 | ext: string; |
- | 1182 | sl: TStringList; |
|
- | 1183 | s: string; |
|
1171 | begin |
1184 | begin |
1172 | ListBox3.Items.BeginUpdate; |
1185 | sl := TStringList.Create; |
1173 | try |
1186 | try |
1174 | ListBox3.Clear; |
- | |
1175 | - | ||
1176 | Image3.Visible := false; |
- | |
1177 | - | ||
1178 | if FindFirst(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + '*.*', faArchive, SR) = 0 then |
1187 | if FindFirst(IncludeTrailingPathDelimiter(CurScene^.szSceneFolder) + '*.*', faArchive, SR) = 0 then |
1179 | begin |
1188 | begin |
1180 | repeat |
1189 | repeat |
1181 | ext := UpperCase(ExtractFileExt(SR.Name)); |
1190 | ext := UpperCase(ExtractFileExt(SR.Name)); |
1182 | if ((ext <> '.PK' {Adobe Audition}) and (ext <> '.DB' {Windows Thumbnail})) then |
1191 | if ((ext <> '.PK' {Adobe Audition}) and (ext <> '.DB' {Windows Thumbnail})) then |
1183 | begin |
1192 | begin |
1184 | ListBox3.Items.Add(SR.Name); //Fill the list |
1193 | sl.Add(SR.Name); //Fill the list |
1185 | end; |
1194 | end; |
1186 | until FindNext(SR) <> 0; |
1195 | until FindNext(SR) <> 0; |
1187 | FindClose(SR); |
1196 | FindClose(SR); |
1188 | end; |
1197 | end; |
1189 | 1198 | ||
1190 | // Remove the entries which are present |
1199 | // Remove the entries which are present |
1191 | for i := CurScene^.pictureIndex to CurScene^.pictureIndex+CurScene^.numPics-1 do |
1200 | for i := CurScene^.pictureIndex to CurScene^.pictureIndex+CurScene^.numPics-1 do |
1192 | begin |
1201 | begin |
1193 | idx := ListBox3.Items.IndexOf(Game.pictures[i].szBitmapFile); |
1202 | idx := sl.IndexOf(Game.pictures[i].szBitmapFile); |
1194 | if idx <> -1 then ListBox3.Items.Delete(idx); |
1203 | if idx <> -1 then sl.Delete(idx); |
1195 | end; |
1204 | end; |
1196 | 1205 | ||
1197 | idx := ListBox3.Items.IndexOf(Edit1.Text); |
1206 | idx := sl.IndexOf(Edit1.Text); |
1198 | if idx <> -1 then ListBox3.Items.Delete(idx); |
1207 | if idx <> -1 then sl.Delete(idx); |
1199 | idx := ListBox3.Items.IndexOf('E'+Edit1.Text); |
1208 | idx := sl.IndexOf('E'+Edit1.Text); |
1200 | if idx <> -1 then ListBox3.Items.Delete(idx); |
1209 | if idx <> -1 then sl.Delete(idx); |
1201 | 1210 | ||
1202 | idx := ListBox3.Items.IndexOf(Edit2.Text); |
1211 | idx := sl.IndexOf(Edit2.Text); |
1203 | if idx <> -1 then ListBox3.Items.Delete(idx); |
1212 | if idx <> -1 then sl.Delete(idx); |
1204 | 1213 | ||
1205 | idx := ListBox3.Items.IndexOf(Edit3.Text); |
1214 | idx := sl.IndexOf(Edit3.Text); |
1206 | if idx <> -1 then ListBox3.Items.Delete(idx); |
1215 | if idx <> -1 then sl.Delete(idx); |
- | 1216 | ||
- | 1217 | if sl.Text <> ListBox3.Items.Text then |
|
- | 1218 | begin |
|
- | 1219 | i := ListBox3.ItemIndex; |
|
- | 1220 | if i >= 0 then |
|
- | 1221 | s := ListBox3.Items.Strings[i] |
|
- | 1222 | else |
|
- | 1223 | s := ''; |
|
- | 1224 | ListBox3.Items.Assign(sl); |
|
- | 1225 | i := ListBox3.Items.IndexOf(s); |
|
- | 1226 | if i >= 0 then |
|
- | 1227 | ListBox3.ItemIndex := i |
|
- | 1228 | else |
|
- | 1229 | Image3.Visible := false; |
|
- | 1230 | end; |
|
1207 | finally |
1231 | finally |
1208 | ListBox3.Items.EndUpdate; |
1232 | sl.Free; |
1209 | end; |
1233 | end; |
1210 | end; |
1234 | end; |
1211 | 1235 | ||
1212 | procedure TForm1.RecalcSoundtrackLength; |
1236 | procedure TForm1.RecalcSoundtrackLength; |
1213 | var |
1237 | var |