Skip to content

Commit 1873b07

Browse files
committed
Add missing files
1 parent f87a08d commit 1873b07

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
===========================================================================
3+
blockattack - Block Attack - Rise of the Blocks
4+
Copyright (C) 2005-2025 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://blockattack.net
21+
===========================================================================
22+
*/
23+
24+
#include "PuzzleEditorState.hpp"
25+
#include "imgui.h"
26+
#include "backends/imgui_impl_sdl2.h"
27+
#include "backends/imgui_impl_sdlrenderer2.h"
28+
29+
30+
31+
bool PuzzleEditorState::IsActive() {
32+
return isActive;
33+
}
34+
35+
void PuzzleEditorState::ProcessInput(const SDL_Event& event, bool& processed) {
36+
ImGui_ImplSDL2_ProcessEvent(&event);
37+
}
38+
39+
void PuzzleEditorState::Draw(SDL_Renderer* target) {
40+
ImGui::Begin("File list", nullptr, ImGuiWindowFlags_NoCollapse);
41+
if (ImGui::Selectable("File 1", this->selected_file == "File 1")) {
42+
this->selected_file = "File 1";
43+
}
44+
if (ImGui::Selectable("File 2", this->selected_file == "File 2")) {
45+
this->selected_file = "File 2";
46+
}
47+
48+
ImGui::End();
49+
}
50+
51+
void PuzzleEditorState::Update() {
52+
}
53+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
===========================================================================
3+
blockattack - Block Attack - Rise of the Blocks
4+
Copyright (C) 2005-2025 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://blockattack.net
21+
===========================================================================
22+
*/
23+
24+
25+
#pragma once
26+
27+
#include "../sago/GameStateInterface.hpp"
28+
#include <string>
29+
30+
31+
32+
class PuzzleEditorState : public sago::GameStateInterface {
33+
public:
34+
PuzzleEditorState() = default;
35+
PuzzleEditorState(const PuzzleEditorState& orig) = delete;
36+
virtual ~PuzzleEditorState() = default;
37+
38+
bool IsActive() override;
39+
void ProcessInput(const SDL_Event& event, bool& processed) override;
40+
void Draw(SDL_Renderer* target) override;
41+
void Update() override;
42+
43+
private:
44+
bool isActive = true;
45+
std::string selected_file;
46+
};

0 commit comments

Comments
 (0)