<commit_before>module Scorched.View.MainMenu exposing (build)

import Dict exposing (Dict)

import Svg exposing(Svg)
import Svg.Attributes as Attr

import Scorched.Model.Types exposing (Msg(..))

import Scorched.Model.Types exposing (Model, Configuration, World, Control)
import Scorched.Model.Geometry exposing (Dimension, Offset)

import Scorched.Model.MainMenu as MainMenu

import Scorched.View.Component.BorderBox as BorderBox
import Scorched.View.Component.ShadowText as ShadowText

import Scorched.View.Component.Control as Control

import Scorched.View.World as World

build : Model -> Svg Msg
build ({dimensions, menuData, config} as model) =
  Svg.g
    [ Attr.id "menu-main" ]
    (List.concat
      [ (background model)
      , (controls config (Dict.values menuData.controls))
      , messages
      ]
    )

background : Model -> List (Svg Msg)
background {dimensions, menuData} =
  [ BorderBox.build dimensions 2 False
  , sample menuData.world
  ]

sample : World -> Svg Msg
sample sampleWorld =
  let
     world = World.build sampleWorld MainMenu.worldDimensions
     outline = BorderBox.build {width=908, height=726} 1 True
  in
    Svg.g
      [ Attr.id "menu-main--world", Attr.transform ("translate(109, 6)") ]
      [ outline, world ]

controls : Configuration -> List Control -> List (Svg Msg)
controls config definitions = List.map (Control.build config) definitions

messages : List (Svg msg)
messages =
  [ ShadowText.build "Scorched Earth" {x = 420, y = 48 }

  , Svg.text_
    [ Attr.transform "translate(472, 84)"
    , Attr.fill "white"
    ]
    [ Svg.text "The Mother of All Games" ]

  , Svg.text_
    [ Attr.transform "translate(504, 744)"
    , Attr.fill "black"
    ]
    [ Svg.text "Version 0.0.1" ]

  , Svg.text_
    [ Attr.transform "translate(408, 758)"
    , Attr.fill "black"
    ]
    [ Svg.text "Copyright (c) 1991-1995 <NAME>" ]
  ]
<commit_msg>group controls<commit_after>module Scorched.View.MainMenu exposing (build)

import Dict exposing (Dict)

import Svg exposing(Svg)
import Svg.Attributes as Attr

import Scorched.Model.Types exposing (Msg(..))

import Scorched.Model.Types exposing (Model, Configuration, World, Control)
import Scorched.Model.Geometry exposing (Dimension, Offset)

import Scorched.Model.MainMenu as MainMenu

import Scorched.View.Component.BorderBox as BorderBox
import Scorched.View.Component.ShadowText as ShadowText

import Scorched.View.Component.Control as Control

import Scorched.View.World as World

build : Model -> Svg Msg
build ({dimensions, menuData, config} as model) =
  Svg.g
    [ Attr.id "menu-main" ]
    (List.concat
      [ background model
      , [ controls config (Dict.values menuData.controls) ]
      , messages
      ]
    )

background : Model -> List (Svg Msg)
background {dimensions, menuData} =
  [ BorderBox.build dimensions 2 False
  , sample menuData.world
  ]

sample : World -> Svg Msg
sample sampleWorld =
  let
     world = World.build sampleWorld MainMenu.worldDimensions
     outline = BorderBox.build {width=908, height=726} 1 True
  in
    Svg.g
      [ Attr.id "menu-main--world", Attr.transform ("translate(109, 6)") ]
      [ outline, world ]

controls : Configuration -> List Control -> Svg Msg
controls config definitions =
  Svg.g
    [ Attr.id "controls" ]
    (List.map (Control.build config) definitions)

messages : List (Svg msg)
messages =
  [ ShadowText.build "Scorched Earth" {x = 420, y = 48 }

  , Svg.text_
    [ Attr.transform "translate(472, 84)"
    , Attr.fill "white"
    ]
    [ Svg.text "The Mother of All Games" ]

  , Svg.text_
    [ Attr.transform "translate(504, 744)"
    , Attr.fill "black"
    ]
    [ Svg.text "Version 0.0.1" ]

  , Svg.text_
    [ Attr.transform "translate(408, 758)"
    , Attr.fill "black"
    ]
    [ Svg.text "Copyright (c) 1991-1995 <NAME>" ]
  ]

{'fraction_non_alphanumeric': 0.11428571428571428, 'fraction_numerical': 0.023591087811271297, 'mean_word_length': 3.2780269058295963, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6935456', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1260, 'n_words': 343}