@ -23,7 +23,7 @@ namespace MWLua
return std : : to_string ( id . mIndex ) + " _ " + std : : to_string ( id . mContentFile ) ;
return std : : to_string ( id . mIndex ) + " _ " + std : : to_string ( id . mContentFile ) ;
}
}
const static std : : map < std : : type_index , std : : string > classNames = {
const static std : : map < std : : type_index , std : : string _view > classNames = {
{ typeid ( MWClass : : Activator ) , " Activator " } ,
{ typeid ( MWClass : : Activator ) , " Activator " } ,
{ typeid ( MWClass : : Armor ) , " Armor " } ,
{ typeid ( MWClass : : Armor ) , " Armor " } ,
{ typeid ( MWClass : : Book ) , " Book " } ,
{ typeid ( MWClass : : Book ) , " Book " } ,
@ -40,7 +40,7 @@ namespace MWLua
{ typeid ( MWClass : : Weapon ) , " Weapon " } ,
{ typeid ( MWClass : : Weapon ) , " Weapon " } ,
} ;
} ;
std : : string getMWClassName ( const std : : type_index & cls_type , std : : string fallback )
std : : string _view getMWClassName ( const std : : type_index & cls_type , std : : string _view fallback )
{
{
auto it = classNames . find ( cls_type ) ;
auto it = classNames . find ( cls_type ) ;
if ( it ! = classNames . end ( ) )
if ( it ! = classNames . end ( ) )
@ -55,13 +55,13 @@ namespace MWLua
return id = = " prisonmarker " | | id = = " divinemarker " | | id = = " templemarker " | | id = = " northmarker " ;
return id = = " prisonmarker " | | id = = " divinemarker " | | id = = " templemarker " | | id = = " northmarker " ;
}
}
std : : string getMWClassName ( const MWWorld : : Ptr & ptr )
std : : string _view getMWClassName ( const MWWorld : : Ptr & ptr )
{
{
if ( ptr . getCellRef ( ) . getRefIdRef ( ) = = " player " )
if ( ptr . getCellRef ( ) . getRefIdRef ( ) = = " player " )
return " Player " ;
return " Player " ;
if ( isMarker ( ptr ) )
if ( isMarker ( ptr ) )
return " Marker " ;
return " Marker " ;
return ptr . getTypeDescription ( ) ;
return getMWClassName ( typeid ( ptr . getClass ( ) ) ) ;
}
}
std : : string ptrToString ( const MWWorld : : Ptr & ptr )
std : : string ptrToString ( const MWWorld : : Ptr & ptr )