Merge pull request #61 from Vulpovile/feature/bugfix_properties_duplicate

Fix Bugs
This commit is contained in:
Vulpovile
2022-10-03 08:15:25 -07:00
committed by GitHub
7 changed files with 30 additions and 8 deletions

View File

@@ -718,7 +718,7 @@
> >
</File> </File>
<File <File
RelativePath=".\resource.h" RelativePath=".\src\include\resource.h"
> >
</File> </File>
<File <File
@@ -898,6 +898,10 @@
Name="Resource Files" Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
> >
<File
RelativePath=".\Blocks3D.exe.manifest"
>
</File>
<File <File
RelativePath=".\Dialogs.rc" RelativePath=".\Dialogs.rc"
> >

View File

@@ -40,4 +40,12 @@ FONT 8, "Ms Shell Dlg"
// Icon resources // Icon resources
// //
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_CAN
IDI_ICON1 ICON "FatB3dIcon.ico" IDI_ICON1 ICON "FatB3dIcon.ico"
//
// Manifest resources
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
1 RT_MANIFEST ".\\Blocks3D.exe.manifest"

View File

View File

@@ -175,7 +175,7 @@ void Application::deleteInstance()
} }
} }
if(g_selectedInstances.size() == 0) if(g_selectedInstances.size() == 0)
g_usableApp->_propWindow->ClearProperties(); g_usableApp->_propWindow->UpdateSelected(g_dataModel);
} }
@@ -331,12 +331,25 @@ void Application::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) {
else else
_dataModel->getEngine()->createBody(partInstance); _dataModel->getEngine()->createBody(partInstance);
} }
bool a = false;
while(toDelete.size() > 0) while(toDelete.size() > 0)
{ {
PartInstance * p = toDelete.back(); PartInstance * p = toDelete.back();
toDelete.pop_back(); toDelete.pop_back();
if(std::find(g_selectedInstances.begin(), g_selectedInstances.end(), p) != g_selectedInstances.end())
{
g_selectedInstances.erase(std::remove(g_selectedInstances.begin(), g_selectedInstances.end(), p), g_selectedInstances.end());
a = true;
}
p->setParent(NULL); p->setParent(NULL);
delete p; delete p;
}
if(a)
{
if(g_selectedInstances.size() == 0)
g_usableApp->_propWindow->UpdateSelected(g_dataModel);
else if(g_selectedInstances.size() == 1)
g_usableApp->_propWindow->UpdateSelected(g_selectedInstances[0]);
} }
for(int i = 0; i < 6; i++) for(int i = 0; i < 6; i++)
{ {

View File

@@ -144,6 +144,7 @@ void PartInstance::setParent(Instance* prnt)
PartInstance::PartInstance(const PartInstance &oinst) PartInstance::PartInstance(const PartInstance &oinst)
{ {
PVInstance::PVInstance(oinst); PVInstance::PVInstance(oinst);
physBody = NULL;
glList = glGenLists(1); glList = glGenLists(1);
//name = oinst.name; //name = oinst.name;
//className = "Part"; //className = "Part";

View File

@@ -1,10 +1,6 @@
#include "Globals.h" #include "Globals.h"
#include "Application.h" #include "Application.h"
int const Globals::gen = 0;
int const Globals::major = 0;
int const Globals::minor = 105;
int const Globals::patch = 0;
int Globals::surfaceId = 2; int Globals::surfaceId = 2;
//bool Globals::showMouse = true; //bool Globals::showMouse = true;
bool Globals::useMousePoint = false; bool Globals::useMousePoint = false;

View File

@@ -342,7 +342,7 @@ void PropertyWindow::UpdateSelected(Instance * instance)
{ {
PropGrid_ResetContent(_propGrid); PropGrid_ResetContent(_propGrid);
prop = instance->getProperties(); prop = instance->getProperties();
if (selectedInstance != instance) //if (selectedInstance != instance)
{ {
selectedInstance = instance; selectedInstance = instance;
for(size_t i = 0; i < prop.size(); i++) for(size_t i = 0; i < prop.size(); i++)