Skip to content

Commit

Permalink
Merge branch 'develop' into experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Mar 1, 2025
2 parents 276a5c8 + e088926 commit 0c58985
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 30 deletions.
21 changes: 0 additions & 21 deletions data/orders/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,27 +114,6 @@
"job" : "CustomReaction",
"reaction" : "BREW_DRINK_FROM_PLANT_GROWTH"
},
{
"amount_left" : 1,
"amount_total" : 1,
"frequency" : "Daily",
"id" : 3,
"is_active" : false,
"is_validated" : false,
"item_conditions" :
[
{
"condition" : "AtLeast",
"flags" :
[
"unrotten",
"milk"
],
"value" : 2
}
],
"job" : "MakeCheese"
},
{
"amount_left" : 1,
"amount_total" : 1,
Expand Down
3 changes: 2 additions & 1 deletion docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Template for new versions:
- `spectate`: can now specify number of seconds (in real time) before switching to follow a new unit
- `spectate`: new "cinematic-action" mode that dynamically speeds up perspective switches based on intensity of conflict
- `spectate`: new global keybinding for toggling spectate mode: Ctrl-Shift-S
- `spectate`: new overlay panel that allows you to cycle through following next/prevous units (regardless of whether spectate mode is enabled)
- `spectate`: new overlay panel that allows you to cycle through following next/previous units (regardless of whether spectate mode is enabled)
- `gui/sitemap`: is now the official "go to" tool. new global hotkey for fort and adventure mode: Ctrl-G

## Fixes
Expand Down Expand Up @@ -91,6 +91,7 @@ Template for new versions:
- ``overlay``: widgets can now declare ``overlay_onenable`` and ``overlay_ondisable`` functions to hook enable/disable

## Removed
- `orders`: MakeCheese job removed from library/basic orders set. Please use `autocheese` instead!

# 51.06-r1

Expand Down
11 changes: 9 additions & 2 deletions docs/plugins/orders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,14 @@ This collection of orders handles basic fort necessities:
You should import it as soon as you have enough dwarves to perform the tasks.
Right after the first migration wave is usually a good time.

Note that the jugs are specifically made out of wood. This is so, as long as you don't may any other "Tools" out of wood, you can have a stockpile just for jugs by restricting a finished goods stockpile to only take wooden tools.
These orders do not contain milking, shearing, or cheesemaking jobs since the
game does not provide sufficient order conditions. Please enable ``automilk``,
``autoshear``, and `autocheese` on the DFHack `gui/control-panel` for these
types of jobs.

Note that the jugs are specifically made out of wood. This is so, as long as
you don't may any other "Tools" out of wood, you can have a stockpile just for
jugs by restricting a finished goods stockpile to only take wooden tools.

Armok's additional note: "shleggings? Yes,
`shleggings <https://youtu.be/bLN8cOcTjdo&t=3458>`__."
Expand All @@ -155,7 +162,7 @@ Armok's additional note: "shleggings? Yes,

This collection creates basic items that require heat. It is separated out from
``library/basic`` to give players the opportunity to set up magma furnaces first
in order to save resources. It handles:
(if desired) in order to save resources. It handles:

- charcoal (including smelting of bituminous coal and lignite)
- pearlash
Expand Down
20 changes: 15 additions & 5 deletions plugins/lua/spectate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ function TooltipOverlay:render_unit_banners(dc)
local oneTileOffset = GetScreenCoordinates({x = topleft.x + 1, y = topleft.y + 1, z = topleft.z + 0})
local pen = COLOR_WHITE

local _, screenHeight = dfhack.screen:getWindowSize()

local used_tiles = {}
-- reverse order yields better offsets for overlapping texts
for i = #units, 1, -1 do
Expand All @@ -447,6 +449,10 @@ function TooltipOverlay:render_unit_banners(dc)
local y = scrPos.y - 1 -- subtract 1 to move the text over the heads
local x = scrPos.x + oneTileOffset.x - 1 -- subtract 1 to move the text inside the map tile

-- do not write anything in the top rows, where DF's interface is.
-- todo: use precise rectangles
if y < 4 then goto continue end

-- to resolve overlaps, we'll mark every coordinate we write anything in,
-- and then check if the new tooltip will overwrite any used coordinate.
-- if it will, try the next row, to a maximum offset of 4.
Expand Down Expand Up @@ -477,15 +483,19 @@ function TooltipOverlay:render_unit_banners(dc)
-- we can't place any useful information, and will ignore it instead.
if 0 <= usedAt and usedAt <= 2 then goto continue end

local writer = dc:seek(x, y + dy)
-- do not write anything over DF's interface
-- todo: use precise rectangles
if y + dy > screenHeight - 4 then goto continue end

dc:seek(x, y + dy)
local ix = 0
for _, tok in ipairs(info) do
local s
if type(tok) == "string" then
writer:pen(pen)
dc:pen(pen)
s = tok
else
writer:pen(tok.pen)
dc:pen(tok.pen)
s = tok.text
end

Expand All @@ -496,10 +506,10 @@ function TooltipOverlay:render_unit_banners(dc)
-- we want to replace it with an `_`, so we need another `- 1`
s = s:sub(1, usedAt - len - ix - 1 - 1) .. '_'

writer:string(s)
dc:string(s)
break -- nothing more will fit
else
writer:string(s)
dc:string(s)
end

ix = ix + len
Expand Down
2 changes: 1 addition & 1 deletion scripts
Submodule scripts updated 2 files
+1 −1 gui/notes.lua
+1 −0 gui/spectate.lua

0 comments on commit 0c58985

Please sign in to comment.