Use configured resolution for login/outgame/ingame
[ryzomcore.git] / ryzom / client / src / client_sheets / character_sheet.h
blob39221eaadc0636bb14aa428f40ebdc9dde4cc371
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef CL_CHARACTER_SHEET_H
21 #define CL_CHARACTER_SHEET_H
24 /////////////
25 // INCLUDE //
26 /////////////
27 #include "client_sheets.h"
29 #include "nel/misc/types_nl.h"
30 #include "nel/misc/rgba.h"
32 #include "entity_sheet.h"
33 #include "ground_fx_sheet.h"
34 #include "body_to_bone_sheet.h"
35 // Game Share
36 #include "game_share/loot_harvest_state.h"
37 #include "game_share/people.h"
38 #include <vector>
39 #include <string>
42 ///////////
43 // USING //
44 ///////////
47 ///////////
48 // CLASS //
49 ///////////
50 namespace NLGEORGES
52 class UFormElm;
53 class UFormLoader;
56 /**
57 * Class to manage the character sheet.
58 * \author Guillaume PUZIN
59 * \author Nevrax France
60 * \date 2001
62 class CCharacterSheet : public CEntitySheet
64 public:
65 enum { NumAttackLists = 8 };
66 public:
67 class CEquipment
69 public:
70 NLMISC::TSStringId IdItem;
71 NLMISC::TSStringId IdBindPoint;
72 sint8 Texture;
73 sint8 Color;
75 CEquipment()
77 IdItem= NLMISC::CStaticStringMapper::emptyId();
78 IdBindPoint= NLMISC::CStaticStringMapper::emptyId();
79 Texture= 0;
80 Color= 0;
83 std::string getItem() const { return ClientSheetsStrings.get(IdItem); }
84 std::string getBindPoint() const { return ClientSheetsStrings.get(IdBindPoint); }
86 /// Serialize character sheet into binary data file.
87 virtual void serial(NLMISC::IStream &f)
90 ClientSheetsStrings.serial(f, IdItem);
91 f.serial(Texture);
92 f.serial(Color);
93 ClientSheetsStrings.serial(f, IdBindPoint);
97 // Character Gender.
98 uint8 Gender;
99 // Character Race
100 EGSPD::CPeople::TPeople Race;
101 // Character's skeleton.
102 NLMISC::TSStringId IdSkelFilename;
103 // Base Name of the animation set.
104 NLMISC::TSStringId IdAnimSetBaseName;
105 // Automaton Type
106 NLMISC::TSStringId IdAutomaton;
107 float Scale;
108 // The sound familly (used for sound context var 2)
109 uint32 SoundFamily;
110 // The sound variation (used for sound context var 3)
111 uint32 SoundVariation;
112 // Lod Character.
113 NLMISC::TSStringId IdLodCharacterName;
114 float LodCharacterDistance;
115 // value to scale the "pos" channel of the animation of the creature.
116 float CharacterScalePos;
117 // The name of the faction the creature belongs to
118 NLMISC::TSStringId IdFame;
120 // Possible(impossible) Actions.
121 bool Selectable;
122 bool Talkable;
123 bool Attackable;
124 bool Givable;
125 bool Mountable;
126 bool Turn;
127 bool SelectableBySpace;
128 //character harvest/loot state
129 LHSTATE::TLHState HLState;
132 // Equipment worm or creature body.
133 CEquipment Body;
134 CEquipment Legs;
135 CEquipment Arms;
136 CEquipment Hands;
137 CEquipment Feet;
138 CEquipment Head;
139 CEquipment Face;
140 CEquipment ObjectInRightHand;
141 CEquipment ObjectInLeftHand;
142 // Yoyo: if you add some, modify getWholeEquipmentList()
145 sint8 HairColor;
146 sint8 Skin;
147 sint8 EyesColor;
149 // NLMISC::TSStringId IdFirstName;
150 // NLMISC::TSStringId IdLastName;
152 float DistToFront;
153 float DistToBack;
154 float DistToSide;
156 float ColRadius;
157 float ColHeight;
158 float ColLength;
159 float ColWidth;
161 float ClipRadius;
162 float ClipHeight;
164 float MaxSpeed;
165 bool DisplayOSD;
166 // New flags created for bot objects
167 bool DisplayInRadar; // display the entity in the radar
168 bool DisplayOSDName; // name is displayed if (DisplayOSD && DisplayName)
169 bool DisplayOSDBars; // bars are displayed if (DisplayOSD && DisplayBars)
170 bool DisplayOSDForceOver; // even if ClientCfg.ShowNameUnderCursor==false, force OSD to display when under cursor (DisplayOSD must be true)
171 bool Traversable; // the client can traverse this entity after some force time
173 // Name positions on Z axis
174 float NamePosZLow;
175 float NamePosZNormal;
176 float NamePosZHigh;
178 // Alternative Look
179 std::vector<NLMISC::TSStringId> IdAlternativeClothes;
181 // Hair Item List
182 std::vector<CEquipment> HairItemList;
184 // list of fx for some ground type (step fxs)
185 std::vector<CGroundFXSheet> GroundFX;
187 // name of static FX played on entity (empty if none)
188 NLMISC::TSStringId IdStaticFX;
190 // body to bone
191 CBodyToBoneSheet BodyToBone;
193 // spell casting prefix. This prefix is used to see which sheet contains datas about spell casting
194 NLMISC::TSStringId SpellCastingPrefix;
196 // attack lists filenames
197 std::vector<NLMISC::TSStringId> AttackLists;
199 // consider
200 sint8 RegionForce; // Force depending on the region the creature belongs
201 sint8 ForceLevel; // Level of creature inside the same region
202 uint16 Level; // Precise level of the creature
204 bool R2Npc;
206 class CCastRay
208 public:
209 NLMISC::CVector Origin;
210 NLMISC::CVector Pos;
211 void serial(NLMISC::IStream &f)
213 f.serial(Origin);
214 f.serial(Pos);
217 // offset for projectile casting (useful for watchtowers as they got no bones)
218 std::vector<CCastRay> ProjectileCastRay;
220 /// Constructor
221 CCharacterSheet();
223 std::string getSkelFilename() const { return ClientSheetsStrings.get(IdSkelFilename); }
224 std::string getAnimSetBaseName() const { return ClientSheetsStrings.get(IdAnimSetBaseName); }
225 std::string getAutomaton() const { return ClientSheetsStrings.get(IdAutomaton); }
226 std::string getLodCharacterName() const { return ClientSheetsStrings.get(IdLodCharacterName); }
227 std::string getFame() const { return ClientSheetsStrings.get(IdFame); }
228 // std::string getFirstName() const { return ClientSheetsStrings.get(IdFirstName); }
229 // std::string getLastName() const { return ClientSheetsStrings.get(IdLastName); }
230 std::string getAlternativeClothes(uint i) const { return ClientSheetsStrings.get(IdAlternativeClothes[i]); }
231 std::string getStaticFX() const { return ClientSheetsStrings.get(IdStaticFX); }
233 /// Build the sheet from an external script.
234 virtual void build(const NLGEORGES::UFormElm &item);
236 /// Serialize character sheet into binary data file.
237 virtual void serial(NLMISC::IStream &f);
239 /// Return the list of all equipement possibles (body... + HairList). Pointers should be used localy
240 void getWholeEquipmentList(std::vector<const CEquipment*> &equipList) const;
242 private:
243 /// Read an equipment slot.
244 void readEquipment(const NLGEORGES::UFormElm &form, const std::string &key, CEquipment &slot);
248 #endif // CL_CHARACTER_SHEET_H
250 /* End of character_sheet.h */