diff options
author | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-09-03 01:08:39 +0100 |
---|---|---|
committer | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-09-03 01:08:39 +0100 |
commit | 1b891ff2f166a5d00270c1cd00d2606d8cfd114d (patch) | |
tree | 0608bfc71f17d2c79bdfe68e779a44c22f24ec29 /NorthstarDLL/scriptdatatables.cpp | |
parent | 2f2b497aca23239406ce3f8d94f29f10d205a68b (diff) | |
download | NorthstarLauncher-1b891ff2f166a5d00270c1cd00d2606d8cfd114d.tar.gz NorthstarLauncher-1b891ff2f166a5d00270c1cd00d2606d8cfd114d.zip |
various formatting changes and fixes
Diffstat (limited to 'NorthstarDLL/scriptdatatables.cpp')
-rw-r--r-- | NorthstarDLL/scriptdatatables.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/NorthstarDLL/scriptdatatables.cpp b/NorthstarDLL/scriptdatatables.cpp index cd8a6b2a..2861b964 100644 --- a/NorthstarDLL/scriptdatatables.cpp +++ b/NorthstarDLL/scriptdatatables.cpp @@ -46,7 +46,6 @@ struct Datatable ConVar* Cvar_ns_prefer_datatable_from_disk; template <ScriptContext context> Datatable* (*SQ_GetDatatableInternal)(HSquirrelVM* sqvm); -std::string DataTableToString(Datatable* datatable); struct CSVData { @@ -97,6 +96,7 @@ Vector3 StringToVector(char* pString) return vRet; } +// var function GetDataTable( asset path ) template <ScriptContext context> SQRESULT SQ_GetDatatable(HSquirrelVM* sqvm) { const char* pAssetName; @@ -271,6 +271,7 @@ template <ScriptContext context> SQRESULT SQ_GetDatatable(HSquirrelVM* sqvm) } } +// int function GetDataTableRowCount( var datatable, string columnName ) template <ScriptContext context> SQRESULT SQ_GetDataTableColumnByName(HSquirrelVM* sqvm) { CSVData** pData; @@ -297,6 +298,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableColumnByName(HSquirrelV return SQRESULT_NOTNULL; } +// int function GetDataTableRowCount( var datatable ) template <ScriptContext context> SQRESULT SQ_GetDataTableRowCount(HSquirrelVM* sqvm) { CSVData** pData; @@ -307,12 +309,11 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableRowCount(HSquirrelVM* s return g_pSquirrel<context>->m_funcOriginals["GetDatatableRowCount"](sqvm); CSVData* csv = *pData; - const char* pColumnName = g_pSquirrel<context>->getstring(sqvm, 2); - g_pSquirrel<context>->pushinteger(sqvm, csv->dataPointers.size()); return SQRESULT_NOTNULL; } +// string function GetDataTableString( var datatable, int row, int col ) template <ScriptContext context> SQRESULT SQ_GetDataTableString(HSquirrelVM* sqvm) { CSVData** pData; @@ -339,6 +340,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableString(HSquirrelVM* sqv return SQRESULT_NOTNULL; } +// asset function GetDataTableAsset( var datatable, int row, int col ) template <ScriptContext context> SQRESULT SQ_GetDataTableAsset(HSquirrelVM* sqvm) { CSVData** pData; @@ -365,6 +367,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableAsset(HSquirrelVM* sqvm return SQRESULT_NOTNULL; } +// int function GetDataTableInt( var datatable, int row, int col ) template <ScriptContext context> SQRESULT SQ_GetDataTableInt(HSquirrelVM* sqvm) { CSVData** pData; @@ -391,6 +394,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableInt(HSquirrelVM* sqvm) return SQRESULT_NOTNULL; } +// float function GetDataTableFloat( var datatable, int row, int col ) template <ScriptContext context> SQRESULT SQ_GetDataTableFloat(HSquirrelVM* sqvm) { CSVData** pData; @@ -417,6 +421,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableFloat(HSquirrelVM* sqvm return SQRESULT_NOTNULL; } +// bool function GetDataTableBool( var datatable, int row, int col ) template <ScriptContext context> SQRESULT SQ_GetDataTableBool(HSquirrelVM* sqvm) { CSVData** pData; @@ -443,6 +448,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableBool(HSquirrelVM* sqvm) return SQRESULT_NOTNULL; } +// vector function GetDataTableVector( var datatable, int row, int col ) template <ScriptContext context> SQRESULT SQ_GetDataTableVector(HSquirrelVM* sqvm) { CSVData** pData; @@ -466,6 +472,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableVector(HSquirrelVM* sqv return SQRESULT_NOTNULL; } +// int function GetDataTableRowMatchingStringValue( var datatable, int col, string value ) template <ScriptContext context> SQRESULT SQ_GetDataTableRowMatchingStringValue(HSquirrelVM* sqvm) { CSVData** pData; @@ -491,6 +498,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableRowMatchingStringValue( return SQRESULT_NOTNULL; } +// int function GetDataTableRowMatchingAssetValue( var datatable, int col, asset value ) template <ScriptContext context> SQRESULT SQ_GetDataTableRowMatchingAssetValue(HSquirrelVM* sqvm) { CSVData** pData; @@ -517,6 +525,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableRowMatchingAssetValue(H return SQRESULT_NOTNULL; } +// int function GetDataTableRowMatchingFloatValue( var datatable, int col, float value ) template <ScriptContext context> SQRESULT SQ_GetDataTableRowMatchingFloatValue(HSquirrelVM* sqvm) { CSVData** pData; @@ -542,6 +551,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableRowMatchingFloatValue(H return SQRESULT_NOTNULL; } +// int function GetDataTableRowMatchingIntValue( var datatable, int col, int value ) template <ScriptContext context> SQRESULT SQ_GetDataTableRowMatchingIntValue(HSquirrelVM* sqvm) { CSVData** pData; @@ -567,6 +577,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableRowMatchingIntValue(HSq return SQRESULT_NOTNULL; } +// int function GetDataTableRowMatchingVectorValue( var datatable, int col, vector value ) template <ScriptContext context> SQRESULT SQ_GetDataTableRowMatchingVectorValue(HSquirrelVM* sqvm) { CSVData** pData; @@ -593,6 +604,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableRowMatchingVectorValue( return SQRESULT_NOTNULL; } +// int function GetDataTableRowGreaterThanOrEqualToIntValue( var datatable, int col, int value ) template <ScriptContext context> SQRESULT SQ_GetDataTableRowGreaterThanOrEqualToIntValue(HSquirrelVM* sqvm) { CSVData** pData; @@ -619,6 +631,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableRowGreaterThanOrEqualTo return SQRESULT_NOTNULL; } +// int function GetDataTableRowLessThanOrEqualToIntValue( var datatable, int col, int value ) template <ScriptContext context> SQRESULT SQ_GetDataTableRowLessThanOrEqualToIntValue(HSquirrelVM* sqvm) { CSVData** pData; @@ -644,6 +657,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableRowLessThanOrEqualToInt return SQRESULT_NOTNULL; } +// int function GetDataTableRowGreaterThanOrEqualToFloatValue( var datatable, int col, float value ) template <ScriptContext context> SQRESULT SQ_GetDataTableRowGreaterThanOrEqualToFloatValue(HSquirrelVM* sqvm) { CSVData** pData; @@ -669,6 +683,7 @@ template <ScriptContext context> SQRESULT SQ_GetDataTableRowGreaterThanOrEqualTo return SQRESULT_NOTNULL; } +// int function GetDataTableRowLessThanOrEqualToFloatValue( var datatable, int col, float value ) template <ScriptContext context> SQRESULT SQ_GetDataTableRowLessThanOrEqualToFloatValue(HSquirrelVM* sqvm) { CSVData** pData; @@ -919,4 +934,4 @@ ON_DLL_LOAD_RELIESON("engine.dll", SharedScriptDataTables, ConVar, (CModule modu RegisterConCommand("dump_datatables", ConCommand_dump_datatables, "dumps all datatables from a hardcoded list", FCVAR_NONE); RegisterConCommand("dump_datatable", ConCommand_dump_datatable, "dump a datatable", FCVAR_NONE); -}
\ No newline at end of file +} |