From 6b2d64d38f2d7625e6e3c832592c4ca956fb4044 Mon Sep 17 00:00:00 2001 From: nkorslund Date: Tue, 12 May 2009 21:07:55 +0000 Subject: [PATCH] broken commit - I'm working on it git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@106 ea6a568a-9f4f-0410-981a-c910a81bb256 --- gui/cpp_console.cpp | 4 ++-- gui/gui.d | 15 ++++++++++----- media_mygui/openmw_console_layout.xml | 2 +- monster/modules/console.d | 3 ++- mscripts/game/gameobject.mn | 10 ++++++++++ scene/player.d | 2 +- scene/soundlist.d | 1 + 7 files changed, 27 insertions(+), 10 deletions(-) diff --git a/gui/cpp_console.cpp b/gui/cpp_console.cpp index 0b4ec008d..3b009b51f 100644 --- a/gui/cpp_console.cpp +++ b/gui/cpp_console.cpp @@ -44,7 +44,7 @@ public: Console() : Layout("openmw_console_layout.xml") { - setCoord(0,0, + setCoord(10,10, mWindow->getWidth()*2/3, mWindow->getHeight()/2); getWidget(command, "edit_Command"); @@ -72,7 +72,7 @@ public: const Ogre::UTFString &cm = command->getCaption(); if(cm.empty()) return; - history->addText("#FFFFFF" + cm + "\n"); + history->addText("#FFFFFF> " + cm + "\n"); int res = console_input(cm.asUTF8_c_str()); Ogre::UTFString out = console_output(); diff --git a/gui/gui.d b/gui/gui.d index b089f63d1..5bd37ec5e 100644 --- a/gui/gui.d +++ b/gui/gui.d @@ -264,13 +264,18 @@ void setupGUIScripts() cons = new Console(cmo); // Bind native functions - cmc.bind("walk", { bullet_walk(); }); - cmc.bind("fly", { bullet_fly(); }); - cmc.bind("ghost", { bullet_ghost(); }); - cmc.bind("setfont", { gui_setConsoleFont(toStringz(stack.popString8())); }); + cmc.bind("walk", { bullet_walk(); cons.putln("Walk mode enabled");}); + cmc.bind("fly", { bullet_fly(); cons.putln("Fly mode enabled");}); + cmc.bind("ghost", { bullet_ghost(); cons.putln("Ghost mode enabled");}); + cmc.bind("setfont", + { + char[] fnt = stack.popString8(); + gui_setConsoleFont(toStringz(fnt)); + cons.putln("Setting font " ~ fnt); + }); cmc.bind("clear", { gui_clearConsole(); }); cmc.bind("exit", { exitProgram(); }); - cmc.bind("wireframe", { writefln("Wireframe not fixed yet"); }); + cmc.bind("wireframe", { cons.putln("Wireframe mode not implemented yet"); }); } Console cons; diff --git a/media_mygui/openmw_console_layout.xml b/media_mygui/openmw_console_layout.xml index 8c64a1da9..621528c4a 100644 --- a/media_mygui/openmw_console_layout.xml +++ b/media_mygui/openmw_console_layout.xml @@ -5,7 +5,7 @@ - + diff --git a/monster/modules/console.d b/monster/modules/console.d index 21f52c893..08f224888 100644 --- a/monster/modules/console.d +++ b/monster/modules/console.d @@ -115,7 +115,6 @@ class Console trd = Thread.getPaused(); } - private: void put(char[] str, bool newLine=false) { if(hasCallback) @@ -134,6 +133,8 @@ class Console void putln(char[] str) { put(str, true); } + private: + Statement[] parse(TokenArray toks, Scope sc) { Statement b; diff --git a/mscripts/game/gameobject.mn b/mscripts/game/gameobject.mn index 564456170..721fce4b2 100644 --- a/mscripts/game/gameobject.mn +++ b/mscripts/game/gameobject.mn @@ -67,3 +67,13 @@ int fltv; int unam; // TODO: Scripts + +// Cute hack for the console +char[] pos() +{ + // TODO: Make this simpler + char[] xx = x; + char[] yy = y; + char[] zz = z; + return "X:" ~ xx ~ " Y:" ~ yy ~ " Z:" ~ zz; +} diff --git a/scene/player.d b/scene/player.d index c794fe350..043b18e49 100644 --- a/scene/player.d +++ b/scene/player.d @@ -45,7 +45,7 @@ struct PlayerData void setup() { assert(mo is null); - mo = vm.load("game.player").createObject; + mo = vm.load("game.player").getSing; level = mo.getIntPtr("level"); // Still an ugly hack diff --git a/scene/soundlist.d b/scene/soundlist.d index 31caaa06d..bad47f2df 100644 --- a/scene/soundlist.d +++ b/scene/soundlist.d @@ -25,6 +25,7 @@ module scene.soundlist; import esm.loadsoun; import sound.audio; +import sound.sfx; SoundList soundScene;