mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-31 22:49:19 +00:00
upload "kind" alien swarm
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#include "cbase.h"
|
||||
#include "StimMusicSelectDialog.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
extern ConVar asw_stim_music;
|
||||
|
||||
StimMusicSelectDialog::StimMusicSelectDialog( Panel *parent, const char *title, vgui::FileOpenDialogType_t type, KeyValues *pContextKeyValues ) :
|
||||
FileOpenDialog( parent, title, type, pContextKeyValues )
|
||||
{
|
||||
// get notified when the file has been picked
|
||||
AddActionSignalTarget( this );
|
||||
}
|
||||
|
||||
void StimMusicSelectDialog::OnFileSelected(const char *fullpath)
|
||||
{
|
||||
if ( fullpath )
|
||||
{
|
||||
asw_stim_music.SetValue( fullpath );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
vgui::DHANDLE<StimMusicSelectDialog> g_hSelectStimMusicDialog;
|
||||
|
||||
void asw_pick_stim_music_f()
|
||||
{
|
||||
if (g_hSelectStimMusicDialog.Get() == NULL)
|
||||
{
|
||||
g_hSelectStimMusicDialog = new StimMusicSelectDialog(NULL, "#asw_pick_stim_music", vgui::FOD_OPEN, NULL);
|
||||
g_hSelectStimMusicDialog->AddFilter("*.mp3,*.wav", "#asw_stim_music_types", true);
|
||||
}
|
||||
g_hSelectStimMusicDialog->DoModal(false);
|
||||
g_hSelectStimMusicDialog->Activate();
|
||||
}
|
||||
ConCommand asw_pick_stim_music( "asw_pick_stim_music", asw_pick_stim_music_f, "Shows a dialog for picking custom stim music", FCVAR_NONE );
|
||||
Reference in New Issue
Block a user