cleanup, fix offset vbSelected values when using NextRow choice at the front
This commit is contained in:
@@ -39,6 +39,101 @@ static int GetOneSelection( const vector<bool> &vbSelected )
|
||||
}
|
||||
|
||||
|
||||
class OptionRowHandlerList : public OptionRowHandler
|
||||
{
|
||||
public:
|
||||
vector<GameCommand> ListEntries;
|
||||
GameCommand Default;
|
||||
bool m_bUseModNameForIcon;
|
||||
|
||||
OptionRowHandlerList::OptionRowHandlerList() { Init(); }
|
||||
virtual void Init()
|
||||
{
|
||||
OptionRowHandler::Init();
|
||||
ListEntries.clear();
|
||||
Default.Init();
|
||||
m_bUseModNameForIcon = false;
|
||||
}
|
||||
virtual void ImportOption( const OptionRowDefinition &row, PlayerNumber pn, vector<bool> &vbSelectedOut ) const;
|
||||
virtual int ExportOption( const OptionRowDefinition &def, PlayerNumber pn, const vector<bool> &vbSelected ) const;
|
||||
virtual CString GetIconText( const OptionRowDefinition &def, int iFirstSelection ) const
|
||||
{
|
||||
return m_bUseModNameForIcon ?
|
||||
ListEntries[iFirstSelection].m_sModifiers :
|
||||
def.choices[iFirstSelection];
|
||||
}
|
||||
virtual CString GetAndEraseScreen( int iChoice )
|
||||
{
|
||||
GameCommand &mc = ListEntries[iChoice];
|
||||
if( mc.m_sScreen != "" )
|
||||
{
|
||||
/* Hack: instead of applying screen commands here, store them in
|
||||
* m_sNextScreen and apply them after we tween out. If we don't set
|
||||
* m_sScreen to "", we'll load it twice (once for each player) and
|
||||
* then again for m_sNextScreen. */
|
||||
CString sNextScreen = mc.m_sScreen;
|
||||
mc.m_sScreen = "";
|
||||
return sNextScreen;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
class OptionRowHandlerLua : public OptionRowHandler
|
||||
{
|
||||
public:
|
||||
LuaExpression *m_pLuaTable;
|
||||
|
||||
OptionRowHandlerLua::OptionRowHandlerLua() { m_pLuaTable = NULL; Init(); }
|
||||
void Init()
|
||||
{
|
||||
OptionRowHandler::Init();
|
||||
delete m_pLuaTable;
|
||||
m_pLuaTable = new LuaExpression;
|
||||
}
|
||||
virtual void ImportOption( const OptionRowDefinition &row, PlayerNumber pn, vector<bool> &vbSelectedOut ) const;
|
||||
virtual int ExportOption( const OptionRowDefinition &def, PlayerNumber pn, const vector<bool> &vbSelected ) const;
|
||||
virtual void Reload( OptionRowDefinition &defOut );
|
||||
};
|
||||
|
||||
class OptionRowHandlerConfig : public OptionRowHandler
|
||||
{
|
||||
public:
|
||||
const ConfOption *opt;
|
||||
|
||||
OptionRowHandlerConfig::OptionRowHandlerConfig() { Init(); }
|
||||
void Init()
|
||||
{
|
||||
OptionRowHandler::Init();
|
||||
opt = NULL;
|
||||
}
|
||||
virtual void ImportOption( const OptionRowDefinition &row, PlayerNumber pn, vector<bool> &vbSelectedOut ) const;
|
||||
virtual int ExportOption( const OptionRowDefinition &def, PlayerNumber pn, const vector<bool> &vbSelected ) const;
|
||||
};
|
||||
|
||||
|
||||
namespace OptionRowHandlerUtil
|
||||
{
|
||||
void FillList( OptionRowHandlerList* pHand, OptionRowDefinition &defOut, CString param );
|
||||
void FillLua( OptionRowHandlerLua* pHand, OptionRowDefinition &defOut, CString sLuaFunction );
|
||||
void FillSteps( OptionRowHandlerList* pHand, OptionRowDefinition &defOut );
|
||||
void FillConf( OptionRowHandlerConfig* pHand, OptionRowDefinition &defOut, CString param );
|
||||
void FillCharacters( OptionRowHandlerList* pHand, OptionRowDefinition &defOut );
|
||||
void FillStyles( OptionRowHandlerList* pHand, OptionRowDefinition &defOut );
|
||||
void FillGroups( OptionRowHandlerList* pHand, OptionRowDefinition &defOut );
|
||||
void FillDifficulties( OptionRowHandlerList* pHand, OptionRowDefinition &defOut );
|
||||
|
||||
inline OptionRowHandler* MakeList( OptionRowDefinition &defOut, CString param ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillList( pHand, defOut, param ); return pHand; }
|
||||
inline OptionRowHandler* MakeLua( OptionRowDefinition &defOut, CString sLuaFunction ) { OptionRowHandlerLua *pHand = new OptionRowHandlerLua; FillLua( pHand, defOut, sLuaFunction ); return pHand; }
|
||||
inline OptionRowHandler* MakeSteps( OptionRowDefinition &defOut ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillSteps( pHand, defOut ); return pHand; }
|
||||
inline OptionRowHandler* MakeConf( OptionRowDefinition &defOut, CString param ) { OptionRowHandlerConfig *pHand = new OptionRowHandlerConfig; FillConf( pHand, defOut, param ); return pHand; }
|
||||
inline OptionRowHandler* MakeCharacters( OptionRowDefinition &defOut ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillCharacters( pHand, defOut ); return pHand; }
|
||||
inline OptionRowHandler* MakeStyles( OptionRowDefinition &defOut ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillStyles( pHand, defOut ); return pHand; }
|
||||
inline OptionRowHandler* MakeGroups( OptionRowDefinition &defOut ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillGroups( pHand, defOut ); return pHand; }
|
||||
inline OptionRowHandler* MakeDifficulties( OptionRowDefinition &defOut ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillDifficulties( pHand, defOut ); return pHand; }
|
||||
}
|
||||
|
||||
|
||||
void OptionRowHandlerList::ImportOption( const OptionRowDefinition &row, PlayerNumber pn, vector<bool> &vbSelectedOut ) const
|
||||
{
|
||||
int FallbackOption = -1;
|
||||
@@ -194,9 +289,9 @@ int OptionRowHandlerLua::ExportOption( const OptionRowDefinition &def, PlayerNum
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OptionRowHandlerLua::Reload( OptionRowDefinition &def )
|
||||
void OptionRowHandlerLua::Reload( OptionRowDefinition &defOut )
|
||||
{
|
||||
OptionRowHandlerUtil::FillLua( this, def, m_sName );
|
||||
OptionRowHandlerUtil::FillLua( this, defOut, m_sName );
|
||||
}
|
||||
|
||||
|
||||
@@ -226,6 +321,8 @@ int OptionRowHandlerConfig::ExportOption( const OptionRowDefinition &def, Player
|
||||
return opt->GetEffects();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/* Add the list named "ListName" to the given row/handler. */
|
||||
void OptionRowHandlerUtil::FillList( OptionRowHandlerList* pHand, OptionRowDefinition &row, CString _ListName )
|
||||
@@ -653,6 +750,29 @@ void OptionRowHandlerUtil::FillDifficulties( OptionRowHandlerList* pHand, Option
|
||||
}
|
||||
|
||||
|
||||
OptionRowHandler* OptionRowHandlerUtil::Make( const Command &command, OptionRowDefinition &defOut )
|
||||
{
|
||||
OptionRowHandler* pHand = NULL;
|
||||
|
||||
BeginHandleArgs;
|
||||
|
||||
const CString &name = command.GetName();
|
||||
|
||||
if( name == "list" ) pHand = OptionRowHandlerUtil::MakeList( defOut, sArg(1) );
|
||||
else if( name == "lua" ) pHand = OptionRowHandlerUtil::MakeLua( defOut, sArg(1) );
|
||||
else if( name == "steps" ) pHand = OptionRowHandlerUtil::MakeSteps( defOut );
|
||||
else if( name == "conf" ) pHand = OptionRowHandlerUtil::MakeConf( defOut, sArg(1) );
|
||||
else if( name == "characters" ) pHand = OptionRowHandlerUtil::MakeCharacters( defOut );
|
||||
else if( name == "styles" ) pHand = OptionRowHandlerUtil::MakeStyles( defOut );
|
||||
else if( name == "groups" ) pHand = OptionRowHandlerUtil::MakeGroups( defOut );
|
||||
else if( name == "difficulties" ) pHand = OptionRowHandlerUtil::MakeDifficulties( defOut );
|
||||
|
||||
EndHandleArgs;
|
||||
|
||||
return pHand;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (c) 2002-2004 Chris Danford
|
||||
* All rights reserved.
|
||||
|
||||
@@ -26,102 +26,15 @@ public:
|
||||
virtual void ImportOption( const OptionRowDefinition &row, PlayerNumber pn, vector<bool> &vbSelectedOut ) const = 0;
|
||||
/* Returns an OPT mask. */
|
||||
virtual int ExportOption( const OptionRowDefinition &def, PlayerNumber pn, const vector<bool> &vbSelected ) const = 0;
|
||||
virtual void Reload( OptionRowDefinition &def ) {}
|
||||
virtual void Reload( OptionRowDefinition &defOut ) {}
|
||||
virtual CString GetIconText( const OptionRowDefinition &def, int iFirstSelection ) const { return ""; }
|
||||
virtual CString GetAndEraseScreen( int iChoice ) { return ""; }
|
||||
};
|
||||
|
||||
class OptionRowHandlerList : public OptionRowHandler
|
||||
{
|
||||
public:
|
||||
vector<GameCommand> ListEntries;
|
||||
GameCommand Default;
|
||||
bool m_bUseModNameForIcon;
|
||||
|
||||
OptionRowHandlerList::OptionRowHandlerList() { Init(); }
|
||||
virtual void Init()
|
||||
{
|
||||
OptionRowHandler::Init();
|
||||
ListEntries.clear();
|
||||
Default.Init();
|
||||
m_bUseModNameForIcon = false;
|
||||
}
|
||||
virtual void ImportOption( const OptionRowDefinition &row, PlayerNumber pn, vector<bool> &vbSelectedOut ) const;
|
||||
virtual int ExportOption( const OptionRowDefinition &def, PlayerNumber pn, const vector<bool> &vbSelected ) const;
|
||||
virtual CString GetIconText( const OptionRowDefinition &def, int iFirstSelection ) const
|
||||
{
|
||||
return m_bUseModNameForIcon ?
|
||||
ListEntries[iFirstSelection].m_sModifiers :
|
||||
def.choices[iFirstSelection];
|
||||
}
|
||||
virtual CString GetAndEraseScreen( int iChoice )
|
||||
{
|
||||
GameCommand &mc = ListEntries[iChoice];
|
||||
if( mc.m_sScreen != "" )
|
||||
{
|
||||
/* Hack: instead of applying screen commands here, store them in
|
||||
* m_sNextScreen and apply them after we tween out. If we don't set
|
||||
* m_sScreen to "", we'll load it twice (once for each player) and
|
||||
* then again for m_sNextScreen. */
|
||||
CString sNextScreen = mc.m_sScreen;
|
||||
mc.m_sScreen = "";
|
||||
return sNextScreen;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
class OptionRowHandlerLua : public OptionRowHandler
|
||||
{
|
||||
public:
|
||||
LuaExpression *m_pLuaTable;
|
||||
|
||||
OptionRowHandlerLua::OptionRowHandlerLua() { m_pLuaTable = NULL; Init(); }
|
||||
void Init()
|
||||
{
|
||||
OptionRowHandler::Init();
|
||||
delete m_pLuaTable;
|
||||
m_pLuaTable = new LuaExpression;
|
||||
}
|
||||
virtual void ImportOption( const OptionRowDefinition &row, PlayerNumber pn, vector<bool> &vbSelectedOut ) const;
|
||||
virtual int ExportOption( const OptionRowDefinition &def, PlayerNumber pn, const vector<bool> &vbSelected ) const;
|
||||
virtual void Reload( OptionRowDefinition &def );
|
||||
};
|
||||
|
||||
class OptionRowHandlerConfig : public OptionRowHandler
|
||||
{
|
||||
public:
|
||||
const ConfOption *opt;
|
||||
|
||||
OptionRowHandlerConfig::OptionRowHandlerConfig() { Init(); }
|
||||
void Init()
|
||||
{
|
||||
OptionRowHandler::Init();
|
||||
opt = NULL;
|
||||
}
|
||||
virtual void ImportOption( const OptionRowDefinition &row, PlayerNumber pn, vector<bool> &vbSelectedOut ) const;
|
||||
virtual int ExportOption( const OptionRowDefinition &def, PlayerNumber pn, const vector<bool> &vbSelected ) const;
|
||||
};
|
||||
|
||||
namespace OptionRowHandlerUtil
|
||||
{
|
||||
void FillList( OptionRowHandlerList* pHand, OptionRowDefinition &def, CString param );
|
||||
void FillLua( OptionRowHandlerLua* pHand, OptionRowDefinition &def, CString sLuaFunction );
|
||||
void FillSteps( OptionRowHandlerList* pHand, OptionRowDefinition &def );
|
||||
void FillConf( OptionRowHandlerConfig* pHand, OptionRowDefinition &def, CString param );
|
||||
void FillCharacters( OptionRowHandlerList* pHand, OptionRowDefinition &def );
|
||||
void FillStyles( OptionRowHandlerList* pHand, OptionRowDefinition &def );
|
||||
void FillGroups( OptionRowHandlerList* pHand, OptionRowDefinition &def );
|
||||
void FillDifficulties( OptionRowHandlerList* pHand, OptionRowDefinition &def );
|
||||
|
||||
inline OptionRowHandler* MakeList( OptionRowDefinition &def, CString param ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillList( pHand, def, param ); return pHand; }
|
||||
inline OptionRowHandler* MakeLua( OptionRowDefinition &def, CString sLuaFunction ) { OptionRowHandlerLua *pHand = new OptionRowHandlerLua; FillLua( pHand, def, sLuaFunction ); return pHand; }
|
||||
inline OptionRowHandler* MakeSteps( OptionRowDefinition &def ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillSteps( pHand, def ); return pHand; }
|
||||
inline OptionRowHandler* MakeConf( OptionRowDefinition &def, CString param ) { OptionRowHandlerConfig *pHand = new OptionRowHandlerConfig; FillConf( pHand, def, param ); return pHand; }
|
||||
inline OptionRowHandler* MakeCharacters( OptionRowDefinition &def ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillCharacters( pHand, def ); return pHand; }
|
||||
inline OptionRowHandler* MakeStyles( OptionRowDefinition &def ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillStyles( pHand, def ); return pHand; }
|
||||
inline OptionRowHandler* MakeGroups( OptionRowDefinition &def ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillGroups( pHand, def ); return pHand; }
|
||||
inline OptionRowHandler* MakeDifficulties( OptionRowDefinition &def ) { OptionRowHandlerList *pHand = new OptionRowHandlerList; FillDifficulties( pHand, def ); return pHand; }
|
||||
OptionRowHandler* Make( const Command &cmd, OptionRowDefinition &defOut );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -82,45 +82,25 @@ void ScreenOptionsMaster::Init()
|
||||
for( unsigned i = 0; i < asLineNames.size(); ++i )
|
||||
{
|
||||
CString sLineName = asLineNames[i];
|
||||
|
||||
OptionRowDefinition &row = m_OptionRowAlloc[i];
|
||||
|
||||
OptionRowDefinition &def = m_OptionRowAlloc[i];
|
||||
CString sRowCommands = LINE(sLineName);
|
||||
OptionRowHandler* &pHand = OptionRowHandlers[i];
|
||||
pHand = NULL;
|
||||
|
||||
Commands vCommands;
|
||||
ParseCommands( sRowCommands, vCommands );
|
||||
|
||||
if( vCommands.v.size() < 1 )
|
||||
if( vCommands.v.size() != 1 )
|
||||
RageException::Throw( "Parse error in %s::Line%i", m_sName.c_str(), i+1 );
|
||||
|
||||
OptionRowHandler* &pHand = OptionRowHandlers[i];
|
||||
pHand = NULL;
|
||||
Command& command = vCommands.v[0];
|
||||
pHand = OptionRowHandlerUtil::Make( command, def );
|
||||
if( pHand == NULL )
|
||||
RageException::Throw( "Invalid OptionRowHandler '%s' in %s::Line%i", command.GetOriginalCommandString().c_str(), m_sName.c_str(), i );
|
||||
|
||||
for( unsigned c=0; c<vCommands.v.size(); ++c )
|
||||
{
|
||||
Command& command = vCommands.v[c];
|
||||
|
||||
BeginHandleArgs;
|
||||
|
||||
const CString &name = command.GetName();
|
||||
|
||||
if( name == "list" ) pHand = OptionRowHandlerUtil::MakeList( row, sArg(1) );
|
||||
else if( name == "lua" ) pHand = OptionRowHandlerUtil::MakeLua( row, sArg(1) );
|
||||
else if( name == "steps" ) pHand = OptionRowHandlerUtil::MakeSteps( row );
|
||||
else if( name == "conf" ) pHand = OptionRowHandlerUtil::MakeConf( row, sArg(1) );
|
||||
else if( name == "characters" ) pHand = OptionRowHandlerUtil::MakeCharacters( row );
|
||||
else if( name == "styles" ) pHand = OptionRowHandlerUtil::MakeStyles( row );
|
||||
else if( name == "groups" ) pHand = OptionRowHandlerUtil::MakeGroups( row );
|
||||
else if( name == "difficulties" ) pHand = OptionRowHandlerUtil::MakeDifficulties( row );
|
||||
else
|
||||
RageException::Throw( "Unexpected type '%s' in %s::Line%i", name.c_str(), m_sName.c_str(), i );
|
||||
|
||||
EndHandleArgs;
|
||||
}
|
||||
|
||||
// TRICKY: Insert a down arrow as the first choice in the row.
|
||||
if( m_OptionsNavigation == NAV_TOGGLE_THREE_KEY )
|
||||
row.choices.insert( row.choices.begin(), ENTRY_NAME(NEXT_ROW_NAME) );
|
||||
def.choices.insert( def.choices.begin(), ENTRY_NAME(NEXT_ROW_NAME) );
|
||||
}
|
||||
|
||||
ASSERT( OptionRowHandlers.size() == asLineNames.size() );
|
||||
@@ -166,40 +146,36 @@ void ScreenOptionsMaster::Update( float fDelta )
|
||||
// ASSERT( iNumSelected == 1 );
|
||||
//}
|
||||
|
||||
/* Hack: the NextRow entry is never set, and should be transparent. Remove
|
||||
* it, and readd it below. */
|
||||
#define ERASE_ONE_BOOL_AT_FRONT_IF_NEEDED( vbSelected ) \
|
||||
if( m_OptionsNavigation == NAV_TOGGLE_THREE_KEY ) \
|
||||
vbSelected.erase( vbSelected.begin() );
|
||||
#define INSERT_ONE_BOOL_AT_FRONT_IF_NEEDED( vbSelected ) \
|
||||
if( m_OptionsNavigation == NAV_TOGGLE_THREE_KEY ) \
|
||||
vbSelected.insert( vbSelected.begin(), false );
|
||||
|
||||
|
||||
void ScreenOptionsMaster::ImportOptions( int r )
|
||||
{
|
||||
const OptionRowHandler *pHand = OptionRowHandlers[r];
|
||||
const OptionRowDefinition &def = m_OptionRowAlloc[r];
|
||||
OptionRow &row = *m_Rows[r];
|
||||
|
||||
/* Hack: the NextRow entry is never set, and should be transparent. Remove
|
||||
* it, and readd it below. */
|
||||
if( m_OptionsNavigation == NAV_TOGGLE_THREE_KEY )
|
||||
{
|
||||
if( def.bOneChoiceForAllPlayers )
|
||||
row.m_vbSelected[0].erase( row.m_vbSelected[0].begin() );
|
||||
else
|
||||
FOREACH_HumanPlayer( p )
|
||||
row.m_vbSelected[p].erase( row.m_vbSelected[p].begin() );
|
||||
}
|
||||
|
||||
if( def.bOneChoiceForAllPlayers )
|
||||
{
|
||||
ERASE_ONE_BOOL_AT_FRONT_IF_NEEDED( row.m_vbSelected[0] );
|
||||
pHand->ImportOption(def, PLAYER_1, row.m_vbSelected[0] );
|
||||
INSERT_ONE_BOOL_AT_FRONT_IF_NEEDED( row.m_vbSelected[0] );
|
||||
}
|
||||
else
|
||||
{
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
ERASE_ONE_BOOL_AT_FRONT_IF_NEEDED( row.m_vbSelected[p] );
|
||||
pHand->ImportOption( def, p, row.m_vbSelected[p] );
|
||||
}
|
||||
|
||||
if( m_OptionsNavigation == NAV_TOGGLE_THREE_KEY )
|
||||
{
|
||||
if( def.bOneChoiceForAllPlayers )
|
||||
row.m_vbSelected[0].insert( row.m_vbSelected[0].begin(), false );
|
||||
else
|
||||
FOREACH_HumanPlayer( p )
|
||||
row.m_vbSelected[p].insert( row.m_vbSelected[p].begin(), false );
|
||||
INSERT_ONE_BOOL_AT_FRONT_IF_NEEDED( row.m_vbSelected[p] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,11 +202,21 @@ void ScreenOptionsMaster::ExportOptions( int iRow )
|
||||
const OptionRowHandler *pHand = OptionRowHandlers[iRow];
|
||||
const OptionRowDefinition &def = m_OptionRowAlloc[iRow];
|
||||
OptionRow &row = *m_Rows[iRow];
|
||||
FOREACH_HumanPlayer( pn )
|
||||
{
|
||||
vector<bool> &vbSelected = row.m_vbSelected[pn];
|
||||
|
||||
m_iChangeMask |= pHand->ExportOption( def, pn, vbSelected );
|
||||
if( def.bOneChoiceForAllPlayers )
|
||||
{
|
||||
ERASE_ONE_BOOL_AT_FRONT_IF_NEEDED( row.m_vbSelected[0] );
|
||||
m_iChangeMask |= pHand->ExportOption( def, PLAYER_1, row.m_vbSelected[0] );
|
||||
INSERT_ONE_BOOL_AT_FRONT_IF_NEEDED( row.m_vbSelected[0] );
|
||||
}
|
||||
else
|
||||
{
|
||||
FOREACH_HumanPlayer( p )
|
||||
{
|
||||
ERASE_ONE_BOOL_AT_FRONT_IF_NEEDED( row.m_vbSelected[p] );
|
||||
m_iChangeMask |= pHand->ExportOption( def, p, row.m_vbSelected[p] );
|
||||
INSERT_ONE_BOOL_AT_FRONT_IF_NEEDED( row.m_vbSelected[p] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +268,7 @@ void ScreenOptionsMaster::RefreshIcons()
|
||||
else if( iFirstSelection != -1 )
|
||||
{
|
||||
const OptionRowHandler *pHand = OptionRowHandlers[i];
|
||||
sIcon = pHand->GetIconText( def, iFirstSelection );
|
||||
sIcon = pHand->GetIconText( def, iFirstSelection+(m_OptionsNavigation==NAV_TOGGLE_THREE_KEY?-1:0) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user