Ejemplo n.º 1
0
// -------------------------------------------------------------------------------- //
void guPLSoListBox::SetPlayList( int plid, int pltype )
{
    m_PLIds.Empty();
    m_PLTypes.Empty();
    if( plid != wxNOT_FOUND )
    {
        m_PLIds.Add( plid );
        m_PLTypes.Add( pltype );

        if( pltype == guPLAYLIST_TYPE_DYNAMIC )
        {
            guDynPlayList DynPlayList;
            m_Db->GetDynamicPlayList( plid, &DynPlayList );
            m_DisableSorting = false;
            if( DynPlayList.m_Sorted )
            {
                SetTracksOrder( wxNOT_FOUND );
                m_DisableSorting = true;
                return;
            }
        }
    }

    ReloadItems();
}
Ejemplo n.º 2
0
void Inventory::Load( PlayerState* pPlayerState )
{
	ReloadItems();

	m_pPlayerState = pPlayerState;
	m_iLastSeenCombo = 0;

	// don't load battle sounds if they're not going to be used
	switch( GAMESTATE->m_PlayMode )
	{
		case PLAY_MODE_BATTLE:
		{
			m_soundAcquireItem.Load( THEME->GetPathS("Inventory","aquire item") );
			for( unsigned i=0; i<g_Items.size(); i++ )
			{
				RageSound* pSound = new RageSound;
				pSound->Load( THEME->GetPathS("Inventory",ssprintf("use item %u",i+1)) );
				m_vpSoundUseItem.push_back( pSound );
			}
			m_soundItemEnding.Load( THEME->GetPathS("Inventory","item ending") );
			break;
		}
		default: break;
	}
}
Ejemplo n.º 3
0
void UserInterface::blitAddressQueueList(	vector<string>* AddressQueueListItems)	//OK Dec 6
{
	ReloadItems(						//A helper macro to implement the body of UserInterface::blitROBList()
				AddressQueueListItems,	//1 In vector:				AddressQueueListItems
				addressQueueItems,		//2	WidgetList to refresh:	_interfaceWidgetItems.addressQueueItems
				addressQueueItemsCount,
				addressQueue		);	//3 Widget to blit to:		_interfaceWidgets.addressQueue

				/*library bug. Remove items  if list shrank*/
				while(_interfaceWidgetItemCount.addressQueueItemsCount > loop)
					{
						_interfaceWidgetItemCount.addressQueueItemsCount--;
						deleteCDKScrollItem(_interfaceWidgets.addressQueue,
											_interfaceWidgetItemCount.addressQueueItemsCount);
					}
					_interfaceWidgetItemCount.addressQueueItemsCount = loop;
					/*re-set list items to new list*/
				_interfaceWidgetItems.addressQueueItems = charROBListItems;
				if(_interfaceWidgetItems.addressQueueItems == NULL)
					return;
				setCDKScrollItems (	_interfaceWidgets.addressQueue,
									(char**)_interfaceWidgetItems.addressQueueItems,
									loop,
									true								);



//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.addressQueue,		//Draw this window
					true						);	//Draw with a box around it
#endif
}
Ejemplo n.º 4
0
// -------------------------------------------------------------------------------- //
void guAlListBox::OnOrderSelected( wxCommandEvent &event )
{
    m_AlbumsOrder = event.GetId() - ID_ALBUM_ORDER_NAME;
    m_Db->SetAlbumsOrder( m_AlbumsOrder );

    ReloadItems( false );
}
Ejemplo n.º 5
0
// -------------------------------------------------------------------------------- //
// guAlListBox
// -------------------------------------------------------------------------------- //
guAlListBox::guAlListBox( wxWindow * parent, guLibPanel * libpanel, guDbLibrary * db, const wxString &label ) :
    guListView( parent, wxLB_MULTIPLE | guLISTVIEW_ALLOWDRAG | guLISTVIEW_HIDE_HEADER )
{
    m_Db = db;
    m_Items = new guAlbumItems();
    m_LibPanel = libpanel;

    guConfig * Config = ( guConfig * ) guConfig::Get();
    Config->RegisterObject( this );

    m_ConfigPath = libpanel->GetMediaViewer()->ConfigPath();
    m_AlbumsOrder = Config->ReadNum( wxT( "AlbumsOrder" ), 0, m_ConfigPath );
    m_Db->SetAlbumsOrder( m_AlbumsOrder );

    guListViewColumn * Column = new guListViewColumn( label, 0 );
    InsertColumn( Column );

    Bind( wxEVT_MENU, &guAlListBox::OnSearchLinkClicked, this, ID_LINKS_BASE, ID_LINKS_BASE + guLINKS_MAXCOUNT );
    Bind( wxEVT_MENU, &guAlListBox::OnCommandClicked, this, ID_COMMANDS_BASE, ID_COMMANDS_BASE + guCOMMANDS_MAXCOUNT );
    Bind( wxEVT_MENU, &guAlListBox::OnOrderSelected, this, ID_ALBUM_ORDER_NAME, ID_ALBUM_ORDER_ARTIST_YEAR_REVERSE );

    Bind( guConfigUpdatedEvent, &guAlListBox::OnConfigUpdated, this, ID_CONFIG_UPDATED );

    CreateAcceleratorTable();

    ReloadItems();
}
Ejemplo n.º 6
0
// -------------------------------------------------------------------------------- //
guCoListBox::guCoListBox( wxWindow * parent, guLibPanel * libpanel, guDbLibrary * db, const wxString &label ) :
             guAccelListBox( parent, db, label )
{
    m_LibPanel = libpanel;

    CreateAcceleratorTable();

    ReloadItems();
}
Ejemplo n.º 7
0
// -------------------------------------------------------------------------------- //
void guPLSoListBox::MoveSelection( void )
{
    if( ( m_TracksOrder != wxNOT_FOUND ) ||
        ( m_PLIds.Count() != 1 ) ||
        ( m_PLTypes[ 0 ] != guPLAYLIST_TYPE_STATIC ) )
        return;

    wxArrayInt   MoveIds;
    wxArrayInt   MoveIndex;
    wxArrayInt   ItemIds;

    // Copy the elements we are going to move
    unsigned long cookie;
    int item = GetFirstSelected( cookie );
    while( item != wxNOT_FOUND )
    {
        MoveIndex.Add( item );
        MoveIds.Add( m_Items[ item ].m_SongId );
        item = GetNextSelected( cookie );
    }

    // Get the position where to move it
    int InsertPos;
    if( m_DragOverItem != wxNOT_FOUND )
        InsertPos = m_DragOverItem + m_DragOverAfter;
    else
        InsertPos = m_Items.Count();

    // Remove the elements from the original position
    int index;
    int count = MoveIndex.Count();
    for( index = count - 1; index >= 0; index-- )
    {
        m_Items.RemoveAt( MoveIndex[ index ] );

        if( MoveIndex[ index ] < InsertPos )
            InsertPos--;
    }

    count = m_Items.Count();
    for( index = 0; index < count; index++ )
    {
        ItemIds.Add( m_Items[ index ].m_SongId );
    }

    count = MoveIds.Count();
    for( index = 0; index < count; index++ )
    {
        ItemIds.Insert( MoveIds[ index ], InsertPos + index );
    }

    // Save it to the database
    m_Db->UpdateStaticPlayList( m_PLIds[ 0 ], ItemIds );
    m_Db->UpdateStaticPlayListFile( m_PLIds[ 0 ] );

    ReloadItems();
}
Ejemplo n.º 8
0
void XGPopControl::DeleteAll(void)
{
	fList.DeleteAll();
#if OPT_MACOS || OPT_WINOS
	ReloadItems();
#endif
	InvalView();
	
	fWidth = -1;
}
Ejemplo n.º 9
0
void XGPopControl::Insert(long index, const char *buffer)
{
	fList.Insert(index,buffer);
#if OPT_MACOS || OPT_WINOS
	ReloadItems();
#endif
	InvalView();
	
	fWidth = -1;
}
Ejemplo n.º 10
0
void XGPopControl::Delete(long index)
{
	fList.Delete(index);
	if (fValue >= Length()) fValue = 0;
#if OPT_MACOS || OPT_WINOS
	ReloadItems();
#endif
	InvalView();
	
	fWidth = -1;
}
Ejemplo n.º 11
0
// -------------------------------------------------------------------------------- //
void guPLSoListBox::SetPlayList( const wxArrayInt &ids, const wxArrayInt &types )
{
    m_PLIds = ids;
    m_PLTypes = types;

    if( m_DisableSorting )
    {
        m_DisableSorting = false;
    }

    ReloadItems();
}
Ejemplo n.º 12
0
// -------------------------------------------------------------------------------- //
guPLSoListBox::guPLSoListBox( wxWindow * parent, guMediaViewer * mediaviewer, wxString confname, int style ) :
             guSoListBox( parent, mediaviewer, confname, style | guLISTVIEW_ALLOWDRAG | guLISTVIEW_ALLOWDROP | guLISTVIEW_DRAGSELFITEMS | guLISTVIEW_COLUMN_SORTING )
{
    m_TracksOrder = wxNOT_FOUND;
    m_DisableSorting = false;

    Bind( wxEVT_MENU, &guPLSoListBox::OnRandomizeTracks, this, ID_TRACKS_RANDOMIZE );

    CreateAcceleratorTable();

    ReloadItems();
}
Ejemplo n.º 13
0
void UserInterface::UserInterface::blitFreeList(vector<string>* FreeListItems)
{
	ReloadItems(						//A helper macro to implement the body of UserInterface::blitROBList()
				FreeListItems,			//1 In vector:				FreeListItems
				freelistItems,			//2	WidgetList to refresh:	_interfaceWidgetItems.freelistItems
				freelistItemsCount,		//Needed for UI fix up (remove items over the new list length)
				freelist		);		//3 Widget to blit to:		_interfaceWidgets.freelist

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.freelist,		//Draw this window
					true						);	//Draw with a box around it
#endif
}
Ejemplo n.º 14
0
void UserInterface::blitRegMapTable(vector<string>* RegMapListItems)	//working OK Dec 6 2k14.
{
	ReloadItems(						//A helper macro to implement the body of UserInterface::blitROBList()
				RegMapListItems,		//1 In vector:				RegMapListItems
				regmaptableItems,		//2	WidgetList to refresh:	_interfaceWidgetItems.regmaptableItems
				regmaptableItemsCount,
				regmaptable		);		//3 Widget to blit to:		_interfaceWidgets.regmaptable

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.regmaptable,	//Draw this window
					true						);	//Draw with a box around it
#endif
}
Ejemplo n.º 15
0
void UserInterface::blitFPQueueList(		vector<string>* FPQueueListItems)	//working OK Dec 6 2k14
{
	ReloadItems(					//A helper macro to implement the body of UserInterface::blitROBList()
				FPQueueListItems,	//1 In vector:				FPQueueListItems
				fpQueueItems,		//2	WidgetList to refresh:	_interfaceWidgetItems.fpQueueItems
				fpQueueItemsCount,
				fpQueue		);		//3 Widget to blit to:		_interfaceWidgets.fpQueue

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.fpQueue,		//Draw this window
					true						);	//Draw with a box around it
#endif
}
Ejemplo n.º 16
0
void UserInterface::blitTraceLogWindow(	vector<string>* TraceLogListItems)
{
	ReloadItems(							//A helper macro to implement the body of UserInterface::blitROBList()
				TraceLogListItems,			//1 In vector:				TraceLogListItems
				traceLogWindowItems,		//2	WidgetList to refresh:	_interfaceWidgetItems.traceLogWindowItems
				traceLogWindowItemsCount,
				tracelogwindow		);		//3 Widget to blit to:		_interfaceWidgets.tracelogwindow

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.tracelogwindow,		//Draw this window
					true						);	//Draw with a box around it
#endif
}
Ejemplo n.º 17
0
void UserInterface::blitLSPipe(			vector<string>* LSPipeListItems)	//OK
{
	ReloadItems(					//A helper macro to implement the body of UserInterface::blitROBList()
				LSPipeListItems,	//1 In vector:				LSPipeListItems
				LSPipeItems,		//2	WidgetList to refresh:	_interfaceWidgetItems.LSPipeItems
				LSPipeItemsCount,
				LSPipe		);		//3 Widget to blit to:		_interfaceWidgets.LSPipe

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.LSPipe,		//Draw this window
					true						);	//Draw with a box around it
#endif
}
Ejemplo n.º 18
0
// -------------------------------------------------------------------------------- //
void guPLSoListBox::OnDropEnd( void )
{
    int index;
    int count;
    wxArrayInt ItemIds;

    if( ( m_PLIds.Count() == 1 ) && ( m_PLTypes[ 0 ] == guPLAYLIST_TYPE_STATIC ) )
    {
        if( m_DropIds.Count() )
        {
            count = m_Items.Count();
            for( index = 0; index < count; index++ )
            {
                ItemIds.Add( m_Items[ index ].m_SongId );
            }

            //int InsertPos = m_DragOverItem + m_DragOverAfter;
            int InsertPos = m_DragOverItem + m_DragOverAfter;
            if( m_DragOverItem == wxNOT_FOUND )
                InsertPos = m_Items.Count();
            //guLogMessage( wxT( "Pos: %i + %i  %i of %i " ), m_DragOverItem, m_DragOverAfter, InsertPos, m_Items.Count() );

            count = m_DropIds.Count();
            for( index = 0; index < count; index++ )
            {
                ItemIds.Insert( m_DropIds[ index ], InsertPos + index );
            }

            // Save it to the database
            m_Db->UpdateStaticPlayList( m_PLIds[ 0 ], ItemIds );
            m_Db->UpdateStaticPlayListFile( m_PLIds[ 0 ] );

            m_DropIds.Clear();
        }
        ReloadItems();
    }
}
Ejemplo n.º 19
0
// -------------------------------------------------------------------------------- //
void guPLSoListBox::SetTracksOrder( const int order )
{
    if( !m_DisableSorting )
    {
        if( m_TracksOrder != order )
        {
            m_TracksOrder = order;
            if( order == wxNOT_FOUND )
                m_TracksOrderDesc = false;
        }
        else if( order != wxNOT_FOUND )
        {
            m_TracksOrderDesc = !m_TracksOrderDesc;
            if( !m_TracksOrderDesc )
            {
                m_TracksOrder = wxNOT_FOUND;
                m_TracksOrderDesc = false;
            }
        }

        int ColId = m_TracksOrder;

        // Create the Columns
        int CurColId;
        int Index;
        int Count = m_ColumnNames.Count();
        for( Index = 0; Index < Count; Index++ )
        {
            CurColId = GetColumnId( Index );
            SetColumnLabel( Index,
                m_ColumnNames[ CurColId ]  + ( ( ColId == CurColId ) ? ( m_TracksOrderDesc ? wxT( " ▼" ) : wxT( " ▲" ) ) : wxEmptyString ) );
        }

        ReloadItems();
    }
}
Ejemplo n.º 20
0
Lod::Lod(int location, char *name, int kind){
	Ind=-1;
	STARTNA(__LINE__, 0)
	Kind = kind;
	Location=location;
	strncpy(Name,name,31); Name[31]=0;
	Ind=FreeInd;
	memset(LodTable[Ind],0,0x190);
	SOD_LOD_ctor(LodTable[Ind],Name);
	Next=First;
	First=this;
	int ret=LoadIt(name);
	if(ret){ 
		char buf[1024];
		sprintf(buf,"Cannot Load LOD file.\nReason : %i\nName : %s\n\nThe game is unstable now!\nPlease fix the problem and run h3WoG.exe again",
			ret,Name);
		TError(buf);
	} else {
		FreeInd = NextInd[Ind];
		if (FreeInd == 0) FreeInd = Ind + 1;
		ReloadItems();
	}
	RETURNV
}