- Timestamp:
- Aug 11, 2024, 9:39:45 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Start.pas
r589 r596 122 122 MiniMap: TMiniMap; 123 123 LastGame: string; 124 LastMap: string; 124 125 procedure DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string); 125 126 procedure InitPopup(PlayerIndex: Integer); … … 403 404 if ValueExists('LastGame') then LastGame := Reg.ReadString('LastGame') 404 405 else LastGame := ''; 406 if ValueExists('LastMap') then LastMap := Reg.ReadString('LastMap') 407 else LastMap := ''; 405 408 if ValueExists('NetworkEnabled') then NetworkEnabled := Reg.ReadBool('NetworkEnabled') 406 409 else NetworkEnabled := False; … … 463 466 WriteInteger('StartTab', Integer(ShowTab)); 464 467 WriteString('LastGame', LastGame); 468 WriteString('LastMap', LastMap); 465 469 WriteBool('NetworkEnabled', NetworkEnabled); 466 470 finally … … 1307 1311 procedure TStartDlg.UpdateMaps; 1308 1312 var 1313 I: Integer; 1309 1314 F: TSearchRec; 1310 1315 begin … … 1317 1322 Maps.Sort; 1318 1323 Maps.Insert(0, Phrases.Lookup('RANMAP')); 1319 ListIndex[tbMain] := Maps.IndexOf(ExtractFileNameOnly(MapFileName)); 1324 I := Maps.IndexOf(LastMap); 1325 if I > 0 then begin // Skip random map on index 0 1326 ListIndex[tbMap] := I; 1327 MapFileName := GetMapsDir + DirectorySeparator + Maps[I] + CevoMapExt; 1328 end else ListIndex[tbMap] := Maps.IndexOf(ExtractFileNameOnly(MapFileName)); 1329 if ListIndex[tbMap] < 0 then 1330 ListIndex[tbMap] := 0; 1331 ListIndex[tbMain] := ListIndex[tbMap]; 1320 1332 if ListIndex[tbMain] < 0 then 1321 1333 ListIndex[tbMain] := 0; … … 1801 1813 LastGame := FormerGames[ListIndex[tbPrevious]] 1802 1814 else LastGame := ''; 1815 if (ListIndex[tbMap] >= 0) and (ListIndex[tbMap] < Maps.Count) then 1816 LastMap := Maps[ListIndex[tbMap]] 1817 else LastMap := ''; 1803 1818 end; 1804 1819
Note:
See TracChangeset
for help on using the changeset viewer.