OpenMoHAA 0.82.0
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{
37 this->value = value;
38 this->string = string;
39}
40
41class UILabel : public UIWidget
42{
43 str label;
44 Container<linkstring *> m_linkstrings;
45 qboolean m_bLinkCvarToShader;
46 str m_sCurrentShaderName;
47 str m_sOneShotSoundName;
48 str m_sLoopingSoundName;
49 qboolean m_bOneShotTriggered;
50 float m_fOneShotSoundTime;
51 int m_iNextOneShotTime;
52 float m_fLoopingSoundStartVolume;
53 float m_fLoopingSoundHoldStartTime;
54 float m_fLoopingSoundEndVolume;
55 float m_fLoopingSoundRampTime;
56 int m_iNextStateTime;
57 int m_iSoundState;
58 int m_iLastEnterTime;
59 int m_iLastDrawTime;
60
61protected:
62 qboolean m_bOutlinedText;
63
64public:
65 CLASS_PROTOTYPE(UILabel);
66
67private:
68 void MouseEntered(Event *ev);
69 void MouseExited(Event *ev);
70 void LinkString(Event *ev);
71 int FindLinkString(str val);
72 void LabelLayoutShader(Event *ev);
73 void LabelLayoutTileShader(Event *ev);
74 // Added in 2.0
75 //====
76 void OneShotSound(Event *ev);
77 void LoopingSound(Event *ev);
78 void EventSetOutlinedText(Event *ev);
79 //====
80 void SetLinkCvarToShader(Event *ev);
81 void FrameInitialized() override; // Added in 2.0
82 void ProcessSounds(); // Added in 2.0
83
84public:
85 UILabel();
86
87 void SetLabel(str lab);
88 void Draw(void) override;
89};
Definition container.h:85
Definition listener.h:246
Definition str.h:77