From 451cb29b6863e93c5fe5683978a44cb62eb74232 Mon Sep 17 00:00:00 2001 From: Josh Allen Date: Tue, 3 May 2005 01:32:19 +0000 Subject: [PATCH] Room selection wheel --- stepmania/src/RoomWheel.cpp | 102 ++++++++++++++++++++++++++++++++++++ stepmania/src/RoomWheel.h | 69 ++++++++++++++++++++++++ 2 files changed, 171 insertions(+) create mode 100644 stepmania/src/RoomWheel.cpp create mode 100644 stepmania/src/RoomWheel.h diff --git a/stepmania/src/RoomWheel.cpp b/stepmania/src/RoomWheel.cpp new file mode 100644 index 0000000000..28c360349f --- /dev/null +++ b/stepmania/src/RoomWheel.cpp @@ -0,0 +1,102 @@ +#include "global.h" +#include "RoomWheel.h" +#include "RageLog.h" + +void RoomWheel::Load( CString sType ) +{ + LOG->Trace( "RoomWheel::Load('%s')", sType.c_str() ); + + LoadFromMetrics( sType ); + LoadVariables(); + + FOREACH( WheelItemBase*, m_WheelBaseItems, i ) + SAFE_DELETE( *i ); + + m_WheelBaseItems.clear(); + for( int i=0; iGetPathF("RoomWheel","text") ); + m_Desc.SetHorizAlignString("left"); + m_Desc.SetShadowLength( 0 ); + m_Desc.SetMaxWidth(DESC_WIDTH); + m_Desc.SetXY( DESC_X, DESC_Y); + m_Desc.RunCommands( DESC_ON_COMMAND ); + this->AddChild( &m_Desc ); +} + +void RoomWheel::BuildWheelItemsData( vector &arrayWheelItemDatas ) +{ + if( arrayWheelItemDatas.empty() ) + { + arrayWheelItemDatas.push_back( new RoomWheelData(TYPE_GENERIC, "- EMPTY -", "", RageColor(1,0,0,1)) ); + } +} + +void RoomWheelItem::LoadFromWheelItemBaseData(WheelItemBaseData* pWID) +{ + RoomWheelData* tmpdata = (RoomWheelData*)pWID; + WheelItemBase::LoadFromWheelItemBaseData(pWID); + m_Desc.SetText(tmpdata->m_sDesc); + m_Desc.SetDiffuseColor(tmpdata->m_color); + m_text.SetDiffuseColor(tmpdata->m_color); +} + +/* + * (c) 2004 Josh Allen + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/stepmania/src/RoomWheel.h b/stepmania/src/RoomWheel.h new file mode 100644 index 0000000000..d8bb9bf5ef --- /dev/null +++ b/stepmania/src/RoomWheel.h @@ -0,0 +1,69 @@ +/* RoomWheel - A wheel containing data about rooms. */ + +#ifndef ROOMWHEEL_H +#define ROOMWHEEL_H + +#include "WheelBase.h" +#include "WheelItemBase.h" +#include "ThemeMetric.h" + +struct RoomWheelData : public WheelItemBaseData +{ + RoomWheelData() { WheelItemBaseData::WheelItemBaseData(); } + RoomWheelData( WheelItemType wit, CString title, CString SubTitle, RageColor color ); + + CString m_sDesc; + RageColor m_color; // either text color or section background color + WheelNotifyIcon::Flags m_Flags; +}; + +class RoomWheelItem : public WheelItemBase +{ +public: + RoomWheelItem(CString sType = "RoomWheelItem"); + RoomWheelData* data; + void Load( CString sType ); + virtual void LoadFromWheelItemBaseData(WheelItemBaseData* pWID); + + BitmapText m_Desc; + + ThemeMetric DESC_X; + ThemeMetric DESC_Y; + ThemeMetric DESC_WIDTH; + ThemeMetric DESC_ON_COMMAND; +}; + +class RoomWheel : public WheelBase { +public: + virtual void Load( CString sType ); + inline virtual RoomWheelData* GetItem(unsigned int i) { return (RoomWheelData*)WheelBase::GetItem(i); } + virtual void BuildWheelItemsData( vector &arrayWheelItemDatas ); +protected: +}; + +#endif + +/* + * (c) 2004 Josh Allen + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */