<commit_before>unit KM_GUIMapEdRMG;
{$I KaM_Remake.inc}
interface
uses
  {$IFDEF MSWindows} Windows, {$ENDIF}
  {$IFDEF Unix} LCLType, {$ENDIF}
  Classes,
  Math, SysUtils, KM_Utils,
  KM_Controls, KM_Defaults, KM_Pics,
  KM_RandomMapGenerator, KM_CommonUtils;

type

  TKMMapEdRMG = class
  private
    fRMG: TKMRandomMapGenerator;

    function NextLine(var Line: Integer; const LINE_Y: Byte = 20): Integer;
    procedure RMG_Change(Sender: TObject);
    procedure RMG_Close(Sender: TObject);
    procedure RMG_Refresh();
    procedure RMG_Generate_Map(Sender: TObject);
    procedure RMG_Generate_New_Seed(Sender: TObject);
    function GetVisible: Boolean;
  protected
    Panel_RMG: TKMPanel;
    CheckGroup_Grass: TKMRadioGroup;
    CheckGroup_LocPosition: TKMRadioGroup;

    Check_Biomes, Check_Ground,Check_Snow,Check_Sand,
    Check_Obstacles,
    Check_Locs, Check_Resources, Check_ConnectLocs, Check_MineFix,
    Check_Height, Check_HideNonSmoothTransition,
    Check_NoGo, Check_ReplaceTerrain,
    Check_Objects, Check_Animals,
    Check_BasicTiles,Check_CA: TKMCheckBox;

    TBar_Biomes1_Step, TBar_Biomes1_Limit, TBar_Biomes2_Step, TBar_Biomes2_Limit,
    TBar_NonWalk_EGold, TBar_NonWalk_EIron, TBar_NonWalk_Swamp, TBar_NonWalk_Wetland, TBar_NonWalk_Water, TBar_ProtectedRadius, TBar_NonWalk_Density, TBar_NonWalk_Size, TBar_NonWalk_Variance,
    TBar_ObjectDensity, TBar_Forests, TBar_Trees,
    TBar_Res_Stone, TBar_Res_Gold, TBar_Res_Iron,
    TBar_Players: TKMTrackBar;

    NumPlayers,NumSeed: TKMNumericEdit;

    Button_RMG_Generate_New_Seed: TKMButton;
    Button_RMG_Generate: TKMButton;
    Button_RMG_Cancel: TKMButton;
  public
    constructor Create(aParent: TKMPanel);
    destructor Destroy; override;

    property Visible: Boolean read GetVisible;
    //function KeyDown(Key: Word; Shift: TShiftState): Boolean;
    procedure Show();
  end;



implementation
uses
  KM_HandsCollection, KM_ResTexts, KM_RenderUI, KM_ResFonts, KM_Hand,
  KM_TerrainSelection, KM_Terrain;


//KM_Game, KM_GameCursor
//KM_InterfaceGame;

{ TKMGUIMapEdGoal }
constructor TKMMapEdRMG.Create(aParent: TKMPanel);
const
  POS_X = 300;
  POS_Y = 0;
  SIZE_X = 700;
  SIZE_Y = 600;
  BOX_X = 200;
  BOX_Y = 60;
  Column_1_X = 20;
  Column_2_X = 160;
  Column_3_X = 300;
  Column_4_X = 480;
  OFFSET_1 = 20;
  OFFSET_2 = 30;
var
  Img: TKMImage;
  Column_1_Y, Column_2_Y, Column_3_Y, Column_4_Y: Integer;
begin
  inherited Create;

  Panel_RMG := TKMPanel.Create(aParent, POS_X, POS_Y, SIZE_X, SIZE_Y);
  Panel_RMG.AnchorsCenter;
  Panel_RMG.Hide;

  TKMBevel.Create(Panel_RMG, -1000,  -1000, 4000, 4000);
  Img := TKMImage.Create(Panel_RMG, -20, -50, SIZE_X+40, SIZE_Y+60, 15, rxGuiMain);
  Img.ImageStretch;
  TKMBevel.Create(Panel_RMG,   0,  0, SIZE_X, SIZE_Y);
  TKMLabel.Create(Panel_RMG, SIZE_X div 2, 10, 'Random Map Generator - Settings', fnt_Outline, taCenter);

  fRMG := TKMRandomMapGenerator.Create;

// COLUMN 1: Locs + Resources
  Column_1_Y := 20;
  TKMLabel.Create(Panel_RMG, Column_1_X, NextLine(Column_1_Y), 280, 0, 'Locs', fnt_Metal, taLeft);<commit_msg>fix RMGSetting window pos (again)<commit_after>unit KM_GUIMapEdRMG;
{$I KaM_Remake.inc}
interface
uses
  {$IFDEF MSWindows} Windows, {$ENDIF}
  {$IFDEF Unix} LCLType, {$ENDIF}
  Classes,
  Math, SysUtils, KM_Utils,
  KM_Controls, KM_Defaults, KM_Pics,
  KM_RandomMapGenerator, KM_CommonUtils;

type

  TKMMapEdRMG = class
  private
    fRMG: TKMRandomMapGenerator;

    function NextLine(var Line: Integer; const LINE_Y: Byte = 20): Integer;
    procedure RMG_Change(Sender: TObject);
    procedure RMG_Close(Sender: TObject);
    procedure RMG_Refresh();
    procedure RMG_Generate_Map(Sender: TObject);
    procedure RMG_Generate_New_Seed(Sender: TObject);
    function GetVisible: Boolean;
  protected
    Panel_RMG: TKMPanel;
    CheckGroup_Grass: TKMRadioGroup;
    CheckGroup_LocPosition: TKMRadioGroup;

    Check_Biomes, Check_Ground,Check_Snow,Check_Sand,
    Check_Obstacles,
    Check_Locs, Check_Resources, Check_ConnectLocs, Check_MineFix,
    Check_Height, Check_HideNonSmoothTransition,
    Check_NoGo, Check_ReplaceTerrain,
    Check_Objects, Check_Animals,
    Check_BasicTiles,Check_CA: TKMCheckBox;

    TBar_Biomes1_Step, TBar_Biomes1_Limit, TBar_Biomes2_Step, TBar_Biomes2_Limit,
    TBar_NonWalk_EGold, TBar_NonWalk_EIron, TBar_NonWalk_Swamp, TBar_NonWalk_Wetland, TBar_NonWalk_Water, TBar_ProtectedRadius, TBar_NonWalk_Density, TBar_NonWalk_Size, TBar_NonWalk_Variance,
    TBar_ObjectDensity, TBar_Forests, TBar_Trees,
    TBar_Res_Stone, TBar_Res_Gold, TBar_Res_Iron,
    TBar_Players: TKMTrackBar;

    NumPlayers,NumSeed: TKMNumericEdit;

    Button_RMG_Generate_New_Seed: TKMButton;
    Button_RMG_Generate: TKMButton;
    Button_RMG_Cancel: TKMButton;
  public
    constructor Create(aParent: TKMPanel);
    destructor Destroy; override;

    property Visible: Boolean read GetVisible;
    //function KeyDown(Key: Word; Shift: TShiftState): Boolean;
    procedure Show();
  end;



implementation
uses
  KM_HandsCollection, KM_ResTexts, KM_RenderUI, KM_ResFonts, KM_Hand,
  KM_TerrainSelection, KM_Terrain;


//KM_Game, KM_GameCursor
//KM_InterfaceGame;

{ TKMGUIMapEdGoal }
constructor TKMMapEdRMG.Create(aParent: TKMPanel);
const
  POS_X = 300;
  POS_Y = 0;
  SIZE_X = 700;
  SIZE_Y = 600;
  BOX_X = 200;
  BOX_Y = 60;
  Column_1_X = 20;
  Column_2_X = 160;
  Column_3_X = 300;
  Column_4_X = 480;
  OFFSET_1 = 20;
  OFFSET_2 = 30;
var
  Img: TKMImage;
  Column_1_Y, Column_2_Y, Column_3_Y, Column_4_Y: Integer;
begin
  inherited Create;

  Panel_RMG := TKMPanel.Create(aParent, (aParent.Width - SIZE_X) div 2, (aParent.Height - SIZE_Y) div 2, SIZE_X, SIZE_Y);
  Panel_RMG.AnchorsCenter;
  Panel_RMG.Hide;

  TKMBevel.Create(Panel_RMG, -1000,  -1000, 4000, 4000);
  Img := TKMImage.Create(Panel_RMG, -20, -50, SIZE_X+40, SIZE_Y+60, 15, rxGuiMain);
  Img.ImageStretch;
  TKMBevel.Create(Panel_RMG,   0,  0, SIZE_X, SIZE_Y);
  TKMLabel.Create(Panel_RMG, SIZE_X div 2, 10, 'Random Map Generator - Settings', fnt_Outline, taCenter);

  fRMG := TKMRandomMapGenerator.Create;

// COLUMN 1: Locs + Resources
  Column_1_Y := 20;
  TKMLabel.Create(Panel_RMG, Column_1_X, NextLine(Column_1_Y), 280, 0, 'Locs', fnt_Metal, taLeft);
{'fraction_non_alphanumeric': 0.0908653074329748, 'fraction_numerical': 0.02825493658693209, 'mean_word_length': 5.030977734753146, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1781409', 'n_tokens_mistral': 2721, 'n_tokens_neox': 2437, 'n_words': 475}