<commit_before>module View exposing (view)

import Color exposing (black, white)
import FontAwesome


-- import Html

import Html exposing (Html, text, div, p, span)
import Html.Attributes exposing (width, height, style)
import Math.Matrix4 as M4
import Math.Matrix4 exposing (Mat4)
import Math.Vector3 as V3
import Math.Vector3 exposing (..)
import Time exposing (Time)
import WebGL
import Window
import App exposing (..)
import Appearance exposing (Appearance, Perception)
import Body exposing (Body)
import Camera exposing (Camera)
import Camera.Util exposing (cameraUp)
import Model exposing (Model, Msg(..))
import Orientation


{-| Generate a View from a Model
-}
view :
    (worldModel -> Maybe Model.World)
    -> Model worldModel worldMsg
    -> Html (Msg worldMsg)
view worldView model =
    case ( model.maybeWindowSize, worldView model.worldModel ) of
        ( Nothing, _ ) ->
            text ""

        ( _, Nothing ) ->
            text ""

        ( Just windowSize, Just world ) ->
            layoutScene windowSize model world


layoutScene : Window.Size -> Model worldModel worldMsg -> Model.World -> Html (Msg worldMsg)
layoutScene windowSize model world =
    let
        render =
            renderWorld model.globalTime world
    in
        if model.player1.cameraVR then
            layoutSceneVR windowSize model render
        else if model.numPlayers == 2 then
            layoutScene2 windowSize model render
        else
            layoutScene1 windowSize model render


type alias RenderWorld msg =
    Model.Eye -> Window.Size -> Model.Player msg -> List WebGL.Entity
<commit_msg>Add loading screen<commit_after>module View exposing (view)

import Color exposing (black, white)
import FontAwesome


-- import Html

import Html exposing (Html, text, div, p, span)
import Html.Attributes exposing (width, height, style)
import Math.Matrix4 as M4
import Math.Matrix4 exposing (Mat4)
import Math.Vector3 as V3
import Math.Vector3 exposing (..)
import Time exposing (Time)
import WebGL
import Window
import App exposing (..)
import Appearance exposing (Appearance, Perception)
import Body exposing (Body)
import Camera exposing (Camera)
import Camera.Util exposing (cameraUp)
import Model exposing (Model, Msg(..))
import Orientation


{-| Generate a View from a Model
-}
view :
    (worldModel -> Maybe Model.World)
    -> Model worldModel worldMsg
    -> Html (Msg worldMsg)
view worldView model =
    case ( model.maybeWindowSize, worldView model.worldModel ) of
        ( Nothing, _ ) ->
            text "Starting ..."

        ( Just windowSize, Nothing ) ->
            loading windowSize

        ( Just windowSize, Just world ) ->
            layoutScene windowSize model world

loading : Window.Size -> Html (Msg worldMsg)
loading windowSize =
    let
        left = 0
        right = 0
        helpHMargin = windowSize.width//10
        helpVMargin = windowSize.height//10

        overlayContent = text "Loading ..."
    in
        overlay left right helpHMargin helpVMargin overlayContent

layoutScene : Window.Size -> Model worldModel worldMsg -> Model.World -> Html (Msg worldMsg)
layoutScene windowSize model world =
    let
        render =
            renderWorld model.globalTime world
    in
        if model.player1.cameraVR then
            layoutSceneVR windowSize model render
        else if model.numPlayers == 2 then
            layoutScene2 windowSize model render
        else
            layoutScene1 windowSize model render


type alias RenderWorld msg =
    Model.Eye -> Window.Size -> Model.Player msg -> List WebGL.Entity

{'fraction_non_alphanumeric': 0.0769659788064696, 'fraction_numerical': 0.007808142777467931, 'mean_word_length': 2.771819137749737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, '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': '3047260', 'n_tokens_mistral': 993, 'n_tokens_neox': 938, 'n_words': 358}