45 lines
1.0 KiB
C
Raw Normal View History

2024-05-12 03:19:01 -04:00
#pragma once
#include <string>
#include "../options/parser.h"
2024-11-21 02:16:25 -05:00
#include "cache.h"
#include "flags/flags.h"
#include "../ui/frame.h"
2024-05-12 03:19:01 -04:00
2024-11-21 02:16:25 -05:00
// Default Configuration
2024-05-12 03:19:01 -04:00
#define DEFAULT_USERNAME "StevePi"
#define DEFAULT_RENDER_DISTANCE "Short"
2024-11-21 02:16:25 -05:00
// State
struct State {
explicit State(const launcher_cache &cache);
// Methods
void update(bool save);
2024-11-21 14:47:48 -05:00
bool operator==(const State &other) const;
2024-11-21 02:16:25 -05:00
// Properties
std::string username;
std::string render_distance;
Flags flags;
};
// UI
struct ConfigurationUI final : Frame {
explicit ConfigurationUI(State &state_);
int render() override;
private:
2024-11-21 14:47:48 -05:00
void update_render_distance();
int draw_bottom();
2024-11-21 02:16:25 -05:00
void draw_main();
void draw_advanced() const;
static void draw_category(FlagNode &category);
2024-11-21 14:47:48 -05:00
const State empty_state;
2024-11-21 02:16:25 -05:00
State &state;
int render_distance_index;
};
2024-05-12 03:19:01 -04:00
// Handle Non-Launch Commands
void handle_non_launch_client_only_commands(const options_t &options);
// Configure Client Options
void configure_client(const options_t &options);