1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
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/>.
24 #include "group_career.h"
25 #include "interface_manager.h"
26 #include "nel/gui/interface_element.h"
28 //#include "game_share/jobs.h"
29 #include "nel/misc/xml_auto_ptr.h"
33 NLMISC_REGISTER_OBJECT(CViewBase
, CGroupCareer
, std::string
, "career");
34 NLMISC_REGISTER_OBJECT(CViewBase
, CGroupJob
, std::string
, "job");
36 // ***************************************************************************
37 bool CGroupCareer::parse (xmlNodePtr cur
, CInterfaceGroup
*parentGroup
)
39 if(!CGroupContainer::parse(cur
, parentGroup
))
42 CXMLAutoPtr
ptr((const char*) xmlGetProp (cur
, (xmlChar
*)"career"));
49 NLMISC::fromString((const char*)ptr
, careerIndex
);
50 Career
= (ROLES::ERole
) careerIndex
;
51 if(Career
==ROLES::role_unknown
)
53 nlinfo ("unknown career %s in %s", (const char*)ptr
, _Id
.c_str());
59 nlinfo ("no career in %s", _Id
.c_str());
63 if (Career
>= ROLES::NB_ROLES
)
64 Career
= ROLES::fighter
;
66 string sTmp
= ROLES::roleToUCString(Career
);
67 for (uint32 i
= 0; i
< sTmp
.size(); ++i
)
69 if ( (sTmp
[i
] >= 'a') && (sTmp
[i
] <= 'z') )
70 sTmp
[i
] = sTmp
[i
] - 'a' + 'A';
77 // ***************************************************************************
78 bool CGroupJob::parse (xmlNodePtr
/* cur */, CInterfaceGroup
* /* parentGroup */)
82 // if(!CGroupContainer::parse(cur, parentGroup))
85 // CXMLAutoPtr ptr = (char*) xmlGetProp (cur, (xmlChar*)"career");
90 // uint careerIndex, jobIndex;
91 // ROLES::ERole Career;
96 // fromString((const char*)ptr, careerIndex);
97 // Career= (ROLES::ERole) careerIndex;
98 // if(Career==ROLES::role_unknown)
100 // nlinfo ("unknown career %s in %s", (const char*)ptr, _Id.c_str());
106 // nlinfo ("no career in %s", _Id.c_str());
111 // ptr = xmlGetProp (cur, (xmlChar*)"job");
114 // fromString((const char*)ptr, jobIndex);
118 // Job= JOBS::getJobForRace((ROLES::ERole)careerIndex, (EGSPD::CPeople::TPeople)jobIndex);
119 // if(Job==JOBS::Unknown)
121 // nlinfo ("unknown job %s in %s", (const char*)ptr, _Id.c_str());
127 // nlinfo ("no job in %s", _Id.c_str());
131 // string sTmp = JOBS::jobToUCString(Job);
132 // for (uint32 i= 0; i < sTmp.size(); ++i)
133 // if (sTmp[i] < 128)
134 // if ( (sTmp[i] >= 'a') && (sTmp[i] <= 'z') )
135 // sTmp[i] = sTmp[i] - 'a' + 'A';