Skip to content

Commit

Permalink
v1.14.1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
krawthekrow committed Oct 30, 2022
1 parent b56cda5 commit 5201cc0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 31 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ New features:
- Subframe animation (shortcut: Shift-Space). Runs the simulation particle-by-particle rather than frame-by-frame.
- Subframe recording (Lua: `tpt.record_subframe(true)`). Starts a recording of particle-by-particle simulation and automatically stops recording at the end of the frame. You can stop the recording with `tpt.record_subframe(false)` without stopping particle-by-particle simulation.
- (v1.1) Stack tool (shortcut: Shift-S). Dragging on a stack of particles unstacks them; selecting multiple particles in different positions stacks them in order of their positions.
- (v1.1) Stack mode (shortcut: Shift-D to toggle). Allows you to draw over existing particles, and makes right-click delete one stacked particle at a time. This helps to make transparent DTEC.
- (v1.1) Stack mode (shortcut: Shift-D to toggle). Allows you to draw or paste over existing particles, and makes right-click delete one stacked particle at a time. This helps to make things like transparent DTEC.
- (v1.7) Config tool (shortcut: C). Sets particle properties in a few clicks. DRAY: Sets tmp, then tmp2. CRAY: Sets tmp2, then tmp. LDTC: Sets life, then tmp. DTEC/TSNS/LSNS/VSNS: Sets tmp2. FILT: Sets tmp. CONV: Sets tmp (click on another particle with the type you want to set the tmp to).
- (v1.8) Timelapse recording (Lua: `tpt.setrecordinterval(<frames>)`). Changes the interval that frames are captured when recording. Useful when making timelapses.
- (v1.10) Stack edit (shortcut: X, Shift-X, PageUp, PageDown, Home, End). Config tool, property tool, ctype-draw and subframe debugging (Shift-F) target particles at the selected depth. When stack mode is enabled (Shift-D), particles are created and deleted at the selected depth. Note that using the brush with stack edit messes with particle order, so this is best combined with automatic particle order reloading (`tpt.autoreload_enable(1)`).
Expand Down Expand Up @@ -179,6 +179,7 @@ v1.13:
v1.14:
- Allow stack tool to unstack to box.
- Extend config tool to VSNS tmp2.
- Extend stack mode to pasting and placing stamps.
- Extend ruler tool to show box dimensions.
- Put HUD particle info below the zoom window.
- Always show wall type in HUD.
Expand Down
14 changes: 3 additions & 11 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
v1.14:
- Allow stack tool to unstack to box.
- Extend config tool to VSNS tmp2.
- Extend ruler tool to show box dimensions.
- Put HUD particle info below the zoom window.
- Always show wall type in HUD.
- Show particle IDs in HUD when zoomed.
- Add Lua event that triggers before the HUD is drawn.
- Make BRAY life brightness offset also affect tmp=1 BRAY.
- Fix menu glitch when toggling config tool from deco menu.
- Fix vanilla file brower search query change bug.
v1.14.1:
- Extend stack mode to pasting and placing stamps.
- Remove particle type from default top right HUD.
3 changes: 2 additions & 1 deletion src/gui/game/GameController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,13 @@ void GameController::PlaceSave(ui::Point position)
{
HistorySnapshot();
SetWasModified(true);
gameModel->GetSimulation()->needReloadParticleOrder = true;
gameModel->GetSimulation()->BeforeStackEdit();
if (!gameModel->GetSimulation()->Load(placeSave, !gameView->ShiftBehaviour(), position.X, position.Y))
{
gameModel->SetPaused(placeSave->paused | gameModel->GetPaused());
Client::Ref().MergeStampAuthorInfo(placeSave->authors);
}
gameModel->GetSimulation()->AfterStackEdit();
}
}

Expand Down
23 changes: 8 additions & 15 deletions src/gui/game/GameView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2534,10 +2534,7 @@ void GameView::OnDraw()
(isConfiguringTmp2 ? highlightColor : noneString);
}

if (zoomEnabled)
{
sampleInfo << ", #" << sparticleId;
}
sampleInfo << ", #" << sparticleId;
}
else
{
Expand Down Expand Up @@ -2575,28 +2572,24 @@ void GameView::OnDraw()
{
StringBuilder sampleInfo;
sampleInfo << Format::Precision(2);
bool needComma = false;

if (sample.WallType)
{
sampleInfo << c->WallName(sample.WallType);
needComma = true;
}
else if (sample.particle.type)
{
int type = sample.particle.type;
int ctype = sample.particle.ctype;
sampleInfo << c->ElementResolve(type, ctype);
}
else
else if (!sample.particle.type)
{
sampleInfo << "Empty";
needComma = true;
}

if (showDebug)
{
if (!zoomEnabled && sample.particle.type)
sampleInfo << ", #" << sample.ParticleID;

sampleInfo << ", (" << sample.PositionX << " " << sample.PositionY << ")";
if (needComma)
sampleInfo << ", ";
sampleInfo << "(" << sample.PositionX << " " << sample.PositionY << ")";

if (sample.Gravity)
sampleInfo << ", GX: " << sample.GravityVelocityX << " GY: " << sample.GravityVelocityY;
Expand Down
10 changes: 7 additions & 3 deletions src/simulation/Simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ int Simulation::Load(const GameSave * originalSave, bool includePressure, int fu
continue;
}

if ((r = pmap[y][x]))
if (replaceModeFlags&STACK_MODE)
{
// Allow pasting stacks under stack mode, so don't do anything.
}
else if ((r = pmap[y][x]))
{
// Particle already exists in this location. Set pmap to 0, then kill it and all stacked particles in the loop below
pmap[y][x] = 0;
Expand Down Expand Up @@ -4986,7 +4990,7 @@ void Simulation::ReloadParticleOrder()

void Simulation::BeforeStackEdit()
{
if (stackEditDepth < 0)
if (stackEditDepth < 0 && !(replaceModeFlags&STACK_MODE))
return;
CompleteDebugUpdateParticles();
// use pmap_count as count buffer
Expand Down Expand Up @@ -5053,7 +5057,7 @@ void Simulation::BeforeStackEdit()

void Simulation::AfterStackEdit()
{
if (stackEditDepth < 0)
if (stackEditDepth < 0 && !(replaceModeFlags&STACK_MODE))
return;
RecalcFreeParticles(false);
}
Expand Down

0 comments on commit 5201cc0

Please sign in to comment.