00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __ICONS_H__
00031 #define __ICONS_H__
00032
00034
00035 #include "vec2i.h"
00036 #include <string>
00037
00038
00039
00040
00041
00087
00088
00089
00090
00091 #define IconActive 1
00092 #define IconClicked 2
00093 #define IconSelected 4
00094 #define IconDisabled 8
00095 #define IconAutoCast 16
00096
00097
00098
00099
00100
00101 class CGraphic;
00102 class CPlayer;
00103 class ButtonStyle;
00104
00106 class CIcon
00107 {
00108 public:
00109 CIcon(const std::string &ident);
00110 ~CIcon();
00111
00112 static CIcon *New(const std::string &ident);
00113 static CIcon *Get(const std::string &ident);
00114
00115 void Load();
00116
00118 void DrawIcon(const CPlayer &player, const PixelPos &pos) const;
00120 void DrawUnitIcon(const ButtonStyle &style,
00121 unsigned flags, const PixelPos &pos, const std::string &text) const;
00122
00123 const std::string &GetIdent() const { return this->Ident; }
00124
00125 public:
00126 CGraphic *G;
00127 int Frame;
00128 private:
00129 std::string Ident;
00130 };
00131
00133 class IconConfig
00134 {
00135 public:
00136 IconConfig() : Icon(NULL) {}
00137
00138 void Load();
00139 public:
00140 std::string Name;
00141 CIcon *Icon;
00142 };
00143
00144
00145
00146
00147
00148 extern void LoadIcons();
00149 extern void CleanIcons();
00150
00152
00153 #endif // !__ICONS_H__