当前位置: 首页>>代码示例>>C++>>正文


C++ Console_Print函数代码示例

本文整理汇总了C++中Console_Print函数的典型用法代码示例。如果您正苦于以下问题:C++ Console_Print函数的具体用法?C++ Console_Print怎么用?C++ Console_Print使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Console_Print函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Cmd_GetStringIniSetting_Execute

bool Cmd_GetStringIniSetting_Execute(COMMAND_ARGS)
{
	char settingName[kMaxMessageLength] = { 0 };
	*result = -1;

	if (ExtractArgs(EXTRACT_ARGS, &settingName))
	{
		Setting* setting;
		if (GetIniSetting(settingName, &setting))
		{
			char val[kMaxMessageLength] = { 0 };
			if (const char * pVal = setting->Get())
			{
				strcpy_s(val, kMaxMessageLength, pVal);
				AssignToStringVar(PASS_COMMAND_ARGS, val);
				if (IsConsoleMode())
					Console_Print("GetStringIniSetting >> %s", val);
			}
		}
		else if (IsConsoleMode())
			Console_Print("GetStringIniSetting >> SETTING NOT FOUND");
	}

	return true;
}
开发者ID:Alenett,项目名称:TES-Reloaded-Source,代码行数:25,代码来源:Commands_String.cpp

示例2: Cmd_SetCellResetHours_Execute

static bool Cmd_SetCellResetHours_Execute(COMMAND_ARGS)
{
	// specifies # of hours from now until cell reset
	*result = 0;
	TESObjectCELL* cell = NULL;
	UInt32 numHours = -1;
	if (ExtractArgs(PASS_EXTRACT_ARGS, &cell, &numHours) && cell && numHours != -1)
	{
		if (cell->IsInterior() && cell != (*g_thePlayer)->parentCell)
		{
			SInt32 iHoursToRespawn = TimeGlobals::HoursToRespawnCell();
			SInt32 iHoursPassed = TimeGlobals::GameHoursPassed();
			SInt32 detachTime = iHoursPassed + numHours - iHoursToRespawn;
			if (detachTime < iHoursPassed)
			{
				*result = 1;
				CALL_MEMBER_FN(cell, SetDetachTime)(detachTime);
				if (IsConsoleMode())
					Console_Print("Current hours passed :%d Detach time: %d", iHoursPassed, detachTime);
			}
			else if (IsConsoleMode())
				Console_Print("Detach time %d cannot be greater than current hours passed %d", detachTime, iHoursPassed);
		}
	}

	return true;
}
开发者ID:neomonkeus,项目名称:Oblivion-Script-Extender,代码行数:27,代码来源:Commands_Cell.cpp

示例3: Cmd_DumpDocs_Execute

bool Cmd_DumpDocs_Execute(COMMAND_ARGS)
{
	if (IsConsoleMode()) {
		Console_Print("Dumping Command Docs");
	}
	g_scriptCommands.DumpCommandDocumentation();
	if (IsConsoleMode()) {
		Console_Print("Done Dumping Command Docs");
	}
	return true;
}
开发者ID:robojan,项目名称:RealPipboyNV,代码行数:11,代码来源:CommandTable.cpp

示例4: Cmd_GetRuntimeEditorID_Execute

static bool Cmd_GetRuntimeEditorID_Execute(COMMAND_ARGS)
{
	TESForm* BaseObject = NULL;

	if (!g_scriptIntfc->ExtractArgsEx(paramInfo, arg1, opcodeOffsetPtr, scriptObj, eventList, &BaseObject) ||
		(thisObj == NULL && BaseObject == NULL))
	{
		g_strVarInfc->Assign(PASS_COMMAND_ARGS, "");
		return true;
	}

	UInt32 FormID = 0;
	if (thisObj)
		FormID = thisObj->refID;
	else if (BaseObject)
		FormID = BaseObject->refID;

	const char* EditorID = g_editorIDManager.LookupByFormID(FormID);
	if (EditorID == NULL && BaseObject)
		EditorID = BaseObject->GetEditorID();

	if (EditorID == NULL)
		g_strVarInfc->Assign(PASS_COMMAND_ARGS, "");
	else
	{
		g_strVarInfc->Assign(PASS_COMMAND_ARGS, EditorID);

		if (IsConsoleMode())
			Console_Print("EditorID: %s", EditorID);
	}

	return true;
}
开发者ID:shadeMe,项目名称:RuntimeEditorIDs,代码行数:33,代码来源:Commands.cpp

示例5: Cmd_FloatFromFile_Execute

/* Return a float value from the given file.
 * syntax: FloatFromFile filename line_number
 * shortname: ffromf
 *
 * Gets a float from the given line from the file [filename], starting with line 0.
 * -If line_number <= 0, get the first line of the file.
 * -If line_number >= (lines_in_file - 1), get the last line of the file.
 *
 * -Filename is relative to the path where Oblivion.exe is located.
 * -Integers can be read from file, but will be returned as floats (range limits on floats may apply).
 * -This function has been tested using the Oblivion console.  More testing might be needed in scripts to make sure the
 *  returned value is correct.
 * -Prints an error to the console and returns nothing if the file is not found.
 */
bool Cmd_FloatFromFile_Execute(COMMAND_ARGS)
{
	*result = 0.0;
	char lineBuffer[BUFSIZ];
	FILE* fileptr;
	int currLine = 0;
	char filename[129];
	int linePos;

	//just return with error message if file can't be opened
	if (!(ExtractArgs(paramInfo, arg1, opcodeOffsetPtr, thisObj, arg3, scriptObj, eventList, &filename, &linePos)) ||
		fopen_s(&fileptr, filename, "r"))
	{
		Console_Print ("File %s could not be opened.", filename);
		return true;
	}

	//fgets() will move the file pointer to next line for us, allowing for variable line lengths
	while (fgets (lineBuffer, BUFSIZ, fileptr) && currLine < linePos)
	{
		currLine++;
	}

	*result = (float) atof(lineBuffer);
	//Console_Print ("Line %d: %f", linePos, *result);
	fclose (fileptr);
	return true;
}
开发者ID:Alenett,项目名称:OBSE-for-OR,代码行数:42,代码来源:Commands_FileIO.cpp

示例6: Cmd_ListAddForm_Execute

bool Cmd_ListAddForm_Execute(COMMAND_ARGS)
{
	*result = eListInvalid;
	BGSListForm* pListForm = NULL;
	TESForm* pForm = NULL;
	UInt32 n = eListEnd;

#if REPORT_BAD_FORMLISTS
	__try {
#endif

	ExtractArgsEx(EXTRACT_ARGS_EX, &pListForm, &pForm, &n);
	if (pListForm && pForm) {
		UInt32 index = pListForm->AddAt(pForm, n);
		if (index != eListInvalid) {
			*result = index;
		}
		if (IsConsoleMode()) {
			Console_Print("Index: %d", index);
		}
	}

#if REPORT_BAD_FORMLISTS
	} __except(EXCEPTION_EXECUTE_HANDLER)
	{
		ReportBadFormlist(PASS_COMMAND_ARGS, pListForm);
	}
#endif

	return true;
}
开发者ID:ashmedai,项目名称:NVSE,代码行数:31,代码来源:Commands_List.cpp

示例7: Cmd_ListGetNthForm_Execute

bool Cmd_ListGetNthForm_Execute(COMMAND_ARGS)
{
	*result = 0;
	BGSListForm* pListForm = NULL;
	UInt32 n = 0;

#if REPORT_BAD_FORMLISTS
	__try {
#endif

	if (ExtractArgs(EXTRACT_ARGS, &pListForm, &n)) {
		if (pListForm) {
			TESForm* pForm = pListForm->GetNthForm(n);
			if (pForm) {
				*((UInt32 *)result) = pForm->refID;
#if _DEBUG
				TESFullName* listName = DYNAMIC_CAST(pListForm, BGSListForm, TESFullName);
				TESFullName* formName = DYNAMIC_CAST(pForm, TESForm, TESFullName);

				Console_Print("%s item %d: %X %s", listName ? listName->name.m_data : "unknown list", n, pForm->refID, formName ? formName->name.m_data : "unknown item");
#endif
			}
		}
	}

#if REPORT_BAD_FORMLISTS
	} __except(EXCEPTION_EXECUTE_HANDLER)
	{
		ReportBadFormlist(PASS_COMMAND_ARGS, pListForm);
	}
#endif

	return true;
}
开发者ID:ashmedai,项目名称:NVSE,代码行数:34,代码来源:Commands_List.cpp

示例8: Cmd_ListGetFormIndex_Execute

bool Cmd_ListGetFormIndex_Execute(COMMAND_ARGS)
{
	*result = -1;
	BGSListForm* pListForm = NULL;
	TESForm* pForm = NULL;

#if REPORT_BAD_FORMLISTS
	__try {
#endif
	if (ExtractArgs(EXTRACT_ARGS, &pListForm, &pForm)) {
		if (pListForm && pForm) {
			SInt32 index = pListForm->GetIndexOf(pForm); 
			*result = index;
			if (IsConsoleMode()) {
				Console_Print("Index: %d", index);
			}
		}
	}
#if REPORT_BAD_FORMLISTS
	} __except(EXCEPTION_EXECUTE_HANDLER)
	{
		ReportBadFormlist(PASS_COMMAND_ARGS, pListForm);
	}
#endif

	return true;
}
开发者ID:ashmedai,项目名称:NVSE,代码行数:27,代码来源:Commands_List.cpp

示例9: Cmd_ListGetCount_Execute

bool Cmd_ListGetCount_Execute(COMMAND_ARGS)
{
	*result = 0;
	BGSListForm* pListForm = NULL;

#if REPORT_BAD_FORMLISTS
	__try {
#endif

	if (ExtractArgs(EXTRACT_ARGS, &pListForm)) {
		if (pListForm) {
			*result = pListForm->Count();
#if _DEBUG
			Console_Print("count: %d", pListForm->Count());
#endif
		}
	}

#if REPORT_BAD_FORMLISTS
	} __except(EXCEPTION_EXECUTE_HANDLER)
	{
		ReportBadFormlist(PASS_COMMAND_ARGS, pListForm);
	}
#endif

	return true;
}
开发者ID:ashmedai,项目名称:NVSE,代码行数:27,代码来源:Commands_List.cpp

示例10: Cmd_GetSoundAttenuation_Execute

static bool Cmd_GetSoundAttenuation_Execute(COMMAND_ARGS)
{
    TESSound* sound = NULL;
    char whichStr[0x20] = { 0 };
    *result = -1.0;

    if (ExtractArgs(PASS_EXTRACT_ARGS, &sound, whichStr) && sound) {
        UInt32 which = AttenCodeForString(whichStr);
        switch (which) {
        case kAtten_Min:
            *result = sound->minAttenuation * 5;
            break;
        case kAtten_Max:
            *result = sound->maxAttenuation * 100;
            break;
        case kAtten_Static:
            *result = sound->staticAttenuation / 100.0;
            break;
        }
    }

    if (IsConsoleMode()) {
        Console_Print("GetSoundAttenuation >> %.2f", *result);
    }

    return true;
}
开发者ID:Alenett,项目名称:OBSE-for-OR,代码行数:27,代码来源:Commands_Sound.cpp

示例11: Cmd_GetDialogueSpeaker_Eval

bool Cmd_GetDialogueSpeaker_Eval(COMMAND_ARGS_EVAL)
{
	*result = 0;
	UInt32* refResult = (UInt32*)result;
	*refResult = 0;
	BaseProcess* pProcess = NULL;
	TESPackage* pPackage = NULL;
	DialoguePackage* pDPackage = NULL;

	Actor* pActor = DYNAMIC_CAST(thisObj, TESForm, Actor);
	if (pActor)
		pProcess = pActor->baseProcess;
	if (pProcess) {
		pPackage = pProcess->GetCurrentPackage();
		//DumpClass(pPackage, 128);
	}
	if (pPackage) {
		pDPackage = DYNAMIC_CAST(pPackage, TESPackage, DialoguePackage);
		if (pDPackage) {
			if (pDPackage->speaker)
				*refResult = pDPackage->speaker->refID;
		}
		//DEBUG_MESSAGE("\t\tGDK E Actor:%x package:[%#10x] refResult:[%x]\n", pActor->refID, pPackage, *refResult);
	}

	if (IsConsoleMode())
		Console_Print("GetDialogueSpeaker >> %10X", *refResult);
	return true;
}
开发者ID:Alenett,项目名称:TES-Reloaded-Source,代码行数:29,代码来源:Commands_Packages.cpp

示例12: Cmd_GetCurrentPackage_Execute

bool Cmd_GetCurrentPackage_Execute(COMMAND_ARGS)
{
	*result = 0;
	UInt32* refResult = (UInt32*)result;
	*refResult = 0;

	//DEBUG_MESSAGE("\t\tGCP @\n");
	TESObjectREFR* pRefr = NULL;
	Actor * pActor = NULL;
	TESPackage* pPackage = NULL;
	ExtractArgs(EXTRACT_ARGS, &pRefr);
	if (!pRefr)
		if(!thisObj)
			return true;
		else
			pRefr = thisObj;
	//DEBUG_MESSAGE("\t\tGCP 0 Refr:%x\n", pRefr->refID);
	pActor = DYNAMIC_CAST(pRefr, TESObjectREFR, Actor);
	if (!pActor || !pActor->baseProcess)
			return true;
	//DEBUG_MESSAGE("\t\tGCP 1 Package:[%x] Refr:%x\n", pForm, pRefr->refID);
	pPackage = pActor->baseProcess->GetCurrentPackage();
	//DEBUG_MESSAGE("\t\tGCP 2 Package:[%x] Refr:%x\n", pPackage, pRefr->refID);
	if (pPackage) {
		*refResult = pPackage->refID;
		//DEBUG_MESSAGE("\t\tGCP 3 Package:%x  Refr:%x\n", *refResult, pRefr->refID);
	}
	if (IsConsoleMode())
		Console_Print("GetCurrentPackage >> [%08X] ", *result);
	return true;
}
开发者ID:Alenett,项目名称:TES-Reloaded-Source,代码行数:31,代码来源:Commands_Packages.cpp

示例13: Cmd_NX_GetEVFo_Execute

bool Cmd_NX_GetEVFo_Execute(COMMAND_ARGS)
{
  std::string key;
  char keyName[512];
  float fValue = 0;
  UInt32 iPersist = 0;

  _MESSAGE("START GetEVFo");
  *result = 0;

  if (ExtractArgs(EXTRACT_ARGS, &keyName))
  {
    if (thisObj)
    {
      key = keyName;
      *((UInt32 *)result) = nvse_ex_evformmap[thisObj->refID][key];
      if (IsConsoleMode())
      {
        Console_Print("GetEVFo: %x", *((UInt32 *)result));
      }
    }
  }

  _MESSAGE("END GetEVFo");

  return true;
}
开发者ID:ashmedai,项目名称:NVSE,代码行数:27,代码来源:nvse_extender.cpp

示例14: Cmd_GetCurrentRegions_Execute

static bool Cmd_GetCurrentRegions_Execute(COMMAND_ARGS)
{
	ArrayID arrID = g_ArrayMap.Create(kDataType_Numeric, true, scriptObj->GetModIndex());
	*result = arrID;

	TESObjectCELL* cell = (*g_thePlayer)->parentCell;
	if (cell)
	{
		ExtraRegionList* xRegionList = (ExtraRegionList*)cell->extraData.GetByType(kExtraData_RegionList);
		if (xRegionList && xRegionList->regionList)
		{
			double idx = 0.0;
			for (TESRegionList::Entry* cur = &xRegionList->regionList->regionList; cur && cur->region; cur = cur->next)
			{
				g_ArrayMap.SetElementFormID(arrID, idx, cur->region->refID);
				idx += 1.0;
#if _DEBUG
				Console_Print("Region %08x addr %08x", cur->region->refID, cur->region);
#endif
			}
		}
	}

	return true;
}
开发者ID:Alenett,项目名称:OBSE-for-OR,代码行数:25,代码来源:Commands_Player.cpp

示例15: Cmd_ListAddReference_Execute

bool Cmd_ListAddReference_Execute(COMMAND_ARGS)
{
	*result = eListInvalid;
	BGSListForm* pListForm = NULL;
	UInt32 n = eListEnd;

#if REPORT_BAD_FORMLISTS
	__try {
#endif

	if (ExtractArgs(EXTRACT_ARGS, &pListForm, &n)) {
		if (!pListForm || !thisObj) return true;

		UInt32 index = pListForm->AddAt(thisObj, n);
		if (index != eListInvalid) {
			*result = index;
		}
		if (IsConsoleMode()) {
			Console_Print("Index: %d", index);
		}
	}

#if REPORT_BAD_FORMLISTS
	} __except(EXCEPTION_EXECUTE_HANDLER)
	{
		ReportBadFormlist(PASS_COMMAND_ARGS, pListForm);
	}
#endif

	return true;
}
开发者ID:ashmedai,项目名称:NVSE,代码行数:31,代码来源:Commands_List.cpp


注:本文中的Console_Print函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。