<commit_before>﻿using UnityEngine;
using System.Collections.Generic;

public class ScreenEditSingleBasic : MonoBehaviour
{
    #region Class Member Variables

    public GameObject TopView;
    public GameObject SideView;
    public GameObject InnerCamera;

    private const float DIVISOR = 16;

    private float unit_w;
    private float unit_h;

    private Texture2D stripColor;
    private Texture2D logoBMS;
    private Texture2D signOutButton;
    private Texture2D backButton;
    private Texture2D topViewButton;
    private Texture2D sideViewButton;
    private Texture2D addButton;
    private Texture2D favoriteButton;

    private Rect rectStrip;
    private Rect rectBMSLogo;
    private Rect rectSignOut;
    private Rect rectLayoutLabel;
    private Rect rectItemLabel;
    private Rect rectBackButton;
    private Rect rectSideView;
    private Rect rectTopView;

    private Vector2 scrollPos = Vector2.zero;

    private GUIStyle labelStyle;
    private GUIStyle highlightStyle;

    #endregion

    #region Unity Loop Methods

    private void Start()
    {
        stripColor = new Texture2D(1, 1);
        stripColor.SetPixel(0, 0, Color.blue);
        stripColor.Apply();

        logoBMS = Resources.Load<Texture2D>("Textures/LogoBMS");
        signOutButton = Resources.Load<Texture2D>("Textures/SignOutTexture");
        backButton = Resources.Load<Texture2D>("Textures/BackTexture");
        topViewButton = Resources.Load<Texture2D>("Textures/TopViewTexture");
        sideViewButton = Resources.Load<Texture2D>("Textures/SideViewTexture");
        addButton = Resources.Load<Texture2D>("Textures/AddTexture");
        favoriteButton = Resources.Load<Texture2D>("Textures/FavoriteTexture");

        highlightStyle = new GUIStyle();
        highlightStyle.fontSize = 32;
        highlightStyle.fontStyle = FontStyle.Bold;
        highlightStyle.normal.textColor = Color.black;

        labelStyle = new GUIStyle();
        labelStyle.fontSize = 25;
        labelStyle.normal.textColor = Color.black;
    }

    private void Update()
    {
        unit_w = Screen.width / DIVISOR;
        unit_h = Screen.height / DIVISOR;
        rectStrip = new Rect(0, 0, Screen.width, unit_h * 2);
        rectBMSLogo = new Rect(unit_w, unit_h * 0.15f, unit_w * 5, unit_h * 1.7f);
        rectSignOut = new Rect(Screen.width - unit_w * 2, unit_h * 0.5f, unit_w * 1.5f, unit_h);
        rectBackButton = new Rect(Screen.width - unit_w * 4, unit_h * 0.5f, unit_w * 1.5f, unit_h);
        rectTopView = new Rect(unit_w, Screen.height - unit_h * 1.5f, unit_w * 1.5f, unit_h);
        rectSideView = new Rect(unit_w * 3, Screen.height - unit_h * 1.5f, unit_w * 1.5f, unit_h);

        Vector2 labelSize = highlightStyle.CalcSize(new GUIContent("Single Basic Layout"));
        rectLayoutLabel = new Rect(unit_w, unit_h * 2.5f, labelSize.x, labelSize.y);

        labelSize = highlightStyle.CalcSize(new GUIContent("Layout Items"));
        rectItemLabel = new Rect(unit_w * 9, unit_h * 2.5f, labelSize.x, labelSize.y);
    }

    private void OnGUI()
    {
        GUI.DrawTexture(rectStrip, stripColor);
        GUI.DrawTexture(rectBMSLogo, logoBMS);
        GUI.DrawTexture(rectSignOut, signOutButton);
        GUI.DrawTexture(rectBackButton, backButton);
        if (GUI.Button(rectBackButton, "", "Label"))
        {
            Application.LoadLevel(SceneController.Instance.BackStack.Pop());
        }

        if (GUI.Button(rectSignOut, "", "Label"))
        {
            SceneController.Instance.BackStack.Push("singleBasic");
            Application.LoadLevel("signon");
        }

        GUI.DrawTexture(rectTopView, topViewButton);
        if (GUI.Button(rectTopView, "", "Label"))
        {
            InnerCamera.transform.position = TopView.transform.position;
            InnerCamera.transform.rotation = TopView.transform.rotation;
        }

        GUI.DrawTexture(rectSideView, sideViewButton);
        if (GUI.Button(rectSideView, "", "Label"))
        {
            InnerCamera.transform.position = SideView.transform.position;
            InnerCamera.transform.rotation = SideView.transform.rotation;
        }

        GUI.Label(rectLayoutLabel, "Single Basic Layout", highlightStyle);
        GUI.Label(rectItemLabel, "Layout Items", highlightStyle);

        DrawItems();
    }

    #endregion

    private void DrawItems()
    {
        scrollPos = GUI.BeginScrollView(new Rect(0, 0, 0, 0), scrollPos, new Rect(0, 0, 0, 0));
        foreach (var item in SceneController.Instance.ItemList)
        {
            Rect rectAdd = new Rect(0, 0, 0, 0);
            Rect rectFavorite = new Rect(0, 0, 0, 0);

            Vector2 size = labelStyle.CalcSize(new GUIContent(item.Key));
            GUI.Label(new Rect(0, 0, size.x, size.y), item.Key, labelStyle);
            GUI.DrawTexture(new Rect(0, 0, 0, 0), item.Value.Logo);
            GUI.DrawTexture(new Rect(0, 0, 0, 0), item.Value.EfficiencyImage);<commit_msg>Adjusted item add view scroll scaling<commit_after>﻿using UnityEngine;
using System.Collections.Generic;

public class ScreenEditSingleBasic : MonoBehaviour
{
    #region Class Member Variables

    public GameObject TopView;
    public GameObject SideView;
    public GameObject InnerCamera;

    private const float DIVISOR = 16;

    private float unit_w;
    private float unit_h;

    private Texture2D stripColor;
    private Texture2D logoBMS;
    private Texture2D signOutButton;
    private Texture2D backButton;
    private Texture2D topViewButton;
    private Texture2D sideViewButton;
    private Texture2D addButton;
    private Texture2D favoriteButton;

    private Rect rectStrip;
    private Rect rectBMSLogo;
    private Rect rectSignOut;
    private Rect rectLayoutLabel;
    private Rect rectItemLabel;
    private Rect rectBackButton;
    private Rect rectSideView;
    private Rect rectTopView;

    private Vector2 scrollPos = Vector2.zero;

    private GUIStyle labelStyle;
    private GUIStyle highlightStyle;

    #endregion

    #region Unity Loop Methods

    private void Start()
    {
        stripColor = new Texture2D(1, 1);
        stripColor.SetPixel(0, 0, Color.blue);
        stripColor.Apply();

        logoBMS = Resources.Load<Texture2D>("Textures/LogoBMS");
        signOutButton = Resources.Load<Texture2D>("Textures/SignOutTexture");
        backButton = Resources.Load<Texture2D>("Textures/BackTexture");
        topViewButton = Resources.Load<Texture2D>("Textures/TopViewTexture");
        sideViewButton = Resources.Load<Texture2D>("Textures/SideViewTexture");
        addButton = Resources.Load<Texture2D>("Textures/AddTexture");
        favoriteButton = Resources.Load<Texture2D>("Textures/FavoriteTexture");

        highlightStyle = new GUIStyle();
        highlightStyle.fontSize = 32;
        highlightStyle.fontStyle = FontStyle.Bold;
        highlightStyle.normal.textColor = Color.black;

        labelStyle = new GUIStyle();
        labelStyle.fontSize = 25;
        labelStyle.normal.textColor = Color.black;
    }

    private void Update()
    {
        unit_w = Screen.width / DIVISOR;
        unit_h = Screen.height / DIVISOR;
        rectStrip = new Rect(0, 0, Screen.width, unit_h * 2);
        rectBMSLogo = new Rect(unit_w, unit_h * 0.15f, unit_w * 5, unit_h * 1.7f);
        rectSignOut = new Rect(Screen.width - unit_w * 2, unit_h * 0.5f, unit_w * 1.5f, unit_h);
        rectBackButton = new Rect(Screen.width - unit_w * 4, unit_h * 0.5f, unit_w * 1.5f, unit_h);
        rectTopView = new Rect(unit_w, Screen.height - unit_h * 1.5f, unit_w * 1.5f, unit_h);
        rectSideView = new Rect(unit_w * 3, Screen.height - unit_h * 1.5f, unit_w * 1.5f, unit_h);

        Vector2 labelSize = highlightStyle.CalcSize(new GUIContent("Single Basic Layout"));
        rectLayoutLabel = new Rect(unit_w, unit_h * 2.5f, labelSize.x, labelSize.y);

        labelSize = highlightStyle.CalcSize(new GUIContent("Layout Items"));
        rectItemLabel = new Rect(unit_w * 9, unit_h * 2.5f, labelSize.x, labelSize.y);
    }

    private void OnGUI()
    {
        GUI.DrawTexture(rectStrip, stripColor);
        GUI.DrawTexture(rectBMSLogo, logoBMS);
        GUI.DrawTexture(rectSignOut, signOutButton);
        GUI.DrawTexture(rectBackButton, backButton);
        if (GUI.Button(rectBackButton, "", "Label"))
        {
            Application.LoadLevel(SceneController.Instance.BackStack.Pop());
        }

        if (GUI.Button(rectSignOut, "", "Label"))
        {
            SceneController.Instance.BackStack.Push("singleBasic");
            Application.LoadLevel("signon");
        }

        GUI.DrawTexture(rectTopView, topViewButton);
        if (GUI.Button(rectTopView, "", "Label"))
        {
            InnerCamera.transform.position = TopView.transform.position;
            InnerCamera.transform.rotation = TopView.transform.rotation;
        }

        GUI.DrawTexture(rectSideView, sideViewButton);
        if (GUI.Button(rectSideView, "", "Label"))
        {
            InnerCamera.transform.position = SideView.transform.position;
            InnerCamera.transform.rotation = SideView.transform.rotation;
        }

        GUI.Label(rectLayoutLabel, "Single Basic Layout", highlightStyle);
        GUI.Label(rectItemLabel, "Layout Items", highlightStyle);

        DrawItems();
    }

    #endregion

    private void DrawItems()
    {
        scrollPos = GUI.BeginScrollView(new Rect(unit_w * 9, unit_h * 4, unit_w * 6, unit_h * 11), scrollPos, new Rect(0, 0, 2000, 2000));
        foreach (var item in SceneController.Instance.ItemList)
        {
            Rect rectAdd = new Rect(0, 0, 0, 0);
            Rect rectFavorite = new Rect(0, 0, 0, 0);

            Vector2 size = labelStyle.CalcSize(new GUIContent(item.Key));
            GUI.Label(new Rect(0, 0, size.x, size.y), item.Key, labelStyle);
            GUI.DrawTexture(new Rect(0, 0, 0, 0), item.Value.Logo);
            GUI.DrawTexture(new Rect(0, 0, 0, 0), item.Value.EfficiencyImage);
{'fraction_non_alphanumeric': 0.10590713067896901, 'fraction_numerical': 0.018553806037508776, 'mean_word_length': 2.8412942989214174, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '6945698', 'n_tokens_mistral': 3175, 'n_tokens_neox': 2996, 'n_words': 670}