Enabled news (but not addons) in normal debug mode.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8086 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
02ddcc961b
commit
6867018d52
@ -17,7 +17,6 @@
|
||||
/**
|
||||
\page addons Addons
|
||||
*/
|
||||
#ifdef ADDONS_MANAGER
|
||||
|
||||
#include "addons/addon.hpp"
|
||||
|
||||
@ -87,5 +86,4 @@ void Addon::writeXML(std::ofstream *out_stream)
|
||||
<< "\"/>\n";
|
||||
} // writeXML
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -17,8 +17,6 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifdef ADDONS_MANAGER
|
||||
|
||||
#ifndef HEADER_ADDON_HPP
|
||||
#define HEADER_ADDON_HPP
|
||||
|
||||
@ -135,4 +133,3 @@ public:
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -17,7 +17,6 @@
|
||||
/**
|
||||
\page addons Addons
|
||||
*/
|
||||
#ifdef ADDONS_MANAGER
|
||||
|
||||
#include "addons/addons_manager.hpp"
|
||||
|
||||
@ -380,5 +379,3 @@ void AddonsManager::saveInstalled(const std::string &type)
|
||||
track_manager->loadTrackList();
|
||||
} // saveInstalled
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -15,7 +15,6 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifdef ADDONS_MANAGER
|
||||
|
||||
#ifndef HEADER_ADDONS_MANAGER_HPP
|
||||
#define HEADER_ADDONS_MANAGER_HPP
|
||||
@ -90,4 +89,4 @@ public:
|
||||
|
||||
extern AddonsManager *addons_manager;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifdef ADDONS_MANAGER
|
||||
#include "addons/network_http.hpp"
|
||||
|
||||
#include <curl/curl.h>
|
||||
@ -115,15 +114,19 @@ void *NetworkHttp::mainLoop(void *obj)
|
||||
me->checkRedirect(xml);
|
||||
me->updateNews(xml, xml_file);
|
||||
me->loadAddonsList(xml, xml_file);
|
||||
#ifdef ADDONS_MANAGER
|
||||
addons_manager->initOnline(xml);
|
||||
if(UserConfigParams::m_verbosity>=3)
|
||||
printf("[addons] Addons manager list downloaded\n");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef ADDONS_MANAGER
|
||||
addons_manager->setErrorState();
|
||||
if(UserConfigParams::m_verbosity>=3)
|
||||
printf("[addons] Can't download addons list.\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
@ -608,4 +611,3 @@ float NetworkHttp::getProgress() const
|
||||
return m_progress.get();
|
||||
} // getProgress
|
||||
|
||||
#endif
|
||||
|
@ -15,8 +15,6 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#ifdef ADDONS_MANAGER
|
||||
|
||||
#ifndef HEADER_NETWORK_HTTP_HPP
|
||||
#define HEADER_NETWORK_HTTP_HPP
|
||||
|
||||
@ -148,4 +146,4 @@ public:
|
||||
extern NetworkHttp *network_http;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#ifdef ADDONS_MANAGER
|
||||
|
||||
#include "irrlicht.h"
|
||||
#include <string.h>
|
||||
#include <iostream>
|
||||
@ -122,4 +122,3 @@ bool extract_zip(const std::string &from, const std::string &to)
|
||||
|
||||
return !error;
|
||||
} // extract_zip
|
||||
#endif
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#ifdef ADDONS_MANAGER
|
||||
|
||||
#ifndef HEADER_ZIP_HPP
|
||||
#define HEADER_ZIP_HPP
|
||||
|
||||
@ -22,4 +22,3 @@
|
||||
bool extract_zip(const std::string &from, const std::string &to);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -43,7 +43,7 @@
|
||||
Optimization="0"
|
||||
WholeProgramOptimization="false"
|
||||
AdditionalIncludeDirectories="../../../src;../../../src/bullet/src;../../../src/enet/include;../../../dependencies/include;../../../dependencies/include/irrlicht"
|
||||
PreprocessorDefinitions="BT_NO_PROFILE;HAVE_OPENAL;HAVE_OGGVORBIS;_DEBUG;_CONSOLE;WIN32;NOMINMAX;VERSION=\"0.7alpha3\";_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;DEBUG;PACKAGE=\"supertuxkart\";HAVE_GETTEXT;ENABLE_NLS;HAVE_GLUT;_CRTDBG_MAP_ALLOC;ENABLE_BIDI"
|
||||
PreprocessorDefinitions="BT_NO_PROFILE;HAVE_OPENAL;HAVE_OGGVORBIS;_DEBUG;_CONSOLE;WIN32;NOMINMAX;VERSION=\"0.7alpha3\";_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;DEBUG;PACKAGE=\"supertuxkart\";HAVE_GLUT;_CRTDBG_MAP_ALLOC;ENABLE_BIDI"
|
||||
GeneratePreprocessedFile="0"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@ -65,7 +65,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="opengl32.lib user32.lib gdi32.lib winmm.lib advapi32.lib OpenAL32.lib libogg.lib libvorbis.lib libvorbisfile.lib intl.lib Irrlicht.lib ws2_32.lib fribidi.lib"
|
||||
AdditionalDependencies="opengl32.lib user32.lib gdi32.lib winmm.lib advapi32.lib OpenAL32.lib libogg.lib libvorbis.lib libvorbisfile.lib Irrlicht.lib ws2_32.lib fribidi.lib pthreadVC2.lib libcurld_imp.lib"
|
||||
OutputFile="./../../../$(ProjectName)_d.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="../../../dependencies/lib"
|
||||
|
@ -167,9 +167,7 @@ FileManager::FileManager(char *argv[])
|
||||
fprintf(stderr, "[FileManager] Data files will be fetched from: '%s'\n",
|
||||
m_root_dir.c_str() );
|
||||
checkAndCreateConfigDir();
|
||||
#ifdef ADDONS_MANAGER
|
||||
checkAndCreateAddonsDir();
|
||||
#endif
|
||||
} // FileManager
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -511,7 +509,6 @@ void FileManager::checkAndCreateConfigDir()
|
||||
} // checkAndCreateConfigDir
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
#ifdef ADDONS_MANAGER
|
||||
void FileManager::checkAndCreateAddonsDir()
|
||||
{
|
||||
#if defined(WIN32)
|
||||
@ -587,7 +584,6 @@ std::string FileManager::getAddonsFile(const std::string &name)
|
||||
{
|
||||
return getAddonsDir()+"/"+name;
|
||||
}
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
std::string FileManager::getConfigDir() const
|
||||
@ -694,7 +690,6 @@ void FileManager::listFiles(std::set<std::string>& result,
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifdef ADDONS_MANAGER
|
||||
void FileManager::checkAndCreateDirForAddons(std::string addons_name,
|
||||
std::string addons_type)
|
||||
{
|
||||
@ -757,4 +752,3 @@ bool FileManager::removeDirectory(const std::string &name) const
|
||||
#endif
|
||||
} // remove directory
|
||||
|
||||
#endif
|
||||
|
@ -69,9 +69,7 @@ private:
|
||||
io::path createAbsoluteFilename(const std::string &f);
|
||||
void checkAndCreateConfigDir();
|
||||
bool isDirectory(const std::string &path) const;
|
||||
#ifdef ADDONS_MANAGER
|
||||
void checkAndCreateAddonsDir();
|
||||
#endif
|
||||
public:
|
||||
FileManager(char *argv[]);
|
||||
~FileManager();
|
||||
@ -82,14 +80,12 @@ public:
|
||||
|
||||
std::string getConfigDir() const;
|
||||
bool checkAndCreateDirectoryP(const std::string &path);
|
||||
#ifdef ADDONS_MANAGER
|
||||
const std::string &getAddonsDir() const;
|
||||
std::string getAddonsFile(const std::string &name);
|
||||
void checkAndCreateDirForAddons(std::string addons_name,
|
||||
std::string addons_type);
|
||||
bool removeFile(const std::string &name) const;
|
||||
bool removeDirectory(const std::string &name) const;
|
||||
#endif
|
||||
std::string getDataDir () const;
|
||||
std::string getTranslationDir() const;
|
||||
std::string getGUIDir () const;
|
||||
|
19
src/main.cpp
19
src/main.cpp
@ -40,20 +40,23 @@
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
|
||||
#include "IEventReceiver.h"
|
||||
|
||||
#include "main_loop.hpp"
|
||||
#include "addons/addons_manager.hpp"
|
||||
#include "addons/network_http.hpp"
|
||||
#include "audio/music_manager.hpp"
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "challenges/unlock_manager.hpp"
|
||||
#include "tutorial/tutorial_manager.hpp"
|
||||
#include "config/stk_config.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "config/player.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "input/input_manager.hpp"
|
||||
#include "input/device_manager.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "items/attachment_manager.hpp"
|
||||
#include "items/item_manager.hpp"
|
||||
#include "items/projectile_manager.hpp"
|
||||
@ -69,15 +72,9 @@
|
||||
#include "states_screens/state_manager.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "tracks/track_manager.hpp"
|
||||
#include "tutorial/tutorial_manager.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
|
||||
#include <IEventReceiver.h>
|
||||
|
||||
#ifdef ADDONS_MANAGER
|
||||
#include "addons/network_http.hpp"
|
||||
#include "addons/addons_manager.hpp"
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
// gamepad visualisation screen
|
||||
// ============================================================================
|
||||
@ -762,13 +759,11 @@ void initRest()
|
||||
|
||||
GUIEngine::init(device, driver, StateManager::get());
|
||||
|
||||
#ifdef ADDONS_MANAGER
|
||||
// This only initialises the non-network part of the addons manager. The
|
||||
// online section of the addons manager will be initialised from a
|
||||
// separate thread running in network http.
|
||||
addons_manager = new AddonsManager();
|
||||
network_http = new NetworkHttp();
|
||||
#endif
|
||||
music_manager = new MusicManager();
|
||||
sfx_manager = new SFXManager();
|
||||
// The order here can be important, e.g. KartPropertiesManager needs
|
||||
@ -820,9 +815,7 @@ void cleanTuxKart()
|
||||
//delete in reverse order of what they were created in.
|
||||
//see InitTuxkart()
|
||||
if(race_manager) delete race_manager;
|
||||
#ifdef ADDONS_MANAGER
|
||||
if(network_http) delete network_http;
|
||||
#endif
|
||||
if(network_manager) delete network_manager;
|
||||
if(grand_prix_manager) delete grand_prix_manager;
|
||||
if(highscore_manager) delete highscore_manager;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "guiengine/scalable_font.hpp"
|
||||
#include "guiengine/widgets/label_widget.hpp"
|
||||
#include "guiengine/widgets/list_widget.hpp"
|
||||
#include "guiengine/widgets/ribbon_widget.hpp"
|
||||
#include "input/device_manager.hpp"
|
||||
@ -102,9 +103,9 @@ void MainMenuScreen::init()
|
||||
IconButtonWidget* w = this->getWidget<IconButtonWidget>("addons");
|
||||
w->setDeactivated();
|
||||
}
|
||||
#endif
|
||||
LabelWidget* w = this->getWidget<LabelWidget>("info_addons");
|
||||
w->setScrollSpeed(15);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@ -121,6 +122,8 @@ void MainMenuScreen::onUpdate(float delta, irr::video::IVideoDriver* driver)
|
||||
addons_icon->setActivated();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
LabelWidget* w = this->getWidget<LabelWidget>("info_addons");
|
||||
w->update(delta);
|
||||
if(w->scrolledOff())
|
||||
@ -129,8 +132,6 @@ void MainMenuScreen::onUpdate(float delta, irr::video::IVideoDriver* driver)
|
||||
w->setText(news_text);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
IconButtonWidget* lang_combo = this->getWidget<IconButtonWidget>("lang_combo");
|
||||
if (lang_combo != NULL)
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ void OptionsScreenUI::loadedFromFile()
|
||||
{
|
||||
m_inited = false;
|
||||
|
||||
GUIEngine::SpinnerWidget* skinSelector = this->getWidget<GUIEngine::SpinnerWidget>("skinchoice");
|
||||
GUIEngine::SpinnerWidget* skinSelector = getWidget<GUIEngine::SpinnerWidget>("skinchoice");
|
||||
assert( skinSelector != NULL );
|
||||
|
||||
skinSelector->m_properties[PROP_WARP_AROUND] = "true";
|
||||
@ -102,7 +102,7 @@ void OptionsScreenUI::loadedFromFile()
|
||||
void OptionsScreenUI::init()
|
||||
{
|
||||
Screen::init();
|
||||
RibbonWidget* ribbon = this->getWidget<RibbonWidget>("options_choice");
|
||||
RibbonWidget* ribbon = getWidget<RibbonWidget>("options_choice");
|
||||
if (ribbon != NULL) ribbon->select( "tab_ui", PLAYER_ID_GAME_MASTER );
|
||||
|
||||
ribbon->getRibbonChildren()[0].setTooltip( _("Graphics") );
|
||||
@ -110,14 +110,17 @@ void OptionsScreenUI::init()
|
||||
ribbon->getRibbonChildren()[3].setTooltip( _("Players") );
|
||||
ribbon->getRibbonChildren()[4].setTooltip( _("Controls") );
|
||||
|
||||
GUIEngine::SpinnerWidget* skinSelector = this->getWidget<GUIEngine::SpinnerWidget>("skinchoice");
|
||||
GUIEngine::SpinnerWidget* skinSelector = getWidget<GUIEngine::SpinnerWidget>("skinchoice");
|
||||
assert( skinSelector != NULL );
|
||||
|
||||
// ---- video modes
|
||||
|
||||
CheckBoxWidget* fps = this->getWidget<CheckBoxWidget>("showfps");
|
||||
CheckBoxWidget* fps = getWidget<CheckBoxWidget>("showfps");
|
||||
assert( fps != NULL );
|
||||
fps->setState( UserConfigParams::m_display_fps );
|
||||
CheckBoxWidget* news = getWidget<CheckBoxWidget>("enable-internet");
|
||||
assert( news != NULL );
|
||||
news->setState( UserConfigParams::m_enable_internet );
|
||||
|
||||
// --- select the right skin in the spinner
|
||||
bool currSkinFound = false;
|
||||
@ -161,7 +164,7 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con
|
||||
}
|
||||
else if (name == "skinchoice")
|
||||
{
|
||||
GUIEngine::SpinnerWidget* skinSelector = this->getWidget<GUIEngine::SpinnerWidget>("skinchoice");
|
||||
GUIEngine::SpinnerWidget* skinSelector = getWidget<GUIEngine::SpinnerWidget>("skinchoice");
|
||||
assert( skinSelector != NULL );
|
||||
|
||||
const core::stringw selectedSkin = skinSelector->getStringValue();
|
||||
@ -170,10 +173,16 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con
|
||||
}
|
||||
else if (name == "showfps")
|
||||
{
|
||||
CheckBoxWidget* fps = this->getWidget<CheckBoxWidget>("showfps");
|
||||
CheckBoxWidget* fps = getWidget<CheckBoxWidget>("showfps");
|
||||
assert( fps != NULL );
|
||||
UserConfigParams::m_display_fps = fps->getState();
|
||||
}
|
||||
else if (name=="enable-internet")
|
||||
{
|
||||
CheckBoxWidget* news = getWidget<CheckBoxWidget>("enable-internet");
|
||||
assert( news != NULL );
|
||||
UserConfigParams::m_enable_internet = news->getState();
|
||||
}
|
||||
|
||||
} // eventCallback
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user