2009-10-04 19:59:05 -04:00
|
|
|
// SuperTuxKart - a fun racing game with go-kart
|
2013-11-15 06:43:21 -05:00
|
|
|
// Copyright (C) 2009-2013 Marianne Gagnon
|
2009-10-04 19:59:05 -04:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 3
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
#include "states_screens/options_screen_input.hpp"
|
|
|
|
|
2010-05-02 15:39:09 -04:00
|
|
|
#include "graphics/irr_driver.hpp"
|
|
|
|
#include "guiengine/CGUISpriteBank.h"
|
2009-10-04 19:59:05 -04:00
|
|
|
#include "guiengine/screen.hpp"
|
|
|
|
#include "guiengine/widget.hpp"
|
2010-04-26 10:41:23 -04:00
|
|
|
#include "guiengine/widgets/button_widget.hpp"
|
2010-05-02 15:39:09 -04:00
|
|
|
#include "guiengine/widgets/list_widget.hpp"
|
2010-04-26 10:41:23 -04:00
|
|
|
#include "guiengine/widgets/ribbon_widget.hpp"
|
2009-10-04 19:59:05 -04:00
|
|
|
#include "input/device_manager.hpp"
|
2014-10-25 08:09:00 -04:00
|
|
|
#include "input/gamepad_device.hpp"
|
|
|
|
#include "input/input_manager.hpp"
|
2009-10-04 19:59:05 -04:00
|
|
|
#include "io/file_manager.hpp"
|
2010-08-14 21:15:19 -04:00
|
|
|
#include "states_screens/options_screen_input2.hpp"
|
|
|
|
#include "states_screens/options_screen_audio.hpp"
|
|
|
|
#include "states_screens/options_screen_video.hpp"
|
2011-03-20 14:50:20 -04:00
|
|
|
#include "states_screens/options_screen_ui.hpp"
|
2009-12-19 14:48:41 -05:00
|
|
|
#include "states_screens/dialogs/add_device_dialog.hpp"
|
2009-10-04 19:59:05 -04:00
|
|
|
#include "states_screens/state_manager.hpp"
|
2014-05-15 08:59:21 -04:00
|
|
|
#include "states_screens/user_screen.hpp"
|
2009-11-14 10:09:34 -05:00
|
|
|
#include "utils/string_utils.hpp"
|
|
|
|
#include "utils/translation.hpp"
|
2009-10-04 19:59:05 -04:00
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <sstream>
|
2010-01-01 20:46:29 -05:00
|
|
|
#include <set>
|
2013-10-23 20:29:05 -04:00
|
|
|
#include <algorithm>
|
2009-10-04 19:59:05 -04:00
|
|
|
|
|
|
|
using namespace GUIEngine;
|
|
|
|
|
2010-03-18 14:18:19 -04:00
|
|
|
DEFINE_SCREEN_SINGLETON( OptionsScreenInput );
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2009-10-04 19:59:05 -04:00
|
|
|
OptionsScreenInput::OptionsScreenInput() : Screen("options_input.stkgui")
|
|
|
|
{
|
2010-08-14 21:15:19 -04:00
|
|
|
} // OptionsScreenInput
|
2010-03-18 14:18:19 -04:00
|
|
|
|
2009-10-04 19:59:05 -04:00
|
|
|
// -----------------------------------------------------------------------------
|
2010-03-18 14:18:19 -04:00
|
|
|
|
2010-05-01 15:16:38 -04:00
|
|
|
void OptionsScreenInput::loadedFromFile()
|
2013-05-29 18:04:35 -04:00
|
|
|
{
|
2013-12-17 18:48:47 -05:00
|
|
|
video::ITexture* icon1 = irr_driver->getTexture( file_manager->getAsset(FileManager::GUI,"keyboard.png" ));
|
|
|
|
video::ITexture* icon2 = irr_driver->getTexture( file_manager->getAsset(FileManager::GUI,"gamepad.png" ));
|
|
|
|
video::ITexture* icon3 = irr_driver->getTexture( file_manager->getAsset(FileManager::GUI,"gamepad_off.png"));
|
2010-05-02 15:39:09 -04:00
|
|
|
|
|
|
|
m_icon_bank = new irr::gui::STKModifiedSpriteBank( GUIEngine::getGUIEnv() );
|
2013-05-29 18:04:35 -04:00
|
|
|
m_icon_bank->addTextureAsSprite(icon1);
|
2010-05-02 15:39:09 -04:00
|
|
|
m_icon_bank->addTextureAsSprite(icon2);
|
2010-11-07 20:26:31 -05:00
|
|
|
m_icon_bank->addTextureAsSprite(icon3);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-05-02 15:39:09 -04:00
|
|
|
// scale icons depending on screen resolution. the numbers below are a bit arbitrary
|
|
|
|
const int screen_width = irr_driver->getFrameSize().Width;
|
|
|
|
const float scale = 0.3f + 0.2f*std::max(0, screen_width - 640)/564.0f;
|
|
|
|
m_icon_bank->setScale(scale);
|
2010-08-14 21:15:19 -04:00
|
|
|
} // loadFromFile
|
2009-10-04 19:59:05 -04:00
|
|
|
|
2009-12-28 13:13:24 -05:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void OptionsScreenInput::buildDeviceList()
|
|
|
|
{
|
2010-05-02 15:39:09 -04:00
|
|
|
GUIEngine::ListWidget* devices = this->getWidget<GUIEngine::ListWidget>("devices");
|
2009-12-28 13:13:24 -05:00
|
|
|
assert( devices != NULL );
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-05-02 15:39:09 -04:00
|
|
|
assert( m_icon_bank != NULL );
|
|
|
|
devices->setIcons(m_icon_bank);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2014-10-25 08:09:00 -04:00
|
|
|
const int keyboard_config_count = input_manager->getDeviceManager()->getKeyboardConfigAmount();
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2009-12-28 13:13:24 -05:00
|
|
|
for (int i=0; i<keyboard_config_count; i++)
|
|
|
|
{
|
|
|
|
//KeyboardConfig *config = input_manager->getDeviceList()->getKeyboardConfig(i);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2009-12-28 13:13:24 -05:00
|
|
|
std::ostringstream kbname;
|
|
|
|
kbname << "keyboard" << i;
|
|
|
|
const std::string internal_name = kbname.str();
|
2013-05-29 18:04:35 -04:00
|
|
|
|
|
|
|
// since irrLicht's list widget has the nasty tendency to put the
|
2011-03-31 19:16:31 -04:00
|
|
|
// icons very close to the text, I'm adding spaces to compensate.
|
|
|
|
devices->addItem(internal_name, (core::stringw(" ") + _("Keyboard %i", i)).c_str(), 0 /* icon */);
|
2009-12-28 13:13:24 -05:00
|
|
|
}
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2014-10-25 08:09:00 -04:00
|
|
|
const int gpad_config_count = input_manager->getDeviceManager()->getGamePadConfigAmount();
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2009-12-28 13:13:24 -05:00
|
|
|
for (int i = 0; i < gpad_config_count; i++)
|
|
|
|
{
|
2014-10-25 08:09:00 -04:00
|
|
|
GamepadConfig *config = input_manager->getDeviceManager()->getGamepadConfig(i);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2009-12-28 13:13:24 -05:00
|
|
|
// Don't display the configuration if a matching device is not available
|
2010-05-02 15:39:09 -04:00
|
|
|
if (config->isPlugged())
|
2009-12-28 13:13:24 -05:00
|
|
|
{
|
2013-05-29 18:04:35 -04:00
|
|
|
// since irrLicht's list widget has the nasty tendency to put the
|
2011-03-31 19:16:31 -04:00
|
|
|
// icons very close to the text, I'm adding spaces to compensate.
|
2011-12-10 14:47:59 -05:00
|
|
|
irr::core::stringw name = (" " + config->getName()).c_str();
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2011-12-10 14:47:59 -05:00
|
|
|
if (config->getNumberOfDevices() > 1)
|
|
|
|
{
|
|
|
|
name += core::stringw(L" (x");
|
|
|
|
name += config->getNumberOfDevices();
|
|
|
|
name += core::stringw(L")");
|
|
|
|
}
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2009-12-28 13:13:24 -05:00
|
|
|
std::ostringstream gpname;
|
|
|
|
gpname << "gamepad" << i;
|
|
|
|
const std::string internal_name = gpname.str();
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-11-07 20:26:31 -05:00
|
|
|
const int icon = (config->isEnabled() ? 1 : 2);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-11-07 20:26:31 -05:00
|
|
|
devices->addItem(internal_name, name, icon);
|
2010-08-14 21:15:19 -04:00
|
|
|
} // if config->isPlugged
|
|
|
|
} // for i<gpad_config_count
|
|
|
|
} // buildDeviceList
|
2009-12-28 13:13:24 -05:00
|
|
|
|
2009-10-04 19:59:05 -04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void OptionsScreenInput::init()
|
|
|
|
{
|
2010-08-14 21:15:19 -04:00
|
|
|
Screen::init();
|
2010-03-27 19:18:07 -04:00
|
|
|
RibbonWidget* tabBar = this->getWidget<RibbonWidget>("options_choice");
|
2010-04-08 17:02:40 -04:00
|
|
|
if (tabBar != NULL) tabBar->select( "tab_controls", PLAYER_ID_GAME_MASTER );
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2011-03-20 15:49:55 -04:00
|
|
|
tabBar->getRibbonChildren()[0].setTooltip( _("Graphics") );
|
|
|
|
tabBar->getRibbonChildren()[1].setTooltip( _("Audio") );
|
|
|
|
tabBar->getRibbonChildren()[2].setTooltip( _("User Interface") );
|
|
|
|
tabBar->getRibbonChildren()[3].setTooltip( _("Players") );
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-05-02 15:39:09 -04:00
|
|
|
/*
|
2009-10-04 19:59:05 -04:00
|
|
|
DynamicRibbonWidget* devices = this->getWidget<DynamicRibbonWidget>("devices");
|
|
|
|
assert( devices != NULL );
|
2010-05-02 15:39:09 -04:00
|
|
|
*/
|
2013-05-29 18:04:35 -04:00
|
|
|
|
|
|
|
|
|
|
|
buildDeviceList();
|
2010-05-02 15:39:09 -04:00
|
|
|
|
|
|
|
//devices->updateItemDisplay();
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-05-02 15:39:09 -04:00
|
|
|
/*
|
2009-10-04 19:59:05 -04:00
|
|
|
// trigger displaying bindings for default selected device
|
|
|
|
const std::string name2("devices");
|
2010-04-08 17:02:40 -04:00
|
|
|
eventCallback(devices, name2, PLAYER_ID_GAME_MASTER);
|
2010-05-02 15:39:09 -04:00
|
|
|
*/
|
2014-07-15 21:11:46 -04:00
|
|
|
// Disable adding keyboard configurations
|
|
|
|
if (StateManager::get()->getGameState() == GUIEngine::INGAME_MENU)
|
|
|
|
{
|
|
|
|
getWidget<ButtonWidget>("add_device")->setDeactivated();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
getWidget<ButtonWidget>("add_device")->setActivated();
|
|
|
|
}
|
2010-08-14 21:15:19 -04:00
|
|
|
} // init
|
2009-10-04 19:59:05 -04:00
|
|
|
|
2009-12-28 13:13:24 -05:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void OptionsScreenInput::rebuildDeviceList()
|
|
|
|
{
|
2010-05-02 15:39:09 -04:00
|
|
|
/*
|
2009-12-28 13:13:24 -05:00
|
|
|
DynamicRibbonWidget* devices = this->getWidget<DynamicRibbonWidget>("devices");
|
|
|
|
assert( devices != NULL );
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2009-12-28 13:13:24 -05:00
|
|
|
devices->clearItems();
|
2013-05-29 18:04:35 -04:00
|
|
|
buildDeviceList();
|
2009-12-28 13:13:24 -05:00
|
|
|
devices->updateItemDisplay();
|
2010-05-02 15:39:09 -04:00
|
|
|
*/
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-05-02 15:39:09 -04:00
|
|
|
ListWidget* devices = this->getWidget<ListWidget>("devices");
|
|
|
|
assert( devices != NULL );
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-05-02 15:39:09 -04:00
|
|
|
devices->clear();
|
2013-05-29 18:04:35 -04:00
|
|
|
buildDeviceList();
|
2010-08-14 21:15:19 -04:00
|
|
|
} // rebuildDeviceList
|
2009-10-04 19:59:05 -04:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
2010-04-25 15:23:57 -04:00
|
|
|
|
2009-10-28 19:04:38 -04:00
|
|
|
void OptionsScreenInput::eventCallback(Widget* widget, const std::string& name, const int playerID)
|
2009-10-04 19:59:05 -04:00
|
|
|
{
|
|
|
|
//const std::string& screen_name = this->getName();
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2009-12-19 14:48:41 -05:00
|
|
|
if (name == "options_choice")
|
2009-10-04 19:59:05 -04:00
|
|
|
{
|
2014-07-15 21:11:46 -04:00
|
|
|
std::string selection = ((RibbonWidget*)widget)->getSelectionIDString(PLAYER_ID_GAME_MASTER);
|
|
|
|
|
|
|
|
Screen *screen = NULL;
|
|
|
|
if (selection == "tab_audio")
|
|
|
|
screen = OptionsScreenAudio::getInstance();
|
|
|
|
else if (selection == "tab_video")
|
|
|
|
screen = OptionsScreenVideo::getInstance();
|
|
|
|
else if (selection == "tab_players")
|
|
|
|
screen = TabbedUserScreen::getInstance();
|
|
|
|
//else if (selection == "tab_controls")
|
|
|
|
// screen = OptionsScreenInput::getInstance();
|
|
|
|
else if (selection == "tab_ui")
|
|
|
|
screen = OptionsScreenUI::getInstance();
|
|
|
|
if(screen)
|
|
|
|
StateManager::get()->replaceTopMostScreen(screen);
|
2009-10-04 19:59:05 -04:00
|
|
|
}
|
2009-12-19 14:48:41 -05:00
|
|
|
else if (name == "add_device")
|
|
|
|
{
|
|
|
|
new AddDeviceDialog();
|
|
|
|
}
|
|
|
|
else if (name == "back")
|
2009-10-04 19:59:05 -04:00
|
|
|
{
|
|
|
|
StateManager::get()->escapePressed();
|
|
|
|
}
|
|
|
|
else if (name == "devices")
|
|
|
|
{
|
2010-05-02 15:39:09 -04:00
|
|
|
ListWidget* devices = this->getWidget<ListWidget>("devices");
|
2009-10-04 19:59:05 -04:00
|
|
|
assert(devices != NULL);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-05-02 15:39:09 -04:00
|
|
|
const std::string& selection = devices->getSelectionInternalName();
|
2009-11-14 10:09:34 -05:00
|
|
|
if (selection.find("gamepad") != std::string::npos)
|
2009-10-04 19:59:05 -04:00
|
|
|
{
|
|
|
|
int i = -1, read = 0;
|
|
|
|
read = sscanf( selection.c_str(), "gamepad%i", &i );
|
2009-11-14 10:09:34 -05:00
|
|
|
if (read == 1 && i != -1)
|
2009-10-04 19:59:05 -04:00
|
|
|
{
|
2014-10-25 08:09:00 -04:00
|
|
|
OptionsScreenInput2::getInstance()->setDevice( input_manager->getDeviceManager()->getGamepadConfig(i) );
|
2010-05-02 15:39:09 -04:00
|
|
|
StateManager::get()->replaceTopMostScreen(OptionsScreenInput2::getInstance());
|
|
|
|
//updateInputButtons( input_manager->getDeviceList()->getGamepadConfig(i) );
|
2009-10-04 19:59:05 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-10-07 14:54:54 -04:00
|
|
|
Log::error("OptionsScreenInput", "Cannot read internal gamepad input device ID: %s",
|
|
|
|
selection.c_str());
|
2009-10-04 19:59:05 -04:00
|
|
|
}
|
|
|
|
}
|
2009-11-14 10:09:34 -05:00
|
|
|
else if (selection.find("keyboard") != std::string::npos)
|
2009-10-04 19:59:05 -04:00
|
|
|
{
|
2009-11-14 10:09:34 -05:00
|
|
|
int i = -1, read = 0;
|
|
|
|
read = sscanf( selection.c_str(), "keyboard%i", &i );
|
|
|
|
if (read == 1 && i != -1)
|
|
|
|
{
|
2010-05-02 15:39:09 -04:00
|
|
|
// updateInputButtons( input_manager->getDeviceList()->getKeyboardConfig(i) );
|
2014-10-25 08:09:00 -04:00
|
|
|
OptionsScreenInput2::getInstance()->setDevice( input_manager->getDeviceManager()->getKeyboardConfig(i) );
|
2010-05-02 15:39:09 -04:00
|
|
|
StateManager::get()->replaceTopMostScreen(OptionsScreenInput2::getInstance());
|
2009-11-14 10:09:34 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-10-07 14:54:54 -04:00
|
|
|
Log::error("OptionsScreenInput", "Cannot read internal keyboard input device ID: %s",
|
|
|
|
selection.c_str());
|
2009-11-14 10:09:34 -05:00
|
|
|
}
|
2009-10-04 19:59:05 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-10-07 14:54:54 -04:00
|
|
|
Log::error("OptionsScreenInput", "Cannot read internal input device ID: %s", selection.c_str());
|
2009-10-04 19:59:05 -04:00
|
|
|
}
|
|
|
|
}
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2010-08-14 21:15:19 -04:00
|
|
|
} // eventCallback
|
2009-10-04 19:59:05 -04:00
|
|
|
|
2010-04-25 15:23:57 -04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2010-05-01 15:16:38 -04:00
|
|
|
void OptionsScreenInput::unloaded()
|
2010-04-25 15:23:57 -04:00
|
|
|
{
|
2010-05-02 15:39:09 -04:00
|
|
|
delete m_icon_bank;
|
|
|
|
m_icon_bank = NULL;
|
2010-08-14 21:15:19 -04:00
|
|
|
} // unloaded
|
2010-04-25 15:23:57 -04:00
|
|
|
|
2011-05-13 20:30:30 -04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2011-05-23 16:51:17 -04:00
|
|
|
void OptionsScreenInput::filterInput(Input::InputType type,
|
|
|
|
int deviceID,
|
|
|
|
int btnID,
|
|
|
|
int axisDir,
|
2013-07-01 18:50:59 -04:00
|
|
|
int axisRange,
|
2011-05-23 16:51:17 -04:00
|
|
|
int value)
|
2011-05-13 20:30:30 -04:00
|
|
|
{
|
2011-05-23 16:51:17 -04:00
|
|
|
if (type == Input::IT_STICKMOTION || type == Input::IT_STICKBUTTON)
|
2011-05-13 20:30:30 -04:00
|
|
|
{
|
2014-10-25 08:09:00 -04:00
|
|
|
GamePadDevice* gamepad = input_manager->getDeviceManager()->getGamePadFromIrrID(deviceID);
|
2011-05-13 20:30:30 -04:00
|
|
|
if (gamepad != NULL && gamepad->getConfiguration() != NULL)
|
|
|
|
{
|
|
|
|
//printf("'%s'\n", gamepad->getConfiguration()->getName().c_str());
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2011-05-13 20:30:30 -04:00
|
|
|
ListWidget* devices = this->getWidget<ListWidget>("devices");
|
|
|
|
assert(devices != NULL);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2011-05-13 20:30:30 -04:00
|
|
|
std::string internal_name;
|
2014-10-25 08:09:00 -04:00
|
|
|
const int gpad_config_count = input_manager->getDeviceManager()->getGamePadConfigAmount();
|
2011-05-13 20:30:30 -04:00
|
|
|
for (int i = 0; i < gpad_config_count; i++)
|
|
|
|
{
|
2014-10-25 08:09:00 -04:00
|
|
|
GamepadConfig *config = input_manager->getDeviceManager()->getGamepadConfig(i);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2011-05-13 20:30:30 -04:00
|
|
|
// Don't display the configuration if a matching device is not available
|
|
|
|
if (config == gamepad->getConfiguration())
|
|
|
|
{
|
|
|
|
std::ostringstream gpname;
|
|
|
|
gpname << "gamepad" << i;
|
|
|
|
internal_name = gpname.str();
|
|
|
|
}
|
|
|
|
}
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2012-12-06 18:56:56 -05:00
|
|
|
if (internal_name.size() > 0 && abs(value) > Input::MAX_VALUE/2)
|
2011-05-13 20:30:30 -04:00
|
|
|
{
|
2011-05-13 20:42:57 -04:00
|
|
|
devices->markItemRed(internal_name.c_str());
|
|
|
|
m_highlights[internal_name] = 0.25f;
|
2011-05-13 20:30:30 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-05-13 20:42:57 -04:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2014-01-21 15:43:17 -05:00
|
|
|
void OptionsScreenInput::onUpdate(float dt)
|
2011-05-13 20:42:57 -04:00
|
|
|
{
|
|
|
|
std::map<std::string, float>::iterator it;
|
|
|
|
for (it = m_highlights.begin(); it != m_highlights.end();)
|
|
|
|
{
|
|
|
|
it->second -= dt;
|
|
|
|
if (it->second < 0.0f)
|
2013-05-29 18:04:35 -04:00
|
|
|
{
|
2011-05-13 20:42:57 -04:00
|
|
|
ListWidget* devices = this->getWidget<ListWidget>("devices");
|
|
|
|
assert(devices != NULL);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2011-05-13 20:42:57 -04:00
|
|
|
devices->markItemRed(it->first.c_str(), false);
|
2013-05-29 18:04:35 -04:00
|
|
|
|
2011-05-13 20:42:57 -04:00
|
|
|
m_highlights.erase(it++);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
it++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//m_highlights[internal_name]
|
2014-01-21 15:43:17 -05:00
|
|
|
} // onUpdate
|