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>
6 // Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as
10 // published by the Free Software Foundation, either version 3 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include "group_career.h"
26 #include "interface_manager.h"
27 #include "nel/gui/interface_element.h"
29 //#include "game_share/jobs.h"
30 #include "nel/misc/xml_auto_ptr.h"
34 NLMISC_REGISTER_OBJECT(CViewBase
, CGroupCareer
, std::string
, "career");
35 NLMISC_REGISTER_OBJECT(CViewBase
, CGroupJob
, std::string
, "job");
37 // ***************************************************************************
38 bool CGroupCareer::parse (xmlNodePtr cur
, CInterfaceGroup
*parentGroup
)
40 if(!CGroupContainer::parse(cur
, parentGroup
))
43 CXMLAutoPtr
ptr((const char*) xmlGetProp (cur
, (xmlChar
*)"career"));
50 NLMISC::fromString((const char*)ptr
, careerIndex
);
51 Career
= (ROLES::ERole
) careerIndex
;
52 if(Career
==ROLES::role_unknown
)
54 nlinfo ("unknown career %s in %s", (const char*)ptr
, _Id
.c_str());
60 nlinfo ("no career in %s", _Id
.c_str());
64 if (Career
>= ROLES::NB_ROLES
)
65 Career
= ROLES::fighter
;
67 string sTmp
= ROLES::roleToUCString(Career
);
68 for (uint32 i
= 0; i
< sTmp
.size(); ++i
)
70 if ( (sTmp
[i
] >= 'a') && (sTmp
[i
] <= 'z') )
71 sTmp
[i
] = sTmp
[i
] - 'a' + 'A';
78 // ***************************************************************************
79 bool CGroupJob::parse (xmlNodePtr
/* cur */, CInterfaceGroup
* /* parentGroup */)
83 // if(!CGroupContainer::parse(cur, parentGroup))
86 // CXMLAutoPtr ptr = (char*) xmlGetProp (cur, (xmlChar*)"career");
91 // uint careerIndex, jobIndex;
92 // ROLES::ERole Career;
97 // fromString((const char*)ptr, careerIndex);
98 // Career= (ROLES::ERole) careerIndex;
99 // if(Career==ROLES::role_unknown)
101 // nlinfo ("unknown career %s in %s", (const char*)ptr, _Id.c_str());
107 // nlinfo ("no career in %s", _Id.c_str());
112 // ptr = xmlGetProp (cur, (xmlChar*)"job");
115 // fromString((const char*)ptr, jobIndex);
119 // Job= JOBS::getJobForRace((ROLES::ERole)careerIndex, (EGSPD::CPeople::TPeople)jobIndex);
120 // if(Job==JOBS::Unknown)
122 // nlinfo ("unknown job %s in %s", (const char*)ptr, _Id.c_str());
128 // nlinfo ("no job in %s", _Id.c_str());
132 // string sTmp = JOBS::jobToUCString(Job);
133 // for (uint32 i= 0; i < sTmp.size(); ++i)
134 // if (sTmp[i] < 128)
135 // if ( (sTmp[i] >= 'a') && (sTmp[i] <= 'z') )
136 // sTmp[i] = sTmp[i] - 'a' + 'A';