git repos / blockattack-game

blame: source/code/editor/SagoTextureSelector.hpp

normal view · raw

1828235c Poul Sander 2025-08-10 10:46 1
/*
1828235c Poul Sander 2025-08-10 10:46 2
===========================================================================
1828235c Poul Sander 2025-08-10 10:46 3
 * Sago Multi Scrambler Puzzle
1828235c Poul Sander 2025-08-10 10:46 4
Copyright (C) 2022 Poul Sander
1828235c Poul Sander 2025-08-10 10:46 5
1828235c Poul Sander 2025-08-10 10:46 6
This program is free software: you can redistribute it and/or modify
1828235c Poul Sander 2025-08-10 10:46 7
it under the terms of the GNU General Public License as published by
1828235c Poul Sander 2025-08-10 10:46 8
the Free Software Foundation, either version 2 of the License, or
1828235c Poul Sander 2025-08-10 10:46 9
(at your option) any later version.
1828235c Poul Sander 2025-08-10 10:46 10
1828235c Poul Sander 2025-08-10 10:46 11
This program is distributed in the hope that it will be useful,
1828235c Poul Sander 2025-08-10 10:46 12
but WITHOUT ANY WARRANTY; without even the implied warranty of
1828235c Poul Sander 2025-08-10 10:46 13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1828235c Poul Sander 2025-08-10 10:46 14
GNU General Public License for more details.
1828235c Poul Sander 2025-08-10 10:46 15
1828235c Poul Sander 2025-08-10 10:46 16
You should have received a copy of the GNU General Public License
1828235c Poul Sander 2025-08-10 10:46 17
along with this program.  If not, see http://www.gnu.org/licenses/
1828235c Poul Sander 2025-08-10 10:46 18
1828235c Poul Sander 2025-08-10 10:46 19
Source information and contacts persons can be found at
1828235c Poul Sander 2025-08-10 10:46 20
https://github.com/sago007/saland
1828235c Poul Sander 2025-08-10 10:46 21
===========================================================================
1828235c Poul Sander 2025-08-10 10:46 22
*/
1828235c Poul Sander 2025-08-10 10:46 23
1828235c Poul Sander 2025-08-10 10:46 24
#include "../../sago/GameStateInterface.hpp"
1828235c Poul Sander 2025-08-10 10:46 25
#include <vector>
1828235c Poul Sander 2025-08-10 10:46 26
#include <string>
1828235c Poul Sander 2025-08-10 10:46 27
#include "editor_loader.hpp"
1828235c Poul Sander 2025-08-10 10:46 28
1828235c Poul Sander 2025-08-10 10:46 29
#pragma once
1828235c Poul Sander 2025-08-10 10:46 30
1828235c Poul Sander 2025-08-10 10:46 31
class SagoTextureSelector : public sago::GameStateInterface {
1828235c Poul Sander 2025-08-10 10:46 32
public:
1828235c Poul Sander 2025-08-10 10:46 33
	SagoTextureSelector();
1828235c Poul Sander 2025-08-10 10:46 34
	SagoTextureSelector(const SagoTextureSelector& orig) = delete;
1828235c Poul Sander 2025-08-10 10:46 35
	virtual ~SagoTextureSelector();
1828235c Poul Sander 2025-08-10 10:46 36
	
1828235c Poul Sander 2025-08-10 10:46 37
	bool IsActive() override;
1828235c Poul Sander 2025-08-10 10:46 38
	void ProcessInput(const SDL_Event& event, bool &processed) override;
1828235c Poul Sander 2025-08-10 10:46 39
	void Draw(SDL_Renderer* target) override;
1828235c Poul Sander 2025-08-10 10:46 40
	void Update() override;
1828235c Poul Sander 2025-08-10 10:46 41
	void Init();
1828235c Poul Sander 2025-08-10 10:46 42
1828235c Poul Sander 2025-08-10 10:46 43
	void runTextureSelectorFrame(SDL_Renderer* target);
1828235c Poul Sander 2025-08-10 10:46 44
	void runSpriteSelectorFrame(SDL_Renderer* target);
1828235c Poul Sander 2025-08-10 10:46 45
1828235c Poul Sander 2025-08-10 10:46 46
private:
1828235c Poul Sander 2025-08-10 10:46 47
	bool isActive = true;
1828235c Poul Sander 2025-08-10 10:46 48
	std::vector<std::string> textures;
1828235c Poul Sander 2025-08-10 10:46 49
	std::map<std::string,SagoSprite> sprites;
1828235c Poul Sander 2025-08-10 10:46 50
	std::string selected_texture;
1828235c Poul Sander 2025-08-10 10:46 51
	std::string selected_sprite;
c461394a Poul Sander 2025-09-17 20:23 52
	int grid_size = 32;
1828235c Poul Sander 2025-08-10 10:46 53
};