<commit_before>﻿using Frenetic;
using Frenetic.CommandSystem;
using Voxalia.Shared.Files;

namespace Voxalia.ClientGame.CommandSystem
{
    /// <summary>
    /// Handles the clientside CVar system.
    /// </summary>
    public class ClientCVar
    {
        /// <summary>
        /// The CVar System the client will use.
        /// </summary>
        public CVarSystem system;

        // System CVars
        public CVar s_filepath, s_glversion, s_glrenderer, s_glvendor, s_littleendian;

        // Game CVars
        public CVar g_timescale, g_firstperson;

        // Network CVars
        public CVar n_first, n_debugmovement;

        // Renderer CVars
        public CVar r_fullscreen, r_width, r_height, r_antialiasing, r_vsync, r_lighting, r_renderwireframe,
            r_fov, r_znear, r_zfar,
            r_dof_strength,
            r_maxfps,
            r_lightmaxdistance,
            r_shadowquality_flashlight, r_shadowquality_max, r_shadowblur, r_shadowquality_sun, r_shadowpace,
            r_highlight_targetblock, r_highlight_placeblock,
            r_good_graphics, r_skybox;

        // Audio CVars
        public CVar a_musicvolume, a_musicpitch, a_globalvolume, a_globalpitch;

        // UI CVars
        public CVar u_mouse_sensitivity, u_reticle, u_reticlescale, u_showhud;

        /// <summary>
        /// Prepares the CVar system, generating default CVars.
        /// </summary>
        public void Init(Outputter output)
        {
            system = new CVarSystem(output);

            // System CVars
            s_filepath = Register("s_filepath", Program.Files.BaseDirectory, CVarFlag.Textual | CVarFlag.ReadOnly); // The current system environment filepath (The directory of /data).
            s_glversion = Register("s_glversion", "UNKNOWN", CVarFlag.Textual | CVarFlag.ReadOnly); // What version of OpenGL is in use.
            s_glrenderer = Register("s_glrenderer", "UNKNOWN", CVarFlag.Textual | CVarFlag.ReadOnly); // What renderer for OpenGL is in use.
            s_glvendor = Register("s_glvendor", "UNKNOWN", CVarFlag.Textual | CVarFlag.ReadOnly); // What graphics card vendor made the device being used for rendering.
            // Game CVars
            g_timescale = Register("g_timescale", "1", CVarFlag.Numeric | CVarFlag.ServerControl); // The current game time scale value.
            g_firstperson = Register("g_firstperson", "true", CVarFlag.Boolean); // Whether to be in FirstPerson view mode.
            // Network CVars
            n_first = Register("n_first", "ipv4", CVarFlag.Textual); // Whether to prefer IPv4 or IPv6.
            n_debugmovement = Register("n_debugmovement", "false", CVarFlag.Boolean); // Whether to debug movement networking.
            // Renderer CVars
            r_fullscreen = Register("r_fullscreen", "false", CVarFlag.Boolean | CVarFlag.Delayed); // Whether to use fullscreen mode.
            r_width = Register("r_width", "800", CVarFlag.Numeric | CVarFlag.Delayed); // What width the window should be.
            r_height = Register("r_height", "600", CVarFlag.Numeric | CVarFlag.Delayed); // What height the window should be.
            r_antialiasing = Register("r_antialiasing", "2", CVarFlag.Numeric | CVarFlag.Delayed); // What AA mode to use (0 = none). // TODO: IMPLEMENT
            r_vsync = Register("r_vsync", "true", CVarFlag.Boolean); // Whether to use vertical synchronization mode.
            r_lighting = Register("r_lighting", "true", CVarFlag.Boolean); // Whether to enable 3D lighting (Otherwise, use FullBright).
            r_renderwireframe = Register("r_renderwireframe", "false", CVarFlag.Boolean); // Whether to render a wireframe.
            r_fov = Register("r_fov", "70", CVarFlag.Numeric); // What Field of Vision range value to use.
            r_znear = Register("r_znear", "0.1", CVarFlag.Numeric); // How close the near plane should be to the camera.
            r_zfar = Register("r_zfar", "1000", CVarFlag.Numeric); // How far the far plane should be from the camera.
            r_dof_strength = Register("r_dof_strength", "4", CVarFlag.Numeric); // How strong the Depth Of Field effect should be.
            r_maxfps = Register("r_maxfps", "60", CVarFlag.Numeric | CVarFlag.Delayed); // What the FPS cap should be.
            r_lightmaxdistance = Register("r_lightmaxdistance", "35", CVarFlag.Numeric); // How far away a light can be from the camera before it is disabled.
            r_shadowquality_flashlight = Register("r_shadowquality_flashlight", "512", CVarFlag.Numeric); // What texture size to use for flashlight shadows.
            r_shadowquality_max = Register("r_shadowquality_max", "2048", CVarFlag.Numeric); // What maximum light texture size to accept from the server.
            r_shadowblur = Register("r_shadowblur", "0.25", CVarFlag.Numeric); // What factor to use for shadow blurring. Smaller = blurrier.
            r_shadowquality_sun = Register("r_shadowquality_sun", "2048", CVarFlag.Numeric | CVarFlag.Delayed); // What texture size to use for the sun. // TODO: Callback to auto-set
            r_shadowpace = Register("r_shadowpace", "2", CVarFlag.Numeric); // How rapidly to rerender shadows, in frames.
            r_highlight_targetblock = Register("r_highlight_targetblock", "true", CVarFlag.Boolean); // Whether to highlight the targeted block. // TODO: u_?
            r_highlight_placeblock = Register("r_highlight_placeblock", "true", CVarFlag.Boolean); // Whether to highlight the targeted placement block. // TODO: u_?
            r_good_graphics = Register("r_good_graphics", "true", CVarFlag.Boolean | CVarFlag.Delayed); // Whether to use 'good' graphics. // TODO: Callback to auto-set
            r_skybox = Register("r_skybox", "default", CVarFlag.ServerControl | CVarFlag.Textual); // What skybox to use.
            // Audio CVars
            a_musicvolume = Register("a_musicvolume", "1", CVarFlag.Numeric | CVarFlag.Delayed); // What volume the music should be.<commit_msg>change default res to 720p<commit_after>﻿using Frenetic;
using Frenetic.CommandSystem;
using Voxalia.Shared.Files;

namespace Voxalia.ClientGame.CommandSystem
{
    /// <summary>
    /// Handles the clientside CVar system.
    /// </summary>
    public class ClientCVar
    {
        /// <summary>
        /// The CVar System the client will use.
        /// </summary>
        public CVarSystem system;

        // System CVars
        public CVar s_filepath, s_glversion, s_glrenderer, s_glvendor, s_littleendian;

        // Game CVars
        public CVar g_timescale, g_firstperson;

        // Network CVars
        public CVar n_first, n_debugmovement;

        // Renderer CVars
        public CVar r_fullscreen, r_width, r_height, r_antialiasing, r_vsync, r_lighting, r_renderwireframe,
            r_fov, r_znear, r_zfar,
            r_dof_strength,
            r_maxfps,
            r_lightmaxdistance,
            r_shadowquality_flashlight, r_shadowquality_max, r_shadowblur, r_shadowquality_sun, r_shadowpace,
            r_highlight_targetblock, r_highlight_placeblock,
            r_good_graphics, r_skybox;

        // Audio CVars
        public CVar a_musicvolume, a_musicpitch, a_globalvolume, a_globalpitch;

        // UI CVars
        public CVar u_mouse_sensitivity, u_reticle, u_reticlescale, u_showhud;

        /// <summary>
        /// Prepares the CVar system, generating default CVars.
        /// </summary>
        public void Init(Outputter output)
        {
            system = new CVarSystem(output);

            // System CVars
            s_filepath = Register("s_filepath", Program.Files.BaseDirectory, CVarFlag.Textual | CVarFlag.ReadOnly); // The current system environment filepath (The directory of /data).
            s_glversion = Register("s_glversion", "UNKNOWN", CVarFlag.Textual | CVarFlag.ReadOnly); // What version of OpenGL is in use.
            s_glrenderer = Register("s_glrenderer", "UNKNOWN", CVarFlag.Textual | CVarFlag.ReadOnly); // What renderer for OpenGL is in use.
            s_glvendor = Register("s_glvendor", "UNKNOWN", CVarFlag.Textual | CVarFlag.ReadOnly); // What graphics card vendor made the device being used for rendering.
            // Game CVars
            g_timescale = Register("g_timescale", "1", CVarFlag.Numeric | CVarFlag.ServerControl); // The current game time scale value.
            g_firstperson = Register("g_firstperson", "true", CVarFlag.Boolean); // Whether to be in FirstPerson view mode.
            // Network CVars
            n_first = Register("n_first", "ipv4", CVarFlag.Textual); // Whether to prefer IPv4 or IPv6.
            n_debugmovement = Register("n_debugmovement", "false", CVarFlag.Boolean); // Whether to debug movement networking.
            // Renderer CVars
            r_fullscreen = Register("r_fullscreen", "false", CVarFlag.Boolean | CVarFlag.Delayed); // Whether to use fullscreen mode.
            r_width = Register("r_width", "1280", CVarFlag.Numeric | CVarFlag.Delayed); // What width the window should be.
            r_height = Register("r_height", "720", CVarFlag.Numeric | CVarFlag.Delayed); // What height the window should be.
            r_antialiasing = Register("r_antialiasing", "2", CVarFlag.Numeric | CVarFlag.Delayed); // What AA mode to use (0 = none). // TODO: IMPLEMENT
            r_vsync = Register("r_vsync", "true", CVarFlag.Boolean); // Whether to use vertical synchronization mode.
            r_lighting = Register("r_lighting", "true", CVarFlag.Boolean); // Whether to enable 3D lighting (Otherwise, use FullBright).
            r_renderwireframe = Register("r_renderwireframe", "false", CVarFlag.Boolean); // Whether to render a wireframe.
            r_fov = Register("r_fov", "70", CVarFlag.Numeric); // What Field of Vision range value to use.
            r_znear = Register("r_znear", "0.1", CVarFlag.Numeric); // How close the near plane should be to the camera.
            r_zfar = Register("r_zfar", "1000", CVarFlag.Numeric); // How far the far plane should be from the camera.
            r_dof_strength = Register("r_dof_strength", "4", CVarFlag.Numeric); // How strong the Depth Of Field effect should be.
            r_maxfps = Register("r_maxfps", "60", CVarFlag.Numeric | CVarFlag.Delayed); // What the FPS cap should be.
            r_lightmaxdistance = Register("r_lightmaxdistance", "35", CVarFlag.Numeric); // How far away a light can be from the camera before it is disabled.
            r_shadowquality_flashlight = Register("r_shadowquality_flashlight", "512", CVarFlag.Numeric); // What texture size to use for flashlight shadows.
            r_shadowquality_max = Register("r_shadowquality_max", "2048", CVarFlag.Numeric); // What maximum light texture size to accept from the server.
            r_shadowblur = Register("r_shadowblur", "0.25", CVarFlag.Numeric); // What factor to use for shadow blurring. Smaller = blurrier.
            r_shadowquality_sun = Register("r_shadowquality_sun", "2048", CVarFlag.Numeric | CVarFlag.Delayed); // What texture size to use for the sun. // TODO: Callback to auto-set
            r_shadowpace = Register("r_shadowpace", "2", CVarFlag.Numeric); // How rapidly to rerender shadows, in frames.
            r_highlight_targetblock = Register("r_highlight_targetblock", "true", CVarFlag.Boolean); // Whether to highlight the targeted block. // TODO: u_?
            r_highlight_placeblock = Register("r_highlight_placeblock", "true", CVarFlag.Boolean); // Whether to highlight the targeted placement block. // TODO: u_?
            r_good_graphics = Register("r_good_graphics", "true", CVarFlag.Boolean | CVarFlag.Delayed); // Whether to use 'good' graphics. // TODO: Callback to auto-set
            r_skybox = Register("r_skybox", "default", CVarFlag.ServerControl | CVarFlag.Textual); // What skybox to use.
            // Audio CVars
            a_musicvolume = Register("a_musicvolume", "1", CVarFlag.Numeric | CVarFlag.Delayed); // What volume the music should be.
{'fraction_non_alphanumeric': 0.10480495563368492, 'fraction_numerical': 0.007366482504604052, 'mean_word_length': 2.8576041330319666, 'pattern_counts': {'":': 0, '<': 15, '<?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': '2872', 'n_tokens_mistral': 3573, 'n_tokens_neox': 3475, 'n_words': 1001}