Beispiel #1
0
User::User( const wxString& nick, const wxString& country, const int& cpu )
    : CommonUser( nick,country,cpu ) ,
    m_serv(0),
    m_battle(0),
    m_flagicon_idx( icons().GetFlagIcon( country ) ),
    m_rankicon_idx( icons().GetRankIcon( 0 ) ),
    m_statusicon_idx( icons().GetUserListStateIcon( m_status, false, false ) )
{}
Beispiel #2
0
User::User()
    : CommonUser( wxEmptyString, wxEmptyString, 0 ),
    m_serv(0),
    m_battle(0),
    m_flagicon_idx( icons().GetFlagIcon( _T("") ) ),
    m_rankicon_idx( icons().GetRankIcon( 0 ) ),
    m_statusicon_idx( icons().GetUserListStateIcon( m_status, false, false ) )
{}
Beispiel #3
0
User::User( const wxString& nick, Server& serv )
    : CommonUser( nick,_T(""),0 ),
    m_serv(&serv),
    m_battle(0),
    m_flagicon_idx( icons().GetFlagIcon( _T("") ) ),
    m_rankicon_idx( icons().GetRankIcon( 0 ) ),
    m_statusicon_idx( icons().GetUserListStateIcon( m_status, false, false ) )
{}
void BattleroomListCtrl::UpdateUser( User& user )
{
    if ( !user.BattleStatus().spectator )
		icons().SetColourIcon( user.BattleStatus().colour );
    wxArrayString sides = LSL::Util::vectorToArrayString(LSL::usync().GetSides(STD_STRING(m_battle->GetHostModName())));
    ASSERT_EXCEPTION( user.BattleStatus().side < (long)sides.GetCount(), _T("Side index too high") );
    user.SetSideiconIndex( icons().GetSideIcon( m_battle->GetHostModName(), user.BattleStatus().side ) );
    int index = GetIndexFromData( &user );
    UpdateUser( index );
}
Beispiel #5
0
User::User(const std::string& nick, IServer& serv)
    : CommonUser(nick, "", 0)
    , m_serv(&serv)
    , m_battle(0)
    , m_flagicon_idx(icons().GetFlagIcon(""))
    , m_rankicon_idx(icons().GetRankIcon(0))
    , m_statusicon_idx(icons().GetUserListStateIcon(GetStatus(), false, false))
    , m_sideicon_idx(icons().ICON_NONE)
{
}
Beispiel #6
0
User::User(const std::string& nick, const std::string& country, const int& cpu)
    : CommonUser(nick, country, cpu)
    , m_serv(0)
    , m_battle(0)
    , m_flagicon_idx(icons().GetFlagIcon(country))
    , m_rankicon_idx(icons().GetRankIcon(0))
    , m_statusicon_idx(icons().GetUserListStateIcon(GetStatus(), false, false))
    , m_sideicon_idx(icons().ICON_NONE)
{
}
Beispiel #7
0
User::User()
    : CommonUser("", "", 0)
    , m_serv(0)
    , m_battle(0)
    , m_flagicon_idx(icons().GetFlagIcon(""))
    , m_rankicon_idx(icons().GetRankIcon(0))
    , m_statusicon_idx(icons().GetUserListStateIcon(GetStatus(), false, false))
    , m_sideicon_idx(icons().ICON_NONE)
{
}
Beispiel #8
0
void ChatPanel::UserStatusUpdated( User& who )
{
  if ( ( m_type == CPT_User ) && ( m_user == &who ) )
  {
	m_chan_opts_button->SetBitmapLabel( icons().GetBitmap(icons().GetUserListStateIcon(who.GetStatus(),false, who.GetBattle() != 0 ) ) );

  }
  if ( !m_show_nick_list || ( m_nicklist == 0 ) ) return;
  try
  {
		m_nicklist->UserUpdated( who );
  } catch (...) { return; }
}
void BattleroomListCtrl::UpdateUser(User& user)
{
	if (!user.BattleStatus().spectator)
		icons().SetColourIcon(user.BattleStatus().colour);
	try {
		wxArrayString sides = lslTowxArrayString(LSL::usync().GetSides(m_battle->GetHostModName()));
		if (user.BattleStatus().side < (long)sides.GetCount()) {
			user.SetSideiconIndex(icons().GetSideIcon(m_battle->GetHostModName(), user.BattleStatus().side));
		}
	} catch (...) {
	}
	int index = GetIndexFromData(&user);
	UpdateUser(index);
}
void CJuikIconManagerImpl::LoadIconsL(TInt aProviderId, const TIconID* aIconDefs, TInt aNbIcons)
{
	CALLSTACKITEM_N(_CL("CJuikIconManagerImpl"), _CL("LoadIconsL"));
	auto_ptr<CAknIconArray> icons( new (ELeave) CAknIconArray(aNbIcons) );
	JuikIcons::LoadIconsL( icons.get(), aIconDefs, aNbIcons );
	SetIconsL( aProviderId, *icons );
}
Beispiel #11
0
int BattleListCtrl::GetItemImage(long item) const
{
    if ( m_data[item] == NULL )
        return -1;

    return icons().GetBattleStatusIcon( *m_data[item] );
}
Beispiel #12
0
int main(int argc, char *argv[])
{
    QGuiApplication a(argc, argv);

    QStringList arguments = QCoreApplication::arguments();
    arguments.pop_front();
    const bool large = !arguments.isEmpty() && arguments.front() == "-l";
    if (large)
        arguments.pop_front();
    if (arguments.size() < 1) {
        std::cout << "Usage: iconextractor [OPTIONS] FILE [IMAGE_FILE_FOLDER]\n\n"
                     "Extracts Windows icons from executables, DLL or icon files\n"
                     "and writes them out as numbered .png-files.\n\n"
                     "Options: -l    Extract large icons.\n\n"
                     "Based on Qt " << QT_VERSION_STR << "\n";
        return 1;
    }
    const QString sourceFile = arguments.at(0);
    QString imageFileRoot = arguments.size() > 1 ? arguments.at(1) : QDir::currentPath();
    const QFileInfo imageFileRootInfo(imageFileRoot);
    if (!imageFileRootInfo.isDir()) {
        std::cerr << imageFileRoot.toStdString() << " is not a directory.\n";
        return 1;
    }

    const UINT iconCount = ExtractIconEx((wchar_t *)sourceFile.utf16(), -1, 0, 0, 0);
    if (!iconCount) {
        std::cerr << sourceFile.toStdString() << " does not appear to contain icons.\n";
        return 1;
    }

    QScopedArrayPointer<HICON> icons(new HICON[iconCount]);
    const UINT extractedIconCount = large ?
        ExtractIconEx((wchar_t *)sourceFile.utf16(), 0, icons.data(), 0, iconCount) :
        ExtractIconEx((wchar_t *)sourceFile.utf16(), 0, 0, icons.data(), iconCount);
    if (!extractedIconCount) {
        qErrnoWarning("Failed to extract icons from %s", qPrintable(sourceFile));
        return 1;
    }

    std::cout << sourceFile.toStdString() << " contains " << extractedIconCount << " icon(s).\n";

    imageFileRoot = imageFileRootInfo.absoluteFilePath() + QLatin1Char('/') + QFileInfo(sourceFile).baseName();
    for (UINT i = 0; i < extractedIconCount; ++i) {
        const QPixmap pixmap = QtWin::fromHICON(icons[i]);
        if (pixmap.isNull()) {
            std::cerr << "Error converting icons.\n";
            return 1;
        }
        const QString fileName = QString::fromLatin1("%1%2.png").arg(imageFileRoot)
            .arg(i, 3, 10, QLatin1Char('0'));
        if (!pixmap.save(fileName)) {
            std::cerr << "Error writing image file " << fileName.toStdString() << ".\n";
            return 1;
        }
        std::cout << "Wrote image file "
                  << QDir::toNativeSeparators(fileName).toStdString() << ".\n";
    }
    return 0;
}
void CustomVirtListCtrl<T,L>::OnColClick( wxListEvent& event )
{
	if ( event.GetColumn() == -1 )
		return;

	const int evt_col = event.GetColumn();


	m_sort_timer.Stop();//otherwise sorting will be way delayed

	int old_sort_col = m_sortorder[0].col;

	wxListItem col;
	GetColumn( m_sortorder[0].col, col );
	col.SetImage( icons().ICON_NONE );
	SetColumn( m_sortorder[0].col, col );

	unsigned int i = 0;
	SortOrder::const_iterator it = m_sortorder.begin();
	for ( ; it != m_sortorder.begin(); ++i, ++it ) {
		if ( m_sortorder[i].col == evt_col )
			break;
	}

//    for ( ; m_sortorder[i].col != event.GetColumn() && i < 4; ++i ) {}

	i = LSL::Util::Clamp( i, (unsigned int)0, m_sort_criteria_count );

	for ( ; i > 0; i--) {
		m_sortorder[i] = m_sortorder[i-1];
	}

	m_sortorder[0].col = evt_col;
	m_sortorder[0].direction *= -1;


	GetColumn( m_sortorder[0].col, col );
	//col.SetImage( ( m_sortorder[0].direction )?ICON_UP:ICON_DOWN );
	col.SetImage( ( m_sortorder[0].direction > 0 )?icons().ICON_UP:icons().ICON_DOWN );
	SetColumn( m_sortorder[0].col, col );

	if ( (old_sort_col != m_sortorder[0].col) || m_dirty_sort) {
		SortList( true );
	} else { // O(n) instead of guaranteed worst case O(n*n)
		ReverseOrder();
	}
}
Beispiel #14
0
void User::SetStatus(const UserStatus& status)
{
	CommonUser::SetStatus(status);
	// If user is host of a game, then his in_game status tells if the game is on!
	if (m_battle != 0) {
		try {
			User& user = m_battle->GetFounder();
			if (user.GetNick() == GetNick()) {
				m_battle->Update("");
			}
		} catch (...) {
		}
	}

	m_statusicon_idx = icons().GetUserListStateIcon(GetStatus(), false, m_battle != 0);
	m_rankicon_idx = icons().GetRankIcon(GetStatus().rank);
}
Beispiel #15
0
int BattleListCtrl::GetItemColumnImage(long item, long column) const
{
    if ( m_data[item] == NULL )
        return -1;

    const IBattle& battle= *m_data[item];

    switch ( column ) {
        default: return -1;

        case 0: return icons().GetBattleStatusIcon( battle );
        case 1:
        {
        	try
        	{
        	 return icons().GetFlagIcon( battle.GetFounder().GetCountry() );
        	}catch(...){}
					break;
        }
		case 2: return icons().GetRankLimitIcon( battle.GetRankNeeded(), false );
        case 4: return battle.MapExists() ? icons().ICON_EXISTS : icons().ICON_NEXISTS;
        case 5: return battle.ModExists() ? icons().ICON_EXISTS : icons().ICON_NEXISTS;
    }
    return -1; // simply to avoid compiler warning
}
void BattleroomListCtrl::AddUser( User& user )
{
	//first time setting is necessary to have color in replay/savegame used controls
	if ( !user.BattleStatus().spectator )
		icons().SetColourIcon( user.BattleStatus().colour );
    if ( AddItem( &user ) )
        return;

    wxLogWarning( _T("user already in battleroom list.") );
}
Beispiel #17
0
void ChatPanel::SetUser( const User* usr )
{
	ASSERT_LOGIC( m_type == CPT_User, _T( "Not of type user" ) );

	if (( usr == 0 ) && ( m_user != 0 ) )
	{
	  StatusMessage( _( "Chat closed." ) );
	  m_user->uidata.panel = 0;
	  m_chan_opts_button->SetBitmapLabel( icons().GetBitmap(icons().ICON_EMPTY) );
	}
	else if ( usr != 0 ) usr->uidata.panel = this;
	m_user = usr;
	if ( m_user )
	{
		m_chan_opts_button->SetBitmapLabel( icons().GetBitmap(icons().GetUserListStateIcon(m_user->GetStatus(),false, m_user->GetBattle() != 0 ) ) );
	}
//	if ( m_user )
//        m_chat_log.SetTarget( sett().GetDefaultServer(), usr->GetNick() );
}
Beispiel #18
0
void ChatPanel::SetUser(const User* usr)
{
	ASSERT_LOGIC(m_type == CPT_User, "Not of type user");

	if (usr == NULL) {
		if (m_user != NULL) {
			m_user->uidata.panel = 0;
			if (m_chan_opts_button != NULL) {
				m_chan_opts_button->SetBitmapLabel(icons().GetBitmap(icons().ICON_EMPTY));
			}
		}
	} else {
		usr->uidata.panel = this;
		if (m_chan_opts_button != NULL) {
			const wxBitmap icon = icons().GetBitmap(icons().GetUserListStateIcon(usr->GetStatus(), false, usr->GetBattle() != 0));
			m_chan_opts_button->SetBitmapLabel(icon);
		}
	}
	m_user = usr;
}
Beispiel #19
0
void BattleRoomTab::RegenerateOptionsList()
{
	long pos = 0;
	m_opts_list->DeleteAllItems();
	m_opts_list->InsertItem(pos, _("Size"));
	m_opt_list_map.clear();
	m_opt_list_map[_("Size")] = pos;
	pos++;
	m_opts_list->InsertItem(pos, _("Windspeed"));
	m_opt_list_map[_("Windspeed")] = pos;
	pos++;
	m_opts_list->InsertItem(pos, _("Tidal strength"));
	m_opt_list_map[_("Tidal strength")] = pos;
	pos++;
	m_opts_list->InsertItem(pos, wxEmptyString);
	pos++;
	pos = AddMMOptionsToList(pos, LSL::Enum::EngineOption);
	// AddMMOptionsToList already increments pos by itself
	m_opts_list->InsertItem(pos, wxEmptyString);
	pos++;
	m_mod_opts_index = pos;
	pos = AddMMOptionsToList(m_mod_opts_index, LSL::Enum::ModOption);
	// AddMMOptionsToList already increments pos by itself
	m_opts_list->InsertItem(pos, wxEmptyString);
	pos++;
	m_map_opts_index = pos;
	pos = AddMMOptionsToList(m_map_opts_index, LSL::Enum::MapOption);
	m_side_sel->Clear();
	if (m_battle != NULL) {
		try {
			const wxArrayString sides = lslTowxArrayString(LSL::usync().GetSides(m_battle->GetHostModName()));
			for (unsigned int i = 0; i < sides.GetCount(); i++) {
				m_side_sel->Append(sides[i], icons().GetBitmap(icons().GetSideIcon(m_battle->GetHostModName(), i)));
			}
			wxSize s = m_side_sel->GetEffectiveMinSize();
			s.SetWidth(s.GetWidth() + 16); // HACK without this additional place, the image overflows the text on wxGtk
			m_side_sel->SetMinSize(s);
		} catch (...) {
		}
	}
}
Beispiel #20
0
/*
 * Get size of object, if possible.
 * Currently does nothing,
 */
static NODE *
builtin_object_size(NODE *f, NODE *a, TWORD rt)
{
	CONSZ v = icons(a->n_right);
	if (v < 0 || v > 3)
		uerror("arg2 must be between 0 and 3");

	tfree(f);
	f = buildtree(COMOP, a->n_left, xbcon(v < 2 ? -1 : 0, NULL, rt));
	nfree(a);
	return f;
}
Beispiel #21
0
static void
setaarg(int str, union aarg *aa, NODE *p)
{
    if (str) {
        if (((str & (A1_STR|A2_STR|A3_STR)) && p->n_op != STRING) ||
                ((str & (A1_NAME|A2_NAME|A3_NAME)) && p->n_op != NAME))
            uerror("bad arg to attribute");
        aa->sarg = p->n_op == STRING ? p->n_name : (char *)p->n_sp;
        nfree(p);
    } else
        aa->iarg = (int)icons(eve(p));
}
Beispiel #22
0
PasteDialog::PasteDialog(wxWindow* parent, const wxString& message)
    : wxDialog(parent, -1, _("Flood warning"), wxDefaultPosition, wxDefaultSize, wxFRAME_FLOAT_ON_PARENT | wxDEFAULT_DIALOG_STYLE)
{
	SetIcon(icons().GetIcon(icons().ICON_SPRINGLOBBY));

	//******** copied from wxsource/generic/msgdlgg.cpp with small modifications***********************************************************
	wxBoxSizer* topsizer = new wxBoxSizer(wxVERTICAL);

	wxBoxSizer* icon_text = new wxBoxSizer(wxHORIZONTAL);

	wxBitmap bitmap = wxArtProvider::GetIcon(wxART_QUESTION, wxART_MESSAGE_BOX);

	wxStaticBitmap* info_icon = new wxStaticBitmap(this, wxID_ANY, bitmap);
	icon_text->Add(info_icon, 0, wxCENTER);

	// 2) text
	icon_text->Add(CreateTextSizer(message), 0, wxALIGN_TOP | wxLEFT, 10);

	topsizer->Add(icon_text, 1, wxCENTER | wxLEFT | wxRIGHT | wxTOP, 10);
	topsizer->Add(0, 10);

	// 3) buttons
	wxSizer* sizerBtn = CreateButtonSizer(wxYES_NO);
	if (sizerBtn) {
		wxButton* but = new wxButton(this, ID_PASTE_BUTTON, _("Use pastebin"));
		sizerBtn->Add(but, 0, wxALL, 10);
		topsizer->Add(sizerBtn, 0, wxALIGN_CENTRE | wxALL, 10);
		but->SetFocus();
	}


	SetAutoLayout(true);
	SetSizer(topsizer);

	topsizer->SetSizeHints(this);
	topsizer->Fit(this);

	Centre(wxBOTH | wxCENTER_FRAME);
	/***************************************************************************************************/
}
int BattleroomListCtrl::GetItemColumnImage(long item, long column) const
{
    if ( (item == -1) || (item >= (long)m_data.size()) || (m_battle == NULL) )
        return -1;

    const User& user = *GetDataFromIndex( item );
    bool is_bot = user.BattleStatus().IsBot();
    bool is_spec = user.BattleStatus().spectator;
	 if ( column == m_status_column_index ) {
		if ( !is_bot ) {
			if ( m_battle->IsFounder( user ) ) {
				return icons().GetHostIcon( is_spec );
			}
			else {
				return icons().GetReadyIcon( is_spec, user.BattleStatus().ready, user.BattleStatus().sync, is_bot );
			}
		}
		else
			return icons().ICON_BOT;
	}
	 if ( column == m_ingame_column_index ) return user.GetStatusIconIndex();
	 if ( column == m_colour_column_index ) return is_spec ? -1 : icons().GetColourIcon( user.BattleStatus().colour );
	 if ( column == m_country_column_index ) return is_bot ? -1 : icons().GetFlagIcon( user.GetCountry() );
	 if ( column == m_rank_column_index ) return is_bot ? -1 : icons().GetRankIcon( user.GetStatus().rank );
	 if ( column == m_faction_column_index ) return is_spec ? -1 : user.GetSideiconIndex();
	 if ( column == m_nick_column_index ) return -1;
	 else
	 {
		const wxString msg =  wxFormat(_("column oob in BattleroomListCtrl::OnGetItemColumnImage: %d" )) % column;
		wxLogWarning( msg);
		return -1;
	 }
}
CustomVirtListCtrl<T,L>::CustomVirtListCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt, const wxSize& sz,
		long style, const wxString& name, unsigned int sort_criteria_count,
		CompareFunction func, bool highlight, UserActions::ActionType hlaction, bool periodic_sort, unsigned int periodic_sort_interval  ):
	wxListCtrl(parent, id, pt, sz, style | wxLC_VIRTUAL),
	m_tiptimer(this, IDD_TIP_TIMER),
	m_sort_timer(this, IDD_SORT_TIMER),
	m_tiptext(wxEmptyString),
#if wxUSE_TIPWINDOW
	m_tipwindow( 0 ),
	m_controlPointer( 0 ),
#endif
	m_columnCount( 0 ),
	m_selected_index(-1),
	m_prev_selected_index(-1),
	m_last_mouse_pos( wxPoint(-1,-1) ),
	m_name(name),
	m_highlight(highlight),
	m_highlightAction(hlaction),
	m_bg_color( GetBackgroundColour() ),
	m_dirty_sort(false),
	m_sort_criteria_count( sort_criteria_count ),
	m_comparator( this,m_sortorder, func ),
	m_periodic_sort_timer_id( wxNewId() ),
	m_periodic_sort_timer( this, m_periodic_sort_timer_id ),
	m_periodic_sort( periodic_sort ),
	m_periodic_sort_interval( periodic_sort_interval )
{
	//dummy init , will later be replaced with loading from settings
	for ( unsigned int i = 0; i < m_columnCount; ++i) {
		m_column_map[i] = i;

	}

	SetImageList( &icons(), wxIMAGE_LIST_NORMAL );
	SetImageList( &icons(), wxIMAGE_LIST_SMALL );
	m_sortorder = sett().GetSortOrder( name );

	StartTimer();
	Connect( ListctrlDoSortEventType, wxCommandEventHandler( ThisType::OnSortEvent ), NULL, this );
}
Beispiel #25
0
void NotifyArea::read_config()
{
	bool clock_visible = true;

	 // read notification icon settings from XML configuration
	XMLPos cfg_pos = g_Globals.get_cfg();

#ifndef __MINGW32__	// SHRestricted() missing in MinGW (as of 29.10.2003)
	if (!g_Globals._SHRestricted || !SHRestricted(REST_HIDECLOCK))
#endif
	{
		if (cfg_pos.go_down("desktopbar")) {
			clock_visible = XMLBoolRef(XMLPos(cfg_pos,"options"), "show-clock", !get_hide_clock_from_registry());
			cfg_pos.back();
		}
	}

	if (cfg_pos.go_down("notify-icons")) {
		XMLPos options(cfg_pos, "options");

		_hide_inactive = XMLBool(options, "hide-inactive", true);	///@todo read default setting from registry
		_show_hidden = XMLBool(options, "show-hidden", false);	///@todo read default setting from registry
		_show_button = XMLBool(options, "show-button", true);

		XMLChildrenFilter icons(cfg_pos, "icon");

		for(XMLChildrenFilter::iterator it=icons.begin(); it!=icons.end(); ++it) {
			const XMLNode& node = **it;

			NotifyIconConfig cfg;

			cfg._name = node.get("name").c_str();
			cfg._tipText = node.get("text").c_str();
			cfg._windowTitle = node.get("window").c_str();
			cfg._modulePath = node.get("module").c_str();
			const string& mode = node.get("show");

			if (mode == "show")
				cfg._mode = NIM_SHOW;
			else if (mode == "hide")
				cfg._mode = NIM_HIDE;
			else //if (mode == "auto")
				cfg._mode = NIM_HIDE;

			_cfg.push_back(cfg);
		}

		cfg_pos.back();
	}

	show_clock(clock_visible);
}
Beispiel #26
0
/*
 * Get size of object, if possible.
 * Currently does nothing,
 */
static NODE *
builtin_object_size(const struct bitable *bt, NODE *a)
{
    CONSZ v = icons(a->n_right);
    NODE *f;

    if (v < 0 || v > 3)
        uerror("arg2 must be between 0 and 3");

    f = buildtree(COMOP, a->n_left, xbcon(v < 2 ? -1 : 0, NULL, bt->rt));
    nfree(a);
    return f;
}
	void ConstructL(const TDesC& aFileName, const TIconID2* aIconDefs, TInt aNbIcons)
	{
		CALLSTACKITEM_N(_CL("CStaticIconProvider"), _CL("ConstructL"));
		iIconDefs = aIconDefs;
		iNbIcons = aNbIcons;
		
		iIconFile = aFileName.AllocL();
		iProviderId = iIconManager.GetNewProviderIdL();

		auto_ptr<CAknIconArray> icons( new (ELeave) CAknIconArray(aNbIcons) );
		JuikIcons::LoadIconsViaFileNameL( icons.get(), *iIconFile, aIconDefs, aNbIcons );
		iIconManager.SetIconsL( iProviderId, *icons );
	}
Beispiel #28
0
void BattleRoomTab::RegenerateOptionsList()
{
	long pos = 0;
	m_opts_list->DeleteAllItems();
	m_opts_list->InsertItem( pos, _( "Size" ) );
	m_opt_list_map[ _( "Size" ) ] = pos;
	pos++;
	m_opts_list->InsertItem( pos , _( "Windspeed" ) );
	m_opt_list_map[ _( "Windspeed" ) ] = pos;
	pos++;
	m_opts_list->InsertItem( pos, _( "Tidal strength" ) );
	m_opt_list_map[ _( "Tidal strength" ) ] = pos;
	pos++;
	m_opts_list->InsertItem( pos, wxEmptyString );
	pos++;
	pos = AddMMOptionsToList( pos, LSL::OptionsWrapper::EngineOption );
	// AddMMOptionsToList already increments pos by itself
	m_opts_list->InsertItem( pos, wxEmptyString );
	pos++;
	m_mod_opts_index = pos;
	pos = AddMMOptionsToList( m_mod_opts_index, LSL::OptionsWrapper::ModOption );
	// AddMMOptionsToList already increments pos by itself
	m_opts_list->InsertItem( pos, wxEmptyString );
	pos++;
	m_map_opts_index = pos;
	pos = AddMMOptionsToList( m_map_opts_index, LSL::OptionsWrapper::MapOption );
	m_side_sel->Clear();
	if (m_battle != NULL) {
		try {
			printf("RegenerateOptionsList\n");
			const wxArrayString sides = LSL::Util::vectorToArrayString(LSL::usync().GetSides(STD_STRING(m_battle->GetHostModName())));
			for ( unsigned int i = 0; i < sides.GetCount(); i++ ) {
				m_side_sel->Append(sides[i], icons().GetBitmap( icons().GetSideIcon( m_battle->GetHostModName(), i ) ) );
			printf("RegenerateOptionsList %s\n", (const char*)sides[i].mb_str());
			}
		}
		catch ( ... ) {}
	}
}
Beispiel #29
0
void BattleRoomTab::UpdateUser(User& user)
{

	if (!m_battle)
		return;
	m_players->UpdateUser(user);

	m_minimap->UpdateMinimap();

	UpdateStatsLabels();

	if (&user != &m_battle->GetMe())
		return;

	UserBattleStatus& bs = user.BattleStatus();
	m_team_sel->SetSelection(bs.team);
	m_ally_sel->SetSelection(bs.ally);

	if (m_side_sel->GetCount() > 0) {
		m_side_sel->SetSelection(bs.side);
	}

	m_spec_chk->SetValue(bs.spectator);
	m_auto_unspec_chk->SetValue(m_battle->GetAutoUnspec());
	m_ready_chk->SetValue(bs.ready);
	// Enable or disable widgets' sensitivity as appropriate.
	if (bs.spectator) {
		m_side_sel->Disable();
		m_ally_sel->Disable();
		m_team_sel->Disable();
		if (m_battle->GetBattleType() != BT_Replay) {
			m_auto_unspec_chk->Enable();
			m_ready_chk->Disable();
		} else {
			m_ready_chk->Enable();
			m_auto_unspec_chk->Disable();
		}
	} else { // we are player
		m_side_sel->Enable();
		m_ally_sel->Enable();
		m_team_sel->Enable();
		m_ready_chk->Enable();
		m_auto_unspec_chk->Disable(); //disable and uncheck unspec as we are already a player
		m_auto_unspec_chk->SetValue(false);
		m_battle->SetAutoUnspec(false);
	}

	icons().SetColourIcon(user.BattleStatus().colour);
	m_color_sel->SetColor(lslTowxColour(user.BattleStatus().colour));
}
Beispiel #30
0
static Scheme_Object *char_map_list (int argc, Scheme_Object *argv[])
{
  int i, bottom, top, uniform;
  Scheme_Object *l = scheme_null;

# define icons scheme_make_immutable_pair

  for (i = 2 * (NUM_UCHAR_RANGES - 1); i >= 0; i -= 2) {
    bottom = mapped_uchar_ranges[i];
    top = mapped_uchar_ranges[i + 1];
    if (top & URANGE_VARIES) {
      top -= URANGE_VARIES;
      uniform = 0;
    } else
      uniform = 1;
    l = icons(icons(scheme_make_integer_value(bottom),
		    icons(scheme_make_integer_value(top),
			  icons((uniform ? scheme_true : scheme_false),
				scheme_null))),
	      l);
  }

  return l;
}