<commit_before>#include "MainMenu.h"
#include "Layout.h"
#include "ScreenManager.h"
#include "ResourceManager.h"

/*
todo: refactor:
add listener for each button
new Command(this, onActivated)
*/


using namespace volt;

MainMenu::MainMenu() : _wasClosed(false), _initialMenu(true) {
	_buttonList.addButton("New Game", MainMenu::btnNewGame);
	_buttonList.addButton("Resume Game", MainMenu::btnResumeGame);
	_buttonList.addButton("About", MainMenu::btnAbout);
	_buttonList.addButton("Exit", MainMenu::btnExit);
	_buttonList.selectFirstButton();

	// todo:
	// -- _logoSprite.SetImage(game::ResourceManager::GetImage("logo.png"));
}


void MainMenu::Render(sf::RenderTarget& target) const {
	sf::Color screenColor = sf::Color(0,0,0,128);
	sf::FloatRect screenRect = game::ScreenManager::GetLayout().GetRect();
	sf::Shape screenBg = sf::Shape::Rectangle(screenRect.Left, screenRect.Top, screenRect.Right, screenRect.Bottom, screenColor);
	target.Draw(screenBg);


	sf::FloatRect rect = _buttonList.GetRect();
	float x = _buttonList.GetPosition().x;
	float y = _buttonList.GetPosition().y;

	float x1 = x - 20;
	float y1 = y - 20;
	float x2 = x + rect.Right + 20;
	float y2 = y + rect.Bottom + 20;

	sf::Shape background = sf::Shape::Rectangle(x1, y1, x2, y2, sf::Color(64,0,0,192), 1.0f, sf::Color(255,255,255,128));
	target.Draw(background);
	target.Draw(_buttonList);
	//target.Draw(_logoSprite);
}

void MainMenu::HandleEvent(const sf::Event& e) {<commit_msg>main menu changes<commit_after>#include "MainMenu.h"
#include "Layout.h"
#include "ScreenManager.h"
#include "ResourceManager.h"

using namespace volt;

MainMenu::MainMenu() : _wasClosed(false), _initialMenu(true) {
	_buttonList.addButton("New Game", MainMenu::btnNewGame);
	_buttonList.addButton("Resume Game", MainMenu::btnResumeGame);
	_buttonList.addButton("About", MainMenu::btnAbout);
	_buttonList.addButton("Exit", MainMenu::btnExit);
	_buttonList.selectFirstButton();

	// todo:
	// -- _logoSprite.SetImage(game::ResourceManager::GetImage("logo.png"));
}

void MainMenu::Render(sf::RenderTarget& target) const {
	sf::Color screenColor = sf::Color(0,0,0,128);
	sf::FloatRect screenRect = game::ScreenManager::GetLayout().GetRect();
	sf::Shape screenBg = sf::Shape::Rectangle(screenRect.Left, screenRect.Top, screenRect.Right, screenRect.Bottom, screenColor);
	target.Draw(screenBg);


	sf::FloatRect rect = _buttonList.GetRect();
	float x = _buttonList.GetPosition().x;
	float y = _buttonList.GetPosition().y;

	float x1 = x - 20;
	float y1 = y - 20;
	float x2 = x + rect.Right + 20;
	float y2 = y + rect.Bottom + 20;

	sf::Shape background = sf::Shape::Rectangle(x1, y1, x2, y2, sf::Color(64,0,0,192), 1.0f, sf::Color(255,255,255,128));
	target.Draw(background);
	target.Draw(_buttonList);
	//target.Draw(_logoSprite);
}

void MainMenu::HandleEvent(const sf::Event& e) {
{'fraction_non_alphanumeric': 0.16884032428621784, 'fraction_numerical': 0.03031371166725414, 'mean_word_length': 6.390625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '488229', 'n_tokens_mistral': 1053, 'n_tokens_neox': 994, 'n_words': 188}