1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#ifndef NULLSOFT_GEN_FF_SKINCOLORELEMENT_H
#define NULLSOFT_GEN_FF_SKINCOLORELEMENT_H
#include <api/skin/skinitem.h>
#include "ParamList.h"
struct SkinColorElement : public SkinItem
{
public:
SkinColorElement(const wchar_t *_id, ARGB32 v, int script_id = -1, int secondarycounter = 0, const wchar_t *colorgrp = NULL, const wchar_t *path = NULL, ifc_xmlreaderparams *p = NULL)
: id(_id), value(v), scriptid(script_id), seccount(secondarycounter), colorgroup(colorgrp), rootpath(path)
{
if (p != NULL)
{
for (size_t i = 0;i != p->getNbItems();i++)
params.addItem(p->getItemName(i), p->getItemValue(i));
}
}
const wchar_t *getXmlRootPath() { return rootpath; }
const wchar_t *getName() { return L"color"; }
ifc_xmlreaderparams *getParams() { return ¶ms; }
int getSkinPartId() { return scriptid; }
SkinItem *getAncestor();
const wchar_t *getId() { return id; }
ARGB32 getColor() { return value; }
ARGB32 *getColorRef() { return &value; }
int getSecCount() { return seccount; }
const wchar_t *getColorGroup() { return colorgroup; }
private:
RECVS_DISPATCH;
StringW id;
ARGB32 value;
int scriptid;
int seccount;
StringW colorgroup;
StringW rootpath;
ParamList params;
};
class SortSkinColorElement
{
public:
static int compareItem(SkinColorElement *p1, SkinColorElement *p2)
{
int r = WCSICMP(p1->getId(), p2->getId());
if (!r)
{
if (p1->getSkinPartId() < p2->getSkinPartId()) return -1;
if (p1->getSkinPartId() > p2->getSkinPartId()) return 1;
if (p1->getSecCount() < p2->getSecCount()) return -1;
if (p1->getSecCount() > p2->getSecCount()) return 1;
return 0;
}
return r;
}
static int compareAttrib(const wchar_t *attrib, SkinColorElement *item)
{
return WCSICMP(attrib, item->getId());
}
};
#endif
|