order(0)
{ }
+Category::Category(const string &n, unsigned o):
+ name(n),
+ condition(0),
+ order(o)
+{ }
+
Category::Category(const Category &other):
+ name(other.name),
condition(other.condition ? other.condition->clone() : 0),
order(other.order),
appearance(other.appearance)
Category &Category::operator=(const Category &other)
{
delete condition;
+ name = other.name;
condition = (other.condition ? other.condition->clone() : 0);
order = other.order;
appearance = other.appearance;
void Category::create_statements(list<FilterStatement> &st) const
{
- st.clear();
- st.push_back(FilterStatement());
- st.back().add_line(format("SetFontSize %d", appearance.get_font_size()));
-
- const Color &bg_color = appearance.get_background_color();
- if(bg_color.defined)
- st.back().add_line(format("SetBackgroundColor %d %d %d", bg_color.r, bg_color.g, bg_color.b));
-
- const Color &brd_color = appearance.get_border_color();
- if(brd_color.defined)
- st.back().add_line(format("SetBorderColor %d %d %d", brd_color.r, brd_color.g, brd_color.b));
-
- const Color &txt_color = appearance.get_text_color();
- if(txt_color.defined)
- st.back().add_line(format("SetTextColor %d %d %d", txt_color.r, txt_color.g, txt_color.b));
-
- if(appearance.get_sound_type())
- st.back().add_line(format("PlayAlertSound %d %d", appearance.get_sound_type(), appearance.get_sound_volume()));
+ if(st.empty())
+ st.push_back(FilterStatement());
if(condition)
condition->add_lines(st);
DataFile::ObjectLoader<Category>(c),
poe(p),
compound(n),
- app_loader(c.appearance, p.get_theme())
+ app_loader(c.appearance)
{
add("and", &Loader::and_);
- add("appearance", &Loader::appearance);
add("base_type", &Loader::condition<BaseTypeCondition>);
+ add("category", &Loader::category);
add("class", &Loader::condition<ClassCondition>);
add_range<DropLevelCondition>("drop_level");
add_range<HeightCondition>("height");
add_range<LinkedSocketsCondition>("linked_sockets");
add_range<SocketsCondition>("sockets");
add("or", &Loader::or_);
- add("order", &Category::order);
add_range<QualityCondition>("quality");
add_range<RarityCondition>("rarity");
add_range<WidthCondition>("width");
add_condition(cond.release());
}
-void Category::Loader::appearance(const std::string &name)
+void Category::Loader::category(const string &name)
{
- obj.appearance = poe.get_theme().get_appearance(name);
+ const Category &categ = poe.get_category(name);
+ add_condition(categ.condition->clone());
}
template<typename T>