本文整理汇总了C++中sett函数的典型用法代码示例。如果您正苦于以下问题:C++ sett函数的具体用法?C++ sett怎么用?C++ sett使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sett函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OutputLine
void ChatPanel::OutputError(const wxString& message)
{
OutputLine(wxString::Format(_("Error: %s"), message.c_str()), sett().GetChatColorError());
}
开发者ID:springlobby,项目名称:springlobby,代码行数:4,代码来源:chatpanel.cpp
示例2: sett
void BattleRoomTab::SetBattle( Battle* battle )
{
m_battle = battle;
m_team_sel->Enable(m_battle);
m_ally_sel->Enable(m_battle);
m_color_sel->Enable(m_battle);
m_side_sel->Enable(m_battle);
m_options_preset_sel->Enable(m_battle);
m_minimap->Enable(m_battle);
m_player_panel->Enable(m_battle);
m_map_combo->Enable(m_battle);
m_players->Enable(m_battle);
m_leave_btn->Enable(m_battle);
m_start_btn->Enable(m_battle);
m_addbot_btn->Enable(m_battle);
m_manage_players_btn->Enable(m_battle);
m_save_btn->Enable(m_battle);
m_delete_btn->Enable(m_battle);
m_default_btn->Enable(m_battle);
m_browse_map_btn->Enable(m_battle);
m_ready_chk->Enable(m_battle);
m_spec_chk->Enable(m_battle);
m_lock_chk->Enable(m_battle);
m_autolock_chk->Enable(m_battle);
m_opts_list->Enable(m_battle);
m_minimap->SetBattle( m_battle );
m_players->SetBattle( m_battle );
m_chat->SetBattle( m_battle );
m_players->Clear();
m_side_sel->Clear();
if ( m_battle )
{
m_options_preset_sel->SetStringSelection( sett().GetModDefaultPresetName( m_battle->GetHostModName() ) );
m_color_sel->SetColor( m_battle->GetMe().BattleStatus().colour );
try
{
wxArrayString sides = 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 ) ) );
}
}
catch ( ... ) {}
for ( UserList::user_map_t::size_type i = 0; i < m_battle->GetNumUsers(); i++ )
{
m_players->AddUser( m_battle->GetUser( i ) );
#ifdef __WXMAC__
UpdateUser( m_battle->GetUser( i ) );
#endif
}
if ( !m_battle->IsFounderMe() )
{
m_options_preset_sel->Disable();
m_save_btn->Disable();
m_delete_btn->Disable();
m_default_btn->Disable();
m_manage_players_btn->Disable();
m_lock_chk->Disable();
m_autolock_chk->Disable();
}
m_host_new_btn->Show( false );
RegenerateOptionsList();
ReloadMaplist();
UpdateBattleInfo( wxString::Format( _T( "%d_mapname" ), OptionsWrapper::PrivateOptions ) );
UpdateBattleInfo();
UpdateStatsLabels();
}
else
{
m_host_new_btn->Show( true );
}
}
开发者ID:SpliFF,项目名称:springlobby,代码行数:88,代码来源:battleroomtab.cpp
示例3: sett
bool ChatLog::LogEnabled()
{
return sett().GetChatLogEnable();
}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:4,代码来源:chatlog.cpp
示例4: WindowHintsPickle
MapSelectDialog::MapSelectDialog( wxWindow* parent )
: // WindowHintsPickle( m_dialog_name, this, wxSize( DEFSETT_MW_WIDTH, DEFSETT_MW_HEIGHT ) ),
m_horizontal_direction( sett().GetHorizontalSortorder() ),
m_vertical_direction( sett().GetVerticalSortorder() )
{
//(*Initialize(MapSelectDialog)
wxStaticBoxSizer* StaticBoxSizer2;
wxStaticText* StaticText2;
wxStaticText* StaticText1;
wxBoxSizer* BoxSizer2;
wxBoxSizer* boxSizerHorizontal;
wxBoxSizer* BoxSizer1;
wxStaticBoxSizer* StaticBoxSizer1;
wxBoxSizer* boxSizerVertical;
wxStdDialogButtonSizer* StdDialogButtonSizer1;
Create(parent, wxID_ANY, _("Select map (click and drag to scroll)"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxMAXIMIZE_BOX, _T("wxID_ANY"));
BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
BoxSizer2 = new wxBoxSizer(wxVERTICAL);
StaticText2 = new wxStaticText(this, ID_STATICTEXT2, _("Vertical sort key"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
BoxSizer2->Add(StaticText2, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
boxSizerVertical = new wxBoxSizer(wxHORIZONTAL);
m_vertical_choice = new wxChoice(this, ID_VERTICAL_CHOICE, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_VERTICAL_CHOICE"));
boxSizerVertical->Add(m_vertical_choice, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2->Add(boxSizerVertical, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Horizontal sort key"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
BoxSizer2->Add(StaticText1, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5);
boxSizerHorizontal = new wxBoxSizer(wxHORIZONTAL);
m_horizontal_choice = new wxChoice(this, ID_HORIZONTAL_CHOICE, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_HORIZONTAL_CHOICE"));
boxSizerHorizontal->Add(m_horizontal_choice, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2->Add(boxSizerHorizontal, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
StaticBoxSizer1 = new wxStaticBoxSizer(wxVERTICAL, this, _("Show"));
m_filter_all = new wxRadioButton(this, ID_FILTER_ALL, _("All maps"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_FILTER_ALL"));
m_filter_all->SetToolTip(_("Shows all available maps"));
StaticBoxSizer1->Add(m_filter_all, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
m_filter_popular = new wxRadioButton(this, ID_FILTER_POPULAR, _("Popular maps"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_FILTER_POPULAR"));
m_filter_popular->SetToolTip(_("Shows only maps which are currently being player on the server. You must be online to use this."));
StaticBoxSizer1->Add(m_filter_popular, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
m_filter_recent = new wxRadioButton(this, ID_FILTER_RECENT, _("Recently played maps"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_FILTER_RECENT"));
m_filter_recent->SetValue(true);
m_filter_recent->SetToolTip(_("Shows only maps you played recently. (Based on your replays.)"));
StaticBoxSizer1->Add(m_filter_recent, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
BoxSizer2->Add(StaticBoxSizer1, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer2 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Filter"));
m_filter_text = new wxTextCtrl(this, ID_FILTER_TEXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_FILTER_TEXT"));
m_filter_text->SetToolTip(_("Shows only maps which contain this text in their name or description."));
StaticBoxSizer2->Add(m_filter_text, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
BoxSizer2->Add(StaticBoxSizer2, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
m_map_details = new wxStaticBoxSizer(wxVERTICAL, this, _("Map details"));
m_map_name = new wxStaticText(this, ID_MAP_NAME, wxEmptyString, wxDefaultPosition, wxSize(170,90), wxST_NO_AUTORESIZE, _T("ID_MAP_NAME"));
m_map_name->SetLabel( wxEmptyString );
m_map_details->Add(m_map_name, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
m_map_opts_list = new wxListCtrl(this, ID_MAP_OPTS_LIST, wxDefaultPosition, wxSize(170,120), wxLC_REPORT|wxLC_NO_HEADER|wxNO_BORDER, wxDefaultValidator, _T("ID_MAP_OPTS_LIST"));
m_map_details->Add(m_map_opts_list, 1, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer2->Add(m_map_details, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StdDialogButtonSizer1 = new wxStdDialogButtonSizer();
StdDialogButtonSizer1->AddButton(new wxButton(this, wxID_OK, wxEmptyString));
StdDialogButtonSizer1->AddButton(new wxButton(this, wxID_CANCEL, wxEmptyString));
StdDialogButtonSizer1->Realize();
BoxSizer2->Add(StdDialogButtonSizer1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
BoxSizer1->Add(BoxSizer2, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
m_mapgrid = new MapGridCtrl(this, wxSize(600,400), ID_MAPGRID);
BoxSizer1->Add(m_mapgrid, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
SetSizer(BoxSizer1);
BoxSizer1->Fit(this);
BoxSizer1->SetSizeHints(this);
Center();
Connect(ID_VERTICAL_CHOICE,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&MapSelectDialog::OnSortKeySelect);
Connect(ID_HORIZONTAL_CHOICE,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&MapSelectDialog::OnSortKeySelect);
Connect(ID_FILTER_ALL,wxEVT_COMMAND_RADIOBUTTON_SELECTED,(wxObjectEventFunction)&MapSelectDialog::OnFilterAllSelect);
Connect(ID_FILTER_POPULAR,wxEVT_COMMAND_RADIOBUTTON_SELECTED,(wxObjectEventFunction)&MapSelectDialog::OnFilterPopularSelect);
Connect(ID_FILTER_RECENT,wxEVT_COMMAND_RADIOBUTTON_SELECTED,(wxObjectEventFunction)&MapSelectDialog::OnFilterRecentSelect);
Connect(ID_FILTER_TEXT,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&MapSelectDialog::OnFilterTextChanged);
m_mapgrid->Connect(ID_MAPGRID,wxEVT_LEFT_DCLICK,(wxObjectEventFunction)&MapSelectDialog::OnMapGridLeftDClick,0,this);
Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&MapSelectDialog::OnInit);
//*)
Connect(ID_MAPGRID,MapGridCtrl::MapSelectedEvt,(wxObjectEventFunction)&MapSelectDialog::OnMapSelected,0,this);
Connect(ID_MAPGRID,MapGridCtrl::LoadingCompletedEvt,(wxObjectEventFunction)&MapSelectDialog::OnMapLoadingCompleted,0,this);
// Ugh.. Can not have these created by generated code because wxSmith doesn't accept a symbolic size,
// (ie. wxSize(CONTROL_HEIGHT,CONTROL_HEIGHT)) and all Set*Size() methods don't seem to have any effect.
m_vertical_direction_button = new wxButton(this, ID_VERTICAL_DIRECTION, _T("ᴠ"), wxDefaultPosition, wxSize(CONTROL_HEIGHT,CONTROL_HEIGHT), 0, wxDefaultValidator, _T("ID_VERTICAL_DIRECTION"));
boxSizerVertical->Add(m_vertical_direction_button, 0, wxALL|wxEXPAND|wxSHAPED|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
m_horizontal_direction_button = new wxButton(this, ID_HORIZONTAL_DIRECTION, _T(">"), wxDefaultPosition, wxSize(CONTROL_HEIGHT,CONTROL_HEIGHT), 0, wxDefaultValidator, _T("ID_HORIZONTAL_DIRECTION"));
boxSizerHorizontal->Add(m_horizontal_direction_button, 0, wxALL|wxEXPAND|wxSHAPED|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
//<>ᴠᴧ
Connect(ID_VERTICAL_DIRECTION, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&MapSelectDialog::OnVerticalDirectionClicked);
Connect(ID_HORIZONTAL_DIRECTION, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&MapSelectDialog::OnHorizontalDirectionClicked);
// TODO: refactor, this is copied from battlemaptab.cpp
m_map_opts_list->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) );
m_map_opts_list->SetFont( wxFont( 8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_LIGHT ) );
wxListItem col;
col.SetText( _("Option") );
m_map_opts_list->InsertColumn( 0, col );
//.........这里部分代码省略.........
开发者ID:jamerlan,项目名称:springlobby,代码行数:101,代码来源:mapselectdialog.cpp
示例5: SetSettingsStandAlone
void SpringLobbyApp::CacheAndSettingsSetup()
{
SetSettingsStandAlone( false );
const wxString userConfigDir = GetConfigfileDir();
if ( sett().IsFirstRun() && !wxDirExists( userConfigDir ) )
{
wxMkdir( userConfigDir );
}
if ( (sett().GetCacheVersion() < CACHE_VERSION) && !sett().IsFirstRun() )
{
sett().SetMapCachingThreadProgress( 0 ); // reset map cache thread
sett().SetModCachingThreadProgress( 0 ); // reset mod cache thread
if ( wxDirExists( sett().GetCachePath() ) )
{
wxLogWarning( _T("erasing old cache ver %d (app cache ver %d)"), sett().GetCacheVersion(), CACHE_VERSION );
wxString file = wxFindFirstFile( sett().GetCachePath() + wxFILE_SEP_PATH + _T("*") );
while ( !file.empty() )
{
wxRemoveFile( file );
file = wxFindNextFile();
}
}
}
if ( !sett().IsFirstRun() )
{
int settversion = sett().GetSettingsVersion();
if ( settversion < 3 )
{
sett().ConvertOldSpringDirsOptions();
}
if ( settversion < 4 )
{
if ( sett().GetTorrentPort() == DEFSETT_SPRING_PORT ) sett().SetTorrentPort( DEFSETT_SPRING_PORT + 1 );
}
if ( settversion < 5 )
{
wxArrayString list = sett().GetServers();
int count = list.GetCount();
wxArrayString wordlist = sett().GetHighlightedWords();
for ( int i= 0; i < count; i++ )
{
wxString nick = sett().GetServerAccountNick( list[i] );
if ( wordlist.Index( nick ) == -1 )
{
wordlist.Add( nick );
}
}
sett().SetHighlightedWords( wordlist );
}
if ( settversion < 6 )
{
sett().ConvertOldServerSettings();
}
if ( settversion < 7 )
{
sett().AddChannelJoin( _T("springlobby"), _T("") );
}
if ( settversion < 8 )
{
sett().DeleteServer( _T("Backup server") );
sett().SetServer( _T("Backup server 1"), _T("springbackup1.servegame.com"), 8200 );
sett().SetServer( _T("Backup server 2"), _T("springbackup2.servegame.org"), 8200 );
sett().SetServer( _T("Test server"), _T("taspringmaster.servegame.com"), 8300 );
}
if ( settversion < 10 )
{
sett().ConvertOldColorSettings();
}
if ( settversion < 11 )
{
if( IsUACenabled() )
{
usync().ReloadUnitSyncLib();
if ( usync().IsLoaded() ) usync().SetSpringDataPath(_T("")); // UAC is on, fix the spring data path
}
}
if ( settversion < 12 )
{
sett().ConvertOldChannelSettings();
}
if ( settversion < 13 )
{
sett().ConvertOldHiglightSettings();
}
if ( settversion < 15 )
{
sett().TranslateSavedColumWidths();
}
if ( settversion < 21 )
{
sett().RemoveLayouts();
}
if ( settversion < 18 )
{
//new downloader was introduced
sett().ClearTorrentListToResume();
}
if( settversion < 19 )
//.........这里部分代码省略.........
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:101,代码来源:springlobbyapp.cpp
示例6: sett
void ChatOptionsTab::DoRestore()
{
m_normal_color->SetColor( sett().GetChatColorNormal() );
m_bg_color->SetColor( sett().GetChatColorBackground() );
m_action_color->SetColor( sett().GetChatColorAction() );
m_highlight_color->SetColor( sett().GetChatColorHighlight() );
m_joinleave_color->SetColor( sett().GetChatColorJoinPart() );
m_note_color->SetColor( sett().GetChatColorNotification() );
m_my_color->SetColor( sett().GetChatColorMine() );
m_server_color->SetColor( sett().GetChatColorServer() );
m_client_color->SetColor( sett().GetChatColorClient() );
m_error_color->SetColor( sett().GetChatColorError() );
m_ts_color->SetColor( sett().GetChatColorTime() );
m_chat_font = sett().GetChatFont();
m_fontname->SetLabel( m_chat_font.GetFaceName() );
m_save_logs->SetValue( sett().GetChatLogEnable() );
m_irc_colors->SetValue( sett().GetUseIrcColors() );
wxString highlightstring;
wxArrayString highlights = sett().GetHighlightedWords();
for ( unsigned int i = 0; i < highlights.GetCount(); i++ ) highlightstring << highlights[i] << _T( ";" );
m_highlight_words->SetValue( highlightstring );
m_highlight_req->SetValue( sett().GetRequestAttOnHighlight() );
#ifndef DISABLE_SOUND
m_play_sounds->SetValue( sett().GetChatPMSoundNotificationEnabled() );
#endif
m_num_lines->SetValue( sett().GetAutoloadedChatlogLinesCount() );
m_broadcast_check->SetValue(sett().GetBroadcastEverywhere() );
}
开发者ID:SpliFF,项目名称:springlobby,代码行数:28,代码来源:chatoptionstab.cpp
示例7: slLogDebugFunc
bool ChatPanel::Say(const wxString& message) //FIXME: remove all parsing / tokenizing / ... to dedicated file
{
static const unsigned int flood_threshold = 5;
slLogDebugFunc("");
wxStringTokenizer lines(message, _T('\n'));
if (lines.CountTokens() > flood_threshold) {
PasteDialog dl(this, wxString::Format(_("Are you sure you want to paste %d lines?"), lines.CountTokens()));
switch (dl.ShowModal()) {
case wxID_NO:
return true;
case PasteDialog::pasteButtonReturnCode: {
wxString url = Paste2Pastebin(message);
if (url != wxEmptyString && wxStringTokenizer(url, _T('\n')).CountTokens() <= flood_threshold) {
Say(url);
return true;
} else {
customMessageBoxModal(SL_MAIN_ICON, wxString::Format(_("Failed to post to %s"), _T("paste.springfiles.com")));
return false;
}
}
default:
break;
}
}
while (lines.HasMoreTokens()) {
wxString line = lines.GetNextToken();
wxLogDebug(_T( "line: %s" ), line.c_str());
if (line == "/help") {
ui().ConsoleHelp();
return true;
}
if (line == "/channels") {
ui().mw().ShowChannelChooser();
return true;
}
if (line == _T( "/ver" )) {
//!this instance is not replaced with GetAppname for sake of help/debug online
OutputLine(wxString::Format(_("You have %s."), GetSpringlobbyAgent()), sett().GetChatColorNormal());
return true;
}
if (line == _T( "/clear" )) {
m_chatlog_text->SetValue(wxEmptyString);
return true;
}
if (m_type == CPT_Channel) {
if (m_channel == 0) {
OutputError(_("You are not in channel or channel does not exist."));
return true;
}
if (line.StartsWith(_T( "/" ))) {
if (m_channel->ExecuteSayCommand(STD_STRING(line)))
return true;
if (m_channel->GetServer().ExecuteSayCommand(STD_STRING(line)))
return true;
OutputError(wxString::Format(_("Command (%s) does not exist, use /help for a list of available commands."), line.c_str()));
return true;
}
m_channel->Say(STD_STRING(line));
} else if (m_type == CPT_Battle) {
if (m_battle == 0) {
OutputError(_("You are not in battle or battle does not exist, use /help for a list of available commands."));
return true;
}
if (line.StartsWith(_T( "/" ))) {
if (m_battle->ExecuteSayCommand(STD_STRING(line)))
return true;
if (m_battle->GetServer().ExecuteSayCommand(STD_STRING(line)))
return true;
OutputError(wxString::Format(_("Command (%s) does not exist, use /help for a list of available commands."), line.c_str()));
return true;
}
m_battle->Say(STD_STRING(line));
} else if (m_type == CPT_User) {
if (m_user == 0) {
OutputError(_("User is offline."));
return true;
}
if (line.StartsWith(_T( "/" ))) {
if (m_user->ExecuteSayCommand(STD_STRING(line)))
return true;
if (m_user->GetServer().ExecuteSayCommand(STD_STRING(line)))
return true;
OutputError(wxString::Format(_("Command (%s) does not exist, use /help for a list of available commands."), line.c_str()));
return true;
}
m_user->Say(STD_STRING(line));
} else if (m_type == CPT_Server) {
if (m_server == 0) {
OutputError(_("Not connected to server"));
//.........这里部分代码省略.........
开发者ID:springlobby,项目名称:springlobby,代码行数:101,代码来源:chatpanel.cpp
示例8: sett
void AddBotDialog::OnAddBot( wxCommandEvent& /*event*/ )
{
sett().SetLastAI( m_ai->GetStringSelection() );
EndModal( wxID_OK );
}
开发者ID:N0U,项目名称:springlobby,代码行数:5,代码来源:addbotdialog.cpp
示例9: TowxString
void ChatPanel::Parted(User& who, const wxString& message)
{
// assert( m_type == CPT_Channel || m_type == CPT_Server || m_type == CPT_Battle || m_type == CPT_User );
const bool me_parted = m_channel && &who == &m_channel->GetMe();
const wxString nick = TowxString(who.GetNick());
const bool wasactive = m_active_users.erase(nick) > 0;
if (m_display_joinitem || (wasactive && !who.IsBot())) {
OutputLine(_T( "** " ) + wxString::Format(_("%s left %s (%s)."), nick.c_str(), GetChatTypeStr().c_str(), message.c_str()), sett().GetChatColorJoinPart());
}
if (m_type == CPT_Channel) {
if (m_channel == 0)
return;
if (me_parted) {
m_channel->panel = nullptr;
SetChannel(0);
return;
}
if (m_display_joinitem) {
// change the image of the tab to show new events
SetIconHighlight(highlight_join_leave);
}
} else if (m_type == CPT_Server && me_parted)
return;
if (m_show_nick_list && (m_nicklist != nullptr)) {
m_nicklist->RemoveUser(who);
UpdateUserCountLabel();
}
// Also remove the User from the TextCompletionDatabase
textcompletiondatabase.Delete_Mapping(TowxString(who.GetNick()));
}
开发者ID:springlobby,项目名称:springlobby,代码行数:30,代码来源:chatpanel.cpp
示例10: UpdateUserCountLabel
void ChatPanel::OnChannelJoin(User& who)
{
// assert( m_type == CPT_Channel || m_type == CPT_Server || m_type == CPT_Battle || m_type == CPT_User );
if (m_show_nick_list && (m_nicklist != nullptr)) {
m_nicklist->AddUser(who);
UpdateUserCountLabel();
}
if (m_display_joinitem) {
OutputLine(_T( "** " ) + wxString::Format(_("%s joined %s."), TowxString(who.GetNick()).c_str(), GetChatTypeStr().c_str()), sett().GetChatColorJoinPart());
}
// Also add the User to the TextCompletionDatabase
textcompletiondatabase.Insert_Mapping(TowxString(who.GetNick()), TowxString(who.GetNick()));
}
开发者ID:springlobby,项目名称:springlobby,代码行数:13,代码来源:chatpanel.cpp
示例11: SetIconHighlight
void ChatPanel::Joined(User& who)
{
if (m_display_joinitem) {
// change the image of the tab to show new events
if (m_type == CPT_Channel) {
SetIconHighlight(highlight_join_leave);
}
OutputLine(_T( "** " ) + wxString::Format(_("%s joined %s."), TowxString(who.GetNick()).c_str(), GetChatTypeStr().c_str()), sett().GetChatColorJoinPart());
}
if (m_show_nick_list && (m_nicklist != nullptr)) {
m_nicklist->AddUser(who);
UpdateUserCountLabel();
}
// Also add the User to the TextCompletionDatabase
textcompletiondatabase.Insert_Mapping(TowxString(who.GetNick()), TowxString(who.GetNick()));
}
开发者ID:springlobby,项目名称:springlobby,代码行数:17,代码来源:chatpanel.cpp
示例12: dlg
void HostBattleDialog::Run( wxWindow* parent )
{
HostBattleDialog dlg( parent );
if ( dlg.ShowModal() == wxID_OK )
{
BattleOptions bo;
bo.description = sett().GetLastHostDescription();
bo.port = sett().GetLastHostPort();
bo.nattype = NatType( sett().GetLastHostNATSetting() );
if ( bo.nattype == NAT_None && sett().GetTestHostPort() )
{
switch ( ui().TestHostPort( bo.port ) )
{
case Server::porttest_pass :
break; // success
case Server::porttest_pass_WX26 :
wxLogWarning( _T( "hosting port %d: test aborted (wx26)" ), bo.port );
customMessageBoxNoModal( SL_MAIN_ICON, wxString::Format( _( "Your using wxWidgets prior to version 2.8,\n "
"port testing is not supported.\n Hosting may or may not work." ), bo.port ) );
sett().SetTestHostPort( false ); // no need to have it checked anymore
break;
case Server::porttest_unreachable :
wxLogWarning( _T( "hosting port %d: test undetermined" ), bo.port );
customMessageBoxNoModal( SL_MAIN_ICON, wxString::Format( _( "The server used for testing your port %d "
"is unreachable. \nHosting may or may not work with this setting." ), bo.port ) );
break; //inconclusive test shouldn't hinder hosting imo (koshi)
case Server::porttest_timeout :
case Server::porttest_socketNotOk :
case Server::porttest_socketError :
wxLogWarning( _T( "hosting port %d: test unsuccessful, closing battle" ), bo.port );
customMessageBoxNoModal( SL_MAIN_ICON, wxString::Format( _( "Battle not started because the port you selected (%d) "
"is unable to-f /home/kosh/.springlobby/testing.conf recieve incoming packets\n checks your router & firewall configuration again or change port "
"in the dialog.\n\nIf everything else fails, enable the Hole Punching NAT Traversal\n "
"option in the hosting settings." ), bo.port ) );
return;
default:
wxLogWarning( _T( "unknonw port forward test result" ) );
break;
}
if ( !ui().TestHostPort( bo.port ) )
{
wxLogWarning( _T( "hosting port %d: test unsuccessful, closing battle" ), bo.port );
customMessageBoxNoModal( SL_MAIN_ICON, wxString::Format( _( "Battle not started because the port you selected (%d) is unable to recieve incoming packets\n checks your router & firewall configuration again or change port in the dialog.\n\nIf everything else fails, enable the Hole Punching NAT Traversal\n option in the hosting settings." ), bo.port ) );
return;
}
}
// Get selected mod from unitsync.
UnitSyncMod mod;
try
{
mod = usync().GetMod( sett().GetLastHostMod() );
bo.modhash = mod.hash;
bo.modname = mod.name;
}
catch ( ... )
{
wxLogWarning( _T( "can't host: mod not found" ) );
customMessageBoxNoModal( SL_MAIN_ICON, _( "Battle not started beacuse the mod you selected could not be found. " ), _( "Error starting battle." ), wxOK );
return;
}
UnitSyncMap map;
wxString mname = sett().GetLastHostMap();
try {
if ( usync().MapExists( mname ) )
map = usync().GetMap( mname );
else if ( usync().GetNumMaps() <= 0 )
{
wxLogWarning( _T( "no maps found" ) );
customMessageBoxNoModal( SL_MAIN_ICON, _( "Couldn't find any maps in your spring installation. This could happen when you set the Spring settings incorrectly." ), _( "No maps found" ), wxOK );
return;
}
else
{
map = usync().GetMap( 0 );
}
}
catch ( ... )
{
wxLogWarning( _T( "no maps found" ) );
customMessageBoxNoModal( SL_MAIN_ICON, _( "Couldn't find any maps in your spring installation. This could happen when you set the Spring settings incorrectly." ), _( "No maps found" ), wxOK );
return;
}
bo.maphash = map.hash;
bo.mapname = map.name;
bo.rankneeded = sett().GetLastRankLimit();
bo.maxplayers = sett().GetLastHostPlayerNum();
bo.userelayhost = sett().GetLastHostRelayedMode();
if ( bo.userelayhost ) bo.nattype = NAT_None;
bo.relayhost = sett().GetLastRelayedHost();
serverSelector().GetServer().HostBattle( bo, sett().GetLastHostPassword() );
}
}
开发者ID:mallyvai,项目名称:springlobby,代码行数:100,代码来源:hostbattledialog.cpp
示例13: wxScrolledWindow
//.........这里部分代码省略.........
m_test_text = new wxTextCtrl( m_custom_colors, wxID_ANY, _( "[19:35] ** Server ** Connected to Server.\n[22:30] <Dude> hi everyone\n[22:30] ** Dude2 joined the channel.\n[22:30] * Dude2 thinks his colors looks nice\n[22:45] <Dude> Dude2: orl?\n[22:46] <Dude2> But could be better, should tweak them some more...\n" ), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH );
bCustomColorsSizer->Add( m_test_text, 1, wxALL | wxEXPAND, 5 );
m_custom_colors->SetSizer( bCustomColorsSizer );
m_custom_colors->Layout();
bCustomColorsSizer->Fit( m_custom_colors );
bColorsVSizer->Add( m_custom_colors, 1, wxEXPAND | wxALL, 0 );
wxBoxSizer* bFontNameSizer;
bFontNameSizer = new wxBoxSizer( wxHORIZONTAL );
m_font_label = new wxStaticText( this, wxID_ANY, _( "Font:" ), wxDefaultPosition, wxDefaultSize, 0 );
m_font_label->Wrap( -1 );
bFontNameSizer->Add( m_font_label, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
m_fontname = new wxStaticText( this, wxID_ANY, _( "default" ), wxDefaultPosition, wxDefaultSize, 0 );
m_fontname->Wrap( -1 );
bFontNameSizer->Add( m_fontname, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
m_select_font = new wxButton( this, ID_SELFONT, _( "Select..." ), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
bFontNameSizer->Add( m_select_font, 0, wxALL, 5 );
bColorsVSizer->Add( bFontNameSizer, 0, wxEXPAND, 5 );
sbColorsSizer->Add( bColorsVSizer, 1, wxEXPAND, 5 );
bMainSizerV->Add( sbColorsSizer, 0, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT | wxTOP, 5 );
wxStaticBoxSizer* sbBehaviorSizer;
sbBehaviorSizer = new wxStaticBoxSizer( new wxStaticBox( this, -1, _( "Behavior" ) ), wxHORIZONTAL );
m_irc_colors = new wxCheckBox( this, wxID_ANY, _( "Enable Irc colors in chat messages" ), wxDefaultPosition, wxDefaultSize, 0 );
m_irc_colors->SetValue( sett().GetUseIrcColors() );
sbBehaviorSizer->Add( m_irc_colors, 0, wxALL, 5 );
#ifndef DISABLE_SOUND
m_play_sounds = new wxCheckBox( this, ID_PLAY_SOUNDS, _( "Play notification sounds" ), wxDefaultPosition, wxDefaultSize, 0 );
m_play_sounds->SetValue( sett().GetChatPMSoundNotificationEnabled() );
sbBehaviorSizer->Add( m_play_sounds, 0, wxALL, 5 );
#endif
m_broadcast_check = new wxCheckBox( this, wxID_ANY, _( "Copy server messages in current channel" ), wxDefaultPosition, wxDefaultSize, 0 );
m_broadcast_check->SetValue( sett().GetBroadcastEverywhere() );
sbBehaviorSizer->Add( m_broadcast_check, 0, wxALL, 5 );
bMainSizerV->Add( sbBehaviorSizer, 0, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT, 5 );
wxBoxSizer* bBotomSizer;
bBotomSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbChatLogSizer;
wxStaticBox* sbChatLog = new wxStaticBox( this, -1, _( "Chat logs" ) );
sbChatLogSizer = new wxStaticBoxSizer( sbChatLog, wxVERTICAL );
m_save_logs = new wxCheckBox( this, wxID_ANY, _( "Save chat logs" ), wxDefaultPosition, wxDefaultSize, 0 );
m_save_logs->SetValue( sett().GetChatLogEnable() );
sbChatLogSizer->Add( m_save_logs, 0, wxALL, 5 );
wxBoxSizer* m_num_lines_sizer = new wxBoxSizer( wxHORIZONTAL );
m_num_lines = new wxSpinCtrl( this, wxID_ANY );
m_num_lines_lbl = new wxStaticText( this, wxID_ANY, _( "approx. number of lines loaded from log into chat" ), wxDefaultPosition, wxDefaultSize, 0 );
m_num_lines_sizer->Add( m_num_lines );
m_num_lines_sizer->Add( m_num_lines_lbl, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, 5 );
sbChatLogSizer->Add( m_num_lines_sizer, 0, wxALL, 5 );
开发者ID:SpliFF,项目名称:springlobby,代码行数:67,代码来源:chatoptionstab.cpp
示例14: wxDialog
HostBattleDialog::HostBattleDialog( wxWindow* parent )
: wxDialog( parent, -1, _( "Host new battle" ), wxDefaultPosition, wxSize( 410, 441 ), wxRESIZE_BORDER | wxDEFAULT_DIALOG_STYLE ),
WindowAttributesPickle( _T("hostbattledialog"), this, wxSize( 410, 441 ) ),
m_last_relayhost( sett().GetLastRelayedHost() )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxFlexGridSizer* topsizer = new wxFlexGridSizer( 2, 0, 10);
// topsizer->AddGrowableCol( 1, 1 );
SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* m_main_sizer;
m_main_sizer = new wxBoxSizer( wxVERTICAL );
m_desc_lbl = new wxStaticText( this, wxID_ANY, _( "Description" ), wxDefaultPosition, wxDefaultSize, 0 );
m_desc_lbl->Wrap( -1 );
topsizer->Add( m_desc_lbl, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
// wxBoxSizer* desc_sizer = new wxBoxSizer( wxVERTICAL );
m_desc_text = new wxTextCtrl( this, wxID_ANY, sett().GetLastHostDescription(), wxDefaultPosition, wxDefaultSize, 0 );
m_desc_text->SetToolTip( TE( _( "A short description of the game, this will show up in the battle list." ) ) );
topsizer ->Add( m_desc_text, 1, wxALL | wxEXPAND, 5 );
m_desc_check = new wxCheckBox( this, wxID_ANY, _( "Autopaste description" ) );
m_desc_check->SetValue( sett().GetBattleLastAutoAnnounceDescription() );
m_desc_check->SetToolTip( TE( _( "Automatically write the battle description when a user joins." ) ) );
topsizer->AddStretchSpacer();
topsizer->Add( m_desc_check, 0, wxLEFT, 5 );
// topsizer->Add( desc_sizer , 0, wxEXPAND | wxALL, 0 );
m_mod_lbl = new wxStaticText( this, wxID_ANY, _( "Mod" ), wxDefaultPosition, wxDefaultSize, 0 );
m_mod_lbl->Wrap( -1 );
topsizer->Add( m_mod_lbl, 0, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
wxArrayString m_mod_picChoices;
wxBoxSizer* mod_choice_button_sizer = new wxBoxSizer( wxHORIZONTAL );
m_mod_pic = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_mod_picChoices, 0 );
m_mod_pic->SetToolTip( TE( _( "Select the mod to play with." ) ) );
mod_choice_button_sizer->Add( m_mod_pic, 0, wxALL , 5 );
wxBitmap mp = charArr2wxBitmap( arrow_refresh_png, sizeof( arrow_refresh_png ) );
m_refresh_btn = new wxBitmapButton( this, BTN_REFRESH, mp );
mod_choice_button_sizer->Add( m_refresh_btn, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
topsizer->Add( mod_choice_button_sizer, 0, wxEXPAND|wxALL ,1 );
m_pwd_lbl = new wxStaticText( this, wxID_ANY, _( "Password\n(no spaces)" ), wxDefaultPosition, wxDefaultSize, 0 );
m_pwd_lbl->Wrap( -1 );
topsizer->Add( m_pwd_lbl, 1, wxALL| wxALIGN_CENTER_VERTICAL, 5 );
m_pwd_text = new wxTextCtrl( this, wxID_ANY, sett().GetLastHostPassword(), wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD );
m_pwd_text->SetToolTip( TE( _( "Password needed to join game. Keep empty for no password" ) ) );
topsizer->Add( m_pwd_text, 1, wxALL| wxEXPAND, 5 );
m_port_lbl = new wxStaticText( this, wxID_ANY, _( "Port" ), wxDefaultPosition, wxDefaultSize, 0 );
m_port_lbl->Wrap( -1 );
topsizer->Add( m_port_lbl, 1, wxALL| wxALIGN_CENTER_VERTICAL, 5 );
m_port_text = new wxTextCtrl( this, wxID_ANY, wxString::Format( _T( "%d" ), sett().GetLastHostPort() ), wxDefaultPosition, wxDefaultSize, 0 );
m_port_text->SetToolTip( TE( _( "UDP port to host game on. Default is 8452." ) ) );
topsizer->Add( m_port_text, 1, wxALL| wxEXPAND, 5 );
// m_port_test_check = new wxCheckBox( this, wxID_ANY, _("Test firewall"), wxDefaultPosition, wxDefaultSize, 0 );
// m_port_test_check->SetValue( sett().GetTestHostPort() );
// m_port_sizer->Add( m_port_test_check, 1, wxALL|wxEXPAND, 5 );
m_relayed_host_check = new wxCheckBox( this, CHK_USE_RELAY, _( "Use relayhost" ), wxDefaultPosition, wxDefaultSize, 0 );
m_relayed_host_check->SetToolTip( TE( _( "host and control game on remote server, helps if you have trouble hosting" ) ) );
m_relayed_host_pick = new wxButton( this, PICK_RELAYHOST, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
m_relayed_host_pick->SetLabel( m_last_relayhost.IsEmpty() ? _T("automatic") : m_last_relayhost );
m_relayhost_list = new wxMenu();
wxMenuItem* automatic_pick = new wxMenuItem( m_relayhost_list, AUTO_PICK_HOST, _("Chose automatically"), _("Randomly picks an available one"), wxITEM_RADIO );
m_relayhost_list->Append( automatic_pick );
automatic_pick->Check( m_last_relayhost.IsEmpty() );
m_relayhost_list->AppendSeparator();
wxMenuItem* manual_pick_relay = new wxMenuItem( m_relayhost_list, MANUAL_PICK_HOST, _("Manually enter the manager name"), _("You'll get prompted for the exact manager name"), wxITEM_RADIO );
m_relayhost_list->Append( manual_pick_relay );
m_relayhost_list->AppendSeparator();
m_relayhost_array_list = serverSelector().GetServer().GetRelayHostList();
for ( unsigned int i = 0; i < m_relayhost_array_list.GetCount(); i++ )
{
wxMenuItem* newitem = new wxMenuItem( m_relayhost_list, MANUAL_PICK_HOST + 1 + i, m_relayhost_array_list[i], _T("") , wxITEM_RADIO );
m_relayhost_list->Append( newitem );
newitem->Check( m_last_relayhost == m_relayhost_array_list[i] );
}
m_relayed_host_check->SetValue( sett().GetLastHostRelayedMode() );
m_relayed_host_pick->Show( m_relayed_host_check->IsChecked() );
topsizer->Add( m_relayed_host_check, 1, wxALL | wxEXPAND, 5 );
topsizer->Add( m_relayed_host_pick, 0, wxALL | wxEXPAND, 5);
m_main_sizer->Add( topsizer, 0, wxEXPAND, 0 );
wxStaticBoxSizer* m_players_box;
m_players_box = new wxStaticBoxSizer( new wxStaticBox( this, -1, _( "Number of players" ) ), wxVERTICAL );
//.........这里部分代码省略.........
开发者ID:mallyvai,项目名称:springlobby,代码行数:101,代码来源:hostbattledialog.cpp
示例15: sett
void ImageComparator::Compare( QString const&filepath, QImage const &img )
{
QSettings sett(SettingsValues::filename(),QSettings::IniFormat);
sett.beginGroup(SettingsValues::comparatorGroupName());
QString goldenPath = sett.value(SettingsValues::goldenPathValueName(), SettingsValues::goldenPathDefault()).toString() + "/";
QString diffPath = sett.value(SettingsValues::diffPathValueName(), SettingsValues::diffPathDefault()).toString() + "/";
sett.endGroup();
QFileInfo info(filepath);
QString const samplePath = goldenPath + info.fileName();
if(!QFile::exists(samplePath))
{
QMessageBox::critical(NULL, "Error!", QString("Golden image \"%1\" does not exist!").arg(samplePath));
return;
}
QImage sample(samplePath);
sample = sample.convertToFormat(QImage::Format_ARGB32_Premultiplied);
if(sample.isNull())
{
QMessageBox::critical(NULL, "Error!", QString("Could not open file \"%1\"!").arg(samplePath));
return;
}
if(sample.size() != img.size())
{
QMessageBox::critical(NULL, "Error!", QString("Sample and current images have different sizes!"));
return;
}
unsigned long long accum = 0;
int sx = sample.width();
int sy = sample.height();
int bpl = sample.bytesPerLine();
QImage diffImg(sample.size(), QImage::Format_ARGB32);
for (int y = 0; y < sy; ++y) {
for (int x = 0; x < sx; ++x)
{
for (int c = 0; c < 3; ++c)
{
unsigned idx = y * bpl + (x << 2) + c;
uchar diff = abs((int)sample.constBits()[idx] - (int)img.constBits()[idx]);
diffImg.bits()[idx] = diff;
accum += diff;
}
diffImg.bits()[y * bpl + (x << 2) + 3] = sample.bits()[y * bpl + (x << 2) + 3];
}
}
QString const diffName = diffPath + info.fileName();
QDir diffDir(diffPath);
if(!diffDir.exists(diffPath))
{
if(!QDir(diffPath + "/..").mkpath(diffDir.dirName()))
{
QMessageBox::critical(NULL, "Error!", QString("Could not create diff folder \"%1\"!").arg(diffPath));
return;
}
}
if(!diffImg.save(diffName, info.suffix().toAscii().data()))
{
QMessageBox::critical(NULL, "Error!", QString("Could not save the difference image \"%1\"!").arg(diffName));
return;
}
double diff = ((double)accum / (img.size().width() * img.size().height() * 3) * 100.0 / 255.0);
QDialog dlg;
Ui::ImgDifferenceDialog ui;
ui.setupUi(&dlg);
dlg.setModal(true);
dlg.setSizeGripEnabled(false);
dlg.layout()->setSizeConstraint( QLayout::SetFixedSize );
ui.label->setText(QString("The difference is: %1").arg(diff, 0, 'f', 2));
QPixmap pxmp = QPixmap::fromImage(diffImg);
QRect r = ui.frame->frameRect();
if(r.width() < pxmp.width())
pxmp = pxmp.scaledToWidth(r.width(), Qt::SmoothTransformation);
if(r.height() < pxmp.height())
pxmp = pxmp.scaledToHeight(r.height(), Qt::SmoothTransformation);
//ui.differenceLabel->resize(pxmp.size());
ui.differenceLabel->setPixmap(pxmp);
dlg.exec();
}
开发者ID:DimkoChurinov,项目名称:ImagePro,代码行数:80,代码来源:image_comparator.cpp
示例16: wxSetEnv
//! @brief Initializes the application.
//!
//! It will open the main window and connect default to server or open the connect window.
bool SpringLobbyApp::OnInit()
{
wxSetEnv( _T("UBUNTU_MENUPROXY"), _T("0") );
//this triggers the Cli Parser amongst other stuff
if (!wxApp::OnInit())
return false;
SetAppName( m_appname );
if (!m_crash_handle_disable) {
#if wxUSE_ON_FATAL_EXCEPTION
wxHandleFatalExceptions( true );
#endif
#if defined(__WXMSW__) && defined(ENABLE_DEBUG_REPORT)
//this undocumented function acts as a workaround for the dysfunctional
// wxUSE_ON_FATAL_EXCEPTION on msw when mingw is used (or any other non SEH-capable compiler )
SetUnhandledExceptionFilter(filter);
#endif
}
//initialize all loggers, we'll use the returned pointer to set correct parent window later
wxLogChain* logchain = 0;
wxLogWindow *loggerwin = InitializeLoggingTargets( 0, m_log_console, m_log_file_path, m_log_window_show, !m_crash_handle_disable, m_log_verbosity, logchain );
//this needs to called _before_ mainwindow instance is created
wxInitAllImageHandlers();
wxFileSystem::AddHandler(new wxZipFSHandler);
wxSocketBase::Initialize();
#ifdef __WXMSW__
wxString path = wxPathOnly( wxStandardPaths::Get().GetExecutablePath() ) + wxFileName::GetPathSeparator() + _T("locale");
#else
#if defined(LOCALE_INSTALL_DIR)
wxString path ( _T(LOCALE_INSTALL_DIR) );
#else
// use a dummy name here, we're only interested in the base path
wxString path = wxStandardPaths::Get().GetLocalizedResourcesDir(_T("noneWH"),wxStandardPaths::ResourceCat_Messages);
path = path.Left( path.First(_T("noneWH") ) );
#endif
#endif
m_translationhelper = new wxTranslationHelper( *( (wxApp*)this ), path );
m_translationhelper->Load();
if ( !wxDirExists( GetConfigfileDir() ) )
wxMkdir( GetConfigfileDir() );
#ifdef __WXMSW__
sett().SetSearchSpringOnlyInSLPath( sett().GetSearchSpringOnlyInSLPath() );
#endif
sett().SetSpringBinary( sett().GetCurrentUsedSpringIndex(), sett().GetCurrentUsedSpringBinary() );
sett().SetUnitSync( sett().GetCurrentUsedSpringIndex(), sett().GetCurrentUsedUnitSync() );
if ( sett().DoResetPerspectives() )
{
//we do this early on and reset the config var a little later so we can save a def. perps once mw is created
sett().RemoveLayouts();
sett().SetDoResetPerspectives( false );
ui().mw().SavePerspectives( _T("SpringLobby-default") );
}
sett().RefreshSpringVersionList();
//this should take off the firstload time considerably *ie nil it :P )
mapSelectDialog();
if ( !m_customizer_archive_name.IsEmpty() )
{//this needsto happen before usync load
sett().SetForcedSpringConfigFilePath( GetCustomizedEngineConfigFilePath() );
}
//unitsync first load, NEEDS to be blocking
const bool usync_loaded = usync().ReloadUnitSyncLib();
if ( !sett().IsFirstRun() && !usync_loaded )
{
customMessageBox( SL_MAIN_ICON, _("Please check that the file given in Preferences->Sp
|
请发表评论