mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-05 05:07:48 +00:00
GEEKING
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "V8DataModel/StudioToolVerb.h"
|
||||
#include "V8DataModel/StudioTool.h"
|
||||
#include "V8DataModel/StudioToolMouseCommand.h"
|
||||
#include "V8DataModel/Workspace.h"
|
||||
|
||||
namespace RBX
|
||||
{
|
||||
StudioToolVerb::StudioToolVerb(const char* name, StudioTool* studioTool, Workspace* workspace, bool toggle)
|
||||
: Verb(workspace, name)
|
||||
, workspace(workspace)
|
||||
, studioTool(studioTool)
|
||||
, toggle(toggle)
|
||||
{}
|
||||
bool StudioToolVerb::isEnabled() const
|
||||
{
|
||||
return studioTool && studioTool->getEnabled();
|
||||
}
|
||||
bool StudioToolVerb::isChecked() const
|
||||
{
|
||||
if(StudioToolMouseCommand* mouseCommand = dynamic_cast<StudioToolMouseCommand*>(workspace->getCurrentMouseCommand())){
|
||||
return mouseCommand->getStudioTool() == studioTool;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void StudioToolVerb::doIt(IDataState* dataState)
|
||||
{
|
||||
if (isChecked() && toggle) {
|
||||
workspace->setNullMouseCommand(); // Toggle on / off if already on
|
||||
}
|
||||
else {
|
||||
studioTool->equip(workspace);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user