[Orxonox-commit 4026] r8700 - in code/branches/presentation: data/gui/layouts data/gui/scripts data/levels src/modules/docking
dafrick at orxonox.net
dafrick at orxonox.net
Mon Jun 6 08:15:38 CEST 2011
Author: dafrick
Date: 2011-06-06 08:15:38 +0200 (Mon, 06 Jun 2011)
New Revision: 8700
Modified:
code/branches/presentation/data/gui/layouts/DockingDialog.layout
code/branches/presentation/data/gui/scripts/DockingDialog.lua
code/branches/presentation/data/levels/presentationFS11.oxw
code/branches/presentation/src/modules/docking/Dock.cc
code/branches/presentation/src/modules/docking/Dock.h
code/branches/presentation/src/modules/docking/DockingTarget.cc
code/branches/presentation/src/modules/docking/DockingTarget.h
Log:
Adherence to styleguide.
Modified: code/branches/presentation/data/gui/layouts/DockingDialog.layout
===================================================================
--- code/branches/presentation/data/gui/layouts/DockingDialog.layout 2011-06-05 22:19:03 UTC (rev 8699)
+++ code/branches/presentation/data/gui/layouts/DockingDialog.layout 2011-06-06 06:15:38 UTC (rev 8700)
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<GUILayout >
- <Window Type="MenuWidgets/StaticImage" Name="orxonox/DockingBackground" >
+ <Window Type="MenuWidgets/StaticImage" Name="orxonox/Docking/Background" >
<Property Name="FrameEnabled" Value="False" />
<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}}" />
<Property Name="BackgroundEnabled" Value="False" />
- <Window Type="MenuWidgets/StaticText" Name="orxonox/DockingTitle" >
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Docking/Title" >
<Property Name="Text" Value="Docking" />
<Property Name="Alpha" Value="0.8" />
<Property Name="InheritsAlpha" Value="False" />
@@ -15,18 +15,18 @@
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="VertFormatting" Value="TopAligned" />
<Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.7,0}}" />
- <Window Type="MenuWidgets/Listbox" Name="orxonox/DockingDocks" >
+ <Window Type="MenuWidgets/Listbox" Name="orxonox/Docking/Docks" >
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.85,0}}" />
</Window>
</Window>
- <Window Type="MenuWidgets/Button" Name="orxonox/DockingDockButton" >
+ <Window Type="MenuWidgets/Button" Name="orxonox/Docking/DockButton" >
<Property Name="Text" Value="Dock" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.2875,0},{0.725,0},{0.4875,0},{0.775,0}}" />
<Event Name="Clicked" Function="DockingDialog.dockButton_clicked"/>
</Window>
- <Window Type="MenuWidgets/Button" Name="orxonox/DockingCancelButton" >
+ <Window Type="MenuWidgets/Button" Name="orxonox/Docking/CancelButton" >
<Property Name="Text" Value="Cancel" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.725,0},{0.7125,0},{0.775,0}}" />
Modified: code/branches/presentation/data/gui/scripts/DockingDialog.lua
===================================================================
--- code/branches/presentation/data/gui/scripts/DockingDialog.lua 2011-06-05 22:19:03 UTC (rev 8699)
+++ code/branches/presentation/data/gui/scripts/DockingDialog.lua 2011-06-06 06:15:38 UTC (rev 8700)
@@ -8,12 +8,12 @@
--button are arranged in a 1x2 matrix
P:setButton(1, 1, {
- ["button"] = winMgr:getWindow("orxonox/DockingDockButton"),
+ ["button"] = winMgr:getWindow("orxonox/Docking/DockButton"),
["callback"] = P.dockButton_clicked
})
P:setButton(1, 2, {
- ["button"] = winMgr:getWindow("orxonox/DockingCancelButton"),
+ ["button"] = winMgr:getWindow("orxonox/Docking/CancelButton"),
["callback"] = P.cancelButton_clicked
})
@@ -36,7 +36,7 @@
table.insert(P.docks, orxonox.Dock:getActiveDockAtIndex(i))
end
- local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/DockingDocks"))
+ local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/Docking/Docks"))
listbox:resetList()
for k in pairs(P.docks) do
@@ -50,7 +50,7 @@
end
function P.dockButton_clicked(e)
- local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/DockingDocks"))
+ local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/Docking/Docks"))
local choice = listbox:getFirstSelectedItem()
if choice ~= nil then
local index = listbox:getItemIndex(choice)
Modified: code/branches/presentation/data/levels/presentationFS11.oxw
===================================================================
--- code/branches/presentation/data/levels/presentationFS11.oxw 2011-06-05 22:19:03 UTC (rev 8699)
+++ code/branches/presentation/data/levels/presentationFS11.oxw 2011-06-06 06:15:38 UTC (rev 8700)
@@ -138,24 +138,24 @@
<!-- PARTICLE EFFECT -->
- <ParticleSpawner position="-50,50,-125" source="Orxonox/RingExp" autostart="false" lifetime=500 loop=1 startdelay=7.5>
+ <ParticleSpawner position="-50,50,-125" source="Orxonox/RingExp" autostart="false" lifetime=500 loop=1 startdelay=2.5>
<events>
<spawn>
- <EventListener event=spawntrigger />
+ <EventListener event=spawndelaytrigger1 />
</spawn>
</events>
</ParticleSpawner>
- <ParticleSpawner position="-50,50,-125" source="Orxonox/RingExp2" autostart="false" lifetime=500 loop=1 startdelay=7>
+ <ParticleSpawner position="-50,50,-125" source="Orxonox/RingExp2" autostart="false" lifetime=500 loop=1 startdelay=2>
<events>
<spawn>
- <EventListener event=spawntrigger />
+ <EventListener event=spawndelaytrigger1 />
</spawn>
</events>
</ParticleSpawner>
- <ParticleSpawner position="-50,50,-125" source="Orxonox/RingExp3" autostart="false" lifetime=500 loop=1 startdelay=7>
+ <ParticleSpawner position="-50,50,-125" source="Orxonox/RingExp3" autostart="false" lifetime=500 loop=1 startdelay=2>
<events>
<spawn>
- <EventListener event=spawntrigger />
+ <EventListener event=spawndelaytrigger1 />
</spawn>
</events>
</ParticleSpawner>
Modified: code/branches/presentation/src/modules/docking/Dock.cc
===================================================================
--- code/branches/presentation/src/modules/docking/Dock.cc 2011-06-05 22:19:03 UTC (rev 8699)
+++ code/branches/presentation/src/modules/docking/Dock.cc 2011-06-06 06:15:38 UTC (rev 8700)
@@ -62,7 +62,6 @@
{
}
-
void Dock::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(Dock, XMLPort, xmlelement, mode);
@@ -79,7 +78,6 @@
XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
}
-
bool Dock::execute(bool bTriggered, BaseObject* trigger)
{
PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
@@ -108,7 +106,7 @@
if(bTriggered)
{
// Add player to this Docks candidates
- candidates.insert(player);
+ candidates_.insert(player);
// Show docking dialog
GUIManager::showGUI("DockingDialog");
@@ -116,13 +114,12 @@
else
{
// Remove player from candidates list
- candidates.erase(player);
+ candidates_.erase(player);
}
return true;
}
-
void Dock::cmdDock()
{
PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
@@ -143,57 +140,56 @@
}
}
-
bool Dock::dock(PlayerInfo* player)
{
// Check if player is a candidate
- if(candidates.find(player) == candidates.end())
+ if(candidates_.find(player) == candidates_.end())
{
COUT(2) << "Dock::dock Player is not a candidate!" << std::endl;
return false;
}
- candidates.erase(player);
- docked.insert(player);
+ candidates_.erase(player);
+ docked_.insert(player);
- if (animations.empty())
+ if (animations_.empty())
return dockingAnimationFinished(player);
else
- DockingAnimation::invokeAnimation(true, player, animations);
+ DockingAnimation::invokeAnimation(true, player, animations_);
return true;
}
bool Dock::dockingAnimationFinished(PlayerInfo* player)
{
- if(docked.find(player) == docked.end())
+ if(docked_.find(player) == docked_.end())
{
COUT(2) << "Dock::dockingAnimationFinished Player is not currently docked." << std::endl;
return false;
}
- DockingEffect::invokeEffect(true, player, effects);
+ DockingEffect::invokeEffect(true, player, effects_);
return true;
}
bool Dock::undock(PlayerInfo* player)
{
// Check if player is docked to this Dock
- if(docked.find(player) == docked.end())
+ if(docked_.find(player) == docked_.end())
{
COUT(2) << "Dock::undock Player is not docked to this Dock." << std::endl;
return false;
}
- docked.erase(player);
- candidates.insert(player);
+ docked_.erase(player);
+ candidates_.insert(player);
- DockingEffect::invokeEffect(false, player, effects);
+ DockingEffect::invokeEffect(false, player, effects_);
- if (animations.empty())
+ if (animations_.empty())
return undockingAnimationFinished(player);
else
- DockingAnimation::invokeAnimation(false, player, animations);
+ DockingAnimation::invokeAnimation(false, player, animations_);
return true;
}
@@ -203,14 +199,13 @@
return true;
}
-
unsigned int Dock::getNumberOfActiveDocks()
{
int i = 0;
PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
{
- if(it->candidates.find(player) != it->candidates.end())
+ if(it->candidates_.find(player) != it->candidates_.end())
i++;
}
return i;
@@ -221,7 +216,7 @@
PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
{
- if(it->candidates.find(player) != it->candidates.end())
+ if(it->candidates_.find(player) != it->candidates_.end())
{
if(index == 0)
return *it;
@@ -231,17 +226,16 @@
return NULL;
}
-
bool Dock::addEffect(DockingEffect* effect)
{
assert(effect);
- effects.push_back(effect);
+ effects_.push_back(effect);
return true;
}
const DockingEffect* Dock::getEffect(unsigned int i) const
{
- for (std::list<DockingEffect*>::const_iterator effect = this->effects.begin(); effect != this->effects.end(); ++effect)
+ for (std::list<DockingEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect)
{
if(i == 0)
return *effect;
@@ -254,13 +248,13 @@
{
assert(animation);
animation->setParent(this);
- animations.push_back(animation);
+ animations_.push_back(animation);
return true;
}
const DockingAnimation* Dock::getAnimation(unsigned int i) const
{
- for (std::list<DockingAnimation*>::const_iterator animation = this->animations.begin(); animation != this->animations.end(); ++animation)
+ for (std::list<DockingAnimation*>::const_iterator animation = this->animations_.begin(); animation != this->animations_.end(); ++animation)
{
if(i == 0)
return *animation;
@@ -269,4 +263,3 @@
return NULL;
}
}
-
Modified: code/branches/presentation/src/modules/docking/Dock.h
===================================================================
--- code/branches/presentation/src/modules/docking/Dock.h 2011-06-05 22:19:03 UTC (rev 8699)
+++ code/branches/presentation/src/modules/docking/Dock.h 2011-06-06 06:15:38 UTC (rev 8700)
@@ -54,46 +54,49 @@
class _DockingExport Dock // tolua_export
: public StaticEntity
{ // tolua_export
- public:
- Dock(BaseObject* creator);
- virtual ~Dock();
+ public:
+ Dock(BaseObject* creator);
+ virtual ~Dock();
- // Trigger interface
- bool execute(bool bTriggered, BaseObject* trigger);
+ // Trigger interface
+ bool execute(bool bTriggered, BaseObject* trigger);
- // XML interface
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
+ // XML interface
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
- // XML functions
- bool addEffect(DockingEffect* effect); //!< Add a DockingEffect to the Dock.
- const DockingEffect* getEffect(unsigned int index) const; //!< Get the DockingEffect at a given index.
- bool addAnimation(DockingAnimation* animation); //!< Add a DockingAnimation to the Dock.
- const DockingAnimation* getAnimation(unsigned int index) const; //!< Get the DockingAnimation at a given index.
+ // XML functions
+ bool addEffect(DockingEffect* effect); //!< Add a DockingEffect to the Dock.
+ const DockingEffect* getEffect(unsigned int index) const; //!< Get the DockingEffect at a given index.
+ bool addAnimation(DockingAnimation* animation); //!< Add a DockingAnimation to the Dock.
+ const DockingAnimation* getAnimation(unsigned int index) const; //!< Get the DockingAnimation at a given index.
- // Docking/undocking logic, checks conditions and invokes the DockingAnimations
- bool dock(PlayerInfo* player); //!< Returns true if given player docked successfully (player must be a candidate)
- bool undock(PlayerInfo* player); //!< Undocks a player (player must be docked)
+ // Docking/undocking logic, checks conditions and invokes the DockingAnimations
+ bool dock(PlayerInfo* player); //!< Returns true if given player docked successfully (player must be a candidate)
+ bool undock(PlayerInfo* player); //!< Undocks a player (player must be docked)
- // Animation logic
- bool dockingAnimationFinished(PlayerInfo* player); //!< Called when a docking animation finished
- bool undockingAnimationFinished(PlayerInfo* player); //!< Called when a undocking animation finished
+ // Animation logic
+ bool dockingAnimationFinished(PlayerInfo* player); //!< Called when a docking animation finished
+ bool undockingAnimationFinished(PlayerInfo* player); //!< Called when a undocking animation finished
- // LUA interface
- void dock() { this->dock(HumanController::getLocalControllerSingleton()->getPlayer()); } // tolua_export
- static unsigned int getNumberOfActiveDocks(); // tolua_export
- static Dock* getActiveDockAtIndex(unsigned int index); // tolua_export
+ // LUA interface
+ // tolua_begin
+ void dock()
+ { this->dock(HumanController::getLocalControllerSingleton()->getPlayer()); }
+ static unsigned int getNumberOfActiveDocks();
+ static Dock* getActiveDockAtIndex(unsigned int index);
+ // tolua_end
- // Console commands
- static void cmdDock();
- static void cmdUndock();
+ // Console commands
+ static void cmdDock();
+ static void cmdUndock();
- private:
- std::set<PlayerInfo*> candidates; //!< A set of all players which are allowed to dock using the console command.
- std::set<PlayerInfo*> docked; //!< A set of all docked players
+ private:
+ std::set<PlayerInfo*> candidates_; //!< A set of all players which are allowed to dock using the console command.
+ std::set<PlayerInfo*> docked_; //!< A set of all docked players
- std::list<DockingEffect*> effects; //!< The list of DockingEffects to be executed when a player docks.
- std::list<DockingAnimation*> animations; //!< The list of DockingAnimations to be executed before a player docks
+ std::list<DockingEffect*> effects_; //!< The list of DockingEffects to be executed when a player docks.
+ std::list<DockingAnimation*> animations_; //!< The list of DockingAnimations to be executed before a player docks
}; // tolua_export
} // tolua_export
Modified: code/branches/presentation/src/modules/docking/DockingTarget.cc
===================================================================
--- code/branches/presentation/src/modules/docking/DockingTarget.cc 2011-06-05 22:19:03 UTC (rev 8699)
+++ code/branches/presentation/src/modules/docking/DockingTarget.cc 2011-06-06 06:15:38 UTC (rev 8700)
@@ -48,22 +48,12 @@
{
}
-
void DockingTarget::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(DockingTarget, XMLPort, xmlelement, mode);
- XMLPortParam(DockingTarget, "name", setName, getName, xmlelement, mode);
COUT(4) << "DockingTarget with name '" << this->getName() << "' created.." << std::endl;
}
-
- void DockingTarget::setName(const std::string& str) {
- this->name_ = str;
- }
-
- const std::string& DockingTarget::getName() const {
- return this->name_;
- }
}
Modified: code/branches/presentation/src/modules/docking/DockingTarget.h
===================================================================
--- code/branches/presentation/src/modules/docking/DockingTarget.h 2011-06-05 22:19:03 UTC (rev 8699)
+++ code/branches/presentation/src/modules/docking/DockingTarget.h 2011-06-06 06:15:38 UTC (rev 8700)
@@ -53,17 +53,12 @@
*/
class _DockingExport DockingTarget : public StaticEntity
{
- private:
- std::string name_;
-
public:
DockingTarget(BaseObject* creator);
virtual ~DockingTarget();
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual void setName(const std::string& str);
- virtual const std::string& getName() const;
};
}
More information about the Orxonox-commit
mailing list