ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

dialogpanel.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the AUTHORS
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef STARK_UI_DIALOG_PANEL_H
00024 #define STARK_UI_DIALOG_PANEL_H
00025 
00026 #include "engines/stark/ui/window.h"
00027 
00028 #include "engines/stark/visual/text.h"
00029 
00030 #include "common/scummsys.h"
00031 #include "common/str.h"
00032 #include "common/str-array.h"
00033 #include "common/array.h"
00034 #include "common/rect.h"
00035 
00036 namespace Stark {
00037 
00038 class VisualImageXMG;
00039 class ClickText;
00040 
00041 namespace Resources {
00042 class Speech;
00043 }
00044 
00045 class DialogPanel : public Window {
00046 public:
00047     DialogPanel(Gfx::Driver *gfx, Cursor *cursor);
00048     virtual ~DialogPanel();
00049 
00051     void reset();
00052 
00054     void onScreenChanged();
00055 
00057     void scrollUp();
00058     void scrollDown();
00059 
00061     void focusNextOption();
00062     void focusPrevOption();
00063 
00065     void selectFocusedOption();
00066 
00068     void selectOption(uint index);
00069 
00070 protected:
00071     void onMouseMove(const Common::Point &pos) override;
00072     void onClick(const Common::Point &pos) override;
00073     void onRightClick(const Common::Point &pos) override;
00074     void onGameLoop() override;
00075     void onRender() override;
00076 
00077 private:
00078     void updateSubtitleVisual();
00079     void clearSubtitleVisual();
00080     void updateDialogOptions();
00081     void clearOptions();
00082     void renderOptions();
00083     void renderScrollArrows() const;
00084 
00085     void updateFirstVisibleOption();
00086     void updateLastVisibleOption();
00087 
00088     VisualImageXMG *_passiveBackGroundTexture;
00089     VisualImageXMG *_activeBackGroundTexture;
00090     VisualImageXMG *_scrollUpArrowImage;
00091     VisualImageXMG *_scrollDownArrowImage;
00092     VisualImageXMG *_dialogOptionBullet;
00093     VisualText *_subtitleVisual;
00094 
00095     bool _scrollUpArrowVisible;
00096     bool _scrollDownArrowVisible;
00097     Common::Rect _scrollUpArrowRect;
00098     Common::Rect _scrollDownArrowRect;
00099 
00100     Resources::Speech *_currentSpeech;
00101     void abortCurrentSpeech();
00102 
00103     uint32 _firstVisibleOption, _lastVisibleOption;
00104     uint32 _focusedOption;
00105     Common::Array<ClickText*> _options;
00106     bool _acceptIdleMousePos;
00107 
00108     static const Color _aprilColor;
00109     static const Color _otherColor;
00110     static const uint32 _optionsTop = 4;
00111     static const uint32 _optionsLeft = 30;
00112     static const uint32 _optionsHeight = 80;
00113 };
00114 
00115 } // End of namespace Stark
00116 
00117 #endif // STARK_UI_DIALOG_PANEL_H


Generated on Sat Feb 16 2019 05:00:49 for ResidualVM by doxygen 1.7.1
curved edge   curved edge