#pragma once

#include <Progress.h>
#include <TextField.h>

#include "Menu.h"
#undef LoadMenu

class ServerStatus;
class FactoryClient;

class LoadMenu : public Menu
{
private:
    ProgressBar* step;
    TextField* stepTitle;
    ProgressBar* stage;
    TextField* stageTitle;
    ProgressBar* all;

public:
    LoadMenu(Screen* zScreen);
    void load(FactoryClient* client,
        Text name,
        Text secret,
        unsigned short port,
        std::function<void(int, Text)> onFinish);
    void stepProgress(int stepSize);
    void beginNextStep(const char* title, int nextStepSize);
    void stageProgress(int stepSize);
    void beginNextStage(const char* title, int nextStageSize);
    void allProgress(int stepSize);
};

Image* loadImage(Framework::Text path);