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