//Done By Jacob void renderSettings_COOP() { console.writeToBuffer(25,15,"Press Enter to go back to Settings",0x0F); console.writeToBuffer(25,17,"Press Up to increase Revive Timeframe",0x0F); console.writeToBuffer(25,18,"Press Down to decrease Revive Timeframe",0x0F); console.writeToBuffer(25,19,"Timeframe:",0x0F); console.writeToBuffer(36,19,RespawnTF,0x0F); //console.writeToBuffer(25,20,"Press Right to increase Revive Time Required",0x0F); //console.writeToBuffer(25,21,"Press Left to decrease Revive Time Required",0x0F); //console.writeToBuffer(25,22,"Time Required:",0x0F); //console.writeToBuffer(39,22,RespawnRate,0x0F); }
JSValue JSC_HOST_CALL jsConsolePrototypeFunctionTimeEnd(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.inherits(&JSConsole::s_info)) return throwError(exec, TypeError); JSConsole* castedThisObj = static_cast<JSConsole*>(asObject(thisValue)); Console* imp = static_cast<Console*>(castedThisObj->impl()); ScriptCallStack callStack(exec, args, 1); const UString& title = valueToStringWithUndefinedOrNullCheck(exec, args.at(0)); imp->timeEnd(title, &callStack); return jsUndefined(); }
void __stdcall LoggerCore(PVOID pVoid) { char Temp[1024]; // ---- // ---- while(true) { Sleep(100); g_Console.AddMessageToConsole(Temp); g_Console.LoadConsoleCommands(Temp); } }
void ConsoleCommands::toggleRenderMode(Console& console, const Console::Arguments& args, GameSettings& gameSettings) { gameSettings.setWireframe(!gameSettings.isWireframe()); if (gameSettings.isWireframe()) { console.printLine("Rendering mode switched to wireframe"); } else { console.printLine("Rendering mode switched to solid"); } }
void FrostEdit::on_close_clicked() { Console* c = qobject_cast<Console*>(mApplicationOutput->currentWidget()); if(c != nullptr) { QProcess* proc = c->getProcess(); if(proc != nullptr) { if(c->running()) c->closeProcess(); mRunningApplication.removeAt(mRunningApplication.indexOf(proc)); delete proc; } } }
/** * @interface_method_impl{PDMIVMMDEVCONNECTOR,pfnUpdateGuestStatus} */ DECLCALLBACK(void) vmmdevUpdateGuestStatus(PPDMIVMMDEVCONNECTOR pInterface, uint32_t uFacility, uint16_t uStatus, uint32_t fFlags, PCRTTIMESPEC pTimeSpecTS) { PDRVMAINVMMDEV pDrv = RT_FROM_MEMBER(pInterface, DRVMAINVMMDEV, Connector); Console *pConsole = pDrv->pVMMDev->getParent(); /* Store that information in IGuest */ Guest* guest = pConsole->i_getGuest(); AssertPtrReturnVoid(guest); guest->i_setAdditionsStatus((VBoxGuestFacilityType)uFacility, (VBoxGuestFacilityStatus)uStatus, fFlags, pTimeSpecTS); pConsole->i_onAdditionsStateChange(); }
static v8::Handle<v8::Value> memoryAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) { INC_STATS("DOM.Console.memory._get"); Console* imp = V8Console::toNative(info.Holder()); RefPtr<MemoryInfo> result = imp->memory(); v8::Handle<v8::Value> wrapper = result.get() ? getDOMObjectMap().get(result.get()) : v8::Handle<v8::Value>(); if (wrapper.IsEmpty()) { wrapper = toV8(result.get()); if (!wrapper.IsEmpty()) V8DOMWrapper::setHiddenReference(info.Holder(), wrapper); } return wrapper; }
JSValue JSC_HOST_CALL jsConsolePrototypeFunctionAssert(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) { UNUSED_PARAM(args); if (!thisValue.inherits(&JSConsole::s_info)) return throwError(exec, TypeError); JSConsole* castedThisObj = static_cast<JSConsole*>(asObject(thisValue)); Console* imp = static_cast<Console*>(castedThisObj->impl()); ScriptCallStack callStack(exec, args, 1); bool condition = args.at(0).toBoolean(exec); imp->assertCondition(condition, &callStack); return jsUndefined(); }
void ConsoleCommands::toggleShowFps(Console& console, const Console::Arguments& args, GameSettings& gameSettings) { gameSettings.setShowFps(!gameSettings.isShowFps()); if (gameSettings.isShowFps()) { console.printLine("Fps counter shown"); } else { console.printLine("Fps counter hidden"); } }
void FrostEdit::applicationCloseRequest(int id) { Console* c = qobject_cast<Console*>(mApplicationOutput->widget(id)); if(c != nullptr) { QProcess* proc = c->getProcess(); if(proc != nullptr) { if(proc->state() == QProcess::Running) proc->close(); mRunningApplication.removeAt(mRunningApplication.indexOf(proc)); delete proc; } mApplicationOutput->removeTab(id); delete c; } }
void __stdcall LoggerCore(PVOID pVoid) { char Temp[1024]; // ---- AllocConsole(); SetConsoleTitleA(CONSOLETITLE); // ---- while(true) { Sleep(100); g_Console.AddMessageToConsole(Temp); g_Console.LoadConsoleCommands(Temp); } }
void TowerApp::CreateConsoleAndDebugHud() { // Get default style ResourceCache *cache = GetSubsystem<ResourceCache>(); XMLFile *xmlFile = cache->GetResource<XMLFile>("UI/DefaultStyle.xml"); // Create console Console *console = engine_->CreateConsole(); console->SetDefaultStyle(xmlFile); console->GetBackground()->SetOpacity(0.8f); // Create debug HUD. DebugHud *debugHud = engine_->CreateDebugHud(); debugHud->SetDefaultStyle(xmlFile); }
void Urho3DQtApplication::CreateConsoleAndDebugHud() { // Get default style ResourceCache* cache = GetSubsystem<ResourceCache>(); XMLFile* xmlFile = cache->GetResource<XMLFile>("UI/DefaultStyle.xml"); // Create console Console* console = engine_->CreateConsole(); console->SetDefaultStyle(xmlFile); // Create debug HUD. DebugHud* debugHud = engine_->CreateDebugHud(); debugHud->SetDefaultStyle(xmlFile); }
EncodedJSValue JSC_HOST_CALL jsConsolePrototypeFunctionTime(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSConsole::s_info)) return throwVMTypeError(exec); JSConsole* castedThis = static_cast<JSConsole*>(asObject(thisValue)); Console* imp = static_cast<Console*>(castedThis->impl()); const String& title(valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0))); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->time(title); return JSValue::encode(jsUndefined()); }
int lua_Util_listOptions(lua_State *lua) { // Get the console Console *console = dynamic_cast<Console *>(ScreenManager::instance()->getScreen(SCREEN_CONSOLE)); Color4f white; Color4fSet((&white),1.0,1.0,1.0,1.0); // List options Config *settings = State::instance()->settings; for(std::map<std::string, ConfigOption>::iterator iter = settings->map()->begin(); iter != settings->map()->end(); iter++) { console->log(iter->first + " = " + iter->second.getString(),white); } return 0; }
DECLCALLBACK(int) vmmdevGetHeightReduction(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *heightReduction) { PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); Console *pConsole = pDrv->pVMMDev->getParent(); if (!heightReduction) return VERR_INVALID_PARAMETER; IFramebuffer *framebuffer = pConsole->getDisplay()->getFramebuffer(); if (framebuffer) framebuffer->COMGETTER(HeightReduction)((ULONG*)heightReduction); else *heightReduction = 0; return VINF_SUCCESS; }
EncodedJSValue JSC_HOST_CALL jsConsolePrototypeFunctionGroupCollapsed(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSConsole::s_info)) return throwVMTypeError(exec); JSConsole* castedThis = static_cast<JSConsole*>(asObject(thisValue)); Console* imp = static_cast<Console*>(castedThis->impl()); RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, 0)); size_t maxStackSize = imp->shouldCaptureFullStackTrace() ? ScriptCallStack::maxCallStackSizeToCapture : 1; RefPtr<ScriptCallStack> callStack(createScriptCallStack(exec, maxStackSize)); imp->groupCollapsed(scriptArguments, callStack); return JSValue::encode(jsUndefined()); }
EncodedJSValue JSC_HOST_CALL jsConsolePrototypeFunctionDebug(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); JSConsole* castedThis = static_cast<JSConsole*>(asObject(thisValue)); Console* imp = static_cast<Console*>(castedThis->impl()); unsigned count = exec->argumentCount(); Vector<NPVariant, 8> cArgs(count); unsigned i; for (i = 0; i < count; i++) JSC::Bindings::convertValueToNPVariant(exec, exec->argument(i), &cArgs[i]); // Invoke the 'C' method. bool retval = true; NPVariant resultVariant; VOID_TO_NPVARIANT(resultVariant); { JSLock::DropAllLocks dropAllLocks(SilenceAssertionsOnly); //ASSERT(JSC::Bindings::globalExceptionString().isNull()); NPInvokeFunctionPtr ptr = (NPInvokeFunctionPtr)(imp->frame()->page()->chrome()->client()->getJavascriptCallCppCallback()); retval = ptr(0, 0, cArgs.data(), count, &resultVariant); //CInstance::moveGlobalExceptionToExecState(exec); } if (!retval) throwError(exec, createError(exec, "Error calling method on NPObject.")); for (i = 0; i < count; i++) _NPN_ReleaseVariantValue(&cArgs[i]); JSValue resultValue = JSC::Bindings::convertNPVariantToValue(exec, &resultVariant, 0); _NPN_ReleaseVariantValue(&resultVariant); return resultValue; // JSValue thisValue = exec->hostThisValue(); // if (!thisValue.inherits(&JSConsole::s_info)) // return throwVMTypeError(exec); // JSConsole* castedThis = static_cast<JSConsole*>(asObject(thisValue)); // Console* imp = static_cast<Console*>(castedThis->impl()); // RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, 0)); // size_t maxStackSize = imp->shouldCaptureFullStackTrace() ? ScriptCallStack::maxCallStackSizeToCapture : 1; // RefPtr<ScriptCallStack> callStack(createScriptCallStack(exec, maxStackSize)); // // imp->debug(scriptArguments, callStack); // return JSValue::encode(jsUndefined()); }
bool ConsoleManager::RunCommand(char* buf) { if (strcmp(buf, "user") == 0) { go_user(); } //! exit command if (strcmp(buf, "exit") == 0) { return true; } //! clear screen else if (strcmp(buf, "cls") == 0) { console.Clear(); } //! help else if (strcmp(buf, "help") == 0) { console.Print("Orange OS Console Help\n"); console.Print(" - exit: quits and halts the system\n"); console.Print(" - cls: clears the display\n"); console.Print(" - help: displays this message\n"); console.Print(" - read: reads a file\n"); console.Print(" - reset: Resets and recalibrates floppy for reading\n"); console.Print(" - proc: Run process\n"); } //! read sector else if (strcmp(buf, "read") == 0) { cmd_read(); } else if (strcmp(buf, "memstate") == 0) { cmd_memstate(); } else if (strcmp(buf, "alloc") == 0) { cmd_alloc(); } else if (strcmp(buf, "memtask") == 0) { cmd_memtask(); } //! run process else if (strcmp(buf, "proc") == 0) { cmd_proc(); } else { console.Print("Unknown Command\n"); } return false; }
//! read command void cmd_read() { //! get pathname char path[32]; DebugPrintf("\n\rex: \"file.txt\", \"a:\\file.txt\", \"a:\\folder\\file.txt\"\n\rFilename> "); console.GetCommand(path, 30); //! open file FILE file = volOpenFile(path); //! test for invalid file if (file.flags == FS_INVALID) { DebugPrintf("\n\rUnable to open file"); return; } //! cant display directories if ((file.flags & FS_DIRECTORY) == FS_DIRECTORY) { DebugPrintf("\n\rUnable to display contents of directory."); return; } //! top line DebugPrintf("\n\n\r-------[%s]-------\n\r", file.name); //! display file contents while (file.eof != 1) { //! read cluster unsigned char buf[512]; volReadFile(&file, buf, 512); //! display file for (int i = 0; i<512; i++) DebugPutc(buf[i]); //! wait for input to continue if not EOF if (file.eof != 1) { DebugPrintf("\n\r------[Press a key to continue]------"); console.GetChar(); DebugPrintf("\r"); //clear last line } } //! done :) DebugPrintf("\n\n\r--------[EOF]--------"); }
//-------------------------------------------------------------- // Purpose : Initialisation function // Initialize variables, allocate memory, load data from file, etc. // This is called once before entering into your main loop // Input : void // Output : void //-------------------------------------------------------------- void init( void ) { // Set precision for floating point output g_dElapsedTime = 0.0; g_dBounceTime = 0.0; // sets the initial state for the game g_eGameState = S_SPLASHSCREEN; g_sChar.m_cLocation.X = g_Console.getConsoleSize().X / 2; g_sChar.m_cLocation.Y = g_Console.getConsoleSize().Y / 2; g_sChar.m_bActive = true; // sets the width, height and the font name to use in the console g_Console.setConsoleFont(0, 16, L"Consolas"); }
void Log::addLog(char * text){ llog * tmp = NULL; Console * console = new Console; tmp = (llog *)malloc(sizeof(llog)); tmp->pNext = NULL; tmp->string = NULL; if(!tmp){ console->writeError("Can't allocate memory",INLINE); }else{ tmp->string = text; tmp->pNext = log; } log = tmp; delete console; }
DECLCALLBACK(int) iface_VideoAccelEnable(PPDMIVMMDEVCONNECTOR pInterface, bool fEnable, VBVAMEMORY *pVbvaMemory) { PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); Console *pConsole = pDrv->pVMMDev->getParent(); Display *display = pConsole->getDisplay(); if (display) { LogSunlover(("MAIN::VMMDevInterface::iface_VideoAccelEnable: %d, %p\n", fEnable, pVbvaMemory)); return display->VideoAccelEnable(fEnable, pVbvaMemory); } return VERR_NOT_SUPPORTED; }
/** * @interface_method_impl{PDMIVMMDEVCONNECTOR,pfnUpdateGuestStatus} */ DECLCALLBACK(void) vmmdevUpdateGuestStatus(PPDMIVMMDEVCONNECTOR pInterface, uint32_t uFacility, uint16_t uStatus, uint32_t fFlags, PCRTTIMESPEC pTimeSpecTS) { PDRVMAINVMMDEV pDrv = PDMIVMMDEVCONNECTOR_2_MAINVMMDEV(pInterface); Console *pConsole = pDrv->pVMMDev->getParent(); /* Store that information in IGuest */ Guest* guest = pConsole->getGuest(); Assert(guest); if (!guest) return; guest->setAdditionsStatus((VBoxGuestFacilityType)uFacility, (VBoxGuestFacilityStatus)uStatus, fFlags, pTimeSpecTS); pConsole->onAdditionsStateChange(); }
void Urho3DTemplate::SetWindowTitleAndIcon() { //Get default style ResourceCache* cache = GetSubsystem<ResourceCache>(); XMLFile* xmlfile = cache->GetResource<XMLFile>("UI/DefaulStyle.xml"); //Create console Console* console = engine_->CreateConsole(); console->SetDefaultStyle(xmlfile); console->GetBackground()->SetOpacity(0.0f); //Create debug HUD DebugHud* debugHud = engine_->CreateDebugHud(); debugHud->SetDefaultStyle(xmlfile); }
void Console::VarRecord::printInfo(Console &console) const { const char *flagstr = "ra"; int i, f = 1; for (i = 0; i < 2; i++, f <<= 1) { if (hasFlag(f)) { console.print(std::string(1, flagstr[i])); } else { console.print("-"); } } console.print( CON_Format(CON_Lang(" {0} \"{1}\" with value {2}\n")) << var->getTypeName() << name << getValue()); }
void GameMain::HandleKeyDown(StringHash eventType, VariantMap& eventData) { using namespace KeyDown; int key = eventData[P_KEY].GetInt(); Input* input_ = GetSubsystem<Input>(); UI* ui = GetSubsystem<UI>(); UIElement* root = ui->GetRoot(); if (key == KEY_ESC) { menu.isActive = !menu.isActive; Vector<SharedPtr<UIElement>> elements = root->GetChildren(); for (unsigned int i = 0; i < elements.Size(); i++) { if (elements[i]->GetVar("MENU").GetInt() == 1) elements[i]->SetVisible(menu.isActive); } input_->SetMouseVisible(menu.isActive); } else if (key == KEY_F1) { Console* console = GetSubsystem<Console>(); console->Toggle(); } if (key == KEY_F2) drawDebug_ = !drawDebug_; if (key == KEY_F3) GetSubsystem<DebugHud>()->ToggleAll(); if (key == KEY_F) { static bool flee = false; world.flyingShips.shipScript_->SetFlee(flee); flee = !flee; } if (key == KEY_G) { } }
void ZSList::SendEmoteMessageRaw(const char* to, uint32 to_guilddbid, int16 to_minstatus, uint32 type, const char* message) { if (!message) return; ServerPacket* pack = new ServerPacket; pack->opcode = ServerOP_EmoteMessage; pack->size = sizeof(ServerEmoteMessage_Struct)+strlen(message)+1; pack->pBuffer = new uchar[pack->size]; memset(pack->pBuffer, 0, pack->size); ServerEmoteMessage_Struct* sem = (ServerEmoteMessage_Struct*) pack->pBuffer; if (to) { if (to[0] == '*') { Console* con = console_list.FindByAccountName(&to[1]); if (con) con->SendEmoteMessageRaw(to, to_guilddbid, to_minstatus, type, message); delete pack; return; } strcpy((char *) sem->to, to); } else { sem->to[0] = 0; } sem->guilddbid = to_guilddbid; sem->minstatus = to_minstatus; sem->type = type; strcpy(&sem->message[0], message); char tempto[64]={0}; if(to) strn0cpy(tempto,to,64); pack->Deflate(); if (tempto[0] == 0) { SendPacket(pack); if (to_guilddbid == 0) console_list.SendEmoteMessageRaw(type, message); } else { ZoneServer* zs = FindByName(to); if (zs != 0) zs->SendPacket(pack); else SendPacket(pack); } delete pack; }
//Done By Jacob void renderSettings_Survival() { console.writeToBuffer(25,15,"Press ENTER to go back to Settings",0x0F); console.writeToBuffer(25,17,"Press UP to increase Spawn Time",0x0F); console.writeToBuffer(25,18,"Press Down to decrease Spawn Time",0x0F); console.writeToBuffer(25,19,"Spawn Time:",0x0F); console.writeToBuffer(37,19,SpawnRate,0x0F); console.writeToBuffer(25,20,"Press Right to increase Max Ghost",0x0F); console.writeToBuffer(25,21,"Press Left to decrease Max Ghost",0x0F); console.writeToBuffer(25,22,"Max Ghost Count:",0x0F); console.writeToBuffer(41,22,MaxGhostCount,0x0F); }
// Do your clean up of memory here // This is called once just before the game exits void shutdown() { // Reset to white text on black background colour(FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED); console.clearBuffer(); }