Skip to content

Commit

Permalink
Merge pull request #12 from o-reo/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
o-reo authored Oct 3, 2022
2 parents ab370f0 + a2153db commit bdcee74
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,8 @@ void Gui::_updateBars() {

void Gui::_updateControls() {
ImGui::Begin("Controls");
ImGui::SliderInt("Speed", &this->speed, 1, 240, "%i/s");
ImGui::SliderInt("Speed", &this->speed, 1, 500, "%i/s");

if (ImGui::Button("Load")) {
this->state = STATE::Stopped;
this->queues.start(Utils::SplitStringToInt(this->numbers, ' '));
this->queues.commands = this->pushswap.commands;
}

ImGui::SameLine();
if (ImGui::Button("Start")) {
this->state = STATE::Running;
}
Expand Down Expand Up @@ -119,6 +112,10 @@ void Gui::_updateControls() {
ImGui::InputText("", &this->pushswap.path);
if (ImGui::Button("Compute")) {
this->pushswap.run(this->numbers);
this->state = STATE::Stopped;
this->queues.start(Utils::SplitStringToInt(this->numbers, ' '));
this->queues.commands = this->pushswap.commands;
this->queues.executedCommands.clear();
}

std::string status{"..."};
Expand Down

0 comments on commit bdcee74

Please sign in to comment.