Changeset 725


Ignore:
Timestamp:
Jan 13, 2026, 4:01:26 PM (102 minutes ago)
Author:
chronos
Message:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Inp.pas

    r622 r725  
    2424    Center: Boolean;
    2525  end;
    26 
    27 var
    28   InputDlg: TInputDlg;
    2926
    3027
  • trunk/Integrated.lpr

    r724 r725  
    3737  Application.CreateForm(TDirectDlg, DirectDlg);
    3838  Application.CreateForm(TStartDlg, StartDlg);
    39   Application.CreateForm(TMessgDlg, MessgDlg);
    40   Application.CreateForm(TInputDlg, InputDlg);
    4139  Application.CreateForm(TBackground, Background);
    4240  Application.CreateForm(TLogDlg, LogDlg);
  • trunk/LocalPlayer/Help.pas

    r715 r725  
    20542054
    20552055procedure THelpDlg.SearchBtnClick(Sender: TObject);
    2056 begin
    2057   InputDlg.Caption := Phrases.Lookup('SEARCH');
    2058   InputDlg.EditInput.Text := SearchContent;
    2059   InputDlg.CenterToRect(BoundsRect);
    2060   InputDlg.ShowModal;
    2061   if (InputDlg.ModalResult = mrOK) and (Length(InputDlg.EditInput.Text) >= 2) then
    2062   begin
    2063     Search(InputDlg.EditInput.Text);
    2064     case SearchResult.Count of
    2065       0: begin
    2066         Gtk2Fix;
    2067         SimpleMessage(Format(HelpText.Lookup('NOMATCHES'),
    2068           [InputDlg.EditInput.Text]));
    2069       end;
    2070       1:
    2071         with THelpLineInfo(SearchResult.Objects[0]) do
    2072           ShowNewContent(FWindowMode, Category, Index);
    2073       else begin
    2074         NewSearchContent := InputDlg.EditInput.Text;
    2075         ShowNewContent(FWindowMode, hkMisc, Integer(miscSearchResult));
     2056var
     2057  InputDlg: TInputDlg;
     2058begin
     2059  InputDlg := TInputDlg.Create(nil);
     2060  try
     2061    InputDlg.Caption := Phrases.Lookup('SEARCH');
     2062    InputDlg.EditInput.Text := SearchContent;
     2063    InputDlg.CenterToRect(BoundsRect);
     2064    InputDlg.ShowModal;
     2065    if (InputDlg.ModalResult = mrOK) and (Length(InputDlg.EditInput.Text) >= 2) then
     2066    begin
     2067      Search(InputDlg.EditInput.Text);
     2068      case SearchResult.Count of
     2069        0: begin
     2070          Gtk2Fix;
     2071          SimpleMessage(Format(HelpText.Lookup('NOMATCHES'),
     2072            [InputDlg.EditInput.Text]));
     2073        end;
     2074        1:
     2075          with THelpLineInfo(SearchResult.Objects[0]) do
     2076            ShowNewContent(FWindowMode, Category, Index);
     2077        else begin
     2078          NewSearchContent := InputDlg.EditInput.Text;
     2079          ShowNewContent(FWindowMode, hkMisc, Integer(miscSearchResult));
     2080        end;
    20762081      end;
    20772082    end;
     2083  finally
     2084    InputDlg.Free;
    20782085  end;
    20792086end;
  • trunk/LocalPlayer/Nego.pas

    r674 r725  
    715715  A, I, Max: Integer;
    716716  Price: Cardinal;
     717  InputDlg: TInputDlg;
    717718begin
    718719  if (Page <> History[Me].N) or (ClientMode = scDipCancelTreaty) or
     
    737738      opMoney:
    738739        begin // choose amount
    739           InputDlg.Caption := Phrases.Lookup('TITLE_AMOUNT');
    740           InputDlg.EditInput.Text := '';
    741           InputDlg.CenterToRect(BoundsRect);
    742           InputDlg.ShowModal;
    743           if InputDlg.ModalResult <> mrOK then
    744             Exit;
    745           Val(InputDlg.EditInput.Text, A, I);
    746           if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then
    747             Exit;
    748           Inc(Price, A);
     740          InputDlg := TInputDlg.Create(nil);
     741          try
     742            InputDlg.Caption := Phrases.Lookup('TITLE_AMOUNT');
     743            InputDlg.EditInput.Text := '';
     744            InputDlg.CenterToRect(BoundsRect);
     745            InputDlg.ShowModal;
     746            if InputDlg.ModalResult <> mrOK then
     747              Exit;
     748            Val(InputDlg.EditInput.Text, A, I);
     749            if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then
     750              Exit;
     751            Inc(Price, A);
     752          finally
     753            InputDlg.Free;
     754          end;
    749755        end;
    750756      opShipParts:
     
    828834  A, I, Max: Integer;
    829835  Price: Cardinal;
     836  InputDlg: TInputDlg;
    830837begin
    831838  if (Page <> History[Me].N) or (ClientMode = scDipCancelTreaty) or
     
    849856      opMoney:
    850857        begin // choose amount
    851           InputDlg.Caption := Phrases.Lookup('TITLE_AMOUNT');
    852           InputDlg.EditInput.Text := '';
    853           InputDlg.CenterToRect(BoundsRect);
    854           InputDlg.ShowModal;
    855           if InputDlg.ModalResult <> mrOK then
    856             Exit;
    857           Val(InputDlg.EditInput.Text, A, I);
    858           if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then
    859             Exit;
    860           if (Price = opMoney) and (A > MyRO.Money) then
    861             A := MyRO.Money;
    862           Inc(Price, A);
     858          InputDlg := TInputDlg.Create(nil);
     859          try
     860            InputDlg.Caption := Phrases.Lookup('TITLE_AMOUNT');
     861            InputDlg.EditInput.Text := '';
     862            InputDlg.CenterToRect(BoundsRect);
     863            InputDlg.ShowModal;
     864            if InputDlg.ModalResult <> mrOK then
     865              Exit;
     866            Val(InputDlg.EditInput.Text, A, I);
     867            if (I <> 0) or (A <= 0) or (A >= MaxMoneyPrice) then
     868              Exit;
     869            if (Price = opMoney) and (A > MyRO.Money) then
     870              A := MyRO.Money;
     871            Inc(Price, A);
     872          finally
     873            InputDlg.Free;
     874          end;
    863875        end;
    864876      opShipParts:
     
    869881          Inc(Price, MainScreen.ModalSelectDlg.Result shl 16);
    870882          Max := MyRO.Ship[Me].Parts[MainScreen.ModalSelectDlg.Result];
    871           InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER');
    872           InputDlg.EditInput.Text := '';
    873           InputDlg.CenterToRect(BoundsRect);
    874           Gtk2Fix;
    875           InputDlg.ShowModal;
    876           if InputDlg.ModalResult <> mrOK then
    877             Exit;
    878           Val(InputDlg.EditInput.Text, A, I);
    879           if (I <> 0) or (A <= 0) then
    880             Exit;
    881           if A > Max then
    882             A := Max;
    883           if A > MaxShipPartPrice then
    884             A := MaxShipPartPrice;
    885           Inc(Price, A);
     883          InputDlg := TInputDlg.Create(nil);
     884          try
     885            InputDlg.Caption := Phrases.Lookup('TITLE_NUMBER');
     886            InputDlg.EditInput.Text := '';
     887            InputDlg.CenterToRect(BoundsRect);
     888            Gtk2Fix;
     889            InputDlg.ShowModal;
     890            if InputDlg.ModalResult <> mrOK then
     891              Exit;
     892            Val(InputDlg.EditInput.Text, A, I);
     893            if (I <> 0) or (A <= 0) then
     894              Exit;
     895            if A > Max then
     896              A := Max;
     897            if A > MaxShipPartPrice then
     898              A := MaxShipPartPrice;
     899            Inc(Price, A);
     900          finally
     901            InputDlg.Free;
     902          end;
    886903        end;
    887904      opAllTech:
  • trunk/LocalPlayer/Select.pas

    r714 r725  
    967967var
    968968  CityNameInfo: TCityNameInfo;
    969 begin
    970   InputDlg.Caption := Phrases.Lookup('TITLE_CITYNAME');
    971   InputDlg.EditInput.Text := CityName(MyCity[cix].ID);
    972   InputDlg.CenterToRect(BoundsRect);
    973   InputDlg.ShowModal;
    974   if (InputDlg.ModalResult = mrOK) and (InputDlg.EditInput.Text <> '') and
    975     (InputDlg.EditInput.Text <> CityName(MyCity[cix].ID)) then
    976   begin
    977     CityNameInfo.ID := MyCity[cix].ID;
    978     CityNameInfo.NewName := InputDlg.EditInput.Text;
    979     if CityNameInfo.GetCommandDataSize > CommandDataMaxSize then
    980       Delete(CityNameInfo.NewName, Length(CityNameInfo.NewName) -
    981         (CityNameInfo.GetCommandDataSize - 1 - CommandDataMaxSize), MaxInt);
    982     Server(CommandWithData(cSetCityName, CityNameInfo.GetCommandDataSize),
    983       Me, 0, CityNameInfo);
    984     if MainScreen.CityDlg.Visible then
     969  InputDlg: TInputDlg;
     970begin
     971  InputDlg := TInputDlg.Create(nil);
     972  try
     973    InputDlg.Caption := Phrases.Lookup('TITLE_CITYNAME');
     974    InputDlg.EditInput.Text := CityName(MyCity[cix].ID);
     975    InputDlg.CenterToRect(BoundsRect);
     976    InputDlg.ShowModal;
     977    if (InputDlg.ModalResult = mrOK) and (InputDlg.EditInput.Text <> '') and
     978      (InputDlg.EditInput.Text <> CityName(MyCity[cix].ID)) then
    985979    begin
    986       MainScreen.CityDlg.FormShow(nil);
    987       MainScreen.CityDlg.Invalidate;
    988     end;
    989     Result := True;
    990   end
    991   else
    992     Result := False;
     980      CityNameInfo.ID := MyCity[cix].ID;
     981      CityNameInfo.NewName := InputDlg.EditInput.Text;
     982      if CityNameInfo.GetCommandDataSize > CommandDataMaxSize then
     983        Delete(CityNameInfo.NewName, Length(CityNameInfo.NewName) -
     984          (CityNameInfo.GetCommandDataSize - 1 - CommandDataMaxSize), MaxInt);
     985      Server(CommandWithData(cSetCityName, CityNameInfo.GetCommandDataSize),
     986        Me, 0, CityNameInfo);
     987      if MainScreen.CityDlg.Visible then
     988      begin
     989        MainScreen.CityDlg.FormShow(nil);
     990        MainScreen.CityDlg.Invalidate;
     991      end;
     992      Result := True;
     993    end else Result := False;
     994  finally
     995    InputDlg.Free;
     996  end;
    993997end;
    994998
     
    9961000var
    9971001  ModelNameInfo: TModelNameInfo;
    998 begin
    999   InputDlg.Caption := Phrases.Lookup('TITLE_MODELNAME');
    1000   InputDlg.EditInput.Text := Tribe[Me].ModelName[mix];
    1001   InputDlg.CenterToRect(BoundsRect);
    1002   InputDlg.ShowModal;
    1003   if (InputDlg.ModalResult = mrOK) and (InputDlg.EditInput.Text <> '') and
    1004     (InputDlg.EditInput.Text <> Tribe[Me].ModelName[mix]) then
    1005   begin
    1006     ModelNameInfo.mix := mix;
    1007     ModelNameInfo.NewName := InputDlg.EditInput.Text;
    1008     if ModelNameInfo.GetCommandDataSize > CommandDataMaxSize then
    1009       Delete(ModelNameInfo.NewName, Length(ModelNameInfo.NewName) -
    1010         (ModelNameInfo.GetCommandDataSize - 1 - CommandDataMaxSize), MaxInt);
    1011     Server(CommandWithData(cSetModelName, ModelNameInfo.GetCommandDataSize),
    1012       Me, 0, ModelNameInfo);
    1013     if MainScreen.UnitStatDlg.Visible then
     1002  InputDlg: TInputDlg;
     1003begin
     1004  InputDlg := TInputDlg.Create(nil);
     1005  try
     1006    InputDlg.Caption := Phrases.Lookup('TITLE_MODELNAME');
     1007    InputDlg.EditInput.Text := Tribe[Me].ModelName[mix];
     1008    InputDlg.CenterToRect(BoundsRect);
     1009    InputDlg.ShowModal;
     1010    if (InputDlg.ModalResult = mrOK) and (InputDlg.EditInput.Text <> '') and
     1011      (InputDlg.EditInput.Text <> Tribe[Me].ModelName[mix]) then
    10141012    begin
    1015       MainScreen.UnitStatDlg.FormShow(nil);
    1016       MainScreen.UnitStatDlg.Invalidate;
    1017     end;
    1018     Result := True;
    1019   end
    1020   else
    1021     Result := False;
     1013      ModelNameInfo.mix := mix;
     1014      ModelNameInfo.NewName := InputDlg.EditInput.Text;
     1015      if ModelNameInfo.GetCommandDataSize > CommandDataMaxSize then
     1016        Delete(ModelNameInfo.NewName, Length(ModelNameInfo.NewName) -
     1017          (ModelNameInfo.GetCommandDataSize - 1 - CommandDataMaxSize), MaxInt);
     1018      Server(CommandWithData(cSetModelName, ModelNameInfo.GetCommandDataSize),
     1019        Me, 0, ModelNameInfo);
     1020      if MainScreen.UnitStatDlg.Visible then
     1021      begin
     1022        MainScreen.UnitStatDlg.FormShow(nil);
     1023        MainScreen.UnitStatDlg.Invalidate;
     1024      end;
     1025      Result := True;
     1026    end else Result := False;
     1027  finally
     1028    InputDlg.Free;
     1029  end;
    10221030end;
    10231031
  • trunk/Messg.pas

    r558 r725  
    3333  end;
    3434
    35 var
    36   MessgDlg: TMessgDlg;
    3735
    3836procedure SimpleMessage(SimpleText: string);
     
    102100procedure SimpleMessage(SimpleText: string);
    103101begin
    104   with MessgDlg do
    105   begin
     102  with TMessgDlg.Create(nil) do
     103  try
    106104    MessgText := SimpleText;
    107105    Kind := mkOK;
    108106    ShowModal;
     107  finally
     108    Free;
    109109  end;
    110110end;
     
    112112procedure SoundMessage(SimpleText, SoundItem: string);
    113113begin
    114   with MessgDlg do
    115   begin
     114  with TMessgDlg.Create(nil) do
     115  try
    116116    MessgText := SimpleText;
    117117    OpenSound := SoundItem;
    118118    Kind := mkOK;
    119119    ShowModal;
     120  finally
     121    Free;
    120122  end;
    121123end;
  • trunk/NoTerm.pas

    r630 r725  
    114114  NewStat;
    115115  if G.RO[Me].Turn > 0 then
    116     with MessgDlg do
    117     begin
     116    with TMessgDlg.Create(nil) do
     117    try
    118118      MessgText := Phrases.Lookup('ENDTOUR');
    119119      Kind := mkYesNo;
     
    123123      else
    124124        EndCommand := sBreak;
     125    finally
     126      Free;
    125127    end
    126128  else
  • trunk/Settings.pas

    r707 r725  
    6868  end;
    6969
    70 var
    71   SettingsDlg: TSettingsDlg;
    7270
    7371const
  • trunk/Start.pas

    r723 r725  
    545545
    546546procedure TStartDlg.ShowSettings;
     547var
     548  SettingsDlg: TSettingsDlg;
    547549begin
    548550  SettingsDlg := TSettingsDlg.Create(nil);
    549   if SettingsDlg.ShowModal = mrOk then begin
    550     LoadAssets;
    551     SmartInvalidate(0, 0, ClientWidth, ClientHeight, Page = pgMain);
    552     UpdateInterface;
    553     Background.UpdateInterface;
    554     UpdateMusic;
    555   end;
    556   FreeAndNil(SettingsDlg);
     551  try
     552    if SettingsDlg.ShowModal = mrOk then begin
     553      LoadAssets;
     554      SmartInvalidate(0, 0, ClientWidth, ClientHeight, Page = pgMain);
     555      UpdateInterface;
     556      Background.UpdateInterface;
     557      UpdateMusic;
     558    end;
     559  finally
     560    SettingsDlg.Free;
     561  end;
    557562end;
    558563
     
    16931698  Ok: Boolean;
    16941699  MapPictureFileName: string;
     1700  InputDlg: TInputDlg;
    16951701begin
    16961702  if List.ItemIndex >= 0 then
    16971703  begin
    1698     if Page = pgLoad then
    1699       InputDlg.Caption := Phrases.Lookup('TITLE_BOOKNAME')
    1700     else
    1701       InputDlg.Caption := Phrases.Lookup('TITLE_MAPNAME');
    1702     InputDlg.EditInput.Text := List.Items[List.ItemIndex];
    1703     InputDlg.CenterToRect(BoundsRect);
    1704     InputDlg.ShowModal;
    1705     NewName := InputDlg.EditInput.Text;
    1706     while IsAutoSaveFileName(NewName) do
    1707       Delete(NewName, 1, 1);
    1708     if (InputDlg.ModalResult = mrOK) and (NewName <> '') and
    1709       (NewName <> List.Items[List.ItemIndex]) then
    1710     begin
    1711       for I := 1 to Length(NewName) do
    1712         if NewName[I] in ['\', '/', ':', '*', '?', '"', '<', '>', '|'] then
    1713         begin
    1714           SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[I]]));
    1715           Exit;
     1704    InputDlg := TInputDlg.Create(nil);
     1705    try
     1706      if Page = pgLoad then
     1707        InputDlg.Caption := Phrases.Lookup('TITLE_BOOKNAME')
     1708      else
     1709        InputDlg.Caption := Phrases.Lookup('TITLE_MAPNAME');
     1710      InputDlg.EditInput.Text := List.Items[List.ItemIndex];
     1711      InputDlg.CenterToRect(BoundsRect);
     1712      InputDlg.ShowModal;
     1713      NewName := InputDlg.EditInput.Text;
     1714      while IsAutoSaveFileName(NewName) do
     1715        Delete(NewName, 1, 1);
     1716      if (InputDlg.ModalResult = mrOK) and (NewName <> '') and
     1717        (NewName <> List.Items[List.ItemIndex]) then
     1718      begin
     1719        for I := 1 to Length(NewName) do
     1720          if NewName[I] in ['\', '/', ':', '*', '?', '"', '<', '>', '|'] then
     1721          begin
     1722            SimpleMessage(Format(Phrases.Lookup('NOFILENAME'), [NewName[I]]));
     1723            Exit;
     1724          end;
     1725        if Page = pgLoad then
     1726          AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
     1727        else
     1728          AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
     1729            CevoMapExt);
     1730        Ok := True;
     1731        try
     1732          if Page = pgLoad then
     1733            Rename(F, GetSavedDir + DirectorySeparator + NewName + CevoExt)
     1734          else
     1735            Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapExt);
     1736        except
     1737          // Play('INVALID');
     1738          Ok := False;
    17161739        end;
    1717       if Page = pgLoad then
    1718         AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
    1719       else
    1720         AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
    1721           CevoMapExt);
    1722       Ok := True;
    1723       try
    1724         if Page = pgLoad then
    1725           Rename(F, GetSavedDir + DirectorySeparator + NewName + CevoExt)
    1726         else
    1727           Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapExt);
    1728       except
    1729         // Play('INVALID');
    1730         Ok := False;
    1731       end;
    1732       if Page <> pgLoad then begin
    1733         // Rename map picture
    1734         MapPictureFileName := GetMapsDir + DirectorySeparator +
    1735           List.Items[List.ItemIndex] + CevoMapPictureExt;
    1736         if FileExists(MapPictureFileName) then
    1737         try
    1738           AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex]
    1739             + CevoMapPictureExt);
    1740           Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt);
    1741         except
     1740        if Page <> pgLoad then begin
     1741          // Rename map picture
     1742          MapPictureFileName := GetMapsDir + DirectorySeparator +
     1743            List.Items[List.ItemIndex] + CevoMapPictureExt;
     1744          if FileExists(MapPictureFileName) then
     1745          try
     1746            AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex]
     1747              + CevoMapPictureExt);
     1748            Rename(F, GetMapsDir + DirectorySeparator + NewName + CevoMapPictureExt);
     1749          except
     1750          end;
    17421751        end;
    1743       end;
    1744       if Ok then begin
    1745         if Page = pgLoad then
    1746           FormerGames[List.ItemIndex] := NewName
    1747         else
    1748           Maps[List.ItemIndex] := NewName;
    1749         List.Items[List.ItemIndex] := NewName;
    1750         if Page = pgEditMap then
    1751           PaintInfo;
    1752         List.Invalidate;
    1753       end;
     1752        if Ok then begin
     1753          if Page = pgLoad then
     1754            FormerGames[List.ItemIndex] := NewName
     1755          else
     1756            Maps[List.ItemIndex] := NewName;
     1757          List.Items[List.ItemIndex] := NewName;
     1758          if Page = pgEditMap then
     1759            PaintInfo;
     1760          List.Invalidate;
     1761        end;
     1762      end;
     1763    finally
     1764      InputDlg.Free;
    17541765    end;
    17551766  end;
     
    17601771  iDel: Integer;
    17611772  F: file;
     1773  MessgDlg: TMessgDlg;
    17621774begin
    17631775  if List.ItemIndex >= 0 then
    17641776  begin
    1765     if Page = pgLoad then
    1766       MessgDlg.MessgText := Phrases.Lookup('DELETEQUERY')
    1767     else
    1768       MessgDlg.MessgText := Phrases.Lookup('MAPDELETEQUERY');
    1769     MessgDlg.Kind := mkOKCancel;
    1770     MessgDlg.ShowModal;
    1771     if MessgDlg.ModalResult = mrOK then
    1772     begin
     1777    MessgDlg := TMessgDlg.Create(nil);
     1778    try
    17731779      if Page = pgLoad then
    1774         AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
     1780        MessgDlg.MessgText := Phrases.Lookup('DELETEQUERY')
    17751781      else
    1776         AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
    1777           CevoMapExt);
    1778       Erase(F);
    1779       iDel := List.ItemIndex;
    1780       if Page = pgLoad then
    1781         FormerGames.Delete(iDel)
    1782       else
    1783         Maps.Delete(iDel);
    1784       List.Items.Delete(iDel);
    1785       if List.Items.Count = 0 then
    1786         ChangePage(pgNoLoad)
    1787       else
     1782        MessgDlg.MessgText := Phrases.Lookup('MAPDELETEQUERY');
     1783      MessgDlg.Kind := mkOKCancel;
     1784      MessgDlg.ShowModal;
     1785      if MessgDlg.ModalResult = mrOK then
    17881786      begin
    1789         if iDel = 0 then
    1790           List.ItemIndex := 0
     1787        if Page = pgLoad then
     1788          AssignFile(F, GetSavedDir + DirectorySeparator + List.Items[List.ItemIndex] + CevoExt)
    17911789        else
    1792           List.ItemIndex := iDel - 1;
    1793         if (Page = pgEditMap) and (List.ItemIndex = 0) then
    1794           ChangePage(pgEditRandom)
     1790          AssignFile(F, GetMapsDir + DirectorySeparator + List.Items[List.ItemIndex] +
     1791            CevoMapExt);
     1792        Erase(F);
     1793        iDel := List.ItemIndex;
     1794        if Page = pgLoad then
     1795          FormerGames.Delete(iDel)
     1796        else
     1797          Maps.Delete(iDel);
     1798        List.Items.Delete(iDel);
     1799        if List.Items.Count = 0 then
     1800          ChangePage(pgNoLoad)
    17951801        else
    17961802        begin
    1797           List.Invalidate;
    1798           if Page = pgLoad then
    1799             TurnValid := False;
    1800           PaintInfo;
    1801           if Page = pgLoad then
    1802             ReplayBtn.Visible := MiniMap.Mode <> mmMultiPlayer;
     1803          if iDel = 0 then
     1804            List.ItemIndex := 0
     1805          else
     1806            List.ItemIndex := iDel - 1;
     1807          if (Page = pgEditMap) and (List.ItemIndex = 0) then
     1808            ChangePage(pgEditRandom)
     1809          else
     1810          begin
     1811            List.Invalidate;
     1812            if Page = pgLoad then
     1813              TurnValid := False;
     1814            PaintInfo;
     1815            if Page = pgLoad then
     1816              ReplayBtn.Visible := MiniMap.Mode <> mmMultiPlayer;
     1817          end;
    18031818        end;
    18041819      end;
     1820    finally
     1821      MessgDlg.Free;
    18051822    end;
    18061823  end;
Note: See TracChangeset for help on using the changeset viewer.