diff --git a/README.md b/README.md index 126095c520..57d912ee83 100644 --- a/README.md +++ b/README.md @@ -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()`). 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)`). @@ -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. diff --git a/changelog.txt b/changelog.txt index 0c48261279..0e0a0cbeca 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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. diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index b90d62bf7c..3af2e4cc34 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -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(); } } diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index fb2ce9bd8d..a8b07d6cb5 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -2534,10 +2534,7 @@ void GameView::OnDraw() (isConfiguringTmp2 ? highlightColor : noneString); } - if (zoomEnabled) - { - sampleInfo << ", #" << sparticleId; - } + sampleInfo << ", #" << sparticleId; } else { @@ -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; diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 4a711354cc..dac802cbe0 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -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; @@ -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 @@ -5053,7 +5057,7 @@ void Simulation::BeforeStackEdit() void Simulation::AfterStackEdit() { - if (stackEditDepth < 0) + if (stackEditDepth < 0 && !(replaceModeFlags&STACK_MODE)) return; RecalcFreeParticles(false); }