OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
consolewidget.h
Go to the documentation of this file.
1#pragma once
2
3#include <Tempest/Widget>
4#include <Tempest/Dialog>
5#include <Tempest/Shortcut>
6
7#include "marvin.h"
8
9class MainWindow;
10
11class ConsoleWidget : public Tempest::Widget {
12 public:
13 ConsoleWidget(const MainWindow& owner);
15
16 void printLine(std::string_view s);
17 void close();
18 int exec();
19
20 protected:
21 void paintEvent (Tempest::PaintEvent& e) override;
22 void keyDownEvent (Tempest::KeyEvent& e) override;
23 void keyRepeatEvent(Tempest::KeyEvent& e) override;
24 using Tempest::Widget::keyUpEvent;
25
26 void updateSizeHint();
27
28 private:
29 struct Overlay;
30
31 const MainWindow& mainWindow;
32 Tempest::UiOverlay* overlay = nullptr;
33 const Tempest::Texture2d* background = nullptr;
34 Tempest::Shortcut closeSk;
35 std::vector<std::string> log, cmdHist;
36 std::string currCmd;
37 size_t histPos = size_t(-1);
38 size_t cursPos = 0;
39 Marvin marvin;
40 };
41
void printLine(std::string_view s)
void keyDownEvent(Tempest::KeyEvent &e) override
void paintEvent(Tempest::PaintEvent &e) override
void keyRepeatEvent(Tempest::KeyEvent &e) override
Main application window handling game rendering and input.
Definition mainwindow.h:58
Definition marvin.h:9