SinglePlayerBattle::SinglePlayerBattle(MainSinglePlayerTab& msptab) : m_sptab(msptab) , m_me(STD_STRING(cfg().ReadString("/Spring/DefaultName"))) { OnUserAdded(m_me); m_me.BattleStatus().side = sett().GetBattleLastSideSel(TowxString(GetHostGameName())); m_me.BattleStatus().colour = wxColourTolsl(sett().GetBattleLastColour()); CustomBattleOptions().setSingleOption("startpostype", LSL::Util::ToIntString(ST_Pick), LSL::Enum::EngineOption); }
void test_wxColourTolsl(const unsigned char red, const unsigned char green, const unsigned char blue, const unsigned char alpha) { const wxColor wxcol(red, green, blue, alpha); LSL::lslColor lslcol = wxColourTolsl(wxcol); BOOST_CHECK(lslcol.Red() == red); BOOST_CHECK(lslcol.Green() == green); BOOST_CHECK(lslcol.Blue() == blue); BOOST_CHECK(lslcol.Alpha() == alpha); }
void SinglePlayerTab::OnColorButton(wxCommandEvent& /*unused*/) { User& u = m_battle.GetMe(); wxColour CurrentColour = lslTowxColour(u.BattleStatus().colour); CurrentColour = GetColourFromUser(this, CurrentColour); if (!CurrentColour.IsOk()) return; sett().SetBattleLastColour(CurrentColour); m_battle.ForceColour(u, wxColourTolsl(CurrentColour)); UpdateMinimap(); }
void BattleroomListCtrl::OnColourSelect(wxCommandEvent& /*unused*/) { slLogDebugFunc(""); wxColour CurrentColour = lslTowxColour(m_sel_user->BattleStatus().colour); CurrentColour = GetColourFromUser(this, CurrentColour); if (!CurrentColour.IsOk()) return; if (m_sel_user) m_battle->ForceColour(*m_sel_user, wxColourTolsl(CurrentColour)); }
void BattleRoomTab::OnColourSel(wxCommandEvent& /*unused*/) { if (!m_battle) return; if (!m_battle) return; User& u = m_battle->GetMe(); wxColour CurrentColour = lslTowxColour(u.BattleStatus().colour); CurrentColour = GetColourFromUser(this, CurrentColour); if (!CurrentColour.IsOk()) return; sett().SetBattleLastColour(CurrentColour); m_battle->ForceColour(u, wxColourTolsl(CurrentColour)); }