Changeset 614 for trunk


Ignore:
Timestamp:
Sep 14, 2024, 5:43:37 PM (3 months ago)
Author:
chronos
Message:
  • Added: Nwe editor menu action to create filled map with selected tile.
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/GameServer.pas

    r604 r614  
    7575  MovieMode: Boolean): Boolean;
    7676procedure EditMap(const AMapFileName: string; Newlx, Newly, NewLandMass: Integer);
     77procedure FillMap(TerrainType: Cardinal);
    7778procedure DirectHelp(Command: Integer);
    7879function ToAutoSaveFileName(FileName: string): string;
     
    13631364  Notify(ntBackOff);
    13641365  Inform(pTurn);
    1365   ChangeClientWhenDone(cTurn, 0, nil^, 0)
     1366  ChangeClientWhenDone(cTurn, 0, nil^, 0);
     1367end;
     1368
     1369procedure FillMap(TerrainType: Cardinal);
     1370var
     1371  Loc1: Integer;
     1372begin
     1373  for Loc1 := 0 to MapSize - 1 do
     1374    RealMap[Loc1] := TerrainType or ($F shl 27);
    13661375end;
    13671376
     
    13751384procedure EditMap(const AMapFileName: string; Newlx, Newly, NewLandMass: Integer);
    13761385var
    1377   p1, Loc1: Integer;
     1386  p1: Integer;
    13781387  Game: TNewGameData;
    13791388  Map: TMap;
     
    14021411    FreeAndNil(Map);
    14031412  end else begin
    1404     for Loc1 := 0 to MapSize - 1 do
    1405       RealMap[Loc1] := fOcean or ($F shl 27);
     1413    FillMap(fOcean);
    14061414  end;
    14071415  CL := nil;
     
    30693077
    30703078    sRandomMap:
    3071       if (Player = 0) and MapGeneratorAvailable then
    3072       begin
     3079      if (Player = 0) and MapGeneratorAvailable then begin
    30733080        CreateElevation;
    30743081        PreviewElevation := False;
     
    30763083        FillChar(ObserveLevel, MapSize * 4, 0);
    30773084        DiscoverAll(Player, lObserveSuper);
    3078       end
    3079       else
    3080         Result := eInvalid;
     3085      end else Result := eInvalid;
     3086
     3087    sFillMap:
     3088      if Player = 0 then begin
     3089        FillMap(TFillMapData(Data).Tile);
     3090        FillChar(ObserveLevel, MapSize * 4, 0);
     3091        DiscoverAll(Player, lObserveSuper);
     3092      end else Result := eInvalid;
    30813093
    30823094    sMapGeneratorRequest:
  • trunk/Language.txt

    r473 r614  
    421421#MAP_PREFSTART Preferred Starting Position
    422422#MAP_RANDOM Do you want to dismiss this map and replace it by an automatically generated random map?
     423#MAP_FILL Do you want to dismiss this map and replace it by an automatically filled map?
    423424#MAP_CLOSE You're going to close this map.\Do you wish to save it?
    424425
     
    551552Previous Unit
    552553Next Unit
     554Filled Map
    553555
    554556#ADVANCES
  • trunk/LocalPlayer/KeyBindings.pas

    r468 r614  
    5757  BResign: TKeyBinding;
    5858  BRandomMap: TKeyBinding;
     59  BFillMap: TKeyBinding;
    5960  BDisbandUnit: TKeyBinding;
    6061  BFortify: TKeyBinding;
     
    321322  BResign := AddItem('Resign', 'Resign', 'Ctrl+Q');
    322323  BRandomMap := AddItem('RandomMap', 'Random map', 'Ctrl+R');
     324  BFillMap := AddItem('FillMap', 'Fill map', 'Ctrl+F');
    323325  BDisbandUnit := AddItem('DisbandUnit', 'Disband unit', 'Ctrl+D');
    324326  BFortify := AddItem('Fortify', 'Fortify', 'F');
  • trunk/LocalPlayer/Term.lfm

    r533 r614  
    1414  DesignTimePPI = 144
    1515  Font.Color = clWindowText
    16   Font.Height = -20
     16  Font.Height = -45
    1717  Font.Name = 'MS Sans Serif'
    1818  KeyPreview = True
     
    3131  OnShow = FormShow
    3232  Position = poDefault
    33   LCLVersion = '2.2.0.4'
     33  LCLVersion = '3.4.0.0'
    3434  Scaled = False
    35   WindowState = wsNormal
    3635  object UnitBtn: TButtonB
    3736    Tag = 14
     
    555554      OnClick = mRandomMapClick
    556555    end
     556    object mFillMap: TMenuItem
     557      Tag = 102
     558      GroupIndex = 1
     559      ShortCut = 16454
     560      OnClick = mFillMapClick
     561    end
    557562    object N3: TMenuItem
    558563      Caption = '-'
  • trunk/LocalPlayer/Term.pas

    r613 r614  
    1212{$ENDIF}
    1313  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    14   LCLIntf, LCLType, SysUtils, Classes, DrawDlg, Types, Math,
     14  LCLIntf, LCLType, Menus, SysUtils, Classes, DrawDlg, Types, Math,
    1515  DateUtils, Platform, ButtonB, ButtonC, EOTButton, Area,
    1616  GraphicSet, MiniMap, IsoEngine, Wonders, TechTree, Enhance, Nego, CityType,
     
    3434  TMainScreen = class(TDrawDlg)
    3535    mBigTiles: TMenuItem;
     36    mFillMap: TMenuItem;
    3637    mNextUnit: TMenuItem;
    3738    N13: TMenuItem;
     
    197198    procedure mDiagramClick(Sender: TObject);
    198199    procedure mEmpireClick(Sender: TObject);
     200    procedure mFillMapClick(Sender: TObject);
    199201    procedure mEnhanceClick(Sender: TObject);
    200202    procedure mEnhanceDefClick(Sender: TObject);
     
    37613763end;
    37623764
     3765procedure TMainScreen.mFillMapClick(Sender: TObject);
     3766var
     3767  FillMapData: TFillMapData;
     3768begin
     3769  if not Edited or (SimpleQuery(mkYesNo, Phrases.Lookup('MAP_FILL'), '')
     3770      = mrOK) then begin
     3771    FillMapData.Tile := BrushType;
     3772    Server(sFillMap, Me, 0, FillMapData);
     3773    Edited := True;
     3774    MapValid := False;
     3775    PaintAllMaps;
     3776  end;
     3777end;
     3778
    37633779procedure TMainScreen.mEnhanceClick(Sender: TObject);
    37643780begin
     
    52205236                      end;
    52215237                    end;
    5222                     Inc(Count)
     5238                    Inc(Count);
    52235239                  end;
    52245240                end; // for uix:=0 to MyRO.nUn-1
     
    52705286              JobFocus := nJob + 3
    52715287            else
    5272               JobFocus := nJob + 4
     5288              JobFocus := nJob + 4;
    52735289          end;
    52745290          S := Phrases.Lookup('JOBRESULT', JobFocus);
     
    52945310            (PanelHeight - 1), Left + Width, Top + Height - Self.ClientHeight +
    52955311            PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight)
    5296     end; { if TroopLoc>=0 }
     5312    end; { if TroopLoc >= 0 }
    52975313  end;
    52985314
     
    53325348  xTreasurySection := ClientWidth div 2 - 172;
    53335349  xResearchSection := ClientWidth div 2;
    5334   // ClientWidth div 2+68 = maximum to right
     5350  // ClientWidth div 2 + 68 = maximum to right
    53355351  FillLarge(TopBar.Canvas, 0, 0, ClientWidth, TopBarHeight - 3,
    53365352    ClientWidth div 2);
     
    54225438      if ScienceSum > 0 then
    54235439      begin
    5424         { j:=(i-MyRO.Research-1) div ScienceSum +1;
    5425           if J<1 then J:=1;
    5426           if J>1 then
    5427           S:=Format(Phrases.Lookup('TECHWAIT'),[S,J]); }
     5440        { j := (i - MyRO.Research - 1) div ScienceSum + 1;
     5441          if J < 1 then J := 1;
     5442          if J > 1 then
     5443          S := Format(Phrases.Lookup('TECHWAIT'), [S, J]); }
    54285444        LoweredTextOut(TopBar.Canvas, -1, MainTexture,
    54295445          xResearchSection + 48, 0, S);
     
    70037019  mResign.ShortCut := BResign.ShortCut;
    70047020  mRandomMap.ShortCut := BRandomMap.ShortCut;
     7021  mFillMap.ShortCut := BFillMap.ShortCut;
    70057022  mDisband.ShortCut := BDisbandUnit.ShortCut;
    70067023  mFort.ShortCut := BFortify.ShortCut;
     
    71227139    if BResign.Test(ShortCut) then mResign.Click
    71237140    else if BRandomMap.Test(ShortCut) then mRandomMap.Click
     7141    else if BFillMap.Test(ShortCut) then mFillMap.Click
    71247142    else if BHelp.Test(ShortCut) then mHelp.Click;
    71257143    (*if Shift = [ssCtrl] then
     
    74747492    mRandomMap.Visible := (ClientMode = cEditMap) and
    74757493      (Server(sMapGeneratorRequest, Me, 0, nil^) = eOK);
     7494    mFillMap.Visible := mRandomMap.Visible;
    74767495    mOptions.Visible := ClientMode <> cEditMap;
    74777496    mManip.Visible := ClientMode <> cEditMap;
  • trunk/Localization/cs/Language.txt

    r473 r614  
    421421#MAP_PREFSTART Preferovaná startovní pozice
    422422#MAP_RANDOM Chcete zrušit tuto mapu a nahradit ji automaticky vygenerovanou mapou?
     423#MAP_FILL Chcete zrušit tuto mapu a nahradit ji automaticky vyplněnou mapou?
    423424#MAP_CLOSE Chystáte se zavřít tuto mapu.\Chcete ji uložit?
    424425
     
    551552Předchozí jednotka
    552553Další jednotka
     554Vyplněná mapa
    553555
    554556#ADVANCES
  • trunk/Localization/de/Language.txt

    r473 r614  
    430430#MAP_PREFSTART Bevorzugte Startposition
    431431#MAP_RANDOM Karte löschen und durch eine automatisch erstellte Zufallskarte ersetzen?
     432#MAP_FILL Do you want to dismiss this map and replace it by an automatically filled map?
    432433#MAP_CLOSE Der Kartograf wird beendet.\Soll die Karte gespeichert werden?
    433434
     
    560561Previous Unit
    561562Next Unit
     563Filled Map
    562564
    563565#ADVANCES
  • trunk/Localization/fr/Language.txt

    r544 r614  
    140140#TITLE_SPYMISSION Opération secrète
    141141#TITLE_SUICIDE Mission suicide
     142#TITLE_MESSAGE Message
    142143#FRMILREP Rapport militaire
    143 
    144144'Message Text
    145145#NOALTAI Aucune autre IA n'est installée.\Téléchargez d'autres modules d'IA à partir de la page d'accueil de C-evo ou créez le vôtre.
     
    406406#UTILIZE Utilisez
    407407#INTEGRATE Intégrer
     408#NETWORK_SERVER Network Server
     409#NETWORK_CLIENT Network Client
    408410
    409411'Busy Messages
     
    418420#MAP_PREFSTART Position de départ préférée
    419421#MAP_RANDOM Voulez-vous rejeter cette carte et la remplacer par une carte aléatoire générée automatiquement?
     422#MAP_FILL Do you want to dismiss this map and replace it by an automatically filled map?
    420423#MAP_CLOSE Vous allez fermer cette carte.\Souhaitez-vous la sauvegarder?
    421424
     
    543546Patrouilles, attaques et captures uniquement
    544547Taille des carreaux
     548Small
     549Medium
     550Big
     551Previous Unit
     552Next Unit
     553Filled Map
    545554
    546555#ADVANCES
  • trunk/Localization/it/Language.txt

    r473 r614  
    411411#MAP_PREFSTART Punto di partenza preferenziale
    412412#MAP_RANDOM Vuoi buttare via questa mappa e rimpiazzarla con una generata casualmente?
     413#MAP_FILL Do you want to dismiss this map and replace it by an automatically filled map?
    413414#MAP_CLOSE Stai chiudendo questa mappa.\La vuoi salvare?
    414415
     
    541542Previous Unit
    542543Next Unit
     544Filled Map
    543545
    544546#ADVANCES
  • trunk/Localization/ru/Language.txt

    r473 r614  
    437437#MAP_PREFSTART Привилегированная исходная позиция
    438438#MAP_RANDOM Вы хотите отказаться от этой карты и заменить её случайно сгенерированной картой?
     439#MAP_FILL Do you want to dismiss this map and replace it by an automatically filled map?
    439440#MAP_CLOSE Вы собираетесь закрыть Карту.\Вы хотите сохранить изменения?
    440441
     
    567568Previous Unit
    568569Next Unit
     570Filled Map
    569571
    570572#ADVANCES
  • trunk/Localization/zh-Hans/Language.txt

    r473 r614  
    429429#MAP_PREFSTART 玩家种族初始位置
    430430#MAP_RANDOM 放弃当前的地图, 重新随机生成新的地图?
     431#MAP_FILL Do you want to dismiss this map and replace it by an automatically filled map?
    431432#MAP_CLOSE 选择关闭当前的地图。\是否保存?
    432433
     
    559560Previous Unit
    560561Next Unit
     562Filled Map
    561563
    562564#ADVANCES
  • trunk/Localization/zh-Hant/Language.txt

    r473 r614  
    429429#MAP_PREFSTART 玩家种族初始位置
    430430#MAP_RANDOM 放棄當前的地圖, 重新隨机生成新的地圖?
     431#MAP_FILL Do you want to dismiss this map and replace it by an automatically filled map?
    431432#MAP_CLOSE 選擇關閉當前的地圖。\是否保存?
    432433
     
    559560Previous Unit
    560561Next Unit
     562Filled Map
    561563
    562564#ADVANCES
  • trunk/Protocol.pas

    r457 r614  
    116116  sRandomMap = $0780;
    117117  sMapGeneratorRequest = $0790;
     118  sFillMap = $07a0;
    118119
    119120  // Server Internal Commands
     
    16471648    mix: Integer;
    16481649  end;
     1650  TFillMapData = record
     1651    Tile: Integer;
     1652  end;
    16491653
    16501654  TTileList = array [0 .. INFIN] of Cardinal;
Note: See TracChangeset for help on using the changeset viewer.