[Orxonox-commit 6810] r11437 - in code/branches/Presentation_FS17: . data/gui/layouts data/gui/scripts data/levels data/overlays data/tcl src/modules src/modules/dialogue
patricwi at orxonox.net
patricwi at orxonox.net
Mon May 29 16:18:43 CEST 2017
Author: patricwi
Date: 2017-05-29 16:18:43 +0200 (Mon, 29 May 2017)
New Revision: 11437
Added:
code/branches/Presentation_FS17/data/gui/layouts/Dialogue.layout
code/branches/Presentation_FS17/data/gui/scripts/Dialogue.lua
code/branches/Presentation_FS17/data/gui/scripts/TestDialogButttons.lua
code/branches/Presentation_FS17/data/levels/DialogueShowcase.oxw
code/branches/Presentation_FS17/data/tcl/core
code/branches/Presentation_FS17/src/modules/dialogue/
Modified:
code/branches/Presentation_FS17/
code/branches/Presentation_FS17/data/overlays/HUDTemplates3.oxo
code/branches/Presentation_FS17/src/modules/CMakeLists.txt
code/branches/Presentation_FS17/src/modules/dialogue/DialogueManager.cc
Log:
Dialogue project merged
Index: code/branches/Presentation_FS17
===================================================================
--- code/branches/Presentation_FS17 2017-05-29 13:37:40 UTC (rev 11436)
+++ code/branches/Presentation_FS17 2017-05-29 14:18:43 UTC (rev 11437)
Property changes on: code/branches/Presentation_FS17
___________________________________________________________________
Modified: svn:mergeinfo
## -1,5 +1,6 ##
/code/branches/AI_HS15:10640-10832
/code/branches/BigShip_HS16:11213-11356
+/code/branches/Dialogue_FS17:11360-11436
/code/branches/HUD_HS16:11212-11353
/code/branches/Highscore_HS16:11226-11355
/code/branches/ParticleEffectsFS15:10309-10612
Copied: code/branches/Presentation_FS17/data/gui/layouts/Dialogue.layout (from rev 11436, code/branches/Dialogue_FS17/data/gui/layouts/Dialogue.layout)
===================================================================
--- code/branches/Presentation_FS17/data/gui/layouts/Dialogue.layout (rev 0)
+++ code/branches/Presentation_FS17/data/gui/layouts/Dialogue.layout 2017-05-29 14:18:43 UTC (rev 11437)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+ <Window Type="DefaultWindow" Name="orxonox/Dialogue/Background" >
+ <Property Name="InheritsAlpha" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Dialogue/Inventory" >
+ <Property Name="Alpha" Value="0.8" />
+ <Property Name="InheritsAlpha" Value="False" />
+ <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="VertFormatting" Value="TopAligned" />
+ <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.15,0},{0.85,0},{0.8,0}}" />
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Dialogue/Wrapper" >
+ <Property Name="TextColours" Value="FF4444FF" />
+ <Property Name="InheritsAlpha" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="VertFormatting" Value="TopAligned" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.92,0}}" />
+ </Window>
+ </Window>
+
+ </Window>
+</GUILayout>
\ No newline at end of file
Copied: code/branches/Presentation_FS17/data/gui/scripts/Dialogue.lua (from rev 11436, code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua)
===================================================================
--- code/branches/Presentation_FS17/data/gui/scripts/Dialogue.lua (rev 0)
+++ code/branches/Presentation_FS17/data/gui/scripts/Dialogue.lua 2017-05-29 14:18:43 UTC (rev 11437)
@@ -0,0 +1,144 @@
+
+-- Dialogue.lua
+
+local P = createMenuSheet("Dialogue")
+
+P.wrapper = nil
+P.detailsWindows = {}
+P.detailPickups = {}
+P.pickupsList = {}
+
+P.showing = false
+
+-- Design parameters
+P.imageHeight = 50
+P.detailImageSize = 100
+P.textHeight = 30
+P.buttonWidth = 85
+
+function P.onLoad()
+ P.wrapper = nil
+ P.detailsWindows = {}
+ P.detailPickups = {}
+ P.pickupsList = {}
+end
+
+function P.onShow()
+ orxonox.CommandExecutor:execute("setTimeFactor 0")
+ P.createInventory()
+ P.showing = true
+
+end
+
+function P.onHide()
+ orxonox.CommandExecutor:execute("setTimeFactor 1")
+ P.showing = false
+ P.cleanup(true)
+end
+
+function P.update()
+ P.updateInventory()
+ if P.showing == false then
+ return
+ end
+
+ -- Update opened detail windows.
+
+
+ -- Update main inventory.
+ P.cleanup(false)
+ P.createInventory()
+ -- TODO: Recover scrolling position
+
+end
+
+function P.createInventory()
+
+ local pickupManager = orxonox.DialogueManager:getInstance()
+
+ root = winMgr:getWindow("orxonox/Dialogue/Inventory")
+ local question = orxonox.DialogueManager:getInstance():getquestion()
+ root:setText(question)
+ P.wrapper = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/Dialogue/Inventory/Wrapper")
+ P.wrapper:setSize(CEGUI.UVector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
+ root:addChildWindow(P.wrapper)
+
+
+ detailsButton = winMgr:createWindow("MenuWidgets/Button", "/DetailsButton")
+ local a1 = orxonox.DialogueManager:getInstance():getanswers1()
+ detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.25, (P.imageHeight-P.textHeight)/2)))
+ detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0.8, 0), CEGUI.UDim(0, P.textHeight)))
+ detailsButton:setText(a1)
+ orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name ..".a1Button_clicked")
+ P.wrapper:addChildWindow(detailsButton)
+
+ a2Button = winMgr:createWindow("MenuWidgets/Button", "/a2Button")
+ local a2 = orxonox.DialogueManager:getInstance():getanswers2()
+ a2Button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.4, (P.imageHeight-P.textHeight)/2)))
+ a2Button:setSize(CEGUI.UVector2(CEGUI.UDim(0.8, 0), CEGUI.UDim(0, P.textHeight)))
+ a2Button:setText(a2)
+ orxonox.GUIManager:subscribeEventHelper(a2Button, "Clicked", P.name ..".a2Button_clicked")
+ P.wrapper:addChildWindow(a2Button)
+
+
+end
+
+function P.updateInventory()
+ local questionn = orxonox.DialogueManager:getInstance():getquestion()
+ root:setText(questionn)
+ local a1n = orxonox.DialogueManager:getInstance():getanswers1()
+ detailsButton:setText(a1n)
+ local a2n = orxonox.DialogueManager:getInstance():getanswers2()
+ a2Button:setText(a2n)
+
+end
+
+
+function P.cleanup(destroyDetails)
+
+ if P.wrapper ~= nil then
+ winMgr:destroyWindow(P.wrapper)
+ end
+
+ --Destroy details windows.
+ if destroyDetails == false then
+ return
+ end
+ for k,v in pairs(P.detailsWindows) do
+ if v ~= nil then
+ P.destroyDetailWindow(k)
+ end
+ end
+
+end
+
+
+
+function P.a1Button_clicked(e)
+ local ending = orxonox.DialogueManager:getInstance():theEnd()
+
+ if ending then
+ orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialogue")
+
+
+ else
+ orxonox.DialogueManager:getInstance():a1clicked()
+ P.update()
+ end
+end
+
+function P.a2Button_clicked(e)
+ local ending = orxonox.DialogueManager:getInstance():theEnd()
+
+ if ending then
+ orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialogue")
+
+
+ else
+ orxonox.DialogueManager:getInstance():a2clicked()
+ P.update()
+ end
+
+end
+
+return P
Copied: code/branches/Presentation_FS17/data/gui/scripts/TestDialogButttons.lua (from rev 11436, code/branches/Dialogue_FS17/data/gui/scripts/TestDialogButttons.lua)
===================================================================
--- code/branches/Presentation_FS17/data/gui/scripts/TestDialogButttons.lua (rev 0)
+++ code/branches/Presentation_FS17/data/gui/scripts/TestDialogButttons.lua 2017-05-29 14:18:43 UTC (rev 11437)
@@ -0,0 +1,30 @@
+local P = createMenuSheet("dialogue")
+
+function P.onLoad()
+ --buttons are arranged in a 2x1 Matrix (list)
+ P:setButton(1, 1, {
+ ["button"] = winMgr:getWindow("orxonox/QuickGameTestButton"),
+ ["callback"] = P.QuickGameTestButton_clicked
+ })
+
+ P:setButton(2, 1, {
+ ["button"] = winMgr:getWindow("orxonox/SingleplayerButton"),
+ ["callback"] = P.SingleplayerButton_clicked
+ })
+
+end
+
+-- events for options
+function P.QuickGameTestButton_clicked(e)
+ hideAllMenuSheets()
+ orxonox.execute("startGame")
+end
+
+function P.SingleplayerButton_clicked(e)
+ showMenuSheet("SingleplayerMenu", true)
+end
+
+
+
+return P
+
Copied: code/branches/Presentation_FS17/data/levels/DialogueShowcase.oxw (from rev 11436, code/branches/Dialogue_FS17/data/levels/DialogueShowcase.oxw)
===================================================================
--- code/branches/Presentation_FS17/data/levels/DialogueShowcase.oxw (rev 0)
+++ code/branches/Presentation_FS17/data/levels/DialogueShowcase.oxw 2017-05-29 14:18:43 UTC (rev 11437)
@@ -0,0 +1,79 @@
+<LevelInfo
+ name = "DialogueShowcase"
+ description = "A level to show and test the functionality of the Dialogue module."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+ include("templates/HeavyCruiser.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipEscort.oxt")
+ include("templates/endurancetest_template.oxt")
+?>
+
+<Level>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox"
+ >
+ <DistanceTrigger name="test" position="100,0,100" target="Pawn" distance=25 stayActive="true" />
+ <Backlight position="100,0,100" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/>
+
+ <NextQuestion question="Unknown Spaceship Transmission: Who goes there?" a1="(say your name)" a2="None of your business I'm afraid." >
+ <possibleQuestions>
+ <NextQuestion question="You're not cleared for this area, turn back." a1="Doesn't look too exciting here anyways." a2="You gotta make me try...(attack)" />
+ <NextQuestion question="I'll make it my business. Only military allowed in this area." a1="Whoops, didn't know that, I'll be on my way then." a2="Got an important message for Sgt Smith though." >
+ <possibleQuestions>
+ <NextQuestion question="Make sure I don't have to see your ugly face again." a1="...thanks, bye." a2="I'll think about it." />
+ <NextQuestion question="Oh why didn't you say that in the first place? Off you go." a1="Thanks mate." a2="Just don't be so rude next time." />
+ </possibleQuestions>
+ </NextQuestion>
+ </possibleQuestions>
+ <events>
+ <execute>
+ <EventListener event="test" />
+ </execute>
+ </events>
+ </NextQuestion>
+
+ <DistanceTrigger name="test1" position="100,0,-100" target="Pawn" distance=25 stayActive="true" />
+ <Backlight position="100,0,-100" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,1"/>
+
+ <NextQuestion question="Hey, sorry to bother you, could you help me with something?" a1="Yeah sure." a2="Nope get lost." >
+ <possibleQuestions>
+ <NextQuestion question="Do you like fish" a1="...yes?" a2="This is wasting my time." >
+ <possibleQuestions>
+ <NextQuestion question="Splendid! Would you like your ship to look like one?" a1="..." a2="I'm going now, okay?" />
+ <NextQuestion question="Turtles then?" a1="..." a2="Im going now, okay?" />
+ </possibleQuestions>
+ </NextQuestion>
+ <NextQuestion question="I can pay you know." a1="Got enough money." a2="...are you deaf? Bye."/>
+ </possibleQuestions>
+ <events>
+ <execute>
+ <EventListener event="test1" />
+ </execute>
+ </events>
+ </NextQuestion>
+
+
+
+ <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+ <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+
+
+ </Scene>
+</Level>
Modified: code/branches/Presentation_FS17/data/overlays/HUDTemplates3.oxo
===================================================================
--- code/branches/Presentation_FS17/data/overlays/HUDTemplates3.oxo 2017-05-29 13:37:40 UTC (rev 11436)
+++ code/branches/Presentation_FS17/data/overlays/HUDTemplates3.oxo 2017-05-29 14:18:43 UTC (rev 11437)
@@ -213,5 +213,11 @@
visible = "false"
/>
+ <GUIOverlay
+ name = "Dialogue"
+ guiname = "Dialogue"
+ visible = "false"
+ />
+
</OverlayGroup>
</Template>
Copied: code/branches/Presentation_FS17/data/tcl/core (from rev 11436, code/branches/Dialogue_FS17/data/tcl/core)
===================================================================
(Binary files differ)
Modified: code/branches/Presentation_FS17/src/modules/CMakeLists.txt
===================================================================
--- code/branches/Presentation_FS17/src/modules/CMakeLists.txt 2017-05-29 13:37:40 UTC (rev 11436)
+++ code/branches/Presentation_FS17/src/modules/CMakeLists.txt 2017-05-29 14:18:43 UTC (rev 11437)
@@ -25,6 +25,7 @@
################ Sub Directories ################
+ADD_SUBDIRECTORY(dialogue)
ADD_SUBDIRECTORY(designtools)
ADD_SUBDIRECTORY(gametypes)
ADD_SUBDIRECTORY(notifications)
Modified: code/branches/Presentation_FS17/src/modules/dialogue/DialogueManager.cc
===================================================================
--- code/branches/Dialogue_FS17/src/modules/dialogue/DialogueManager.cc 2017-05-29 13:37:40 UTC (rev 11436)
+++ code/branches/Presentation_FS17/src/modules/dialogue/DialogueManager.cc 2017-05-29 14:18:43 UTC (rev 11437)
@@ -26,10 +26,10 @@
void DialogueManager::registerquestion(NextQuestion* nq){
if(allQuestions.size()==0) {
- orxout(internal_info) << "At least one NextQuestion has to be set." << endl;
+ orxout(verbose) << "At least one NextQuestion has to be set." << endl;
}
allQuestions.push_back(nq);
- orxout(internal_info) << "qsize " << allQuestions.size();
+ orxout(verbose) << "qsize " << allQuestions.size();
}
@@ -89,4 +89,4 @@
else return false;
}
-}
\ No newline at end of file
+}
More information about the Orxonox-commit
mailing list