<commit_before>module Scorched.View.Menu where

import Char (toCode)
import Signal (send)

import Graphics.Element (..)
import Graphics.Collage (..)

import Scorched.Model (Model, lookup)

import Scorched.Action (Action(Configuration), updates)
import Scorched.Model.Configuration (Action(PlayerCount, RoundCount))

import Scorched.Model.Geometry (Dimension)

import Scorched.Model.World as World

import Scorched.Model.View.Menu (hooks)

import Scorched.View.Widget.BorderBox as BorderBox
import Scorched.View.Widget.Button as Button

import Scorched.Model.View.NumericField (defaultSettings)
import Scorched.View.Widget.NumericField as NumericField

import Scorched.View.Helper.World as WorldHelper

renderMenu : Model -> Element
renderMenu ({dimensions} as model) =
  collage
    dimensions.width
    dimensions.height
      [ BorderBox.build dimensions 2 False
      , sample dimensions
      , buttons model dimensions
      ]

sample : Dimension -> Form
sample ({width,height} as dimensions) =
  let
    innerDimensions = {width=906, height=724}

    world = WorldHelper.toForm (World.generate innerDimensions) innerDimensions
    outline = BorderBox.build {width=908, height=726} 1 True
  in
    group
      [ outline
         |> move (-(toFloat width) / 2 + 563, -(toFloat height) / 2 + 397)
      , world
         |> move (-(toFloat width) /2 + 563, -(toFloat height) / 2 + 397)
      ]

buttons : Model -> Dimension -> Form
buttons model {width, height} =
  let
    btns = [ playButton
           , (playerCount model.config.playerCount)
           , (roundCount model.config.roundCount)
           ]
    elem = flow down btns
  in
    toForm elem<commit_msg>remove unnecessary parameter<commit_after>module Scorched.View.Menu where

import Char (toCode)
import Signal (send)

import Graphics.Element (..)
import Graphics.Collage (..)

import Scorched.Model (Model, lookup)

import Scorched.Action (Action(Configuration), updates)
import Scorched.Model.Configuration (Action(PlayerCount, RoundCount))

import Scorched.Model.Geometry (Dimension)

import Scorched.Model.World as World

import Scorched.Model.View.Menu (hooks)

import Scorched.View.Widget.BorderBox as BorderBox
import Scorched.View.Widget.Button as Button

import Scorched.Model.View.NumericField (defaultSettings)
import Scorched.View.Widget.NumericField as NumericField

import Scorched.View.Helper.World as WorldHelper

renderMenu : Model -> Element
renderMenu ({dimensions} as model) =
  collage
    dimensions.width
    dimensions.height
      [ BorderBox.build dimensions 2 False
      , sample dimensions
      , buttons model dimensions
      ]

sample : Dimension -> Form
sample {width,height} =
  let
    innerDimensions = {width=906, height=724}

    world = WorldHelper.toForm (World.generate innerDimensions) innerDimensions
    outline = BorderBox.build {width=908, height=726} 1 True
  in
    group
      [ outline
         |> move (-(toFloat width) / 2 + 563, -(toFloat height) / 2 + 397)
      , world
         |> move (-(toFloat width) /2 + 563, -(toFloat height) / 2 + 397)
      ]

buttons : Model -> Dimension -> Form
buttons model {width, height} =
  let
    btns = [ playButton
           , (playerCount model.config.playerCount)
           , (roundCount model.config.roundCount)
           ]
    elem = flow down btns
  in
    toForm elem
{'fraction_non_alphanumeric': 0.09649385675756668, 'fraction_numerical': 0.017980221756068324, 'mean_word_length': 3.340702210663199, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1512045', 'n_tokens_mistral': 1050, 'n_tokens_neox': 993, 'n_words': 277}