fix tpt.selectedl not updating with sample brush, always put photons[] on top in HUD
This commit is contained in:
parent
b8d53b5f76
commit
1359045b14
@ -148,9 +148,9 @@ GameController::GameController():
|
|||||||
((LuaScriptInterface*)commandInterface)->SetWindow(gameView);
|
((LuaScriptInterface*)commandInterface)->SetWindow(gameView);
|
||||||
|
|
||||||
commandInterface->OnBrushChanged(gameModel->GetBrushID(), gameModel->GetBrush()->GetRadius().X, gameModel->GetBrush()->GetRadius().X);
|
commandInterface->OnBrushChanged(gameModel->GetBrushID(), gameModel->GetBrush()->GetRadius().X, gameModel->GetBrush()->GetRadius().X);
|
||||||
commandInterface->OnActiveToolChanged(0, gameModel->GetActiveTool(0));
|
ActiveToolChanged(0, gameModel->GetActiveTool(0));
|
||||||
commandInterface->OnActiveToolChanged(1, gameModel->GetActiveTool(1));
|
ActiveToolChanged(1, gameModel->GetActiveTool(1));
|
||||||
commandInterface->OnActiveToolChanged(2, gameModel->GetActiveTool(2));
|
ActiveToolChanged(2, gameModel->GetActiveTool(2));
|
||||||
|
|
||||||
//sim = new Simulation();
|
//sim = new Simulation();
|
||||||
Client::Ref().AddListener(this);
|
Client::Ref().AddListener(this);
|
||||||
@ -930,9 +930,13 @@ std::vector<Menu*> GameController::GetMenuList()
|
|||||||
return gameModel->GetMenuList();
|
return gameModel->GetMenuList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameController::SetActiveTool(int toolSelection, Tool * tool)
|
void GameController::ActiveToolChanged(int toolSelection, Tool *tool)
|
||||||
{
|
{
|
||||||
commandInterface->OnActiveToolChanged(toolSelection, tool);
|
commandInterface->OnActiveToolChanged(toolSelection, tool);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameController::SetActiveTool(int toolSelection, Tool * tool)
|
||||||
|
{
|
||||||
gameModel->SetActiveTool(toolSelection, tool);
|
gameModel->SetActiveTool(toolSelection, tool);
|
||||||
gameModel->GetRenderer()->gravityZonesEnabled = false;
|
gameModel->GetRenderer()->gravityZonesEnabled = false;
|
||||||
gameModel->SetLastTool(tool);
|
gameModel->SetLastTool(tool);
|
||||||
|
@ -100,6 +100,7 @@ public:
|
|||||||
void SetActiveMenu(Menu * menu);
|
void SetActiveMenu(Menu * menu);
|
||||||
std::vector<Menu*> GetMenuList();
|
std::vector<Menu*> GetMenuList();
|
||||||
void SetActiveTool(int toolSelection, Tool * tool);
|
void SetActiveTool(int toolSelection, Tool * tool);
|
||||||
|
void ActiveToolChanged(int toolSelection, Tool *tool);
|
||||||
void SetActiveColourPreset(int preset);
|
void SetActiveColourPreset(int preset);
|
||||||
void SetColour(ui::Colour colour);
|
void SetColour(ui::Colour colour);
|
||||||
void SetToolStrength(float value);
|
void SetToolStrength(float value);
|
||||||
|
@ -596,14 +596,17 @@ void GameView::NotifyActiveToolsChanged(GameModel * sender)
|
|||||||
if(sender->GetActiveTool(0) == tool)
|
if(sender->GetActiveTool(0) == tool)
|
||||||
{
|
{
|
||||||
toolButtons[i]->SetSelectionState(0); //Primary
|
toolButtons[i]->SetSelectionState(0); //Primary
|
||||||
|
c->ActiveToolChanged(0, tool);
|
||||||
}
|
}
|
||||||
else if(sender->GetActiveTool(1) == tool)
|
else if(sender->GetActiveTool(1) == tool)
|
||||||
{
|
{
|
||||||
toolButtons[i]->SetSelectionState(1); //Secondary
|
toolButtons[i]->SetSelectionState(1); //Secondary
|
||||||
|
c->ActiveToolChanged(1, tool);
|
||||||
}
|
}
|
||||||
else if(sender->GetActiveTool(2) == tool)
|
else if(sender->GetActiveTool(2) == tool)
|
||||||
{
|
{
|
||||||
toolButtons[i]->SetSelectionState(2); //Tertiary
|
toolButtons[i]->SetSelectionState(2); //Tertiary
|
||||||
|
c->ActiveToolChanged(2, tool);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -31,16 +31,16 @@ void SampleTool::Draw(Simulation * sim, Brush * brush, ui::Point position)
|
|||||||
{
|
{
|
||||||
int particleType = 0;
|
int particleType = 0;
|
||||||
int particleCtype = 0;
|
int particleCtype = 0;
|
||||||
if(sim->pmap[position.Y][position.X])
|
if (sim->photons[position.Y][position.X])
|
||||||
{
|
|
||||||
particleType = sim->parts[sim->pmap[position.Y][position.X]>>8].type;
|
|
||||||
particleCtype = sim->parts[sim->pmap[position.Y][position.X]>>8].ctype;
|
|
||||||
}
|
|
||||||
else if(sim->photons[position.Y][position.X])
|
|
||||||
{
|
{
|
||||||
particleType = sim->parts[sim->photons[position.Y][position.X]>>8].type;
|
particleType = sim->parts[sim->photons[position.Y][position.X]>>8].type;
|
||||||
particleCtype = sim->parts[sim->pmap[position.Y][position.X]>>8].ctype;
|
particleCtype = sim->parts[sim->pmap[position.Y][position.X]>>8].ctype;
|
||||||
}
|
}
|
||||||
|
else if (sim->pmap[position.Y][position.X])
|
||||||
|
{
|
||||||
|
particleType = sim->parts[sim->pmap[position.Y][position.X]>>8].type;
|
||||||
|
particleCtype = sim->parts[sim->pmap[position.Y][position.X]>>8].ctype;
|
||||||
|
}
|
||||||
|
|
||||||
if(particleType)
|
if(particleType)
|
||||||
{
|
{
|
||||||
|
@ -478,16 +478,16 @@ SimulationSample Simulation::Get(int x, int y)
|
|||||||
SimulationSample sample;
|
SimulationSample sample;
|
||||||
sample.PositionX = x;
|
sample.PositionX = x;
|
||||||
sample.PositionY = y;
|
sample.PositionY = y;
|
||||||
if(pmap[y][x])
|
if (photons[y][x])
|
||||||
{
|
|
||||||
sample.particle = parts[pmap[y][x]>>8];
|
|
||||||
sample.ParticleID = pmap[y][x]>>8;
|
|
||||||
}
|
|
||||||
else if(photons[y][x])
|
|
||||||
{
|
{
|
||||||
sample.particle = parts[photons[y][x]>>8];
|
sample.particle = parts[photons[y][x]>>8];
|
||||||
sample.ParticleID = photons[y][x]>>8;
|
sample.ParticleID = photons[y][x]>>8;
|
||||||
}
|
}
|
||||||
|
else if (pmap[y][x])
|
||||||
|
{
|
||||||
|
sample.particle = parts[pmap[y][x]>>8];
|
||||||
|
sample.ParticleID = pmap[y][x]>>8;
|
||||||
|
}
|
||||||
if (bmap[y/CELL][x/CELL])
|
if (bmap[y/CELL][x/CELL])
|
||||||
{
|
{
|
||||||
sample.WallType = bmap[y/CELL][x/CELL];
|
sample.WallType = bmap[y/CELL][x/CELL];
|
||||||
|
Reference in New Issue
Block a user