Use configured resolution for login/outgame/ingame
[ryzomcore.git] / ryzom / client / src / client_sheets / pact_sheet.cpp
blob0b3af5b1ea6934a86373c2caf121740fe767eb31
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/>.
19 #include "stdpch.h"
20 // Application
21 #include "pact_sheet.h"
22 // Georges
23 #include "nel/georges/u_form_elm.h"
25 using namespace NLGEORGES;
27 //=================================================================================
28 void CPactSheet::build(const NLGEORGES::UFormElm &root)
30 Type = PACT;
31 const UFormElm *arrayDeathImpact = NULL;
32 if( root.getNodeByName( &arrayDeathImpact, "death_impact" ) )
34 if( arrayDeathImpact )
36 uint size;
37 nlverify( arrayDeathImpact->getArraySize(size) );
38 PactLose.resize( size );
40 const UFormElm *node;
42 // variable is used for calculate pact effect in differential between pacts type
43 sint16 LoseHitPoints = 0;
44 sint16 LoseStamina = 0;
45 sint16 LoseSap = 0;
46 sint16 LoseSkills = 0;
48 sint16 value;
50 for( uint i = 0; i < size; ++i )
52 node = NULL;
53 arrayDeathImpact->getArrayNode( &node, i );
55 if( node )
57 node->getValueByName( value, "HitPoints" );
58 value = 0 - value - LoseHitPoints;
59 LoseHitPoints += value;
60 PactLose[ i ].LoseHitPointsLevel = value;
62 node->getValueByName( value, "Stamina" );
63 value = 0 - value - LoseStamina;
64 LoseStamina += value;
65 PactLose[ i ].LoseStaminaLevel = value;
67 node->getValueByName( value, "Sap" );
68 value = 0 - value - LoseSap;
69 LoseSap += value;
70 PactLose[ i ].LoseSapLevel = value;
72 node->getValueByName( value, "Skills" );
73 value = 0 - value - LoseSkills;
74 LoseSkills += value;
75 PactLose[ i ].LoseSkillsLevel = value;
77 node->getValueByName( PactLose[ i ].Duration, "Duration" );
78 node->getValueByName( PactLose[ i ].Name, "Name" );
82 // get bitmap for icone display
83 root.getValueByName(Icon, "icon");
84 root.getValueByName(IconBackground, "icon_background");
89 //=================================================================================
90 void CPactSheet::serial(NLMISC::IStream &f)
92 f.serialCont(PactLose);
93 f.serial(Icon);
94 f.serial(IconBackground);