From ab468dd87ae15e930bac0ea93e8cb6f7cca885ec Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Nov 2012 20:23:18 +0800 Subject: [PATCH 01/13] Updated MainMenu.js for new GUI --- MainMenu.js | 379 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 289 insertions(+), 90 deletions(-) diff --git a/MainMenu.js b/MainMenu.js index 6746d28..78a8577 100644 --- a/MainMenu.js +++ b/MainMenu.js @@ -1,27 +1,14 @@ //!ref: Scripts/Background.ui -//!ref: Scripts/MainMenu.ui -//!ref: Scripts/Prop.ui //!ref: Scripts/Scene.ui +//!ref: Scripts/MainMenu.ui +//!ref: Scripts/PropType.ui +//!ref: Scripts/Element.ui +//!ref: Scripts/Object.ui +//!ref: Scripts/ManMade.ui +//!ref: Scripts/Effect.ui //!ref: Props/Sun.txml -//!ref: Props/sun.mesh +//!ref: Props/Car.txml //!ref: Props/PalmTrees.txml -//!ref: Props/Moon.txml -//!ref: Props/Volcano.txml -//!ref: Props/Walrus.txml -//!ref: Props/Beach.txml -//!ref: Props/DaySky.txml -//!ref: Props/Winter.txml -//!ref: Props/Meadow.txml -//!ref: Props/City.txml -//!ref: Props/Forest.txml -//!ref: Props/Mountains.txml -//!ref: Props/Rocket.txml -//!ref: Props/Buttefly.txml -//!ref: Props/SandToys.txml -//!ref: Props/Room&Window.txml -//!ref: Props/Clouds.txml -//!ref: Props/Sunset.txml -//!ref: Props/NightSky.txml engine.ImportExtension("qt.core"); @@ -36,17 +23,32 @@ engine.ImportExtension("qt.gui"); */ var SceneList_visible = false; -var PropList_visible = false; var BackgroundList_visible = false; +var PropType_visible = false; + +var ElementList_visible = false; +var ObjectList_visible = false; +var EffectList_visible = false; +var ManMadeList_visible = false; + var CurrentClickedItemName = null; -var PropProxy = null; +var PropTypeProxy = null; var SceneProxy = null; var BackgroundProxy = null; +var ElementProxy = null; +var ObjectProxy = null; +var ManMadeProxy = null; +var EffectProxy = null; var _SceneListWidget = null; -var _PropListWidget = null; +//var _PropListWidget = null; var _BackgroundListWidget = null; +var _ElementListWidget = null; +var _ObjectListWidget = null; +var _ManMadeListWidget = null; +var _EffectListWidget = null; + /* Use these to get added properties into right positions. Divided into 3 groups. */ @@ -58,7 +60,7 @@ var Objects = ["PalmTrees", "Butterflies", "Mushroom", "Tree1", "Tree2", "Rocks" var ManMade = ["Mob", "SnowMan", "SandCastle", "Rocket", "Parasol", "SandToys", "Tombstone", "Pirates", "Car", "Treasure"]; var SpecialEffects = ["Fire", "Smoke", "FireWorks", "PinkElephant", "BlackMonolith", "UFO", "Hearts"]; - +var PropType = ["Element","Object","ManMade","Effect"]; var ScenePos = [ @@ -92,36 +94,39 @@ function Init() var _PropBtn = findChild(_widget, "PropBtn"); _PropBtn.pressed.connect(PropBtnClicked); // listening to the singal of prop button clicked - + var _SceneBtn = findChild(_widget, "SceneBtn"); _SceneBtn.pressed.connect(SceneBtnClicked); // listening to the singal of SceneBtn button clicked - + var _BackgroundBtn = findChild(_widget, "BackgroundBtn"); _BackgroundBtn.pressed.connect(BackgroundBtnClicked); // listening to the singal of background button clicked - + var _ClearMenuBtn = findChild(_widget, "ClearMenuBtn"); _ClearMenuBtn.pressed.connect(ClearMenuBtnClicked); // listering to the singal of clean menu button clicked - + var _ClearEntityBtn = findChild(_widget,"ClearEntityBtn"); _ClearEntityBtn.pressed.connect(RemoveAllEntities); // listering to the singal of clean entity button clicked + + var _RandomBtn = findChild(_widget,"RandomBtn"); + //_RandomBtn.pressed.connect(Random); //TODO the function Random() //Add connects to elements, man made, special effectts and object buttons. - + var MenuProxy = new UiProxyWidget(_widget); ui.AddProxyWidgetToScene(MenuProxy); MenuProxy.visible = true; MenuProxy.windowFlags = 0; - + MenuProxy.x = 860; MenuProxy.y = 25; - + // load the file "Scene.ui" var _SceneWidget = ui.LoadFromFile("Scripts/Scene.ui", false); - + _SceneListWidget = findChild(_SceneWidget, "SceneListWidget"); _SceneListWidget.itemDoubleClicked.connect(SceneListItemDoubleClicked); - + SceneProxy = new UiProxyWidget(_SceneWidget); ui.AddProxyWidgetToScene(SceneProxy); @@ -131,40 +136,169 @@ function Init() SceneProxy.x = 965; // they should be caculated late SceneProxy.y = 25; - -// load the file "Prop.ui" - var _PropWidget = ui.LoadFromFile("Scripts/Prop.ui", false); - - _PropListWidget = findChild(_PropWidget,"PropListWidget"); - _PropListWidget.itemDoubleClicked.connect(PropListItemDoubleClicked); // listen to the event of item double clicked in PropListWidget - - PropProxy = new UiProxyWidget(_PropWidget); - - ui.AddProxyWidgetToScene(PropProxy); - PropProxy.visible = PropList_visible; - PropProxy.windowFlags = 0; - - PropProxy.x = 965; // they should be caculated late - PropProxy.y = 25; - // load the file "Background.ui" var _BackgroundWidget = ui.LoadFromFile("Scripts/Background.ui", false); - + _BackgroundListWidget = findChild(_BackgroundWidget,"BackgroundListWidget"); _BackgroundListWidget.itemDoubleClicked.connect(BackgroundListItemDoubleClicked); // listen to the event of item double clicked in BackgroundListWidget - + BackgroundProxy = new UiProxyWidget(_BackgroundWidget); - + ui.AddProxyWidgetToScene(BackgroundProxy); BackgroundProxy.visible = BackgroundList_visible; BackgroundProxy.windowFlags = 0; BackgroundProxy.x = 965; // they should be caculated late BackgroundProxy.y = 25; + + + +// load the file "PropType.ui" + var _PropTypeWidget = ui.LoadFromFile("Scripts/PropType.ui", false); +// TODO check the ElementBtnClicked() wehther we can take param in () or not, if it can, then we can use variable(var) replace concrete button name, e.g. varBtnClicked +// in that case, we just need only one function to deal with the event of button clicked. + _ElementBtn = findChild(_PropTypeWidget,"ElementBtn"); + _ElementBtn.pressed.connect(ElementBtnClicked); // listen to the event of Element button clicked in PropTypeWidget + + _ObjectBtn = findChild(_PropTypeWidget,"ObjectBtn"); + _ObjectBtn.pressed.connect(ObjectBtnClicked); // listen to the event of Object button clicked in PropTypeWidget + _ManMadeBtn = findChild(_PropTypeWidget,"ManMadeBtn"); + _ManMadeBtn.pressed.connect(ManMadeBtnClicked); // listen to the event of ManMade button clicked in PropTypeWidget + _EffectBtn = findChild(_PropTypeWidget,"EffectBtn"); + _EffectBtn.pressed.connect(EffectBtnClicked); // listen to the event of Effect button clicked in PropTypeWidget + + + PropTypeProxy = new UiProxyWidget(_PropTypeWidget); + + ui.AddProxyWidgetToScene(PropTypeProxy); + PropTypeProxy.visible = PropType_visible; + PropTypeProxy.windowFlags = 0; + + PropTypeProxy.x = 965; // they should be caculated late + PropTypeProxy.y = 25; + + +// load the file "Element.ui" + var _ElementWidget = ui.LoadFromFile("Scripts/Element.ui", false); + + _ElementListWidget = findChild(_ElementWidget,"ElementListWidget"); + _ElementListWidget.itemDoubleClicked.connect(ElementListItemDoubleClicked); // listen to the event of item double clicked in ElementListWidget + + ElementProxy = new UiProxyWidget(_ElementWidget); + + ui.AddProxyWidgetToScene(ElementProxy); + ElementProxy.visible = ElementList_visible; + ElementProxy.windowFlags = 0; + + ElementProxy.x = 965 + 105; // they should be caculated late + ElementProxy.y = 25 + 13; + +// load the file "Object.ui" + var _ObjectWidget = ui.LoadFromFile("Scripts/Object.ui", false); + + _ObjectListWidget = findChild(_ObjectWidget,"ObjectListWidget"); + _ObjectListWidget.itemDoubleClicked.connect(ObjectListItemDoubleClicked); // listen to the event of item double clicked in ObjectListWidget + + ObjectProxy = new UiProxyWidget(_ObjectWidget); + + ui.AddProxyWidgetToScene(ObjectProxy); + ObjectProxy.visible = ObjectList_visible; + ObjectProxy.windowFlags = 0; + + ObjectProxy.x = 965 + 105; // they should be caculated late + ObjectProxy.y = 25 + 13 ; + +// load the file "ManMade.ui" + var _ManMadeWidget = ui.LoadFromFile("Scripts/ManMade.ui", false); + + _ManMadeListWidget = findChild(_ManMadeWidget,"ManMadeListWidget"); + _ManMadeListWidget.itemDoubleClicked.connect(ManMadeListItemDoubleClicked); // listen to the event of item double clicked in ManMadeListWidget + + ManMadeProxy = new UiProxyWidget(_ManMadeWidget); + + ui.AddProxyWidgetToScene(ManMadeProxy); + ManMadeProxy.visible = ManMadeList_visible; + ManMadeProxy.windowFlags = 0; + + ManMadeProxy.x = 965 + 105; // they should be caculated late + ManMadeProxy.y = 25 + 13 ; + +// load the file "Effect.ui" + var _EffectWidget = ui.LoadFromFile("Scripts/Effect.ui", false); + + _EffectListWidget = findChild(_EffectWidget,"EffectListWidget"); + _EffectListWidget.itemDoubleClicked.connect(EffectListItemDoubleClicked); // listen to the event of item double clicked in EffectListWidget + + EffectProxy = new UiProxyWidget(_EffectWidget); + + ui.AddProxyWidgetToScene(EffectProxy); + EffectProxy.visible = EffectList_visible; + EffectProxy.windowFlags = 0; + + EffectProxy.x = 965 + 105; // they should be caculated late + EffectProxy.y = 25 + 13 ; + + } + // when scene button and background button are clicked, then it should hide all sub menus of proptype + /* function clearPropTypeMenu(){ + for(var i= 0; i Date: Thu, 29 Nov 2012 21:31:39 +0800 Subject: [PATCH 02/13] add the function randombuttionclicked --- MainMenu.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/MainMenu.js b/MainMenu.js index 78a8577..6c0bea1 100644 --- a/MainMenu.js +++ b/MainMenu.js @@ -108,7 +108,7 @@ function Init() _ClearEntityBtn.pressed.connect(RemoveAllEntities); // listering to the singal of clean entity button clicked var _RandomBtn = findChild(_widget,"RandomBtn"); - //_RandomBtn.pressed.connect(Random); //TODO the function Random() + _RandomBtn.pressed.connect(RandomButtonClicked); //TODO the function Random() //Add connects to elements, man made, special effectts and object buttons. @@ -384,6 +384,17 @@ function Init() BackgroundProxy.visible = false; clearPropTypeMenu(); } + + function RandomButtonClicked(){ + var randomArray = [Elements, Objects, Backgrounds, Scenes, ManMade, SpecialEffects]; + var idx = rnd(randomArray.length); + var rndtype = randomArray[idx]; + var entidx = rnd(rndtype.length); + var ent = randomArray[idx][entidx]; + //var ent = rndtype [entidx]; + LoadXML(ent); + + } From bcdef5641826ce978312a7d3314c47dfca4eeaf5 Mon Sep 17 00:00:00 2001 From: huxiaori Date: Fri, 30 Nov 2012 21:29:25 +0800 Subject: [PATCH 03/13] add all new menus --- Background.ui | 82 +++++++++++++++++++++++++++ Effect.ui | 68 ++++++++++++++++++++++ Element.ui | 68 ++++++++++++++++++++++ MainMenu.ui | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++ ManMade.ui | 68 ++++++++++++++++++++++ Object.ui | 68 ++++++++++++++++++++++ PropType.ui | 116 +++++++++++++++++++++++++++++++++++++ Scene.ui | 103 +++++++++++++++++++++++++++++++++ 8 files changed, 727 insertions(+) create mode 100644 Background.ui create mode 100644 Effect.ui create mode 100644 Element.ui create mode 100644 MainMenu.ui create mode 100644 ManMade.ui create mode 100644 Object.ui create mode 100644 PropType.ui create mode 100644 Scene.ui diff --git a/Background.ui b/Background.ui new file mode 100644 index 0000000..7245eca --- /dev/null +++ b/Background.ui @@ -0,0 +1,82 @@ + + + Background + + + + 0 + 0 + 110 + 200 + + + + Form + + + QWidget#Background { background-color: transparent; } +QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} + + + + + + -1 + 0 + 111 + 201 + + + + QWidget#Background{ background-color: transparent;} +QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 11 + 28 + 91 + 161 + + + + + NightSky + + + + + DaySky + + + + + Sunset + + + + + + + 10 + 10 + 71 + 16 + + + + <html><head/><body><p><span style=" color:#ffffff;">Background</span></p></body></html> + + + + + + + diff --git a/Effect.ui b/Effect.ui new file mode 100644 index 0000000..0156eb9 --- /dev/null +++ b/Effect.ui @@ -0,0 +1,68 @@ + + + Effect + + + + 0 + 0 + 132 + 209 + + + + true + + + Form + + + QWidget#Effect{ background-color: transparent;} +QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } + + + + + 1 + -2 + 131 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 2 + 54 + 20 + + + + <html><head/><body><p><span style=" color:#ffffff;">Effects:</span></p></body></html> + + + + + + 15 + 21 + 101 + 181 + + + + true + + + + + + + diff --git a/Element.ui b/Element.ui new file mode 100644 index 0000000..b479e5f --- /dev/null +++ b/Element.ui @@ -0,0 +1,68 @@ + + + Element + + + + 0 + 0 + 132 + 209 + + + + true + + + Form + + + QWidget#Element{ background-color: transparent;} +QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } + + + + + 1 + -2 + 131 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 2 + 54 + 20 + + + + <html><head/><body><p><span style=" color:#ffffff;">Elements:</span></p></body></html> + + + + + + 15 + 21 + 101 + 181 + + + + true + + + + + + + diff --git a/MainMenu.ui b/MainMenu.ui new file mode 100644 index 0000000..97fc479 --- /dev/null +++ b/MainMenu.ui @@ -0,0 +1,154 @@ + + + MainMenu + + + + 0 + 0 + 103 + 212 + + + + true + + + true + + + Form + + + QWidget#MainMenu { background-color: transparent; } +QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} + + + + + + 2 + 1 + 101 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 14 + 84 + 75 + 20 + + + + true + + + Background + + + + + + 14 + 53 + 75 + 20 + + + + true + + + Prop + + + + + + 14 + 21 + 75 + 20 + + + + true + + + + + + Scene + + + + + + 14 + 116 + 75 + 20 + + + + true + + + + + + HomeMenu + + + + + + 14 + 147 + 75 + 20 + + + + true + + + + + + ClearAll + + + + + + 14 + 180 + 75 + 20 + + + + true + + + + + + Random + + + + + + + diff --git a/ManMade.ui b/ManMade.ui new file mode 100644 index 0000000..2d73f2a --- /dev/null +++ b/ManMade.ui @@ -0,0 +1,68 @@ + + + ManMade + + + + 0 + 0 + 132 + 209 + + + + true + + + Form + + + QWidget#ManMade{ background-color: transparent;} +QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } + + + + + 1 + -2 + 131 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 2 + 54 + 20 + + + + <html><head/><body><p><span style=" color:#ffffff;">ManMade:</span></p></body></html> + + + + + + 15 + 21 + 101 + 181 + + + + true + + + + + + + diff --git a/Object.ui b/Object.ui new file mode 100644 index 0000000..7170acb --- /dev/null +++ b/Object.ui @@ -0,0 +1,68 @@ + + + Object + + + + 0 + 0 + 132 + 209 + + + + true + + + Form + + + QWidget#Object{ background-color: transparent;} +QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } + + + + + 1 + -2 + 131 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 2 + 54 + 20 + + + + <html><head/><body><p><span style=" color:#ffffff;">Objects:</span></p></body></html> + + + + + + 15 + 21 + 101 + 181 + + + + true + + + + + + + diff --git a/PropType.ui b/PropType.ui new file mode 100644 index 0000000..b8869e3 --- /dev/null +++ b/PropType.ui @@ -0,0 +1,116 @@ + + + PropTypesMenu + + + + 0 + 0 + 103 + 192 + + + + true + + + true + + + Form + + + QWidget#PropTypesMenu { background-color: transparent; } +QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} + + + + + + 2 + 1 + 101 + 191 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 99 + 81 + 31 + + + + true + + + ManMade + + + + + + 12 + 59 + 81 + 31 + + + + true + + + Objects + + + + + + 12 + 21 + 81 + 31 + + + + true + + + + + + Elements + + + + + + 12 + 138 + 81 + 31 + + + + true + + + + + + Effects + + + + + + + diff --git a/Scene.ui b/Scene.ui new file mode 100644 index 0000000..058c84a --- /dev/null +++ b/Scene.ui @@ -0,0 +1,103 @@ + + + Scene + + + + 0 + 0 + 132 + 209 + + + + true + + + Form + + + QWidget#Scene{ background-color: transparent;} +QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } + + + + + 1 + -2 + 131 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 2 + 54 + 20 + + + + <html><head/><body><p><span style=" color:#ffffff;">Scene:</span></p></body></html> + + + + + + 15 + 21 + 101 + 181 + + + + true + + + + Winter + + + + + Mountains + + + + + Meadow + + + + + Forest + + + + + City + + + + + Beach + + + + + Room&Window + + + + + + + + From 04321eda985456a056cb2bbec778bfdaf5204ccb Mon Sep 17 00:00:00 2001 From: huxiaori Date: Sat, 1 Dec 2012 05:03:23 +0800 Subject: [PATCH 04/13] add RefFiles.js and update MainMenu.js --- MainMenu.js | 13 ++----------- RefFiles.js | 11 +++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 RefFiles.js diff --git a/MainMenu.js b/MainMenu.js index 6c0bea1..4cf44a1 100644 --- a/MainMenu.js +++ b/MainMenu.js @@ -1,14 +1,5 @@ -//!ref: Scripts/Background.ui -//!ref: Scripts/Scene.ui -//!ref: Scripts/MainMenu.ui -//!ref: Scripts/PropType.ui -//!ref: Scripts/Element.ui -//!ref: Scripts/Object.ui -//!ref: Scripts/ManMade.ui -//!ref: Scripts/Effect.ui -//!ref: Props/Sun.txml -//!ref: Props/Car.txml -//!ref: Props/PalmTrees.txml + +engine.IncludeFile("local://RefFiles.js"); engine.ImportExtension("qt.core"); diff --git a/RefFiles.js b/RefFiles.js new file mode 100644 index 0000000..44efac6 --- /dev/null +++ b/RefFiles.js @@ -0,0 +1,11 @@ +//!ref: Scripts/Background.ui +//!ref: Scripts/Scene.ui +//!ref: Scripts/MainMenu.ui +//!ref: Scripts/PropType.ui +//!ref: Scripts/Element.ui +//!ref: Scripts/Object.ui +//!ref: Scripts/ManMade.ui +//!ref: Scripts/Effect.ui +//!ref: Props/Sun.txml +//!ref: Props/Car.txml +//!ref: Props/PalmTrees.txml \ No newline at end of file From bd0d558fa0f86c108a1f3adb1f3e52aef46ba810 Mon Sep 17 00:00:00 2001 From: huxiaori Date: Sun, 2 Dec 2012 21:36:26 +0800 Subject: [PATCH 05/13] add folder Mumble, it --- Mumble/MumbleApplication.js | 493 ++++++++++++++++++++++++++++++++++ Mumble/MumbleClientWidget.ui | 182 +++++++++++++ Mumble/MumbleConnectWidget.ui | 227 ++++++++++++++++ Mumble/StartMumble.ui | 71 +++++ Mumble/instructions.js | 32 +++ Mumble/scene.txml | 25 ++ Mumble/voice-active.png | Bin 0 -> 4310 bytes Mumble/voice-inactive.png | Bin 0 -> 3938 bytes 8 files changed, 1030 insertions(+) create mode 100644 Mumble/MumbleApplication.js create mode 100644 Mumble/MumbleClientWidget.ui create mode 100644 Mumble/MumbleConnectWidget.ui create mode 100644 Mumble/StartMumble.ui create mode 100644 Mumble/instructions.js create mode 100644 Mumble/scene.txml create mode 100644 Mumble/voice-active.png create mode 100644 Mumble/voice-inactive.png diff --git a/Mumble/MumbleApplication.js b/Mumble/MumbleApplication.js new file mode 100644 index 0000000..e132fee --- /dev/null +++ b/Mumble/MumbleApplication.js @@ -0,0 +1,493 @@ + +// *********************************************************************************************************************************** +// Simple example script for using MumblePlugin as VOIP communications provider. Mumble can do VOIP over SSL TCP and encrypted UDP, +// in addition you can do text messaging with the current channel and privately. This example demonstrates most of the features +// provided with the MumblePlugin but not quite all of them, inspect the documentation for more information. +// Note that the 'Open Audio Wizard' widget is not implemented here in javascript but in the C++ code of MumblePlugin. +// +// 1. Download the Mumble installer that includes the Murmur server from http://www.mumble.com/ +// Mumble version should be >=1.2.3. Lower versions may work depending if they have celt >=0.11.1 support. +// 2. Install Mumble. Remember to check "Install Murmur server" in the install process, +// the Murmur is not a part of the default install options. +// 3. Run Tundra with the example scene: Tundra --config viewer-browser.xml --console --file scenes/Mumble/scene.txml +// This will start a client with the browser ui, but don't worry this script should hide the ui. +// If not you can use the menu Browser -> Hide Browser UI to see the scene. +// *********************************************************************************************************************************** + +// Tell the script parser we depend on the following assets +// !ref: local://StartMumble.ui +// !ref: local://MumbleClientWidget.ui, QtUiFile +// !ref: local://MumbleConnectWidget.ui, QtUiFile +// !ref: local://voice-active.png +// !ref: local://voice-inactive.png + +// These are just default that are applied to the connection widget on first show. +// You don't have to edit these if you want to use the client UI to setup connection info. + +engine.ImportExtension("qt.core"); +engine.ImportExtension("qt.gui"); + +/*var _connectionInfo = +{ + host : "efe.mumble.com", // Change to IP if you want to test remote Murmur servers. + port : 8560, // Default port for Murmur, see murmur.ini for changing this. + password : "rautaarajalle", // Default password for Murmur is empty, see murmur.ini for changing this. + channel : "EFE Server/LOBBY", // Default Murmur server will have one channel called "Root". Empty channel name is depicted as "Root" when connecting via MumblePlugin. + outputMuted : false, // True means your voice is sent after connecting, false means your output is muted. + intputMuted : false // True means voice should be sent to us from other client after connecting, false means server wont send us the voice packets. +}; +*/ + +var _connectionInfo = +{ + host : "athena.mumble-serveur.com", // Change to IP if you want to test remote Murmur servers. + port : 13501, // Default port for Murmur, see murmur.ini for changing this. + password : "e92ds6gs", // Default password for Murmur is empty, see murmur.ini for changing this. + channel : "mumble-serveur.com public #1/wow", // Default Murmur server will have one channel called "Root". Empty channel name is depicted as "Root" when connecting via MumblePlugin. + outputMuted : false, // True means your voice is sent after connecting, false means your output is muted. + intputMuted : false // True means voice should be sent to us from other client after connecting, false means server wont send us the voice packets. +}; + + +// Global variables +var _mumbleWidget = null; +var _widget = null; +var _connectWidget = null; +var _buttonWizard = null; +var _buttonConnect = null; +var _buttonDisconnect = null; +var _buttonSelfMute = null; +var _buttonSelfDeaf = null; +var _buttonMuteSelected = null; +var _userList = null; +var _chatLog = null; +var _chatLine = null; +var _iconActive = null; +var _iconInactive = null; + +var clientWidgetVisible = false; + +// when click the button "Mumble" to hind and display the window of client. +function StartMumble(){ + if (_mumbleWidget == null) + { + _mumbleWidget = ui.LoadFromFile("local://StartMumble.ui"); + _mumbleButton = findChild(_mumbleWidget, "MumbleBtn"); + _mumbleButton.clicked.connect(mumbleButtonClicked); + + + //mumbleProxy = new UiProxyWidget(_mumbleWidget); + + //ui.AddProxyWidgetToScene(mumbleProxy); + //mumbleProxy.visible = true; + //mumbleProxy.windowFlags = 0; + + //mumbleProxy.x = 15; // they should be caculated late + //mumbleProxy.y = 150 ; + + _mumbleWidget.visible = true; + _mumbleWidget.pos = new QPoint(15,150); + _mumbleWidget.windowFlags = Qt.CustomizeWindowHint; + //_mumbleWidget.windowFlags = setWindowFlags(Qt::CustomizeWindowHint); + + + } +} + +function mumbleButtonClicked() +{ + clientWidgetVisible = ! clientWidgetVisible; + _widget.visible = clientWidgetVisible; +} + +function StartClient() +{ + // Hook to MumblePlugin + mumble.Connected.connect(OnConnected); + mumble.Disconnected.connect(OnDisconnected); + mumble.ConnectionRejected.connect(OnRejected); + + mumble.MeCreated.connect(OnMeCreated); + mumble.JoinedChannel.connect(OnJoinedChannel); + + mumble.UserMuted.connect(OnUserLocalMuteChanged); + mumble.UserSelfMuted.connect(OnUserSelfMutedChange); + mumble.UserSelfDeaf.connect(OnUserSelfDeafChange); + mumble.UserSpeaking.connect(OnUserSpeakingChange); + mumble.UserPositionalChanged.connect(OnUserPositionalChange); + mumble.ChannelTextMessageReceived.connect(OnChannelTextMessageReceived); + + InitIcons(); + StartMumble(); + // Init UI + _widget = ui.LoadFromFile("local://MumbleClientWidget.ui"); + + _widget.pos = new QPoint(15,240); + _widget.windowFlags = 0; + _buttonConnect = findChild(_widget, "buttonOpenConnect"); + _buttonDisconnect = findChild(_widget, "buttonDisconnect"); + _buttonWizard = findChild(_widget, "buttonOpenWizard"); + _buttonSelfMute = findChild(_widget, "muteSelfToggle"); + _buttonSelfDeaf = findChild(_widget, "deafSelfToggle"); + _buttonMuteSelected = findChild(_widget, "muteSelectedToggle"); + _userList = findChild(_widget, "listUsers"); + _chatLog = findChild(_widget, "chatTextEdit");; + _chatLine = findChild(_widget, "chatLineEdit");; + + _buttonConnect.clicked.connect(ShowConnectDialog); + _buttonDisconnect.clicked.connect(mumble, mumble.Disconnect); // Direct connection to MumblePlugin C++ QObject + _buttonWizard.clicked.connect(mumble, mumble.RunAudioWizard); // Direct connection to MumblePlugin C++ QObject + _buttonSelfMute.clicked.connect(OnSelfMuteToggle); + _buttonSelfDeaf.clicked.connect(OnSelfDeafToggle); + // _buttonMuteSelected.clicked.connect(OnMuteSelectedToggle); + // _userList.currentItemChanged.connect(OnUserSelected); + //_chatLine.returnPressed.connect(SendTextMessage); + + // Init state + SetConnectionState(false, "Disconnected"); + SetChannelName(""); +} + +function InitIcons() +{ + // Just for reference: If the ref is http:// ref it will be found from cache, + // if it is a local we need to query IAsset::DiskSource(). Usually in your app you will know + // which one it is and just call the correct place directly. + try + { + var imageActivePath = asset.GetAssetCache().FindInCache("local://voice-active.png"); + if (imageActivePath == "") + imageActivePath = asset.GetAsset("local://voice-active.png").DiskSource(); + var imageInactivePath = asset.GetAssetCache().FindInCache("local://voice-inactive.png"); + if (imageInactivePath == "") + imageInactivePath = asset.GetAsset("local://voice-inactive.png").DiskSource(); + } + catch (e) + { + imageActivePath = ""; + imageInactivePath = ""; + } + + _iconActive = new QIcon(new QPixmap(imageActivePath)); + _iconInactive = new QIcon(new QPixmap(imageInactivePath)); +} + +function SetConnectionState(connected, strState) +{ + var stateLabel = findChild(_widget, "labelConnectionState"); + stateLabel.text = strState; + + _buttonConnect.enabled = !connected; + _buttonDisconnect.enabled = connected; + _buttonWizard.enabled = connected; + _buttonSelfMute.enabled = connected; + _buttonSelfDeaf.enabled = connected; + //_buttonMuteSelected.enabled = connected; + /* if (!connected) + _buttonMuteSelected.text = ""; + _chatLine.enabled = connected; + _chatLine.text = ""; + _chatLog.clear(); + _userList.clear();*/ +} + +function SetChannelName(channelName) +{ + var channelLabel = findChild(_widget, "labelChannelName"); + channelLabel.text = channelName; +} + +function ShowConnectDialog() +{ + // Initialize if not yet done + if (_connectWidget == null) + { + _connectWidget = ui.LoadFromFile("local://MumbleConnectWidget.ui"); + + var widgets = GetConnectionDataWidgets(_connectWidget); + widgets.connectButton.clicked.connect(Connect); + widgets.cancelButton.clicked.connect(_connectWidget, _connectWidget.hide); + + widgets.host.text = _connectionInfo.host; + widgets.port.value = _connectionInfo.port; + widgets.password.text = _connectionInfo.password; + widgets.channel.text = _connectionInfo.channel; + if (client != null && client.LoginProperty("username") != "") + widgets.username.text = client.LoginProperty("username"); + else + widgets.username.text = "Tom"; + } + + var mainWidgetRect = _widget.frameGeometry; + //_connectWidget.minimumHeight = _widget.height; + _connectWidget.pos = new QPoint(mainWidgetRect.topRight().x() + 25, mainWidgetRect.topRight().y()); + _connectWidget.visible = true; +} + +function GetConnectionDataWidgets(widget) +{ + if (widget == null) + return null; + + var widgets = + { + host : findChild(widget, "hostLineEdit"), + port : findChild(widget, "portSpinBox"), + username : findChild(widget, "usernameLineEdit"), + password : findChild(widget, "passwordLineEdit"), + channel : findChild(widget, "channelLineEdit"), + connectButton : findChild(widget, "buttonConnect"), + cancelButton : findChild(widget, "buttonCancel") + }; + + return widgets; +} + +function Connect() +{ + var widgets = GetConnectionDataWidgets(_connectWidget); + mumble.Connect(widgets.host.text, widgets.port.value, widgets.username.text, widgets.password.text, widgets.channel.text, _connectionInfo.outputMuted, _connectionInfo.intputMuted); + + _connectWidget.visible = false; + SetConnectionState(false, "Connecting to " + widgets.host.text + ":" + widgets.port.value.toString() + "..."); +} + +function OnRejected(rejectType, reason) +{ + // enum RejectReasonWrongServerPW + if (rejectType.value == 4) + QMessageBox.warning(ui.MainWindow(), "", reason); + // enum RejectReasonServerFull + else if (rejectType.value == 6) + QMessageBox.warning(ui.MainWindow(), "", "Server is full"); +} + +function OnConnected(host, port, username) +{ + SetConnectionState(true, "Connected to " + host + ":" + port.toString() +'
' + " as "+ username); +} + +function OnDisconnected(reason) +{ + if (reason != "") + SetConnectionState(false, "Disconnected: " + reason); + else + SetConnectionState(false, "Disconnected"); +} + +function OnMeCreated(mumbleMe) +{ + // Can hook to own user ptr signals here. + // Depends if you want to use own functions for processing 'me' signals. + // Or a generic function to handle all like this example script shows. + // You can use the signaling model you feel is best for you. +} + +function OnJoinedChannel(mumbleChannel) +{ + SetChannelName(mumbleChannel.fullName); + + mumbleChannel.UserJoined.connect(OnUserJoinedPresentChannel); + mumbleChannel.UserLeft.connect(OnUserLeftPresentChannel); +} + +function GetUser(userId) +{ + var user = null; + for(var i=0; i<_userList.count; ++i) + { + var item = _userList.item(i); + if (item != null && item.data(Qt.UserRole) == userId) + { + user = { listItem: item, row: i }; + break; + } + } + return user; +} + +function OnUserJoinedPresentChannel(user) +{ + var listItem = new QListWidgetItem(_iconInactive, user.name + " (" + user.id.toString() + ")"); + listItem.setData(Qt.UserRole, user.id); + + if (user.isMe) + { + var font = listItem.font(); + font.setBold(true); + listItem.setFont(font); + } + + _userList.addItem(listItem); +} + +function OnUserLeftPresentChannel(userId) +{ + var listItem = GetUser(userId); + if (listItem != null) + _userList.takeAt(listItem.row); +} + +function OnUserSelected(listItem) +{ + if (listItem == null) + listItem = _userList.currentItem(); + if (listItem != null && listItem.data(Qt.UserRole) != null) + { + var mumbleUser = mumble.User(listItem.data(Qt.UserRole)); + if (mumbleUser.isMe) + { + _buttonMuteSelected.enabled = false; + _buttonMuteSelected.text = ""; + } + else + { + _buttonMuteSelected.enabled = true; + _buttonMuteSelected.text = mumbleUser.isMuted ? "Unmute " + mumbleUser.name : "Mute " + mumbleUser.name; + } + } +} + +function OnSelfMuteToggle() +{ + var mumbleMe = mumble.Me(); + if (mumbleMe != null) + mumble.SetOutputAudioMuted(!mumbleMe.isSelfMuted); +} + +function OnSelfDeafToggle() +{ + var mumbleMe = mumble.Me(); + if (mumbleMe != null) + mumble.SetInputAudioMuted(!mumbleMe.isSelfDeaf); +} + +function OnMuteSelectedToggle() +{ + var currentItem = _userList.currentItem(); + if (currentItem != null && currentItem.data(Qt.UserRole) != null) + { + var user = mumble.User(currentItem.data(Qt.UserRole)); + if (user != null && !user.isMe) + user.isMuted = !user.isMuted; + } +} + +function UpdateUserState(mumbleUser) +{ + var iter = GetUser(mumbleUser.id); + if (iter != null) + { + var text = mumbleUser.name + " (" + mumbleUser.id.toString() + ")"; + var props = []; + if (mumbleUser.isMuted) + props.push("muted"); + if (mumbleUser.isSelfMuted) + props.push("self muted"); + if (mumbleUser.isSelfDeaf) + props.push("deaf"); + if (!mumbleUser.isPositional) + props.push("non-positional"); + if (props.length > 0) + text += " [" + props.join(", ") + "]"; + iter.listItem.setText(text); + + //OnUserSelected(iter.listItem); + } +} + +function OnUserLocalMuteChanged(mumbleUser, isMuted) +{ + UpdateUserState(mumbleUser); +} + +function OnUserSelfMutedChange(mumbleUser, isMuted) +{ + UpdateUserState(mumbleUser); + if (mumbleUser.isMe) + _buttonSelfMute.text = mumbleUser.isSelfMuted ? "Unmute Self" : "Mute self"; +} + +function OnUserSelfDeafChange(mumbleUser, isDeaf) +{ + UpdateUserState(mumbleUser); + if (mumbleUser.isMe) + _buttonSelfDeaf.text = mumbleUser.isSelfDeaf ? "Unmute Everyone" : "Mute Everyone"; +} + +function OnUserPositionalChange(mumbleUser, isPositional) +{ + UpdateUserState(mumbleUser); +} + +function OnUserSpeakingChange(mumbleUser, speaking) +{ + var iter = GetUser(mumbleUser.id); + if (iter != null) + iter.listItem.setIcon(speaking ? _iconActive : _iconInactive); +} + +function SendTextMessage() +{ + var message = _chatLine.text; + if (message != "") + { + // Own messages are of course not relayed back to us, add by hand. + OnChannelTextMessageReceived(mumble.Me(), message); + // Send message to current channel. + mumble.SendTextMessage(message); + _chatLine.text = ""; + } +} + +function OnChannelTextMessageReceived(mumbleUser, message) +{ + if (message != "") + _chatLog.appendHtml("[" + mumbleUser.name + "] " + message); +} + +// Bootstrap and utility functions + +function OnScriptDestroyed() +{ + mumble.Disconnect("Client closed"); + + if (_widget != null) + { + _widget.visible = false; + ui.RemoveWidgetFromScene(_widget); + _widget = null; + } + if (_connectWidget != null) + { + _connectWidget.visible = false; + ui.RemoveWidgetFromScene(_connectWidget); + _connectWidget = null; + } +} + +function LogInfo(msg) { console.LogInfo("[MumbleApplication]: " + msg); } +function LogError(msg) { console.LogError("[MumbleApplication]: " + msg); } + + +if (!server.IsRunning() && !framework.IsHeadless()) +{ + + if (framework.GetModuleByName("MumblePlugin") != null) + { + try + { + + // Hide browser ui + if (browserplugin != null) + browserplugin.SetBrowserVisibility(false); + } + catch (e) {} + + + StartClient(); + + } + else + console.LogError("MumblePlugin not preset, its not in your startup config?"); +} diff --git a/Mumble/MumbleClientWidget.ui b/Mumble/MumbleClientWidget.ui new file mode 100644 index 0000000..2cf68aa --- /dev/null +++ b/Mumble/MumbleClientWidget.ui @@ -0,0 +1,182 @@ + + + MumbleClientWidget + + + Qt::NonModal + + + true + + + + 0 + 0 + 236 + 264 + + + + Mumble Client + + + 1.000000000000000 + + + QWidget#MumbleClientWidget +{ + border: 0px; + windowFlags: 0x00000800; +}; +QLabel, QPushButton { + font-size: 9pt; +} + +QLabel#labelConnectionStateTitle, #labelChannelNameTitle, #labelControlsTitle, #labelChatTitle { + font-weight: bold; +} + +QPlainTextEdit, QLineEdit, QListWidget { + border: 1px solid grey; +} + +QLineEdit { + border-top: 0px; +} + + + + + 8 + 176 + 221 + 31 + + + + + + + Qt::AlignCenter + + + + + + 11 + 54 + 211 + 118 + + + + + + + 7 + 210 + 81 + 23 + + + + Mute Self + + + + + + 94 + 210 + 71 + 23 + + + + Deaf Self + + + + + + 8 + 236 + 131 + 23 + + + + Open Audio Wizard + + + + + + 150 + 236 + 81 + 23 + + + + Disconnect + + + + + + 171 + 210 + 61 + 23 + + + + Connect + + + + + + 12 + 12 + 93 + 16 + + + + + 0 + 0 + + + + Channel Users + + + 2 + + + + + + 10 + 30 + 211 + 21 + + + + + 0 + 0 + + + + + + + + + + diff --git a/Mumble/MumbleConnectWidget.ui b/Mumble/MumbleConnectWidget.ui new file mode 100644 index 0000000..f8b017c --- /dev/null +++ b/Mumble/MumbleConnectWidget.ui @@ -0,0 +1,227 @@ + + + ConnectDialog + + + Qt::NonModal + + + + 0 + 0 + 229 + 202 + + + + Connection Information + + + 1.000000000000000 + + + /* +QWidget#ConnectDialog { background-color: transparent; } +QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;}*/ + + + + + + + + -1 + 0 + 231 + 201 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + false + + + + 80 + 34 + 66 + 20 + + + + 1000000 + + + + + + 14 + 34 + 24 + 16 + + + + Port + + + + + true + + + + 80 + 112 + 133 + 20 + + + + + + + 14 + 60 + 48 + 16 + + + + Username + + + + + + 14 + 112 + 42 + 16 + + + + Channel + + + + + + 14 + 8 + 60 + 16 + + + + + 60 + 0 + + + + Host + + + + + + 134 + 158 + 75 + 23 + + + + Cancel + + + + + + 14 + 158 + 75 + 23 + + + + Connect + + + + + false + + + + 80 + 8 + 133 + 20 + + + + + + + 14 + 86 + 48 + 16 + + + + Password + + + + + + 9 + 138 + 211 + 21 + + + + Click button to Connect or Cancel + + + + + false + + + + 80 + 86 + 133 + 20 + + + + QLineEdit::Password + + + + + + 80 + 60 + 133 + 20 + + + + + + + + diff --git a/Mumble/StartMumble.ui b/Mumble/StartMumble.ui new file mode 100644 index 0000000..cf8fe10 --- /dev/null +++ b/Mumble/StartMumble.ui @@ -0,0 +1,71 @@ + + + StartMumble + + + Qt::ApplicationModal + + + + 0 + 0 + 103 + 32 + + + + true + + + true + + + Form + + + false + + + QWidget#StartMumble { background-color: transparent; } +QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} + + + + + + 2 + 1 + 101 + 31 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 14 + 6 + 75 + 20 + + + + true + + + + + + Mumble + + + + + + + diff --git a/Mumble/instructions.js b/Mumble/instructions.js new file mode 100644 index 0000000..12e99f4 --- /dev/null +++ b/Mumble/instructions.js @@ -0,0 +1,32 @@ +engine.ImportExtension("qt.core"); +engine.ImportExtension("qt.gui"); + +var label = null; +var proxy = null; + +function OnScriptDestroyed() +{ + if (label != null) + { + label.visible = false; + ui.RemoveWidgetFromScene(label); + } +} + +if (!framework.IsHeadless()) +{ + label = new QLabel(); + label.styleSheet = "QLabel { background-color: rgba(230,230,230,170); font-size: 16px; padding: 10px; }"; + label.text = "This scene and its script MumbleApplication.js demonstrates adding VOIP support to your scene.

" + + "Tundras MumblePlugin provides a Mumble client that can connect to Murmur servers.
" + + "You can get this server and host it yourself: http://www.mumble.com/
" + + "Remember to check 'Install Murmur component' in the installer, the server is not installed by default.
" + + "See murmur.ini for configuring and murmur executable to run the server.

" + + "Once your server is up, use the client UI in Tundra to connect to your server.
" + + "Read more on what you can do with MumblePlugin in the MumbleApplication.js and the Tundra documentation."; + + proxy = ui.AddWidgetToScene(label); + proxy.pos = new QPointF(10, 10); + proxy.windowFlags = 0; + proxy.visible = true; +} \ No newline at end of file diff --git a/Mumble/scene.txml b/Mumble/scene.txml new file mode 100644 index 0000000..ee2672a --- /dev/null +++ b/Mumble/scene.txml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mumble/voice-active.png b/Mumble/voice-active.png new file mode 100644 index 0000000000000000000000000000000000000000..d28135d6676494f0a00da7c5f6497f1f2ce76765 GIT binary patch literal 4310 zcmV;{5Gn78P)004&%004{+008|`004nN004b?008NW002DY000@xb3BE2000U( zX+uL$P-t&-Z*ypGa3D!TLm+T+Z)Rz1WdHz3$DNjUR8-d%htIutdZEoQ(iwV_E---f zE+8EQQ5a?h7|H;{3{7l^s6a#!5dlSzpnw6Rp-8NVVj(D~U=K(TP+~BOsHkK{)=GSN zdGF=r_s6~8+Gp=`_t|@&wJrc8PaiHX1(pIJnJ3@}dN|Wpg-6h_{Qw4dfB~ieFj?uT zzCrH6KqN0W7kawL3H*!R3;{^|zGdj?Pp5H0=h0sk8Wyh&7ga7GLtw0fuTQ>mB{3?=`JbBsZ3rr0E=h-EE#ca>7pWA znp#_08k!lIeo?6Zy7)IG?(HJI3i#YJh}QRq?XUb&>HuKOifXg#4_nNB06Mk;Ab0-{ zo8}<^Bt?B|zwyO+XySQ^7YI^qjEyrhGmW?$mXWxizw3WG{0)8aJtOgUzn6#Z%86wP zlLT~e-B>9}DMCIyJ(bDg&<+1Q#Q!+(uk%&0*raG}W_n!s* z`>t?__>spaFD&Aut10z!o?HH?RWufnX30 z)&drY2g!gBGC?lb3<^LI*ah~2N>BspK_h4ZCqM@{4K9Go;5xVo?tlki1dM~{UdPU)xj{ZqAQTQoLvauf5<ZgZNI6o6v>;tbFLDbRL8g&+C=7~%qN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pSQUv`jS5;0tCpQd0bti6*pCnUuo!OGvvkXL8F3yIP%sB$f4tK()BOiUGKyenp zOj3%1s>o8nN&tf@7i`i_3B6S!xe4GaZeWyE%*%jPE?73KbHLEJG-Ts|AsdFVbqt$U zA$7oF0AmXyoG`X9xEPRK5()%tVo`r66s`g|%ngjJROnKV%R6$QjA5Bh7#Cq4TL{>! znod|eEM(YJSQuk;=7n;&@^Zt9I$>`X0$3_-0?^wH#6P2xYE?fQpwhK*yXVEQzVdRF z!)2jE8N&c_z;?+g*d!G9c$o7`RbQ>PXPr;(_#$66~UJP^Q#V{?J_)s}|!9sScD7x&$dssKS z&vzpZ1STFHd?(dD808Qh`-{sF4H)mQ-g!-O=H*h$6YNmYo?Z6QY4ieQs87RQD^HR!4C@-Y|x1xLj?(Z1asdH?_b07*qoM6N<$ Ef*KJSH2?qr literal 0 HcmV?d00001 diff --git a/Mumble/voice-inactive.png b/Mumble/voice-inactive.png new file mode 100644 index 0000000000000000000000000000000000000000..7671bba3732dae9f726210fda20b686f761fbb26 GIT binary patch literal 3938 zcmV-o51sIdP)004&%004{+008|`004nN004b?008NW002DY000@xb3BE2000U( zX+uL$P-t&-Z*ypGa3D!TLm+T+Z)Rz1WdHz3$DNjUR8-d%htIutdZEoQ(iwV_E---f zE+8EQQ5a?h7|H;{3{7l^s6a#!5dlSzpnw6Rp-8NVVj(D~U=K(TP+~BOsHkK{)=GSN zdGF=r_s6~8+Gp=`_t|@&wJrc8PaiHX1(pIJnJ3@}dN|Wpg-6h_{Qw4dfB~ieFj?uT zzCrH6KqN0W7kawL3H*!R3;{^|zGdj?Pp5H0=h0sk8Wyh&7ga7GLtw0fuTQ>mB{3?=`JbBsZ3rr0E=h-EE#ca>7pWA znp#_08k!lIeo?6Zy7)IG?(HJI3i#YJh}QRq?XUb&>HuKOifXg#4_nNB06Mk;Ab0-{ zo8}<^Bt?B|zwyO+XySQ^7YI^qjEyrhGmW?$mXWxizw3WG{0)8aJtOgUzn6#Z%86wP zlLT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uYq^zt=%FD}X^A3V^1<)g2P)r<7 zNJwyvkB@uxi!kTXXF8L@yY`NN8y2LjXVZ0HdR$T`X#>vMM2nK_HAlFtF_GY^}(^sLEJKRj4V1A^j2( z67m?pb5={MSk#2T#M|`7q>lZeb%bSPWJp?Cnxv$pXbTC$MXoI*3^r;Q0z=?W0Dj^D z;)hsRwM%8bU`!oh#=`wzR7Ds;2#X##7Iy(W=>g)OFR=5cCf?S5nTXqA_I?=)?J#Zt zudb_JmpNamDDW+T{`6}vn6c0(qe@x~V9aaR8-C0NY{wc7(=QW_z4~RsVYQJ^_7uPI zb#?qTASORRZ@#BWf5Tz=WmiTR&mfMLoGSMdEh zYQD4YD+-6y35CxIlrYF=MG?>9r)JAqW5ra98mZhj)>xo!gI!c*v}Us z>>EK;#kCl_n7Mn|2sD8 zX6pThSr_8L4`FdBl-KmPHPkd>J__Tk*Xzfh!f$HL-;2>fWkKNK?EnA(07*qoM6N<$g0!xM1poj5 literal 0 HcmV?d00001 From 5ba6d59b776ab34aa39860ed31e27d69bf55e4ae Mon Sep 17 00:00:00 2001 From: huxiaori Date: Wed, 5 Dec 2012 08:29:29 +0800 Subject: [PATCH 06/13] add file createRefFile and need to integrate it into MainMenu.js late --- CreateRefFile.js | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 CreateRefFile.js diff --git a/CreateRefFile.js b/CreateRefFile.js new file mode 100644 index 0000000..48cac9c --- /dev/null +++ b/CreateRefFile.js @@ -0,0 +1,57 @@ + + + + + + + + + + + From 1592905b6e520e521a49b9d20155a8aac533be28 Mon Sep 17 00:00:00 2001 From: huxiaori Date: Wed, 5 Dec 2012 08:48:51 +0800 Subject: [PATCH 07/13] add file createRefFile and need to integrate it into MainMenu.js late --- CreateRefFile.js | 21 ++++++++------- CreateRefFile.js.bak | 61 ++++++++++++++++++++++++++++++++++++++++++++ Ref.js | 42 ++++++++++++++++++++++++++++++ 3 files changed, 115 insertions(+), 9 deletions(-) create mode 100644 CreateRefFile.js.bak create mode 100644 Ref.js diff --git a/CreateRefFile.js b/CreateRefFile.js index 48cac9c..bfa9e24 100644 --- a/CreateRefFile.js +++ b/CreateRefFile.js @@ -12,24 +12,26 @@ var SpecialEffects = ["Fire", "Smoke", "FireWorks", "PinkElephant", "BlackMonoli var Prop = [Scenes,Backgrounds,Elements,Objects,ManMade,SpecialEffects]; var fileName = "/Ref.js"; + +// this function fits the URL, function getCurrentDirectory(fileName) { var syspath = location.href; -syspath = syspath.toLowerCase(); //°Ñ·¾¶Ãû³Æ×ª»»³ÉСд -myPosition = syspath.lastIndexOf("/"); // »ñÈ¡Îļþ·¾¶ÖеÄ×îºóÒ»¸ö"/" +syspath = syspath.toLowerCase(); +myPosition = syspath.lastIndexOf("/"); // get the last character of "/" in the file path -syspath = syspath.substring(0,parseInt(myPosition)+1); // ʹÓÃsubstringº¯Êý ½ØÈ¡"/"֮ǰµÄ×Ö·û´®£¬¾ÍµÃµ½µ±Ç°Ä¿Â¼µÄ·¾¶ +syspath = syspath.substring(0,parseInt(myPosition)+1); // get the string before the last character of "/" -syspath = syspath.replace("file:///",""); //ÕâÀïÒª°Ñfile:///Ìæ»»Îª¿Õ£¬·ñÔò»á±¨´í +syspath = syspath.replace("file:///",""); // replace the "file:///" with space character -syspath = syspath.replace(new RegExp("%20","gm")," "); // Èç¹ûÎļþÃûÖк¬Óпոñ£¬ÔòÒª»¹Ô­¿Õ¸ñ£¬Ìæ»»ËùÓÐµÄ %20 Ϊ " " +syspath = syspath.replace(new RegExp("%20","gm")," "); // the space in the URL, it appear in the format of "%20", but the path of computure should use space character, -syspath = syspath + fileName; +syspath = syspath + fileName; // get the full name of file path (incldes file name) return syspath.toString(); } -function WriteJs() +function CreateRefFile() { var fso, tf; fso = new ActiveXObject("Scripting.FileSystemObject"); @@ -44,14 +46,15 @@ function WriteJs() } tf.Close(); - } + + - + diff --git a/CreateRefFile.js.bak b/CreateRefFile.js.bak new file mode 100644 index 0000000..91d7464 --- /dev/null +++ b/CreateRefFile.js.bak @@ -0,0 +1,61 @@ + + + + + + + + + + + diff --git a/Ref.js b/Ref.js new file mode 100644 index 0000000..fc7e990 --- /dev/null +++ b/Ref.js @@ -0,0 +1,42 @@ +//!ref: Props/Winter.txml +//!ref: Props/Mountains.txml +//!ref: Props/Meadow.txml +//!ref: Props/Forest.txml +//!ref: Props/City.txml +//!ref: Props/Beach.txml +//!ref: Props/Room.txml +//!ref: Props/NightSky.txml +//!ref: Props/DaySky.txml +//!ref: Props/Sunset.txml +//!ref: Props/Clouds.txml +//!ref: Props/Sun.txml +//!ref: Props/Moon.txml +//!ref: Props/Rainbow.txml +//!ref: Props/SnowFlakes.txml +//!ref: Props/Rain.txml +//!ref: Props/Volcano.txml +//!ref: Props/PalmTrees.txml +//!ref: Props/Butterflies.txml +//!ref: Props/Mushroom.txml +//!ref: Props/Tree1.txml +//!ref: Props/Tree2.txml +//!ref: Props/Rocks.txml +//!ref: Props/Walrus.txml +//!ref: Props/Bunnies.txml +//!ref: Props/Mob.txml +//!ref: Props/SnowMan.txml +//!ref: Props/SandCastle.txml +//!ref: Props/Rocket.txml +//!ref: Props/Parasol.txml +//!ref: Props/SandToys.txml +//!ref: Props/Tombstone.txml +//!ref: Props/Pirates.txml +//!ref: Props/Car.txml +//!ref: Props/Treasure.txml +//!ref: Props/Fire.txml +//!ref: Props/Smoke.txml +//!ref: Props/FireWorks.txml +//!ref: Props/PinkElephant.txml +//!ref: Props/BlackMonolith.txml +//!ref: Props/UFO.txml +//!ref: Props/Hearts.txml From b638880d0ea503154b8a58038353be89104075cf Mon Sep 17 00:00:00 2001 From: huxiaori Date: Wed, 5 Dec 2012 08:53:21 +0800 Subject: [PATCH 08/13] remove the useless backup file of CreateRefFile --- CreateRefFile.js.bak | 61 -------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 CreateRefFile.js.bak diff --git a/CreateRefFile.js.bak b/CreateRefFile.js.bak deleted file mode 100644 index 91d7464..0000000 --- a/CreateRefFile.js.bak +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - From 1da8efd68593d2034a98973e3225fd2807e7aa9f Mon Sep 17 00:00:00 2001 From: huxiaori Date: Fri, 7 Dec 2012 12:47:24 +0200 Subject: [PATCH 09/13] chage the GUI color and modify the MainMenu.js --- Background.ui | 6 +- Effect.ui | 7 +- Element.ui | 6 +- MainMenu.js | 55 +++- MainMenu.js.bak | 702 ++++++++++++++++++++++++++++++++++++++++++++++++ MainMenu.ui | 29 +- MainMenu_bak.js | 702 ++++++++++++++++++++++++++++++++++++++++++++++++ ManMade.ui | 7 +- Object.ui | 7 +- Prop.ui | 494 ++++++++++++++++++++++++++++++++++ PropType.ui | 71 ++++- Ref.js | 42 --- Scene.ui | 3 +- 13 files changed, 2045 insertions(+), 86 deletions(-) create mode 100644 MainMenu.js.bak create mode 100644 MainMenu_bak.js create mode 100644 Prop.ui delete mode 100644 Ref.js diff --git a/Background.ui b/Background.ui index 7245eca..4a1fe96 100644 --- a/Background.ui +++ b/Background.ui @@ -15,7 +15,8 @@ QWidget#Background { background-color: transparent; } -QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} +QFrame#frame { background-color: rgba(33, 217, 229, 200); + border-radius: 12px;} @@ -28,8 +29,7 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} - QWidget#Background{ background-color: transparent;} -QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } + QFrame::StyledPanel diff --git a/Effect.ui b/Effect.ui index 0156eb9..2dc34a6 100644 --- a/Effect.ui +++ b/Effect.ui @@ -18,7 +18,8 @@ QWidget#Effect{ background-color: transparent;} -QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } +QFrame#frame { background-color: rgba(237,29,63,200); + border-radius: 12px;} @@ -40,12 +41,12 @@ QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } 12 2 - 54 + 81 20 - <html><head/><body><p><span style=" color:#ffffff;">Effects:</span></p></body></html> + <html><head/><body><p><span style=" color:#ffffff;">SPECIAL_FX:</span></p></body></html> diff --git a/Element.ui b/Element.ui index b479e5f..017d4ae 100644 --- a/Element.ui +++ b/Element.ui @@ -18,7 +18,7 @@ QWidget#Element{ background-color: transparent;} -QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } +QFrame#frame{ background-color: rgba(21,122,69,200); border-radius: 15px; } @@ -40,12 +40,12 @@ QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } 12 2 - 54 + 111 20 - <html><head/><body><p><span style=" color:#ffffff;">Elements:</span></p></body></html> + <html><head/><body><p><span style=" color:#ffffff;">NATURAL_ELEMENTS:</span></p></body></html> diff --git a/MainMenu.js b/MainMenu.js index 4cf44a1..d7628de 100644 --- a/MainMenu.js +++ b/MainMenu.js @@ -1,5 +1,5 @@ -engine.IncludeFile("local://RefFiles.js"); + engine.ImportExtension("qt.core"); @@ -46,13 +46,15 @@ Use these to get added properties into right positions. Divided into 3 groups. var Scenes = ["Winter", "Mountains", "Meadow", "Forest", "City", "Beach", "Room"]; var Backgrounds = ["NightSky", "DaySky", "Sunset"]; -var Elements =["Clouds", "Sun", "Moon", "Rainbow", "SnowFlakes", "Rain", "Volcano"]; -var Objects = ["PalmTrees", "Butterflies", "Mushroom", "Tree1", "Tree2", "Rocks", "Walrus", "Bunnies"]; -var ManMade = ["Mob", "SnowMan", "SandCastle", "Rocket", "Parasol", "SandToys", "Tombstone", "Pirates", "Car", "Treasure"]; -var SpecialEffects = ["Fire", "Smoke", "FireWorks", "PinkElephant", "BlackMonolith", "UFO", "Hearts"]; +var Elements =["Clouds", "Sun", "Moon", "Volcano"]; +var Objects = ["PalmTrees", "Butterflies", "Walrus"]; +var ManMade = ["Rocket", "SandToys", "Tombstone", "Treasure"]; +var SpecialEffects = ["UFO"]; var PropType = ["Element","Object","ManMade","Effect"]; +var AllEffect = [Scenes,Backgrounds,Elements,Objects,ManMade,SpecialEffects]; +var fileName = "/Ref.js"; var ScenePos = [ position1 = {x : -53.98, y: 10.25, z: -73.77}, @@ -643,6 +645,46 @@ function RemoveAllEntities(){ +/* +// this function fits the URL, +function getCurrentDirectory(fileName) +{ +var syspath = location.href; +syspath = syspath.toLowerCase(); +myPosition = syspath.lastIndexOf("/"); // get the last character of "/" in the file path + +syspath = syspath.substring(0,parseInt(myPosition)+1); // get the string before the last character of "/" + +syspath = syspath.replace("file:///",""); // replace the "file:///" with space character + +syspath = syspath.replace(new RegExp("%20","gm")," "); // the space in the URL, it appear in the format of "%20", but the path of computure should use space character, + +syspath = syspath + fileName; // get the full name of file path (incldes file name) + +return syspath.toString(); +} +*/ +function CreateRefFile() +{ + var fso, tf; + fso = new ActiveXObject("Scripting.FileSystemObject"); + //var pathName = getCurrentDirectory(fileName); + var pathName = "local://Ref.js"; + tf = fso.OpenTextFile(pathName); + for(var i=0; i 0){ + EnableAnims(); + }else + frame.DelayedExecute(1.0).Triggered.connect(EnableAnims); +} + +/* +Animations have to be named 'SceneAnim' or 'PropAnim'. +This function is launched when animations have been loaded into the entity and they are usable. +In this.Positions array 0 = Scene Placement, 1 = Prop Placement and 2 = Background placement +*/ + + +function rnd(n){ + seed = new Date().getTime(); + seed = (seed*9301+49297) % 233280; + return (Math.floor((seed/(233280.0)* n))); +} + +function LoadXML (text){ + + /* + effectArray holds all possible props, scenes or backgrounds that can be added into the 3d world with GUI. The name in array has to be exact same as + the name of the file in /Props/ folder. variable text is GUI's text of chosen button and is used to compare. Use the table made my Tomi & Paula to get + right names for effectArray. + */ + + if(text == null || text == ""){ + console.LogInfo("You havn't selected any effect"); + } + else + { + //Load entity from file, inside Props folder. assets[0] is entity, so scene.LoadSceneXML returns array. + //Create a dynamiccomponent for the entity to check if it has been placed into the world already. This way we wont place them again when adding an new entity. + var assets = scene.LoadSceneXML(asset.GetAsset("Props/" + text + ".txml").DiskSource(), false, false, 0); + var ent = assets[0]; + var id = assets[0].id; + console.LogInfo(ent.name, ent, assets[0].name); + ent.placeable.visible = false; + ent.dynamiccomponent.CreateAttribute('bool', 'Placed'); + if(!ent.animationcontroller && ent.dynamiccomponent.GetAttribute('Placed') == false) + CheckPlacement(ent); + else if(ent.dynamiccomponent.GetAttribute('Placed') == false) + CheckAnims(ent); + } +} + + + +function CheckPlacement(ent){ + //CASE1: Entity has no animations and is not placed yet. We place it and set placed to true, depending on if its prop, scene or background. + //TODO: An array for multiple different locations that the entity can be added in. + if(ent.dynamiccomponent.name == "Prop" || ent.dynamiccomponent.name == "prop"){ + if(ent.dynamiccomponent.GetAttribute('Type') == 'Ground'){ + var idx = rnd(this.Positions[1].length); + var pos = this.Positions[1][idx]; + + }else if(ent.dynamiccomponent.GetAttribute('Type') == 'Sky'){ + var idx = rnd(this.Positions[2].length); + var pos = this.Positions[2][idx]; + }else { + console.LogInfo('DynamicComponent Type: Ground or sky missing'); + var pos = this.Positions[2][1]; + } + + var tm = ent.placeable.transform; + tm.pos.x = pos.x; + tm.pos.y = pos.y; + tm.pos.z = pos.z; + ent.placeable.transform = tm; + ent.placeable.visible = true; + ent.dynamiccomponent.SetAttribute('Placed', true); + + }else if (ent.dynamiccomponent.name == "Scene" || ent.dynamiccomponent.name == "scene"){ + var idx = rnd(this.Positions[0].length); + var pos = this.Positions[0][idx]; + var tm = ent.placeable.transform; + tm.pos.x = pos.x; + tm.pos.y = pos.y; + tm.pos.z = pos.z; + ent.placeable.transform = tm; + ent.placeable.visible = true; + ent.dynamiccomponent.SetAttribute('Placed', true); + + }else if(ent.dynamiccomponent.name == "Background" || ent.dynamiccomponent.name == "background"){ + var idx = rnd(this.Positions[3].length); + var pos = this.Positions[3][idx]; + var tm = ent.placeable.transform; + tm.pos.x = pos.x; + tm.pos.y = pos.y; + tm.pos.z = pos.z; + tm.rot.y = 180; + ent.placeable.transform = tm; + ent.placeable.visible = true; + ent.dynamiccomponent.SetAttribute('Placed', true); + } + +} + +function EnableAnims(ent){ + for(i=0; i QWidget#MainMenu { background-color: transparent; } -QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} +QFrame#frame { background-color: rgba(33, 217, 229, 200); + border-radius: 12px;} @@ -42,24 +43,30 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} - 14 - 84 - 75 - 20 + 5 + 18 + 93 + 30 true - Background + BackGround + + + + 16 + 16 + - 14 - 53 + 13 + 80 75 20 @@ -68,14 +75,14 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} true - Prop + PROPS 14 - 21 + 49 75 20 @@ -87,7 +94,7 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} - Scene + SCENE diff --git a/MainMenu_bak.js b/MainMenu_bak.js new file mode 100644 index 0000000..14878a5 --- /dev/null +++ b/MainMenu_bak.js @@ -0,0 +1,702 @@ + + + + +engine.ImportExtension("qt.core"); +engine.ImportExtension("qt.gui"); +//engine.ImportExtension("qt.uitools"); + +/* + * MainMenu includes the submenus(background, prop, scene, clearMenu, clearEntity) + * When you click the buttons ( background, prop, scene) on the interface of MainMenu, it will popup the corresponding submenu at right side of MainMenu + * when you click the button (clearMenu) on the interface of MainMenu, it will hind the submenu in the screen + * when you click the button (clearEntity) on the interface of MainMenu, it will clear all the entities in the scene. + */ + +var SceneList_visible = false; +var BackgroundList_visible = false; +var PropType_visible = false; + +var ElementList_visible = false; +var ObjectList_visible = false; +var EffectList_visible = false; +var ManMadeList_visible = false; + +var CurrentClickedItemName = null; + +var PropTypeProxy = null; +var SceneProxy = null; +var BackgroundProxy = null; +var ElementProxy = null; +var ObjectProxy = null; +var ManMadeProxy = null; +var EffectProxy = null; + +var _SceneListWidget = null; +//var _PropListWidget = null; +var _BackgroundListWidget = null; +var _ElementListWidget = null; +var _ObjectListWidget = null; +var _ManMadeListWidget = null; +var _EffectListWidget = null; + +/* +Use these to get added properties into right positions. Divided into 3 groups. +*/ + +var Scenes = ["Winter", "Mountains", "Meadow", "Forest", "City", "Beach", "Room"]; +var Backgrounds = ["NightSky", "DaySky", "Sunset"]; +var Elements =["Clouds", "Sun", "Moon", "Rainbow", "SnowFlakes", "Rain", "Volcano"]; +var Objects = ["PalmTrees", "Butterflies", "Mushroom", "Tree1", "Tree2", "Rocks", "Walrus", "Bunnies"]; +var ManMade = ["Mob", "SnowMan", "SandCastle", "Rocket", "Parasol", "SandToys", "Tombstone", "Pirates", "Car", "Treasure"]; +var SpecialEffects = ["Fire", "Smoke", "FireWorks", "PinkElephant", "BlackMonolith", "UFO", "Hearts"]; + +var PropType = ["Element","Object","ManMade","Effect"]; + +var AllEffect = [Scenes,Backgrounds,Elements,Objects,ManMade,SpecialEffects]; +var fileName = "/Ref.js"; + +var ScenePos = [ +position1 = {x : -53.98, y: 10.25, z: -73.77}, +position2 = {x : -60.98, y: 7.75, z: -73.77} +]; + +var SkyPropPos = [ +Skyposition1 = {x: -57.33, y: 16.57, z: -79.25}, +Skyposition2 = {x: -53.33, y: 17.07, z: -67.75} +]; + +var GroundPropPos = [ + Groundposition1 = {x: -61.72, y:9.60, z:-67.75}, + //Groundposition2 = {x: ,y: ,z: } + +]; + +var BackgPos = [ +position1 = {x:-52.40 ,y:13.29 ,z:-73.83} +]; + +this.Positions = [ScenePos, GroundPropPos, SkyPropPos, BackgPos]; + + + +function Init() +{ +// load the file "MainMenu.ui" + var _widget = ui.LoadFromFile("Scripts/MainMenu.ui", false); + + var _PropBtn = findChild(_widget, "PropBtn"); + _PropBtn.pressed.connect(PropBtnClicked); // listening to the singal of prop button clicked + + var _SceneBtn = findChild(_widget, "SceneBtn"); + _SceneBtn.pressed.connect(SceneBtnClicked); // listening to the singal of SceneBtn button clicked + + var _BackgroundBtn = findChild(_widget, "BackgroundBtn"); + _BackgroundBtn.pressed.connect(BackgroundBtnClicked); // listening to the singal of background button clicked + + var _ClearMenuBtn = findChild(_widget, "ClearMenuBtn"); + _ClearMenuBtn.pressed.connect(ClearMenuBtnClicked); // listering to the singal of clean menu button clicked + + var _ClearEntityBtn = findChild(_widget,"ClearEntityBtn"); + _ClearEntityBtn.pressed.connect(RemoveAllEntities); // listering to the singal of clean entity button clicked + + var _RandomBtn = findChild(_widget,"RandomBtn"); + _RandomBtn.pressed.connect(RandomButtonClicked); //TODO the function Random() + + //Add connects to elements, man made, special effectts and object buttons. + + var MenuProxy = new UiProxyWidget(_widget); + + ui.AddProxyWidgetToScene(MenuProxy); + MenuProxy.visible = true; + MenuProxy.windowFlags = 0; + + MenuProxy.x = 860; + MenuProxy.y = 25; + +// load the file "Scene.ui" + var _SceneWidget = ui.LoadFromFile("Scripts/Scene.ui", false); + + _SceneListWidget = findChild(_SceneWidget, "SceneListWidget"); + _SceneListWidget.itemDoubleClicked.connect(SceneListItemDoubleClicked); + + SceneProxy = new UiProxyWidget(_SceneWidget); + + ui.AddProxyWidgetToScene(SceneProxy); + SceneProxy.visible = SceneList_visible; // set the SceneList_visibe = false; + SceneProxy.windowFlags = 0; + + SceneProxy.x = 965; // they should be caculated late + SceneProxy.y = 25; + +// load the file "Background.ui" + var _BackgroundWidget = ui.LoadFromFile("Scripts/Background.ui", false); + + _BackgroundListWidget = findChild(_BackgroundWidget,"BackgroundListWidget"); + _BackgroundListWidget.itemDoubleClicked.connect(BackgroundListItemDoubleClicked); // listen to the event of item double clicked in BackgroundListWidget + + BackgroundProxy = new UiProxyWidget(_BackgroundWidget); + + ui.AddProxyWidgetToScene(BackgroundProxy); + BackgroundProxy.visible = BackgroundList_visible; + BackgroundProxy.windowFlags = 0; + + BackgroundProxy.x = 965; // they should be caculated late + BackgroundProxy.y = 25; + + + +// load the file "PropType.ui" + var _PropTypeWidget = ui.LoadFromFile("Scripts/PropType.ui", false); +// TODO check the ElementBtnClicked() wehther we can take param in () or not, if it can, then we can use variable(var) replace concrete button name, e.g. varBtnClicked +// in that case, we just need only one function to deal with the event of button clicked. + _ElementBtn = findChild(_PropTypeWidget,"ElementBtn"); + _ElementBtn.pressed.connect(ElementBtnClicked); // listen to the event of Element button clicked in PropTypeWidget + + _ObjectBtn = findChild(_PropTypeWidget,"ObjectBtn"); + _ObjectBtn.pressed.connect(ObjectBtnClicked); // listen to the event of Object button clicked in PropTypeWidget + + _ManMadeBtn = findChild(_PropTypeWidget,"ManMadeBtn"); + _ManMadeBtn.pressed.connect(ManMadeBtnClicked); // listen to the event of ManMade button clicked in PropTypeWidget + + _EffectBtn = findChild(_PropTypeWidget,"EffectBtn"); + _EffectBtn.pressed.connect(EffectBtnClicked); // listen to the event of Effect button clicked in PropTypeWidget + + + PropTypeProxy = new UiProxyWidget(_PropTypeWidget); + + ui.AddProxyWidgetToScene(PropTypeProxy); + PropTypeProxy.visible = PropType_visible; + PropTypeProxy.windowFlags = 0; + + PropTypeProxy.x = 965; // they should be caculated late + PropTypeProxy.y = 25; + + +// load the file "Element.ui" + var _ElementWidget = ui.LoadFromFile("Scripts/Element.ui", false); + + _ElementListWidget = findChild(_ElementWidget,"ElementListWidget"); + _ElementListWidget.itemDoubleClicked.connect(ElementListItemDoubleClicked); // listen to the event of item double clicked in ElementListWidget + + ElementProxy = new UiProxyWidget(_ElementWidget); + + ui.AddProxyWidgetToScene(ElementProxy); + ElementProxy.visible = ElementList_visible; + ElementProxy.windowFlags = 0; + + ElementProxy.x = 965 + 105; // they should be caculated late + ElementProxy.y = 25 + 13; + +// load the file "Object.ui" + var _ObjectWidget = ui.LoadFromFile("Scripts/Object.ui", false); + + _ObjectListWidget = findChild(_ObjectWidget,"ObjectListWidget"); + _ObjectListWidget.itemDoubleClicked.connect(ObjectListItemDoubleClicked); // listen to the event of item double clicked in ObjectListWidget + + ObjectProxy = new UiProxyWidget(_ObjectWidget); + + ui.AddProxyWidgetToScene(ObjectProxy); + ObjectProxy.visible = ObjectList_visible; + ObjectProxy.windowFlags = 0; + + ObjectProxy.x = 965 + 105; // they should be caculated late + ObjectProxy.y = 25 + 13 ; + +// load the file "ManMade.ui" + var _ManMadeWidget = ui.LoadFromFile("Scripts/ManMade.ui", false); + + _ManMadeListWidget = findChild(_ManMadeWidget,"ManMadeListWidget"); + _ManMadeListWidget.itemDoubleClicked.connect(ManMadeListItemDoubleClicked); // listen to the event of item double clicked in ManMadeListWidget + + ManMadeProxy = new UiProxyWidget(_ManMadeWidget); + + ui.AddProxyWidgetToScene(ManMadeProxy); + ManMadeProxy.visible = ManMadeList_visible; + ManMadeProxy.windowFlags = 0; + + ManMadeProxy.x = 965 + 105; // they should be caculated late + ManMadeProxy.y = 25 + 13 ; + +// load the file "Effect.ui" + var _EffectWidget = ui.LoadFromFile("Scripts/Effect.ui", false); + + _EffectListWidget = findChild(_EffectWidget,"EffectListWidget"); + _EffectListWidget.itemDoubleClicked.connect(EffectListItemDoubleClicked); // listen to the event of item double clicked in EffectListWidget + + EffectProxy = new UiProxyWidget(_EffectWidget); + + ui.AddProxyWidgetToScene(EffectProxy); + EffectProxy.visible = EffectList_visible; + EffectProxy.windowFlags = 0; + + EffectProxy.x = 965 + 105; // they should be caculated late + EffectProxy.y = 25 + 13 ; + + +} + + // when scene button and background button are clicked, then it should hide all sub menus of proptype + /* function clearPropTypeMenu(){ + for(var i= 0; i 0){ + EnableAnims(); + }else + frame.DelayedExecute(1.0).Triggered.connect(EnableAnims); +} + +/* +Animations have to be named 'SceneAnim' or 'PropAnim'. +This function is launched when animations have been loaded into the entity and they are usable. +In this.Positions array 0 = Scene Placement, 1 = Prop Placement and 2 = Background placement +*/ + + +function rnd(n){ + seed = new Date().getTime(); + seed = (seed*9301+49297) % 233280; + return (Math.floor((seed/(233280.0)* n))); +} + +function LoadXML (text){ + + /* + effectArray holds all possible props, scenes or backgrounds that can be added into the 3d world with GUI. The name in array has to be exact same as + the name of the file in /Props/ folder. variable text is GUI's text of chosen button and is used to compare. Use the table made my Tomi & Paula to get + right names for effectArray. + */ + + if(text == null || text == ""){ + console.LogInfo("You havn't selected any effect"); + } + else + { + //Load entity from file, inside Props folder. assets[0] is entity, so scene.LoadSceneXML returns array. + //Create a dynamiccomponent for the entity to check if it has been placed into the world already. This way we wont place them again when adding an new entity. + var assets = scene.LoadSceneXML(asset.GetAsset("Props/" + text + ".txml").DiskSource(), false, false, 0); + var ent = assets[0]; + var id = assets[0].id; + console.LogInfo(ent.name, ent, assets[0].name); + ent.placeable.visible = false; + ent.dynamiccomponent.CreateAttribute('bool', 'Placed'); + if(!ent.animationcontroller && ent.dynamiccomponent.GetAttribute('Placed') == false) + CheckPlacement(ent); + else if(ent.dynamiccomponent.GetAttribute('Placed') == false) + CheckAnims(ent); + } +} + + + +function CheckPlacement(ent){ + //CASE1: Entity has no animations and is not placed yet. We place it and set placed to true, depending on if its prop, scene or background. + //TODO: An array for multiple different locations that the entity can be added in. + if(ent.dynamiccomponent.name == "Prop" || ent.dynamiccomponent.name == "prop"){ + if(ent.dynamiccomponent.GetAttribute('Type') == 'Ground'){ + var idx = rnd(this.Positions[1].length); + var pos = this.Positions[1][idx]; + + }else if(ent.dynamiccomponent.GetAttribute('Type') == 'Sky'){ + var idx = rnd(this.Positions[2].length); + var pos = this.Positions[2][idx]; + }else { + console.LogInfo('DynamicComponent Type: Ground or sky missing'); + var pos = this.Positions[2][1]; + } + + var tm = ent.placeable.transform; + tm.pos.x = pos.x; + tm.pos.y = pos.y; + tm.pos.z = pos.z; + ent.placeable.transform = tm; + ent.placeable.visible = true; + ent.dynamiccomponent.SetAttribute('Placed', true); + + }else if (ent.dynamiccomponent.name == "Scene" || ent.dynamiccomponent.name == "scene"){ + var idx = rnd(this.Positions[0].length); + var pos = this.Positions[0][idx]; + var tm = ent.placeable.transform; + tm.pos.x = pos.x; + tm.pos.y = pos.y; + tm.pos.z = pos.z; + ent.placeable.transform = tm; + ent.placeable.visible = true; + ent.dynamiccomponent.SetAttribute('Placed', true); + + }else if(ent.dynamiccomponent.name == "Background" || ent.dynamiccomponent.name == "background"){ + var idx = rnd(this.Positions[3].length); + var pos = this.Positions[3][idx]; + var tm = ent.placeable.transform; + tm.pos.x = pos.x; + tm.pos.y = pos.y; + tm.pos.z = pos.z; + tm.rot.y = 180; + ent.placeable.transform = tm; + ent.placeable.visible = true; + ent.dynamiccomponent.SetAttribute('Placed', true); + } + +} + +function EnableAnims(ent){ + for(i=0; i QWidget#ManMade{ background-color: transparent;} -QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } +QFrame#frame { background-color: rgba(33, 217, 229, 200); + border-radius: 12px;} @@ -40,12 +41,12 @@ QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } 12 2 - 54 + 81 20 - <html><head/><body><p><span style=" color:#ffffff;">ManMade:</span></p></body></html> + <html><head/><body><p><span style=" color:#ffffff;">MAN_MADE:</span></p></body></html> diff --git a/Object.ui b/Object.ui index 7170acb..071bfd7 100644 --- a/Object.ui +++ b/Object.ui @@ -18,7 +18,8 @@ QWidget#Object{ background-color: transparent;} -QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } +QFrame#frame { background-color: rgba(36,217,87,200); + border-radius: 12px;} @@ -40,12 +41,12 @@ QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } 12 2 - 54 + 111 20 - <html><head/><body><p><span style=" color:#ffffff;">Objects:</span></p></body></html> + <html><head/><body><p><span style=" color:#ffffff;">NATURAL_OBJECTS:</span></p></body></html> diff --git a/Prop.ui b/Prop.ui new file mode 100644 index 0000000..14c8ffa --- /dev/null +++ b/Prop.ui @@ -0,0 +1,494 @@ + + + Prop + + + + 0 + 0 + 162 + 241 + + + + Form + + + QWidget#Prop{ background-color: transparent;} +QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } + + + + + 0 + 1 + 161 + 241 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 10 + 30 + 141 + 201 + + + + false + + + + Clouds + + + + + 0 + 0 + 0 + + + + + + + 85 + 0 + 255 + + + + + + + Sun + + + + + 0 + 0 + 0 + + + + + + + 85 + 0 + 255 + + + + + + + Moon + + + + + 85 + 0 + 255 + + + + + + + Rainbow + + + + + 85 + 0 + 255 + + + + + + + SnowFlakes + + + + + 85 + 0 + 255 + + + + + + + Rain + + + + + 85 + 0 + 255 + + + + + + + Volcano + + + + + 85 + 0 + 255 + + + + + + + + + + + + Palm Trees + + + + + 255 + 170 + 0 + + + + + + + Butterfries + + + + + 255 + 170 + 0 + + + + + + + Mushroom + + + + + 255 + 170 + 0 + + + + + + + Tree 1 + + + + + 255 + 170 + 0 + + + + + + + Tree 2 + + + + + 255 + 170 + 0 + + + + + + + Rocks + + + + + 255 + 170 + 0 + + + + + + + Walrus + + + + + 0 + 0 + 0 + + + + + + + 255 + 170 + 0 + + + + + + + + + + + + Mob + + + + + 0 + 0 + 0 + + + + + + + 0 + 170 + 0 + + + + + + + SnowMan + + + + + 0 + 170 + 0 + + + + + + + SandCastle + + + + + 0 + 170 + 0 + + + + + + + Rocket + + + + + 0 + 170 + 0 + + + + + + + Parasol + + + + + 0 + 170 + 0 + + + + + + + SandToys + + + + + 0 + 170 + 0 + + + + + + + Doorframe&Raven + + + + + 0 + 170 + 0 + + + + + + + Pirates + + + + + 0 + 170 + 0 + + + + + + + + + + + + Fire + + + + + 85 + 170 + 255 + + + + + + + Smoke + + + + + 85 + 170 + 255 + + + + + + + FireWorks + + + + + 85 + 170 + 255 + + + + + + + PinkElephant + + + + + 85 + 170 + 255 + + + + + + + BlakMonolith + + + + + 85 + 170 + 255 + + + + + + + + + 20 + 10 + 54 + 16 + + + + <html><head/><body><p><span style=" color:#ffffff;">Prop</span></p></body></html> + + + + + + + diff --git a/PropType.ui b/PropType.ui index b8869e3..39fb913 100644 --- a/PropType.ui +++ b/PropType.ui @@ -21,8 +21,57 @@ QWidget#PropTypesMenu { background-color: transparent; } -QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} - +QFrame#frame { background-color: rgba(33, 217, 229, 200); + border-radius: 12px;} +QPushButton#EffectBtn{ +color:black; +background-color: white; + border-width: 4px; + border-color: rgba(237,29,63,200); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 15px; +font:bold; + padding-left: 5px; + padding-right: 5px; + } + +QPushButton#ElementBtn +{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(21,122,69,200); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 15px; +font:bold; + padding-left: 5px; + padding-right: 5px; +} +QPushButton#ManMadeBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,200); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 15px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#ObjectBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(36,233,87,200); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 15px; +font:bold; + padding-left: 5px; + padding-right: 5px;} @@ -42,9 +91,9 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} - 12 + 5 99 - 81 + 91 31 @@ -58,9 +107,9 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} - 12 - 59 - 81 + 7 + 60 + 91 31 @@ -74,9 +123,9 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} - 12 + 8 21 - 81 + 91 31 @@ -93,9 +142,9 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} - 12 + 5 138 - 81 + 91 31 diff --git a/Ref.js b/Ref.js deleted file mode 100644 index fc7e990..0000000 --- a/Ref.js +++ /dev/null @@ -1,42 +0,0 @@ -//!ref: Props/Winter.txml -//!ref: Props/Mountains.txml -//!ref: Props/Meadow.txml -//!ref: Props/Forest.txml -//!ref: Props/City.txml -//!ref: Props/Beach.txml -//!ref: Props/Room.txml -//!ref: Props/NightSky.txml -//!ref: Props/DaySky.txml -//!ref: Props/Sunset.txml -//!ref: Props/Clouds.txml -//!ref: Props/Sun.txml -//!ref: Props/Moon.txml -//!ref: Props/Rainbow.txml -//!ref: Props/SnowFlakes.txml -//!ref: Props/Rain.txml -//!ref: Props/Volcano.txml -//!ref: Props/PalmTrees.txml -//!ref: Props/Butterflies.txml -//!ref: Props/Mushroom.txml -//!ref: Props/Tree1.txml -//!ref: Props/Tree2.txml -//!ref: Props/Rocks.txml -//!ref: Props/Walrus.txml -//!ref: Props/Bunnies.txml -//!ref: Props/Mob.txml -//!ref: Props/SnowMan.txml -//!ref: Props/SandCastle.txml -//!ref: Props/Rocket.txml -//!ref: Props/Parasol.txml -//!ref: Props/SandToys.txml -//!ref: Props/Tombstone.txml -//!ref: Props/Pirates.txml -//!ref: Props/Car.txml -//!ref: Props/Treasure.txml -//!ref: Props/Fire.txml -//!ref: Props/Smoke.txml -//!ref: Props/FireWorks.txml -//!ref: Props/PinkElephant.txml -//!ref: Props/BlackMonolith.txml -//!ref: Props/UFO.txml -//!ref: Props/Hearts.txml diff --git a/Scene.ui b/Scene.ui index 058c84a..a29c0fa 100644 --- a/Scene.ui +++ b/Scene.ui @@ -18,7 +18,8 @@ QWidget#Scene{ background-color: transparent;} -QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } +QFrame#frame { background-color: rgba(33, 217, 229, 200); + border-radius: 12px;} From f8adcbb66157b02a72ebd204345b02df338b1e38 Mon Sep 17 00:00:00 2001 From: huxiaori Date: Tue, 11 Dec 2012 14:26:28 +0200 Subject: [PATCH 10/13] New GUI are ready --- Background.ui | 19 +- Effect.ui | 2 +- Element.ui | 2 +- MainMenu.ui | 113 +++++++++--- ManMade.ui | 2 +- Object.ui | 2 +- Prop.ui | 494 -------------------------------------------------- PropType.ui | 16 +- RefFiles.js | 11 -- Scene.ui | 37 +--- 10 files changed, 105 insertions(+), 593 deletions(-) delete mode 100644 Prop.ui delete mode 100644 RefFiles.js diff --git a/Background.ui b/Background.ui index 4a1fe96..c591b2c 100644 --- a/Background.ui +++ b/Background.ui @@ -15,7 +15,7 @@ QWidget#Background { background-color: transparent; } -QFrame#frame { background-color: rgba(33, 217, 229, 200); +QFrame#frame { background-color: rgba(33, 217, 229, 150); border-radius: 12px;} @@ -46,21 +46,6 @@ QFrame#frame { background-color: rgba(33, 217, 229, 200); 161 - - - NightSky - - - - - DaySky - - - - - Sunset - - @@ -72,7 +57,7 @@ QFrame#frame { background-color: rgba(33, 217, 229, 200); - <html><head/><body><p><span style=" color:#ffffff;">Background</span></p></body></html> + <html><head/><body><p><span style=" color:#ffffff;">BACKGROUND:</span></p></body></html> diff --git a/Effect.ui b/Effect.ui index 2dc34a6..e09ab39 100644 --- a/Effect.ui +++ b/Effect.ui @@ -18,7 +18,7 @@ QWidget#Effect{ background-color: transparent;} -QFrame#frame { background-color: rgba(237,29,63,200); +QFrame#frame { background-color: rgba(237,29,63,150); border-radius: 12px;} diff --git a/Element.ui b/Element.ui index 017d4ae..3a8da6a 100644 --- a/Element.ui +++ b/Element.ui @@ -18,7 +18,7 @@ QWidget#Element{ background-color: transparent;} -QFrame#frame{ background-color: rgba(21,122,69,200); border-radius: 15px; } +QFrame#frame{ background-color: rgba(21,122,69,150); border-radius: 15px; } diff --git a/MainMenu.ui b/MainMenu.ui index d08d053..0a43bf9 100644 --- a/MainMenu.ui +++ b/MainMenu.ui @@ -21,8 +21,75 @@ QWidget#MainMenu { background-color: transparent; } -QFrame#frame { background-color: rgba(33, 217, 229, 200); +QFrame#frame { background-color: rgba(33, 217, 229,200); border-radius: 12px;} + +QPushButton#BackgroundBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#SceneBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#PropBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#ClearMenuBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#ClearEntityBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#RandomBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} @@ -43,8 +110,8 @@ QFrame#frame { background-color: rgba(33, 217, 229, 200); - 5 - 18 + 4 + 13 93 30 @@ -65,10 +132,10 @@ QFrame#frame { background-color: rgba(33, 217, 229, 200); - 13 - 80 - 75 - 20 + 4 + 75 + 93 + 30 @@ -81,10 +148,10 @@ QFrame#frame { background-color: rgba(33, 217, 229, 200); - 14 - 49 - 75 - 20 + 4 + 44 + 93 + 30 @@ -100,10 +167,10 @@ QFrame#frame { background-color: rgba(33, 217, 229, 200); - 14 - 116 - 75 - 20 + 4 + 107 + 93 + 30 @@ -119,10 +186,10 @@ QFrame#frame { background-color: rgba(33, 217, 229, 200); - 14 - 147 - 75 - 20 + 4 + 139 + 93 + 30 @@ -138,10 +205,10 @@ QFrame#frame { background-color: rgba(33, 217, 229, 200); - 14 - 180 - 75 - 20 + 4 + 170 + 93 + 30 diff --git a/ManMade.ui b/ManMade.ui index 10dae57..5358fd2 100644 --- a/ManMade.ui +++ b/ManMade.ui @@ -18,7 +18,7 @@ QWidget#ManMade{ background-color: transparent;} -QFrame#frame { background-color: rgba(33, 217, 229, 200); +QFrame#frame { background-color: rgba(33, 217, 229, 150); border-radius: 12px;} diff --git a/Object.ui b/Object.ui index 071bfd7..62be140 100644 --- a/Object.ui +++ b/Object.ui @@ -18,7 +18,7 @@ QWidget#Object{ background-color: transparent;} -QFrame#frame { background-color: rgba(36,217,87,200); +QFrame#frame { background-color: rgba(36,217,87,150); border-radius: 12px;} diff --git a/Prop.ui b/Prop.ui deleted file mode 100644 index 14c8ffa..0000000 --- a/Prop.ui +++ /dev/null @@ -1,494 +0,0 @@ - - - Prop - - - - 0 - 0 - 162 - 241 - - - - Form - - - QWidget#Prop{ background-color: transparent;} -QFrame#frame{ background-color: rgba(136, 136, 136, 200); border-radius: 15px; } - - - - - 0 - 1 - 161 - 241 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - 10 - 30 - 141 - 201 - - - - false - - - - Clouds - - - - - 0 - 0 - 0 - - - - - - - 85 - 0 - 255 - - - - - - - Sun - - - - - 0 - 0 - 0 - - - - - - - 85 - 0 - 255 - - - - - - - Moon - - - - - 85 - 0 - 255 - - - - - - - Rainbow - - - - - 85 - 0 - 255 - - - - - - - SnowFlakes - - - - - 85 - 0 - 255 - - - - - - - Rain - - - - - 85 - 0 - 255 - - - - - - - Volcano - - - - - 85 - 0 - 255 - - - - - - - - - - - - Palm Trees - - - - - 255 - 170 - 0 - - - - - - - Butterfries - - - - - 255 - 170 - 0 - - - - - - - Mushroom - - - - - 255 - 170 - 0 - - - - - - - Tree 1 - - - - - 255 - 170 - 0 - - - - - - - Tree 2 - - - - - 255 - 170 - 0 - - - - - - - Rocks - - - - - 255 - 170 - 0 - - - - - - - Walrus - - - - - 0 - 0 - 0 - - - - - - - 255 - 170 - 0 - - - - - - - - - - - - Mob - - - - - 0 - 0 - 0 - - - - - - - 0 - 170 - 0 - - - - - - - SnowMan - - - - - 0 - 170 - 0 - - - - - - - SandCastle - - - - - 0 - 170 - 0 - - - - - - - Rocket - - - - - 0 - 170 - 0 - - - - - - - Parasol - - - - - 0 - 170 - 0 - - - - - - - SandToys - - - - - 0 - 170 - 0 - - - - - - - Doorframe&Raven - - - - - 0 - 170 - 0 - - - - - - - Pirates - - - - - 0 - 170 - 0 - - - - - - - - - - - - Fire - - - - - 85 - 170 - 255 - - - - - - - Smoke - - - - - 85 - 170 - 255 - - - - - - - FireWorks - - - - - 85 - 170 - 255 - - - - - - - PinkElephant - - - - - 85 - 170 - 255 - - - - - - - BlakMonolith - - - - - 85 - 170 - 255 - - - - - - - - - 20 - 10 - 54 - 16 - - - - <html><head/><body><p><span style=" color:#ffffff;">Prop</span></p></body></html> - - - - - - - diff --git a/PropType.ui b/PropType.ui index 39fb913..930d34c 100644 --- a/PropType.ui +++ b/PropType.ui @@ -6,7 +6,7 @@ 0 0 - 103 + 102 192 @@ -21,13 +21,13 @@ QWidget#PropTypesMenu { background-color: transparent; } -QFrame#frame { background-color: rgba(33, 217, 229, 200); +QFrame#frame { background-color: rgba(33, 217, 229, 150); border-radius: 12px;} QPushButton#EffectBtn{ color:black; background-color: white; border-width: 4px; - border-color: rgba(237,29,63,200); + border-color: rgba(237,29,63,55); border-style: solid; border-radius: 7; padding: 3px; @@ -41,7 +41,7 @@ QPushButton#ElementBtn {color:black; background-color: white; border-width: 4px; - border-color: rgba(21,122,69,200); + border-color: rgba(21,122,69,55); border-style: solid; border-radius: 7; padding: 3px; @@ -53,7 +53,7 @@ font:bold; QPushButton#ManMadeBtn{color:black; background-color: white; border-width: 4px; - border-color: rgba(29,158,166,200); + border-color: rgba(29,158,166,55); border-style: solid; border-radius: 7; padding: 3px; @@ -64,7 +64,7 @@ font:bold; QPushButton#ObjectBtn{color:black; background-color: white; border-width: 4px; - border-color: rgba(36,233,87,200); + border-color: rgba(36,233,87,55); border-style: solid; border-radius: 7; padding: 3px; @@ -107,7 +107,7 @@ font:bold; - 7 + 5 60 91 31 @@ -123,7 +123,7 @@ font:bold; - 8 + 5 21 91 31 diff --git a/RefFiles.js b/RefFiles.js deleted file mode 100644 index 44efac6..0000000 --- a/RefFiles.js +++ /dev/null @@ -1,11 +0,0 @@ -//!ref: Scripts/Background.ui -//!ref: Scripts/Scene.ui -//!ref: Scripts/MainMenu.ui -//!ref: Scripts/PropType.ui -//!ref: Scripts/Element.ui -//!ref: Scripts/Object.ui -//!ref: Scripts/ManMade.ui -//!ref: Scripts/Effect.ui -//!ref: Props/Sun.txml -//!ref: Props/Car.txml -//!ref: Props/PalmTrees.txml \ No newline at end of file diff --git a/Scene.ui b/Scene.ui index a29c0fa..64fd8ff 100644 --- a/Scene.ui +++ b/Scene.ui @@ -18,7 +18,7 @@ QWidget#Scene{ background-color: transparent;} -QFrame#frame { background-color: rgba(33, 217, 229, 200); +QFrame#frame { background-color: rgba(33, 217, 229, 150); border-radius: 12px;} @@ -61,41 +61,6 @@ QFrame#frame { background-color: rgba(33, 217, 229, 200); true - - - Winter - - - - - Mountains - - - - - Meadow - - - - - Forest - - - - - City - - - - - Beach - - - - - Room&Window - - From cba0b0ff28e24f8e1ffdda3adbbca32b303e5ef2 Mon Sep 17 00:00:00 2001 From: huxiaori Date: Tue, 18 Dec 2012 20:42:17 +0800 Subject: [PATCH 11/13] add Scripts folder, add mumblefunc.js and mumber works now --- Background.ui => Background.ui.bak | 0 CreateRefFile.js => CreateRefFile.js.bak | 10 +- Effect.ui => Effect.ui.bak | 0 Element.ui => Element.ui.bak | 0 MainMenu.js | 291 +++++++----- MainMenu.ui => MainMenu.ui.bak | 0 ManMade.ui => ManMade.ui.bak | 0 Mumble/MumbleApplication.js | 493 --------------------- Mumble/MumbleClientWidget.ui | 182 -------- Mumble/instructions.js | 32 -- Mumble/scene.txml | 25 -- Mumble/voice-active.png | Bin 4310 -> 0 bytes Mumble/voice-inactive.png | Bin 3938 -> 0 bytes MumbleFunc.js | 294 ++++++++++++ Object.ui => Object.ui.bak | 0 PropType.ui => PropType.ui.bak | 0 Scene.ui => Scene.ui.bak | 0 Scripts/Background.ui | 67 +++ Scripts/Effect.ui | 69 +++ Scripts/Element.ui | 68 +++ Scripts/MainMenu.js.bak | 294 ++++++++++++ Scripts/MainMenu.ui | 261 +++++++++++ Scripts/ManMade.ui | 69 +++ Scripts/MumbleClientWidget.ui | 207 +++++++++ {Mumble => Scripts}/MumbleConnectWidget.ui | 17 +- Scripts/Object.ui | 69 +++ Scripts/PropType.ui | 165 +++++++ Scripts/Scene.ui | 69 +++ {Mumble => Scripts}/StartMumble.ui | 43 +- 29 files changed, 1859 insertions(+), 866 deletions(-) rename Background.ui => Background.ui.bak (100%) rename CreateRefFile.js => CreateRefFile.js.bak (89%) rename Effect.ui => Effect.ui.bak (100%) rename Element.ui => Element.ui.bak (100%) rename MainMenu.ui => MainMenu.ui.bak (100%) rename ManMade.ui => ManMade.ui.bak (100%) delete mode 100644 Mumble/MumbleApplication.js delete mode 100644 Mumble/MumbleClientWidget.ui delete mode 100644 Mumble/instructions.js delete mode 100644 Mumble/scene.txml delete mode 100644 Mumble/voice-active.png delete mode 100644 Mumble/voice-inactive.png create mode 100644 MumbleFunc.js rename Object.ui => Object.ui.bak (100%) rename PropType.ui => PropType.ui.bak (100%) rename Scene.ui => Scene.ui.bak (100%) create mode 100644 Scripts/Background.ui create mode 100644 Scripts/Effect.ui create mode 100644 Scripts/Element.ui create mode 100644 Scripts/MainMenu.js.bak create mode 100644 Scripts/MainMenu.ui create mode 100644 Scripts/ManMade.ui create mode 100644 Scripts/MumbleClientWidget.ui rename {Mumble => Scripts}/MumbleConnectWidget.ui (91%) create mode 100644 Scripts/Object.ui create mode 100644 Scripts/PropType.ui create mode 100644 Scripts/Scene.ui rename {Mumble => Scripts}/StartMumble.ui (62%) diff --git a/Background.ui b/Background.ui.bak similarity index 100% rename from Background.ui rename to Background.ui.bak diff --git a/CreateRefFile.js b/CreateRefFile.js.bak similarity index 89% rename from CreateRefFile.js rename to CreateRefFile.js.bak index bfa9e24..b15decc 100644 --- a/CreateRefFile.js +++ b/CreateRefFile.js.bak @@ -11,6 +11,7 @@ var SpecialEffects = ["Fire", "Smoke", "FireWorks", "PinkElephant", "BlackMonoli var Prop = [Scenes,Backgrounds,Elements,Objects,ManMade,SpecialEffects]; +/* var fileName = "/Ref.js"; // this function fits the URL, @@ -30,13 +31,16 @@ syspath = syspath + fileName; // get the full name of file path (incldes file na return syspath.toString(); } - +*/ function CreateRefFile() { var fso, tf; fso = new ActiveXObject("Scripting.FileSystemObject"); - var pathName = getCurrentDirectory(fileName); - tf = fso.CreateTextFile(pathName, true); + //var pathName = getCurrentDirectory(fileName); + //var pathName = "local://Ref.js"; + var pathName = "C:\p2\p2Scripts\Ref.js" + //tf = fso.CreateTextFile(pathName, true); + tf = fso.CreateTextFile(pathName,true); for(var i=0; i=1.2.3. Lower versions may work depending if they have celt >=0.11.1 support. -// 2. Install Mumble. Remember to check "Install Murmur server" in the install process, -// the Murmur is not a part of the default install options. -// 3. Run Tundra with the example scene: Tundra --config viewer-browser.xml --console --file scenes/Mumble/scene.txml -// This will start a client with the browser ui, but don't worry this script should hide the ui. -// If not you can use the menu Browser -> Hide Browser UI to see the scene. -// *********************************************************************************************************************************** - -// Tell the script parser we depend on the following assets -// !ref: local://StartMumble.ui -// !ref: local://MumbleClientWidget.ui, QtUiFile -// !ref: local://MumbleConnectWidget.ui, QtUiFile -// !ref: local://voice-active.png -// !ref: local://voice-inactive.png - -// These are just default that are applied to the connection widget on first show. -// You don't have to edit these if you want to use the client UI to setup connection info. - -engine.ImportExtension("qt.core"); -engine.ImportExtension("qt.gui"); - -/*var _connectionInfo = -{ - host : "efe.mumble.com", // Change to IP if you want to test remote Murmur servers. - port : 8560, // Default port for Murmur, see murmur.ini for changing this. - password : "rautaarajalle", // Default password for Murmur is empty, see murmur.ini for changing this. - channel : "EFE Server/LOBBY", // Default Murmur server will have one channel called "Root". Empty channel name is depicted as "Root" when connecting via MumblePlugin. - outputMuted : false, // True means your voice is sent after connecting, false means your output is muted. - intputMuted : false // True means voice should be sent to us from other client after connecting, false means server wont send us the voice packets. -}; -*/ - -var _connectionInfo = -{ - host : "athena.mumble-serveur.com", // Change to IP if you want to test remote Murmur servers. - port : 13501, // Default port for Murmur, see murmur.ini for changing this. - password : "e92ds6gs", // Default password for Murmur is empty, see murmur.ini for changing this. - channel : "mumble-serveur.com public #1/wow", // Default Murmur server will have one channel called "Root". Empty channel name is depicted as "Root" when connecting via MumblePlugin. - outputMuted : false, // True means your voice is sent after connecting, false means your output is muted. - intputMuted : false // True means voice should be sent to us from other client after connecting, false means server wont send us the voice packets. -}; - - -// Global variables -var _mumbleWidget = null; -var _widget = null; -var _connectWidget = null; -var _buttonWizard = null; -var _buttonConnect = null; -var _buttonDisconnect = null; -var _buttonSelfMute = null; -var _buttonSelfDeaf = null; -var _buttonMuteSelected = null; -var _userList = null; -var _chatLog = null; -var _chatLine = null; -var _iconActive = null; -var _iconInactive = null; - -var clientWidgetVisible = false; - -// when click the button "Mumble" to hind and display the window of client. -function StartMumble(){ - if (_mumbleWidget == null) - { - _mumbleWidget = ui.LoadFromFile("local://StartMumble.ui"); - _mumbleButton = findChild(_mumbleWidget, "MumbleBtn"); - _mumbleButton.clicked.connect(mumbleButtonClicked); - - - //mumbleProxy = new UiProxyWidget(_mumbleWidget); - - //ui.AddProxyWidgetToScene(mumbleProxy); - //mumbleProxy.visible = true; - //mumbleProxy.windowFlags = 0; - - //mumbleProxy.x = 15; // they should be caculated late - //mumbleProxy.y = 150 ; - - _mumbleWidget.visible = true; - _mumbleWidget.pos = new QPoint(15,150); - _mumbleWidget.windowFlags = Qt.CustomizeWindowHint; - //_mumbleWidget.windowFlags = setWindowFlags(Qt::CustomizeWindowHint); - - - } -} - -function mumbleButtonClicked() -{ - clientWidgetVisible = ! clientWidgetVisible; - _widget.visible = clientWidgetVisible; -} - -function StartClient() -{ - // Hook to MumblePlugin - mumble.Connected.connect(OnConnected); - mumble.Disconnected.connect(OnDisconnected); - mumble.ConnectionRejected.connect(OnRejected); - - mumble.MeCreated.connect(OnMeCreated); - mumble.JoinedChannel.connect(OnJoinedChannel); - - mumble.UserMuted.connect(OnUserLocalMuteChanged); - mumble.UserSelfMuted.connect(OnUserSelfMutedChange); - mumble.UserSelfDeaf.connect(OnUserSelfDeafChange); - mumble.UserSpeaking.connect(OnUserSpeakingChange); - mumble.UserPositionalChanged.connect(OnUserPositionalChange); - mumble.ChannelTextMessageReceived.connect(OnChannelTextMessageReceived); - - InitIcons(); - StartMumble(); - // Init UI - _widget = ui.LoadFromFile("local://MumbleClientWidget.ui"); - - _widget.pos = new QPoint(15,240); - _widget.windowFlags = 0; - _buttonConnect = findChild(_widget, "buttonOpenConnect"); - _buttonDisconnect = findChild(_widget, "buttonDisconnect"); - _buttonWizard = findChild(_widget, "buttonOpenWizard"); - _buttonSelfMute = findChild(_widget, "muteSelfToggle"); - _buttonSelfDeaf = findChild(_widget, "deafSelfToggle"); - _buttonMuteSelected = findChild(_widget, "muteSelectedToggle"); - _userList = findChild(_widget, "listUsers"); - _chatLog = findChild(_widget, "chatTextEdit");; - _chatLine = findChild(_widget, "chatLineEdit");; - - _buttonConnect.clicked.connect(ShowConnectDialog); - _buttonDisconnect.clicked.connect(mumble, mumble.Disconnect); // Direct connection to MumblePlugin C++ QObject - _buttonWizard.clicked.connect(mumble, mumble.RunAudioWizard); // Direct connection to MumblePlugin C++ QObject - _buttonSelfMute.clicked.connect(OnSelfMuteToggle); - _buttonSelfDeaf.clicked.connect(OnSelfDeafToggle); - // _buttonMuteSelected.clicked.connect(OnMuteSelectedToggle); - // _userList.currentItemChanged.connect(OnUserSelected); - //_chatLine.returnPressed.connect(SendTextMessage); - - // Init state - SetConnectionState(false, "Disconnected"); - SetChannelName(""); -} - -function InitIcons() -{ - // Just for reference: If the ref is http:// ref it will be found from cache, - // if it is a local we need to query IAsset::DiskSource(). Usually in your app you will know - // which one it is and just call the correct place directly. - try - { - var imageActivePath = asset.GetAssetCache().FindInCache("local://voice-active.png"); - if (imageActivePath == "") - imageActivePath = asset.GetAsset("local://voice-active.png").DiskSource(); - var imageInactivePath = asset.GetAssetCache().FindInCache("local://voice-inactive.png"); - if (imageInactivePath == "") - imageInactivePath = asset.GetAsset("local://voice-inactive.png").DiskSource(); - } - catch (e) - { - imageActivePath = ""; - imageInactivePath = ""; - } - - _iconActive = new QIcon(new QPixmap(imageActivePath)); - _iconInactive = new QIcon(new QPixmap(imageInactivePath)); -} - -function SetConnectionState(connected, strState) -{ - var stateLabel = findChild(_widget, "labelConnectionState"); - stateLabel.text = strState; - - _buttonConnect.enabled = !connected; - _buttonDisconnect.enabled = connected; - _buttonWizard.enabled = connected; - _buttonSelfMute.enabled = connected; - _buttonSelfDeaf.enabled = connected; - //_buttonMuteSelected.enabled = connected; - /* if (!connected) - _buttonMuteSelected.text = ""; - _chatLine.enabled = connected; - _chatLine.text = ""; - _chatLog.clear(); - _userList.clear();*/ -} - -function SetChannelName(channelName) -{ - var channelLabel = findChild(_widget, "labelChannelName"); - channelLabel.text = channelName; -} - -function ShowConnectDialog() -{ - // Initialize if not yet done - if (_connectWidget == null) - { - _connectWidget = ui.LoadFromFile("local://MumbleConnectWidget.ui"); - - var widgets = GetConnectionDataWidgets(_connectWidget); - widgets.connectButton.clicked.connect(Connect); - widgets.cancelButton.clicked.connect(_connectWidget, _connectWidget.hide); - - widgets.host.text = _connectionInfo.host; - widgets.port.value = _connectionInfo.port; - widgets.password.text = _connectionInfo.password; - widgets.channel.text = _connectionInfo.channel; - if (client != null && client.LoginProperty("username") != "") - widgets.username.text = client.LoginProperty("username"); - else - widgets.username.text = "Tom"; - } - - var mainWidgetRect = _widget.frameGeometry; - //_connectWidget.minimumHeight = _widget.height; - _connectWidget.pos = new QPoint(mainWidgetRect.topRight().x() + 25, mainWidgetRect.topRight().y()); - _connectWidget.visible = true; -} - -function GetConnectionDataWidgets(widget) -{ - if (widget == null) - return null; - - var widgets = - { - host : findChild(widget, "hostLineEdit"), - port : findChild(widget, "portSpinBox"), - username : findChild(widget, "usernameLineEdit"), - password : findChild(widget, "passwordLineEdit"), - channel : findChild(widget, "channelLineEdit"), - connectButton : findChild(widget, "buttonConnect"), - cancelButton : findChild(widget, "buttonCancel") - }; - - return widgets; -} - -function Connect() -{ - var widgets = GetConnectionDataWidgets(_connectWidget); - mumble.Connect(widgets.host.text, widgets.port.value, widgets.username.text, widgets.password.text, widgets.channel.text, _connectionInfo.outputMuted, _connectionInfo.intputMuted); - - _connectWidget.visible = false; - SetConnectionState(false, "Connecting to " + widgets.host.text + ":" + widgets.port.value.toString() + "..."); -} - -function OnRejected(rejectType, reason) -{ - // enum RejectReasonWrongServerPW - if (rejectType.value == 4) - QMessageBox.warning(ui.MainWindow(), "", reason); - // enum RejectReasonServerFull - else if (rejectType.value == 6) - QMessageBox.warning(ui.MainWindow(), "", "Server is full"); -} - -function OnConnected(host, port, username) -{ - SetConnectionState(true, "Connected to " + host + ":" + port.toString() +'
' + " as "+ username); -} - -function OnDisconnected(reason) -{ - if (reason != "") - SetConnectionState(false, "Disconnected: " + reason); - else - SetConnectionState(false, "Disconnected"); -} - -function OnMeCreated(mumbleMe) -{ - // Can hook to own user ptr signals here. - // Depends if you want to use own functions for processing 'me' signals. - // Or a generic function to handle all like this example script shows. - // You can use the signaling model you feel is best for you. -} - -function OnJoinedChannel(mumbleChannel) -{ - SetChannelName(mumbleChannel.fullName); - - mumbleChannel.UserJoined.connect(OnUserJoinedPresentChannel); - mumbleChannel.UserLeft.connect(OnUserLeftPresentChannel); -} - -function GetUser(userId) -{ - var user = null; - for(var i=0; i<_userList.count; ++i) - { - var item = _userList.item(i); - if (item != null && item.data(Qt.UserRole) == userId) - { - user = { listItem: item, row: i }; - break; - } - } - return user; -} - -function OnUserJoinedPresentChannel(user) -{ - var listItem = new QListWidgetItem(_iconInactive, user.name + " (" + user.id.toString() + ")"); - listItem.setData(Qt.UserRole, user.id); - - if (user.isMe) - { - var font = listItem.font(); - font.setBold(true); - listItem.setFont(font); - } - - _userList.addItem(listItem); -} - -function OnUserLeftPresentChannel(userId) -{ - var listItem = GetUser(userId); - if (listItem != null) - _userList.takeAt(listItem.row); -} - -function OnUserSelected(listItem) -{ - if (listItem == null) - listItem = _userList.currentItem(); - if (listItem != null && listItem.data(Qt.UserRole) != null) - { - var mumbleUser = mumble.User(listItem.data(Qt.UserRole)); - if (mumbleUser.isMe) - { - _buttonMuteSelected.enabled = false; - _buttonMuteSelected.text = ""; - } - else - { - _buttonMuteSelected.enabled = true; - _buttonMuteSelected.text = mumbleUser.isMuted ? "Unmute " + mumbleUser.name : "Mute " + mumbleUser.name; - } - } -} - -function OnSelfMuteToggle() -{ - var mumbleMe = mumble.Me(); - if (mumbleMe != null) - mumble.SetOutputAudioMuted(!mumbleMe.isSelfMuted); -} - -function OnSelfDeafToggle() -{ - var mumbleMe = mumble.Me(); - if (mumbleMe != null) - mumble.SetInputAudioMuted(!mumbleMe.isSelfDeaf); -} - -function OnMuteSelectedToggle() -{ - var currentItem = _userList.currentItem(); - if (currentItem != null && currentItem.data(Qt.UserRole) != null) - { - var user = mumble.User(currentItem.data(Qt.UserRole)); - if (user != null && !user.isMe) - user.isMuted = !user.isMuted; - } -} - -function UpdateUserState(mumbleUser) -{ - var iter = GetUser(mumbleUser.id); - if (iter != null) - { - var text = mumbleUser.name + " (" + mumbleUser.id.toString() + ")"; - var props = []; - if (mumbleUser.isMuted) - props.push("muted"); - if (mumbleUser.isSelfMuted) - props.push("self muted"); - if (mumbleUser.isSelfDeaf) - props.push("deaf"); - if (!mumbleUser.isPositional) - props.push("non-positional"); - if (props.length > 0) - text += " [" + props.join(", ") + "]"; - iter.listItem.setText(text); - - //OnUserSelected(iter.listItem); - } -} - -function OnUserLocalMuteChanged(mumbleUser, isMuted) -{ - UpdateUserState(mumbleUser); -} - -function OnUserSelfMutedChange(mumbleUser, isMuted) -{ - UpdateUserState(mumbleUser); - if (mumbleUser.isMe) - _buttonSelfMute.text = mumbleUser.isSelfMuted ? "Unmute Self" : "Mute self"; -} - -function OnUserSelfDeafChange(mumbleUser, isDeaf) -{ - UpdateUserState(mumbleUser); - if (mumbleUser.isMe) - _buttonSelfDeaf.text = mumbleUser.isSelfDeaf ? "Unmute Everyone" : "Mute Everyone"; -} - -function OnUserPositionalChange(mumbleUser, isPositional) -{ - UpdateUserState(mumbleUser); -} - -function OnUserSpeakingChange(mumbleUser, speaking) -{ - var iter = GetUser(mumbleUser.id); - if (iter != null) - iter.listItem.setIcon(speaking ? _iconActive : _iconInactive); -} - -function SendTextMessage() -{ - var message = _chatLine.text; - if (message != "") - { - // Own messages are of course not relayed back to us, add by hand. - OnChannelTextMessageReceived(mumble.Me(), message); - // Send message to current channel. - mumble.SendTextMessage(message); - _chatLine.text = ""; - } -} - -function OnChannelTextMessageReceived(mumbleUser, message) -{ - if (message != "") - _chatLog.appendHtml("[" + mumbleUser.name + "] " + message); -} - -// Bootstrap and utility functions - -function OnScriptDestroyed() -{ - mumble.Disconnect("Client closed"); - - if (_widget != null) - { - _widget.visible = false; - ui.RemoveWidgetFromScene(_widget); - _widget = null; - } - if (_connectWidget != null) - { - _connectWidget.visible = false; - ui.RemoveWidgetFromScene(_connectWidget); - _connectWidget = null; - } -} - -function LogInfo(msg) { console.LogInfo("[MumbleApplication]: " + msg); } -function LogError(msg) { console.LogError("[MumbleApplication]: " + msg); } - - -if (!server.IsRunning() && !framework.IsHeadless()) -{ - - if (framework.GetModuleByName("MumblePlugin") != null) - { - try - { - - // Hide browser ui - if (browserplugin != null) - browserplugin.SetBrowserVisibility(false); - } - catch (e) {} - - - StartClient(); - - } - else - console.LogError("MumblePlugin not preset, its not in your startup config?"); -} diff --git a/Mumble/MumbleClientWidget.ui b/Mumble/MumbleClientWidget.ui deleted file mode 100644 index 2cf68aa..0000000 --- a/Mumble/MumbleClientWidget.ui +++ /dev/null @@ -1,182 +0,0 @@ - - - MumbleClientWidget - - - Qt::NonModal - - - true - - - - 0 - 0 - 236 - 264 - - - - Mumble Client - - - 1.000000000000000 - - - QWidget#MumbleClientWidget -{ - border: 0px; - windowFlags: 0x00000800; -}; -QLabel, QPushButton { - font-size: 9pt; -} - -QLabel#labelConnectionStateTitle, #labelChannelNameTitle, #labelControlsTitle, #labelChatTitle { - font-weight: bold; -} - -QPlainTextEdit, QLineEdit, QListWidget { - border: 1px solid grey; -} - -QLineEdit { - border-top: 0px; -} - - - - - 8 - 176 - 221 - 31 - - - - - - - Qt::AlignCenter - - - - - - 11 - 54 - 211 - 118 - - - - - - - 7 - 210 - 81 - 23 - - - - Mute Self - - - - - - 94 - 210 - 71 - 23 - - - - Deaf Self - - - - - - 8 - 236 - 131 - 23 - - - - Open Audio Wizard - - - - - - 150 - 236 - 81 - 23 - - - - Disconnect - - - - - - 171 - 210 - 61 - 23 - - - - Connect - - - - - - 12 - 12 - 93 - 16 - - - - - 0 - 0 - - - - Channel Users - - - 2 - - - - - - 10 - 30 - 211 - 21 - - - - - 0 - 0 - - - - - - - - - - diff --git a/Mumble/instructions.js b/Mumble/instructions.js deleted file mode 100644 index 12e99f4..0000000 --- a/Mumble/instructions.js +++ /dev/null @@ -1,32 +0,0 @@ -engine.ImportExtension("qt.core"); -engine.ImportExtension("qt.gui"); - -var label = null; -var proxy = null; - -function OnScriptDestroyed() -{ - if (label != null) - { - label.visible = false; - ui.RemoveWidgetFromScene(label); - } -} - -if (!framework.IsHeadless()) -{ - label = new QLabel(); - label.styleSheet = "QLabel { background-color: rgba(230,230,230,170); font-size: 16px; padding: 10px; }"; - label.text = "This scene and its script MumbleApplication.js demonstrates adding VOIP support to your scene.

" + - "Tundras MumblePlugin provides a Mumble client that can connect to Murmur servers.
" + - "You can get this server and host it yourself: http://www.mumble.com/
" + - "Remember to check 'Install Murmur component' in the installer, the server is not installed by default.
" + - "See murmur.ini for configuring and murmur executable to run the server.

" + - "Once your server is up, use the client UI in Tundra to connect to your server.
" + - "Read more on what you can do with MumblePlugin in the MumbleApplication.js and the Tundra documentation."; - - proxy = ui.AddWidgetToScene(label); - proxy.pos = new QPointF(10, 10); - proxy.windowFlags = 0; - proxy.visible = true; -} \ No newline at end of file diff --git a/Mumble/scene.txml b/Mumble/scene.txml deleted file mode 100644 index ee2672a..0000000 --- a/Mumble/scene.txml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mumble/voice-active.png b/Mumble/voice-active.png deleted file mode 100644 index d28135d6676494f0a00da7c5f6497f1f2ce76765..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4310 zcmV;{5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6YNmYo?Z6QY4ieQs87RQD^HR!4C@-Y|x1xLj?(Z1asdH?_b07*qoM6N<$ Ef*KJSH2?qr diff --git a/Mumble/voice-inactive.png b/Mumble/voice-inactive.png deleted file mode 100644 index 7671bba3732dae9f726210fda20b686f761fbb26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3938 zcmV-o51sIdP)004&%004{+008|`004nN004b?008NW002DY000@xb3BE2000U( zX+uL$P-t&-Z*ypGa3D!TLm+T+Z)Rz1WdHz3$DNjUR8-d%htIutdZEoQ(iwV_E---f zE+8EQQ5a?h7|H;{3{7l^s6a#!5dlSzpnw6Rp-8NVVj(D~U=K(TP+~BOsHkK{)=GSN zdGF=r_s6~8+Gp=`_t|@&wJrc8PaiHX1(pIJnJ3@}dN|Wpg-6h_{Qw4dfB~ieFj?uT zzCrH6KqN0W7kawL3H*!R3;{^|zGdj?Pp5H0=h0sk8Wyh&7ga7GLtw0fuTQ>mB{3?=`JbBsZ3rr0E=h-EE#ca>7pWA znp#_08k!lIeo?6Zy7)IG?(HJI3i#YJh}QRq?XUb&>HuKOifXg#4_nNB06Mk;Ab0-{ zo8}<^Bt?B|zwyO+XySQ^7YI^qjEyrhGmW?$mXWxizw3WG{0)8aJtOgUzn6#Z%86wP zlLT~e-B>9}DMCIyJ(bDg&<+1Q#Q!+(uk%&0*raG}W_n!s* z`>t?__>spaFD&Aut10z!o?HH?RWufnX30 z)&drY2g!gBGC?lb3<^LI*ah~2N>BspK_h4ZCqM@{4K9Go;5xVo?tlki1dM~{UdPU)xj{ZqAQTQoLvauf5<ZgZNI6o6v>;tbFLDbRL8g&+C=7~%qN5B^ zwkS_j2#SSDLv276qbgBHQSGQ6)GgE~Y6kTQO-3uB4bV1dFZ3#O96A$SfG$Tjpxe-w z(09<|=rSYbRd;g|%>I!rO<0Hzgl9y5R$!^~o_Sb3}g)(-23Wnu-`0_=Y5 zG3+_)Aa)%47DvRX;>>XFxCk5%mxn9IHQ~!?W?(_!4|Q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=MG?>9r)JAqW5ra98mZhj)>xo!gI!c*v}Us z>>EK;#kCl_n7Mn|2sD8 zX6pThSr_8L4`FdBl-KmPHPkd>J__Tk*Xzfh!f$HL-;2>fWkKNK?EnA(07*qoM6N<$g0!xM1poj5 diff --git a/MumbleFunc.js b/MumbleFunc.js new file mode 100644 index 0000000..3946c37 --- /dev/null +++ b/MumbleFunc.js @@ -0,0 +1,294 @@ +/* + * handle the events happening in the mumble + */ + function MumbleBtnClicked(){ + // show and hide the mumble of client + MumbleClientProxy_visible = !MumbleClientProxy_visible; + MumbleClientProxy.visible = MumbleClientProxy_visible; + SetConnectionState(false, "Disconnected"); + // hide the connect dialog + MumbleConnectProxy.visible = false; + + } + + + + function SetConnectionState(connected, strState) + { + var stateLabel = findChild(_mumbleClientWidget, "labelConnectionState"); + stateLabel.text = strState; + + _buttonConnect.enabled = !connected; + _buttonDisconnect.enabled = connected; + _buttonWizard.enabled = connected; + _buttonSelfMute.enabled = connected; + _buttonSelfDeaf.enabled = connected; + } + + function SetChannelName(channelName) + { + var channelLabel = findChild(_mumbleClientWidget, "labelChannelName"); + channelLabel.text = channelName; + } + + function ShowConnectDialog() + { + //Initialize if not yet done + if (_mumbleConnectWidget == null) + { + //_connectWidget = ui.LoadFromFile("local://MumbleConnectWidget.ui"); + _mumbleConnectWidget = ui.LoadFromFile("Scripts/MumbleConnectWidget.ui",false); + MumbleConnectProxy = new UiProxyWidget(_mumbleConnectWidget); + ui.AddProxyWidgetToScene(MumbleConnectProxy); + + MumbleConnectProxy.windowFlags = 0; + MumbleConnectProxy.x = 2 + 248; + MumbleConnectProxy.y = 42; + + var widgets = GetConnectionDataWidgets(_mumbleConnectWidget); + //console.LogInfo("_mumbleConnectWidget:"+_mumbleConnectWidget); + //console.LogInfo("widgets:"+widgets); + widgets.connectButton.clicked.connect(Connect); + widgets.cancelButton.clicked.connect(_mumbleConnectWidget, _mumbleConnectWidget.hide); + + widgets.host.text = _connectionInfo.host; + widgets.port.value = _connectionInfo.port; + widgets.password.text = _connectionInfo.password; + widgets.channel.text = _connectionInfo.channel; + if (client != null && client.LoginProperty("username") != "") + widgets.username.text = client.LoginProperty("username"); + else + widgets.username.text = "Tom"; + } + MumbleConnectProxy.visible = true; + //_mumbleConnectWidget.visible = true; + } + + function GetConnectionDataWidgets(widget) + { + if (widget == null) + return null; + + var widgets = + { + host : findChild(widget, "hostLineEdit"), + port : findChild(widget, "portSpinBox"), + username : findChild(widget, "usernameLineEdit"), + password : findChild(widget, "passwordLineEdit"), + channel : findChild(widget, "channelLineEdit"), + connectButton : findChild(widget, "buttonConnect"), + cancelButton : findChild(widget, "buttonCancel") + }; + + return widgets; + } + + function Connect() + { + var widgets = GetConnectionDataWidgets(_mumbleConnectWidget); + mumble.Connect(widgets.host.text, widgets.port.value, widgets.username.text, widgets.password.text, widgets.channel.text, _connectionInfo.outputMuted, _connectionInfo.intputMuted); + + MumbleConnectProxy.visible = false; + //_mumbleConnectWidget.visible = false; + SetConnectionState(false, "Connecting to " + widgets.host.text + ":" + widgets.port.value.toString() + "..."); + } + + function OnRejected(rejectType, reason) + { + // enum RejectReasonWrongServerPW + if (rejectType.value == 4) + QMessageBox.warning(ui.MainWindow(), "", reason); + // enum RejectReasonServerFull + else if (rejectType.value == 6) + QMessageBox.warning(ui.MainWindow(), "", "Server is full"); + } + + function OnConnected(host, port, username) + { + SetConnectionState(true, "Connected to " + host + ":" + port.toString() +'
' + " as "+ username); + } + + function OnDisconnected(reason) + { + if (reason != "") + SetConnectionState(false, "Disconnected: " + reason); + else + SetConnectionState(false, "Disconnected"); + } + + function OnMeCreated(mumbleMe) + { + // Can hook to own user ptr signals here. + // Depends if you want to use own functions for processing 'me' signals. + // Or a generic function to handle all like this example script shows. + // You can use the signaling model you feel is best for you. + } + + function OnJoinedChannel(mumbleChannel) + { + SetChannelName(mumbleChannel.fullName); + + mumbleChannel.UserJoined.connect(OnUserJoinedPresentChannel); + mumbleChannel.UserLeft.connect(OnUserLeftPresentChannel); + } + + function GetUser(userId) + { + var user = null; + for(var i=0; i<_userList.count; ++i) + { + var item = _userList.item(i); + if (item != null && item.data(Qt.UserRole) == userId) + { + user = { listItem: item, row: i }; + break; + } + } + return user; + } + + function OnUserJoinedPresentChannel(user) + { + var listItem = new QListWidgetItem(_iconInactive, user.name + " (" + user.id.toString() + ")"); + listItem.setData(Qt.UserRole, user.id); + + if (user.isMe) + { + var font = listItem.font(); + font.setBold(true); + listItem.setFont(font); + } + + _userList.addItem(listItem); + } + + function OnUserLeftPresentChannel(userId) + { + var listItem = GetUser(userId); + if (listItem != null) + _userList.takeAt(listItem.row); + } + + function OnUserSelected(listItem) + { + if (listItem == null) + listItem = _userList.currentItem(); + if (listItem != null && listItem.data(Qt.UserRole) != null) + { + var mumbleUser = mumble.User(listItem.data(Qt.UserRole)); + if (mumbleUser.isMe) + { + _buttonMuteSelected.enabled = false; + _buttonMuteSelected.text = ""; + } + else + { + _buttonMuteSelected.enabled = true; + _buttonMuteSelected.text = mumbleUser.isMuted ? "Unmute " + mumbleUser.name : "Mute " + mumbleUser.name; + } + } + } + + function OnSelfMuteToggle() + { + var mumbleMe = mumble.Me(); + if (mumbleMe != null) + mumble.SetOutputAudioMuted(!mumbleMe.isSelfMuted); + } + + function OnSelfDeafToggle() + { + var mumbleMe = mumble.Me(); + if (mumbleMe != null) + mumble.SetInputAudioMuted(!mumbleMe.isSelfDeaf); + } + + function OnMuteSelectedToggle() + { + var currentItem = _userList.currentItem(); + if (currentItem != null && currentItem.data(Qt.UserRole) != null) + { + var user = mumble.User(currentItem.data(Qt.UserRole)); + if (user != null && !user.isMe) + user.isMuted = !user.isMuted; + } + } + + function UpdateUserState(mumbleUser) + { + var iter = GetUser(mumbleUser.id); + if (iter != null) + { + var text = mumbleUser.name + " (" + mumbleUser.id.toString() + ")"; + var props = []; + if (mumbleUser.isMuted) + props.push("muted"); + if (mumbleUser.isSelfMuted) + props.push("self muted"); + if (mumbleUser.isSelfDeaf) + props.push("deaf"); + if (!mumbleUser.isPositional) + props.push("non-positional"); + if (props.length > 0) + text += " [" + props.join(", ") + "]"; + iter.listItem.setText(text); + + //OnUserSelected(iter.listItem); + } + } + + function OnUserLocalMuteChanged(mumbleUser, isMuted) + { + UpdateUserState(mumbleUser); + } + + function OnUserSelfMutedChange(mumbleUser, isMuted) + { + UpdateUserState(mumbleUser); + if (mumbleUser.isMe) + _buttonSelfMute.text = mumbleUser.isSelfMuted ? "Unmute Self" : "Mute self"; + } + + function OnUserSelfDeafChange(mumbleUser, isDeaf) + { + UpdateUserState(mumbleUser); + if (mumbleUser.isMe) + _buttonSelfDeaf.text = mumbleUser.isSelfDeaf ? "Unmute Everyone" : "Mute Everyone"; + } + + function OnUserPositionalChange(mumbleUser, isPositional) + { + UpdateUserState(mumbleUser); + } + + function OnUserSpeakingChange(mumbleUser, speaking) + { + var iter = GetUser(mumbleUser.id); + if (iter != null) + iter.listItem.setIcon(speaking ? _iconActive : _iconInactive); + } + + function SendTextMessage() + { + var message = _chatLine.text; + if (message != "") + { + // Own messages are of course not relayed back to us, add by hand. + OnChannelTextMessageReceived(mumble.Me(), message); + // Send message to current channel. + mumble.SendTextMessage(message); + _chatLine.text = ""; + } + } + + function OnChannelTextMessageReceived(mumbleUser, message) + { + if (message != "") + _chatLog.appendHtml("[" + mumbleUser.name + "] " + message); + } + + // Bootstrap and utility functions + + + function LogInfo(msg) { console.LogInfo("[MumbleApplication]: " + msg); } + function LogError(msg) { console.LogError("[MumbleApplication]: " + msg); } \ No newline at end of file diff --git a/Object.ui b/Object.ui.bak similarity index 100% rename from Object.ui rename to Object.ui.bak diff --git a/PropType.ui b/PropType.ui.bak similarity index 100% rename from PropType.ui rename to PropType.ui.bak diff --git a/Scene.ui b/Scene.ui.bak similarity index 100% rename from Scene.ui rename to Scene.ui.bak diff --git a/Scripts/Background.ui b/Scripts/Background.ui new file mode 100644 index 0000000..c591b2c --- /dev/null +++ b/Scripts/Background.ui @@ -0,0 +1,67 @@ + + + Background + + + + 0 + 0 + 110 + 200 + + + + Form + + + QWidget#Background { background-color: transparent; } +QFrame#frame { background-color: rgba(33, 217, 229, 150); + border-radius: 12px;} + + + + + + -1 + 0 + 111 + 201 + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 11 + 28 + 91 + 161 + + + + + + + 10 + 10 + 71 + 16 + + + + <html><head/><body><p><span style=" color:#ffffff;">BACKGROUND:</span></p></body></html> + + + + + + + diff --git a/Scripts/Effect.ui b/Scripts/Effect.ui new file mode 100644 index 0000000..e09ab39 --- /dev/null +++ b/Scripts/Effect.ui @@ -0,0 +1,69 @@ + + + Effect + + + + 0 + 0 + 132 + 209 + + + + true + + + Form + + + QWidget#Effect{ background-color: transparent;} +QFrame#frame { background-color: rgba(237,29,63,150); + border-radius: 12px;} + + + + + 1 + -2 + 131 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 2 + 81 + 20 + + + + <html><head/><body><p><span style=" color:#ffffff;">SPECIAL_FX:</span></p></body></html> + + + + + + 15 + 21 + 101 + 181 + + + + true + + + + + + + diff --git a/Scripts/Element.ui b/Scripts/Element.ui new file mode 100644 index 0000000..3a8da6a --- /dev/null +++ b/Scripts/Element.ui @@ -0,0 +1,68 @@ + + + Element + + + + 0 + 0 + 132 + 209 + + + + true + + + Form + + + QWidget#Element{ background-color: transparent;} +QFrame#frame{ background-color: rgba(21,122,69,150); border-radius: 15px; } + + + + + 1 + -2 + 131 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 2 + 111 + 20 + + + + <html><head/><body><p><span style=" color:#ffffff;">NATURAL_ELEMENTS:</span></p></body></html> + + + + + + 15 + 21 + 101 + 181 + + + + true + + + + + + + diff --git a/Scripts/MainMenu.js.bak b/Scripts/MainMenu.js.bak new file mode 100644 index 0000000..2ce173f --- /dev/null +++ b/Scripts/MainMenu.js.bak @@ -0,0 +1,294 @@ +//!ref: local:\\Scripts\Background.ui +//!ref: local:\\Scripts\MainMenu.ui +//!ref: local:\\Scripts\Prop.ui +//!ref: local:\\Scripts\Scene.ui + +//!ref: local:\\Props\Sun.txml +//!ref: local:\\Props\PalmTrees.txml +//!ref: local:\\Props\Beach.txml +//!ref: local:\\Props\DaySky.txml + + +engine.ImportExtension("qt.core"); +engine.ImportExtension("qt.gui"); +//engine.ImportExtension("qt.uitools"); + +/* + * MainMenu includes the submenus(background, prop, scene, clearMenu, clearEntity) + * When you click the buttons ( background, prop, scene) on the interface of MainMenu, it will popup the corresponding submenu at right side of MainMenu + * when you click the button (clearMenu) on the interface of MainMenu, it will hind the submenu in the screen + * when you click the button (clearEntity) on the interface of MainMenu, it will clear all the entities in the scene. + */ + +var SceneList_visible = false; +var PropList_visible = false; +var BackgroundList_visible = false; +var CurrentClickedItemName = null; + +var PropProxy = null; +var SceneProxy = null; +var BackgroundProxy = null; + +var _SceneListWidget = null; +var _PropListWidget = null; +var _BackgroundListWidget = null; + + +function Init() +{ +// load the file "MainMenu.ui" + var _widget = ui.LoadFromFile("Scripts/MainMenu.ui", false); + + var _PropBtn = findChild(_widget, "PropBtn"); + _PropBtn.pressed.connect(PropBtnClicked); // listening to the singal of prop button clicked + + var _SceneBtn = findChild(_widget, "SceneBtn"); + _SceneBtn.pressed.connect(SceneBtnClicked); // listening to the singal of SceneBtn button clicked + + var _BackgroundBtn = findChild(_widget, "BackgroundBtn"); + _BackgroundBtn.pressed.connect(BackgroundBtnClicked); // listening to the singal of background button clicked + + var _ClearMenuBtn = findChild(_widget, "ClearMenuBtn"); + _ClearMenuBtn.pressed.connect(ClearMenuBtnClicked); // listering to the singal of clean menu button clicked + + var _ClearEntityBtn = findChild(_widget,"ClearEntityBtn"); + _ClearEntityBtn.pressed.connect(RemoveAllEntities); // listering to the singal of clean entity button clicked + + var MenuProxy = new UiProxyWidget(_widget); + + ui.AddProxyWidgetToScene(MenuProxy); + MenuProxy.visible = true; + MenuProxy.windowFlags = 0; + + MenuProxy.x = 860; + MenuProxy.y = 25; + +// load the file "Scene.ui" + var _SceneWidget = ui.LoadFromFile("Scripts/Scene.ui", false); + + _SceneListWidget = findChild(_SceneWidget, "SceneListWidget"); + _SceneListWidget.itemDoubleClicked.connect(SceneListItemDoubleClicked); + + SceneProxy = new UiProxyWidget(_SceneWidget); + + ui.AddProxyWidgetToScene(SceneProxy); + SceneProxy.visible = SceneList_visible; // set the SceneList_visibe = false; + SceneProxy.windowFlags = 0; + + SceneProxy.x = 965; // they should be caculated late + SceneProxy.y = 25; + + +// load the file "Prop.ui" + var _PropWidget = ui.LoadFromFile("Scripts/Prop.ui", false); + + _PropListWidget = findChild(_PropWidget,"PropListWidget"); + _PropListWidget.itemDoubleClicked.connect(PropListItemDoubleClicked); // listen to the event of item double clicked in PropListWidget + + PropProxy = new UiProxyWidget(_PropWidget); + + ui.AddProxyWidgetToScene(PropProxy); + PropProxy.visible = PropList_visible; + PropProxy.windowFlags = 0; + + PropProxy.x = 965; // they should be caculated late + PropProxy.y = 25; + +// load the file "Background.ui" + var _BackgroundWidget = ui.LoadFromFile("Scripts/Background.ui", false); + + _BackgroundListWidget = findChild(_BackgroundWidget,"BackgroundListWidget"); + _BackgroundListWidget.itemDoubleClicked.connect(BackgroundListItemDoubleClicked); // listen to the event of item double clicked in BackgroundListWidget + + BackgroundProxy = new UiProxyWidget(_BackgroundWidget); + + ui.AddProxyWidgetToScene(BackgroundProxy); + BackgroundProxy.visible = BackgroundList_visible; + BackgroundProxy.windowFlags = 0; + + BackgroundProxy.x = 965; // they should be caculated late + BackgroundProxy.y = 25; + + +} + +/* + * handle the mouse event occur on submenu (scene, prop, background, clear). + * currently, just implement the effect that click the button once , the submenu will be shown, click the button again, the submenu disappear, do the loop like that + */ + + function SceneBtnClicked(){ + + SceneProxy.visible = true; + + PropProxy.visible = ! SceneProxy.visible; + BackgroundProxy.visible = ! SceneProxy.visible; + } + + + function PropBtnClicked(){ + + PropProxy.visible = true; + + SceneProxy.visible = ! PropProxy.visible; + BackgroundProxy.visible = ! PropProxy.visible; + } + + + function BackgroundBtnClicked(){ + + BackgroundProxy.visible = true; + + SceneProxy.visible = ! BackgroundProxy.visible; + PropProxy.visible = ! BackgroundProxy.visible; + } + + function ClearMenuBtnClicked(){ + + SceneProxy.visible = false; + PropProxy.visible = false; + BackgroundProxy.visible = false; + } + + + + + + +/* + * handle the mouse event occur on the submenu + * + */ + // how to get the object name from the ListWidget, actully, Object name = ListWidget.item[index].text() Is this syntax right? + // how to get the number of index + + + function SceneListItemDoubleClicked(){ + + CurrentClickedItemName = _SceneListWidget.currentItem().text(); + console.LogInfo(_SceneListWidget.objectName); + console.LogInfo("CurrentClicked SceceListItem: " + CurrentClickedItemName); + CheckSelected(CurrentClickedItemName); + } + + function PropListItemDoubleClicked (){ + + CurrentClickedItemName = _PropListWidget.currentItem().text(); + console.LogInfo(_PropListWidget.objectName); + console.LogInfo("CurrentClicked PropListItem: " + CurrentClickedItemName); + CheckSelected(CurrentClickedItemName); + + + } + + function BackgroundListItemDoubleClicked (){ + CurrentClickedItemName = _BackgroundListWidget.currentItem().text(); + console.LogInfo(_BackgroundListWidget.objectName); + console.LogInfo("CurrentClicked BackgroundListItem: " + CurrentClickedItemName); + CheckSelected(CurrentClickedItemName); + } + + + + +function CheckSelected (text){ + //Need to check if all props in one or separate arrays. These have to match the files in Props folder to work. + //Also maybe make the URL a bit more generic to be easier to use anywhere. + + //Just for demo purpose, use the one above in real 1 + var effectArray = ["Beach", "PalmTrees", "Sun", "DaySky"]; + + if(text == null || text == ""){ + console.LogInfo("You havn't selected any effect"); + } + else + { + for(j=0; j + + MainMenu + + + + 0 + 0 + 103 + 242 + + + + true + + + true + + + Form + + + QWidget#MainMenu { background-color: transparent; } +QFrame#frame { background-color: rgba(33, 217, 229,200); + border-radius: 12px;} + +QPushButton#BackgroundBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#SceneBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#PropBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#ClearMenuBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#ClearEntityBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#RandomBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#MumbleBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 12px; +font:bold; + padding-left: 5px; + padding-right: 5px;} + + + + + + 2 + 1 + 101 + 241 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + 0 + + + + + 4 + 13 + 93 + 30 + + + + true + + + BackGround + + + + 16 + 16 + + + + + + + 4 + 75 + 93 + 30 + + + + true + + + PROPS + + + + + + 4 + 44 + 93 + 30 + + + + true + + + + + + SCENE + + + + + + 4 + 107 + 93 + 30 + + + + true + + + + + + HomeMenu + + + + + + 4 + 139 + 93 + 30 + + + + true + + + + + + ClearAll + + + + + + 4 + 170 + 93 + 30 + + + + true + + + + + + Random + + + + + + 4 + 202 + 93 + 30 + + + + true + + + + + + Mumble + + + + + + + diff --git a/Scripts/ManMade.ui b/Scripts/ManMade.ui new file mode 100644 index 0000000..5358fd2 --- /dev/null +++ b/Scripts/ManMade.ui @@ -0,0 +1,69 @@ + + + ManMade + + + + 0 + 0 + 132 + 209 + + + + true + + + Form + + + QWidget#ManMade{ background-color: transparent;} +QFrame#frame { background-color: rgba(33, 217, 229, 150); + border-radius: 12px;} + + + + + 1 + -2 + 131 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 2 + 81 + 20 + + + + <html><head/><body><p><span style=" color:#ffffff;">MAN_MADE:</span></p></body></html> + + + + + + 15 + 21 + 101 + 181 + + + + true + + + + + + + diff --git a/Scripts/MumbleClientWidget.ui b/Scripts/MumbleClientWidget.ui new file mode 100644 index 0000000..77d3ecf --- /dev/null +++ b/Scripts/MumbleClientWidget.ui @@ -0,0 +1,207 @@ + + + MumbleClientWidget + + + Qt::NonModal + + + true + + + + 0 + 0 + 243 + 264 + + + + true + + + /*QWidget#MumbleClientWidget +{ + border: 0px; + windowFlags: 0x00000800; + +}; */ + +QWidget#MumbleClientWidget +{ + border: 0px; + windowFlags: 0x00000800; + background-color: transparent; } +QFrame#frame { +windowFlags: 0x00000800; +background-color: rgba(33, 217, 229,200); border-radius: 12px; +} + +QLabel, QPushButton { + font-size: 9pt; +} + +QLabel#labelConnectionStateTitle, #labelChannelNameTitle, #labelControlsTitle, #labelChatTitle { + font-weight: bold; +} + +QPlainTextEdit, QLineEdit, QListWidget { + border: 1px solid grey; +} + +QLineEdit { + border-top: 0px; +} + + + + + 0 + 0 + 243 + 264 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 13 + 6 + 93 + 16 + + + + + 0 + 0 + + + + Channel Users + + + 2 + + + + + + 151 + 230 + 81 + 23 + + + + Disconnect + + + + + + 9 + 170 + 221 + 31 + + + + + + + Qt::AlignCenter + + + + + + 12 + 48 + 211 + 118 + + + + + + + 95 + 204 + 71 + 23 + + + + Deaf Self + + + + + + 11 + 24 + 211 + 21 + + + + + 0 + 0 + + + + + + + + + + 172 + 204 + 61 + 23 + + + + Connect + + + + + + 9 + 230 + 131 + 23 + + + + Open Audio Wizard + + + + + + 8 + 204 + 81 + 23 + + + + Mute Self + + + + + + + diff --git a/Mumble/MumbleConnectWidget.ui b/Scripts/MumbleConnectWidget.ui similarity index 91% rename from Mumble/MumbleConnectWidget.ui rename to Scripts/MumbleConnectWidget.ui index f8b017c..c630024 100644 --- a/Mumble/MumbleConnectWidget.ui +++ b/Scripts/MumbleConnectWidget.ui @@ -2,9 +2,6 @@ ConnectDialog - - Qt::NonModal - 0 @@ -13,19 +10,13 @@ 202 - - Connection Information - - - 1.000000000000000 + + true - /* + QWidget#ConnectDialog { background-color: transparent; } -QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;}*/ - - - +QFrame#frame { background-color: rgba(33, 217, 229,200); border-radius: 12px;} diff --git a/Scripts/Object.ui b/Scripts/Object.ui new file mode 100644 index 0000000..62be140 --- /dev/null +++ b/Scripts/Object.ui @@ -0,0 +1,69 @@ + + + Object + + + + 0 + 0 + 132 + 209 + + + + true + + + Form + + + QWidget#Object{ background-color: transparent;} +QFrame#frame { background-color: rgba(36,217,87,150); + border-radius: 12px;} + + + + + 1 + -2 + 131 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 2 + 111 + 20 + + + + <html><head/><body><p><span style=" color:#ffffff;">NATURAL_OBJECTS:</span></p></body></html> + + + + + + 15 + 21 + 101 + 181 + + + + true + + + + + + + diff --git a/Scripts/PropType.ui b/Scripts/PropType.ui new file mode 100644 index 0000000..930d34c --- /dev/null +++ b/Scripts/PropType.ui @@ -0,0 +1,165 @@ + + + PropTypesMenu + + + + 0 + 0 + 102 + 192 + + + + true + + + true + + + Form + + + QWidget#PropTypesMenu { background-color: transparent; } +QFrame#frame { background-color: rgba(33, 217, 229, 150); + border-radius: 12px;} +QPushButton#EffectBtn{ +color:black; +background-color: white; + border-width: 4px; + border-color: rgba(237,29,63,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 15px; +font:bold; + padding-left: 5px; + padding-right: 5px; + } + +QPushButton#ElementBtn +{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(21,122,69,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 15px; +font:bold; + padding-left: 5px; + padding-right: 5px; +} +QPushButton#ManMadeBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 15px; +font:bold; + padding-left: 5px; + padding-right: 5px;} +QPushButton#ObjectBtn{color:black; +background-color: white; + border-width: 4px; + border-color: rgba(36,233,87,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 15px; +font:bold; + padding-left: 5px; + padding-right: 5px;} + + + + + 2 + 1 + 101 + 191 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 5 + 99 + 91 + 31 + + + + true + + + ManMade + + + + + + 5 + 60 + 91 + 31 + + + + true + + + Objects + + + + + + 5 + 21 + 91 + 31 + + + + true + + + + + + Elements + + + + + + 5 + 138 + 91 + 31 + + + + true + + + + + + Effects + + + + + + + diff --git a/Scripts/Scene.ui b/Scripts/Scene.ui new file mode 100644 index 0000000..64fd8ff --- /dev/null +++ b/Scripts/Scene.ui @@ -0,0 +1,69 @@ + + + Scene + + + + 0 + 0 + 132 + 209 + + + + true + + + Form + + + QWidget#Scene{ background-color: transparent;} +QFrame#frame { background-color: rgba(33, 217, 229, 150); + border-radius: 12px;} + + + + + 1 + -2 + 131 + 211 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + 12 + 2 + 54 + 20 + + + + <html><head/><body><p><span style=" color:#ffffff;">Scene:</span></p></body></html> + + + + + + 15 + 21 + 101 + 181 + + + + true + + + + + + + diff --git a/Mumble/StartMumble.ui b/Scripts/StartMumble.ui similarity index 62% rename from Mumble/StartMumble.ui rename to Scripts/StartMumble.ui index cf8fe10..a42ba5f 100644 --- a/Mumble/StartMumble.ui +++ b/Scripts/StartMumble.ui @@ -1,16 +1,13 @@ - StartMumble - - - Qt::ApplicationModal - + PropTypesMenu + 0 0 - 103 - 32 + 102 + 36 @@ -22,12 +19,22 @@ Form - - false - - QWidget#StartMumble { background-color: transparent; } -QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} + QWidget#PropTypesMenu { background-color: transparent; } +QFrame#frame { background-color: rgba(33, 217, 229, 150); + border-radius: 12px;} +QPushButton#MumbleBtn{ +color:black; +background-color: white; + border-width: 4px; + border-color: rgba(29,158,166,55); + border-style: solid; + border-radius: 7; + padding: 3px; + font-size: 14px; +font:bold; + padding-left: 5px; + padding-right: 5px;} @@ -36,7 +43,7 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} 2 1 101 - 31 + 36 @@ -48,10 +55,10 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} - 14 - 6 - 75 - 20 + 5 + 5 + 91 + 26 @@ -61,7 +68,7 @@ QFrame#frame { background-color: rgba(136, 136, 136, 200); border-radius: 12px;} - Mumble + MUMBLE From 09acb4c35c254006ad6ad327d1c11bd929b323cc Mon Sep 17 00:00:00 2001 From: huxiaori Date: Tue, 18 Dec 2012 22:17:33 +0800 Subject: [PATCH 12/13] All GUI files were moved into Scripts folder, move backup files into bak folder and add the MumbleFunc.js --- Background.ui.bak => bak/Background.ui.bak | 0 CreateRefFile.js.bak => bak/CreateRefFile.js.bak | 0 Effect.ui.bak => bak/Effect.ui.bak | 0 Element.ui.bak => bak/Element.ui.bak | 0 MainMenu_bak.js => bak/MainMenu.js (2).bak | 0 MainMenu.js.bak => bak/MainMenu.js.bak | 0 MainMenu.ui.bak => bak/MainMenu.ui.bak | 0 ManMade.ui.bak => bak/ManMade.ui.bak | 0 Object.ui.bak => bak/Object.ui.bak | 0 PropType.ui.bak => bak/PropType.ui.bak | 0 Scene.ui.bak => bak/Scene.ui.bak | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename Background.ui.bak => bak/Background.ui.bak (100%) rename CreateRefFile.js.bak => bak/CreateRefFile.js.bak (100%) rename Effect.ui.bak => bak/Effect.ui.bak (100%) rename Element.ui.bak => bak/Element.ui.bak (100%) rename MainMenu_bak.js => bak/MainMenu.js (2).bak (100%) rename MainMenu.js.bak => bak/MainMenu.js.bak (100%) rename MainMenu.ui.bak => bak/MainMenu.ui.bak (100%) rename ManMade.ui.bak => bak/ManMade.ui.bak (100%) rename Object.ui.bak => bak/Object.ui.bak (100%) rename PropType.ui.bak => bak/PropType.ui.bak (100%) rename Scene.ui.bak => bak/Scene.ui.bak (100%) diff --git a/Background.ui.bak b/bak/Background.ui.bak similarity index 100% rename from Background.ui.bak rename to bak/Background.ui.bak diff --git a/CreateRefFile.js.bak b/bak/CreateRefFile.js.bak similarity index 100% rename from CreateRefFile.js.bak rename to bak/CreateRefFile.js.bak diff --git a/Effect.ui.bak b/bak/Effect.ui.bak similarity index 100% rename from Effect.ui.bak rename to bak/Effect.ui.bak diff --git a/Element.ui.bak b/bak/Element.ui.bak similarity index 100% rename from Element.ui.bak rename to bak/Element.ui.bak diff --git a/MainMenu_bak.js b/bak/MainMenu.js (2).bak similarity index 100% rename from MainMenu_bak.js rename to bak/MainMenu.js (2).bak diff --git a/MainMenu.js.bak b/bak/MainMenu.js.bak similarity index 100% rename from MainMenu.js.bak rename to bak/MainMenu.js.bak diff --git a/MainMenu.ui.bak b/bak/MainMenu.ui.bak similarity index 100% rename from MainMenu.ui.bak rename to bak/MainMenu.ui.bak diff --git a/ManMade.ui.bak b/bak/ManMade.ui.bak similarity index 100% rename from ManMade.ui.bak rename to bak/ManMade.ui.bak diff --git a/Object.ui.bak b/bak/Object.ui.bak similarity index 100% rename from Object.ui.bak rename to bak/Object.ui.bak diff --git a/PropType.ui.bak b/bak/PropType.ui.bak similarity index 100% rename from PropType.ui.bak rename to bak/PropType.ui.bak diff --git a/Scene.ui.bak b/bak/Scene.ui.bak similarity index 100% rename from Scene.ui.bak rename to bak/Scene.ui.bak From 148035b4923610a47d43af47ec1e45670f76d182 Mon Sep 17 00:00:00 2001 From: huxiaori Date: Wed, 19 Dec 2012 18:20:31 +0800 Subject: [PATCH 13/13] modify the MainMenu.ui --- Scripts/MainMenu.ui | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/Scripts/MainMenu.ui b/Scripts/MainMenu.ui index 5ce456c..1ad656d 100644 --- a/Scripts/MainMenu.ui +++ b/Scripts/MainMenu.ui @@ -7,7 +7,7 @@ 0 0 103 - 242 + 212 @@ -109,7 +109,7 @@ font:bold; 2 1 101 - 241 + 211 @@ -235,25 +235,6 @@ font:bold; Random - - - - 4 - 202 - 93 - 30 - - - - true - - - - - - Mumble - -