bigger selectionbox
This commit is contained in:
@@ -185,6 +185,7 @@
|
||||
OutputFile="./Blocks3D-Debug.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories=""
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/Blocks3D.pdb"
|
||||
SubSystem="1"
|
||||
|
||||
@@ -213,7 +213,7 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
|
||||
button->boxBegin = Vector2(0,215);
|
||||
button->boxEnd = Vector2(80,235);
|
||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
||||
button->textColor = Color3::white();
|
||||
button->textColor = Color3(0,1,1);
|
||||
button->boxColor = Color4::clear();
|
||||
button->textSize = 12;
|
||||
button->title = "Group";
|
||||
@@ -229,7 +229,7 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
|
||||
button->boxBegin = Vector2(0,240);
|
||||
button->boxEnd = Vector2(80,260);
|
||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
||||
button->textColor = Color3::white();
|
||||
button->textColor = Color3(0,1,1);
|
||||
button->boxColor = Color4::clear();
|
||||
button->textSize = 12;
|
||||
button->title = "UnGroup";
|
||||
@@ -245,7 +245,7 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
|
||||
button->boxBegin = Vector2(0,265);
|
||||
button->boxEnd = Vector2(80,285);
|
||||
button->textOutlineColor = Color4(0.5F,0.5F,0.5F,0.5F);
|
||||
button->textColor = Color3::white();
|
||||
button->textColor = Color3(0,1,1);
|
||||
button->boxColor = Color4::clear();
|
||||
button->textSize = 12;
|
||||
button->title = "Duplicate";
|
||||
@@ -520,11 +520,19 @@ void GuiRootInstance::update()
|
||||
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete)
|
||||
{
|
||||
button->disabled = false;
|
||||
button2->disabled = false;
|
||||
button3->disabled = false;
|
||||
button4->disabled = false;
|
||||
button5->disabled = false;
|
||||
button6->disabled = false;
|
||||
|
||||
|
||||
if (g_dataModel->getSelectionService()->getSelection().size() > 1){
|
||||
button2->disabled = false;
|
||||
}
|
||||
|
||||
if (g_dataModel->getSelectionService()->getSelection()[i]->getClassName() == "GroupInstance"){
|
||||
button3->disabled = false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,17 +86,17 @@ void SelectionService::render(RenderDevice * rd)
|
||||
void drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Vector3 size, Vector3 pos, CoordinateFrame c)
|
||||
{
|
||||
Color3 outline = Color3::cyan();//Color3(0.098F,0.6F,1.0F);
|
||||
float offsetSize = 0.05F;
|
||||
float offsetSize = 0.1F;
|
||||
//X
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, from.y + offsetSize, from.z + offsetSize), Vector3(to.x + offsetSize, from.y - offsetSize, from.z - offsetSize))), rd, outline, Color4::clear());
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, to.y + offsetSize, from.z + offsetSize), Vector3(to.x + offsetSize, to.y - offsetSize, from.z - offsetSize))), rd, outline, Color4::clear());
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, to.y + offsetSize, to.z + offsetSize), Vector3(to.x + offsetSize, to.y - offsetSize, to.z - offsetSize))), rd, outline, Color4::clear());
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, from.y + offsetSize, to.z + offsetSize), Vector3(to.x + offsetSize, from.y - offsetSize, to.z - offsetSize))), rd, outline, Color4::clear());
|
||||
//Y
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y - offsetSize + 0.1, from.z + offsetSize), Vector3(from.x - offsetSize, to.y + offsetSize - 0.1, from.z - offsetSize))), rd, outline, Color4::clear());
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y - offsetSize + 0.1, from.z + offsetSize), Vector3(to.x - offsetSize, to.y + offsetSize - 0.1, from.z - offsetSize))), rd, outline, Color4::clear());
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y - offsetSize + 0.1, to.z + offsetSize), Vector3(to.x - offsetSize, to.y + offsetSize-0.1, to.z - offsetSize))), rd, outline, Color4::clear());
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y - offsetSize + 0.1, to.z + offsetSize), Vector3(from.x - offsetSize, to.y + offsetSize - 0.1, to.z - offsetSize))), rd, outline, Color4::clear());
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y - offsetSize + 0.2, from.z + offsetSize), Vector3(from.x - offsetSize, to.y + offsetSize - 0.2, from.z - offsetSize))), rd, outline, Color4::clear());
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y - offsetSize + 0.2, from.z + offsetSize), Vector3(to.x - offsetSize, to.y + offsetSize - 0.2, from.z - offsetSize))), rd, outline, Color4::clear());
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y - offsetSize + 0.2, to.z + offsetSize), Vector3(to.x - offsetSize, to.y + offsetSize-0.1, to.z - offsetSize))), rd, outline, Color4::clear());
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y - offsetSize + 0.2, to.z + offsetSize), Vector3(from.x - offsetSize, to.y + offsetSize - 0.2, to.z - offsetSize))), rd, outline, Color4::clear());
|
||||
|
||||
//Z
|
||||
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y + offsetSize, from.z - offsetSize), Vector3(from.x - offsetSize, from.y - offsetSize, to.z + offsetSize))), rd, outline, Color4::clear());
|
||||
|
||||
@@ -16,7 +16,11 @@ void GUDButtonListener::onButton1MouseClick(BaseButtonInstance* button)
|
||||
}
|
||||
if(cont)
|
||||
{
|
||||
AudioPlayer::playSound(dingSound);
|
||||
|
||||
if(button->disabled == false){
|
||||
AudioPlayer::playSound(dingSound);
|
||||
}
|
||||
|
||||
if(button->name == "Duplicate")
|
||||
{
|
||||
std::vector<Instance*> newinst;
|
||||
@@ -36,28 +40,31 @@ void GUDButtonListener::onButton1MouseClick(BaseButtonInstance* button)
|
||||
}
|
||||
else if(button->name == "Group")
|
||||
{
|
||||
GroupInstance * inst = new GroupInstance();
|
||||
inst->setParent(g_dataModel->getWorkspace());
|
||||
for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++)
|
||||
{
|
||||
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete)
|
||||
if (g_dataModel->getSelectionService()->getSelection().size() > 1){
|
||||
GroupInstance * inst = new GroupInstance();
|
||||
inst->setParent(g_dataModel->getWorkspace());
|
||||
for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++)
|
||||
{
|
||||
g_dataModel->getSelectionService()->getSelection()[i]->setParent(inst);
|
||||
if(PartInstance* part = dynamic_cast<PartInstance*>(g_dataModel->getSelectionService()->getSelection()[i]))
|
||||
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete)
|
||||
{
|
||||
inst->primaryPart = part;
|
||||
g_dataModel->getSelectionService()->getSelection()[i]->setParent(inst);
|
||||
if(PartInstance* part = dynamic_cast<PartInstance*>(g_dataModel->getSelectionService()->getSelection()[i]))
|
||||
{
|
||||
inst->primaryPart = part;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
g_dataModel->getSelectionService()->clearSelection();
|
||||
g_dataModel->getSelectionService()->addSelected(inst);
|
||||
g_dataModel->getSelectionService()->clearSelection();
|
||||
g_dataModel->getSelectionService()->addSelected(inst);
|
||||
}
|
||||
}
|
||||
else if(button->name == "UnGroup")
|
||||
{
|
||||
std::vector<Instance*> newinst;
|
||||
for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++)
|
||||
{
|
||||
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete)
|
||||
Instance* selection = g_dataModel->getSelectionService()->getSelection()[i];
|
||||
if(selection->canDelete && selection->getClassName() == "GroupInstance")
|
||||
{
|
||||
if(GroupInstance* model = dynamic_cast<GroupInstance*>(g_dataModel->getSelectionService()->getSelection()[i]))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user