Пример #1
0
bool cBonusBox::Editor_Force_best_item_Select(const CEGUI::EventArgs& event)
{
    const CEGUI::WindowEventArgs& windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>(event);
    CEGUI::ListboxItem* item = static_cast<CEGUI::Combobox*>(windowEventArgs.window)->getSelectedItem();

    if (item->getText().compare(UTF8_("Enabled")) == 0) {
        Set_Force_Best_Item(1);
    }
    else {
        Set_Force_Best_Item(0);
    }

    return 1;
}
Пример #2
0
void cBonusBox::Load_From_XML(XmlAttributes& attributes)
{
    cBaseBox::Load_From_XML(attributes);

    // item
    Set_Bonus_Type(static_cast<SpriteType>(string_to_int(attributes["item"])));
    // force best possible item
    Set_Force_Best_Item(string_to_int(attributes["force_best_item"]));
    // gold color
    if (box_type == TYPE_GOLDPIECE)
        Set_Goldcolor(Get_Color_Id(attributes.fetch("gold_color", Get_Color_Name(m_gold_color))));
}
Пример #3
0
void cBonusBox :: Create_From_Stream( CEGUI::XMLAttributes &attributes )
{
	cBaseBox::Create_From_Stream( attributes );

	// item
	Set_Bonus_Type( static_cast<SpriteType>(attributes.getValueAsInteger( "item" )) );
	// force best possible item
	Set_Force_Best_Item( attributes.getValueAsBool( "force_best_item" ) );
	// gold color
	if( box_type == TYPE_GOLDPIECE )
	{
		Set_Goldcolor( Get_Color_Id( attributes.getValueAsString( "gold_color", Get_Color_Name( m_gold_color ) ).c_str() ) );
	}
}