OpenMoHAA 0.82.1
Loading...
Searching...
No Matches
uilabel.h
1/*
2===========================================================================
3Copyright (C) 2015 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23#pragma once
24
25class linkstring
26{
27public:
28 str value;
29 str string;
30
31 linkstring(str value, str string);
32};
33
34inline linkstring::linkstring(str value, str string)
35{
36 this->value = value;
37 this->string = string;
38}
39
40class UILabel : public UIWidget
41{
42 str label;
43 Container<linkstring *> m_linkstrings;
44 qboolean m_bLinkCvarToShader;
45 str m_sCurrentShaderName;
46 str m_sOneShotSoundName;
47 str m_sLoopingSoundName;
48 qboolean m_bOneShotTriggered;
49 float m_fOneShotSoundTime;
50 int m_iNextOneShotTime;
51 float m_fLoopingSoundStartVolume;
52 float m_fLoopingSoundHoldStartTime;
53 float m_fLoopingSoundEndVolume;
54 float m_fLoopingSoundRampTime;
55 int m_iNextStateTime;
56 int m_iSoundState;
57 int m_iLastEnterTime;
58 int m_iLastDrawTime;
59
60protected:
61 qboolean m_bOutlinedText;
62
63public:
64 CLASS_PROTOTYPE(UILabel);
65
66private:
67 void MouseEntered(Event *ev);
68 void MouseExited(Event *ev);
69 void LinkString(Event *ev);
70 int FindLinkString(str val);
71 void LabelLayoutShader(Event *ev);
72 void LabelLayoutTileShader(Event *ev);
73 // Added in 2.0
74 //====
75 void OneShotSound(Event *ev);
76 void LoopingSound(Event *ev);
77 void EventSetOutlinedText(Event *ev);
78 //====
79 void SetLinkCvarToShader(Event *ev);
80 void FrameInitialized() override; // Added in 2.0
81 void ProcessSounds(); // Added in 2.0
82
83public:
84 UILabel();
85
86 void SetLabel(str lab);
87 void Draw(void) override;
88};
Definition container.h:85
Definition listener.h:246
Definition str.h:77