anchor.diff:  
     //If the user clicks on the tab that is open, it closes it (main buttons only)
     if ((Sender = Button_Main[1]) and Panel_Terrain.Visible) or
  -     ((Sender = Button_Main[2]) and Panel_Village.Visible) or
  +     ((Sender = Button_Main[2]) and Panel_Town.Visible) or
        ((Sender = Button_Main[3]) and Panel_Player.Visible) or
        ((Sender = Button_Main[4]) and Panel_Mission.Visible) or
        ((Sender = Button_Main[5]) and Panel_Menu.Visible) then
  
positive.code: end;
  
  
  procedure TKMapEdInterface.Village_ScriptChange(Sender: TObject);
  begin
    MyPlayer.AI.Setup.AutoBuild := CheckBox_AutoBuild.Checked;
    MyPlayer.AI.Setup.AutoRepair := CheckBox_AutoRepair.Checked;
  
negative.code: 
  
  {Build page}
  procedure TKMapEdInterface.Create_Town_Page;
  const
    TabGlyph: array [TKMTownTab] of Word = (391, 141, 327, 43, 43);
  var
    I: Integer;
    VT: TKMTownTab;
  begin
    Panel_Town := TKMPanel.Create(Panel_Common, 0, 45, TB_WIDTH, 28);
  
      for VT := Low(TKMTownTab) to High(TKMTownTab) do
      begin
        Button_Town[VT] := TKMButton.Create(Panel_Town, SMALL_PAD_W * Byte(VT), 0, SMALL_TAB_W, SMALL_TAB_H, TabGlyph[VT], rxGui, bsGame);
        Button_Town[VT].OnClick := SwitchPage;
      end;
  
      //Town placement
      Panel_Build := TKMPanel.Create(Panel_Town,0,28,TB_WIDTH,400);
        TKMLabel.Create(Panel_Build,0,PAGE_TITLE_Y,TB_WIDTH,0,'Roadworks',fnt_Outline,taCenter);
        Button_BuildRoad   := TKMButtonFlat.Create(Panel_Build,  0,28,33,33,335);
        Button_BuildField  := TKMButtonFlat.Create(Panel_Build, 37,28,33,33,337);
  