Fix css style order when using external css files
[ryzomcore.git] / ryzom / client / src / interface_v3 / group_in_scene.h
blob777379f1ee6c57d5a453d33044f384bb4f221e7c
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef CL_GROUP_IN_SCENE_HELP_H
24 #define CL_GROUP_IN_SCENE_HELP_H
26 #include "nel/misc/types_nl.h"
27 #include "nel/gui/group_container.h"
28 #include "nel/gui/group_menu.h"
31 /**
32 * Group Displayed "InScene", with a 3d Position
33 * NB: it does require that you change the Position each frame, but you don't have to call
34 * invalidateCoords() each frame
35 * \author Cyril 'Hulud' Corvazier
36 * \author Nevrax France
37 * \date 2003
39 class CGroupInScene : public CInterfaceGroup
41 public:
42 DECLARE_UI_CLASS(CGroupInScene)
43 // Constructor
44 CGroupInScene(const TCtorParam &param);
45 ~CGroupInScene();
47 // From CInterfaceElement
48 virtual void updateCoords();
49 virtual void draw();
50 virtual bool parse (xmlNodePtr cur, CInterfaceGroup *parent);
51 // Called each frame to just move X/Y positions.
52 virtual void onFrameUpdateWindowPos (sint dx, sint dy);
54 // Position of the group in world space
55 NLMISC::CVector Position;
56 // useful only if getUserScale()==true
57 float Scale;
59 void setUserScale(bool us);
60 bool getUserScale() const {return _UserScale;}
62 REFLECT_EXPORT_START(CGroupInScene, CInterfaceGroup)
63 REFLECT_SINT32("offset_x", getOffsetX, setOffsetX);
64 REFLECT_SINT32("offset_y", getOffsetY, setOffsetY);
65 REFLECT_EXPORT_END
67 sint32 getOffsetX() const { return _OffsetX; }
68 void setOffsetX(sint32 dmh) { _OffsetX = dmh; }
69 sint32 getOffsetY() const { return _OffsetY; }
70 void setOffsetY(sint32 dmh) { _OffsetY = dmh; }
72 // set/return the ZBias for this group in scene (default 0)
73 void setZBias(float zbias) {_ZBias= zbias;}
74 float getZBias() const {return _ZBias;}
76 virtual void serial(NLMISC::IStream &f);
78 protected:
80 // Projected Position memorized. x/y is in window coordinate, while z in is world/camera coordinate
81 NLMISC::CVector _ProjCenter;
83 // Offset
84 sint32 _OffsetX, _OffsetY;
86 // scale the group according to user setup
87 bool _UserScale;
89 // Zbias
90 float _ZBias;
92 void computeWindowPos(sint32 &newX, sint32 &newY, NLMISC::CVector &newProjCenter);
94 static const float NearDrawClip;
98 #endif // CL_GROUP_IN_SCENE_HELP_H