Merge branch 'develop' into automelt
commit
8f7788ec20
@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
# Number of jobs == core count
|
||||
jobs=$(grep -c ^processor /proc/cpuinfo)
|
||||
|
||||
# Calculate absolute paths for docker to do mounts
|
||||
srcdir=$(realpath "$(dirname "$(readlink -f "$0")")"/..)
|
||||
|
||||
cd "$srcdir"/build
|
||||
|
||||
builder_uid=$(id -u)
|
||||
|
||||
mkdir -p win64-cross
|
||||
mkdir -p win64-cross/output
|
||||
|
||||
# Check for sudo; we want to use the real user
|
||||
if [[ $(id -u) -eq 0 ]]; then
|
||||
if [[ -z "$SUDO_UID" || "$SUDO_UID" -eq 0 ]]; then
|
||||
echo "Please don't run this script directly as root, use sudo instead:"
|
||||
echo
|
||||
echo " sudo $0"
|
||||
# This is because we can't change the buildmaster UID in the container to 0 --
|
||||
# that's already taken by root.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If this was run using sudo, let's make sure the directories are owned by the
|
||||
# real user (and set the BUILDER_UID to it)
|
||||
builder_uid=$SUDO_UID
|
||||
chown $builder_uid win64-cross win64-cross/output
|
||||
fi
|
||||
|
||||
# Assumes you built a container image called dfhack-build-msvc from
|
||||
# https://github.com/BenLubar/build-env/tree/master/msvc, see
|
||||
# docs/dev/compile/Compile.rst.
|
||||
#
|
||||
# NOTE: win64-cross is mounted in /src/build due to the hardcoded `cmake ..` in
|
||||
# the Dockerfile
|
||||
if ! docker run --rm -it -v "$srcdir":/src -v "$srcdir/build/win64-cross/":/src/build \
|
||||
-e BUILDER_UID=$builder_uid \
|
||||
--name dfhack-win \
|
||||
dfhack-build-msvc bash -c "cd /src/build && dfhack-configure windows 64 Release -DCMAKE_INSTALL_PREFIX=/src/build/output cmake .. -DBUILD_DOCS=1 && dfhack-make -j$jobs install" \
|
||||
; then
|
||||
echo
|
||||
echo "Build failed"
|
||||
exit 1
|
||||
else
|
||||
echo
|
||||
echo "Windows artifacts are at win64-cross/output. Copy or symlink them to"
|
||||
echo "your steam DF directory to install dfhack (and optionally delete the"
|
||||
echo "hack/ directory already present)"
|
||||
echo
|
||||
echo "Typically this can be done like this:"
|
||||
echo " cp -r win64-cross/output/* ~/.local/share/Steam/steamapps/common/\"Dwarf Fortress\""
|
||||
fi
|
@ -0,0 +1,100 @@
|
||||
local _ENV = mkmodule('plugins.orders')
|
||||
|
||||
local dialogs = require('gui.dialogs')
|
||||
local gui = require('gui')
|
||||
local overlay = require('plugins.overlay')
|
||||
local widgets = require('gui.widgets')
|
||||
|
||||
--
|
||||
-- OrdersOverlay
|
||||
--
|
||||
|
||||
local function is_orders_panel_visible()
|
||||
local info = df.global.game.main_interface.info
|
||||
return info.open and info.current_mode == df.info_interface_mode_type.WORK_ORDERS
|
||||
end
|
||||
|
||||
local function do_sort()
|
||||
dfhack.run_command('orders', 'sort')
|
||||
end
|
||||
|
||||
local function do_clear()
|
||||
dialogs.showYesNoPrompt('Clear manager orders?',
|
||||
'Are you sure you want to clear the manager orders?', nil,
|
||||
function() dfhack.run_command('orders', 'clear') end)
|
||||
end
|
||||
|
||||
local function do_import()
|
||||
local output = dfhack.run_command_silent('orders', 'list')
|
||||
dialogs.ListBox{
|
||||
frame_title='Import Manager Orders',
|
||||
with_filter=true,
|
||||
choices=output:split('\n'),
|
||||
on_select=function(idx, choice)
|
||||
dfhack.run_command('orders', 'import', choice.text)
|
||||
end,
|
||||
}:show()
|
||||
end
|
||||
|
||||
local function do_export()
|
||||
dialogs.InputBox{
|
||||
frame_title='Export Manager Orders',
|
||||
on_input=function(text)
|
||||
dfhack.run_command('orders', 'export', text)
|
||||
end
|
||||
}:show()
|
||||
end
|
||||
|
||||
OrdersOverlay = defclass(OrdersOverlay, overlay.OverlayWidget)
|
||||
OrdersOverlay.ATTRS{
|
||||
default_pos={x=61,y=-6},
|
||||
viewscreens='dwarfmode',
|
||||
frame={w=30, h=4},
|
||||
frame_style=gui.GREY_LINE_FRAME,
|
||||
frame_background=gui.CLEAR_PEN,
|
||||
}
|
||||
|
||||
function OrdersOverlay:init()
|
||||
self:addviews{
|
||||
widgets.HotkeyLabel{
|
||||
frame={t=0, l=0},
|
||||
label='import',
|
||||
key='CUSTOM_CTRL_I',
|
||||
on_activate=do_import,
|
||||
},
|
||||
widgets.HotkeyLabel{
|
||||
frame={t=1, l=0},
|
||||
label='export',
|
||||
key='CUSTOM_CTRL_E',
|
||||
on_activate=do_export,
|
||||
},
|
||||
widgets.HotkeyLabel{
|
||||
frame={t=0, l=15},
|
||||
label='sort',
|
||||
key='CUSTOM_CTRL_O',
|
||||
on_activate=do_sort,
|
||||
},
|
||||
widgets.HotkeyLabel{
|
||||
frame={t=1, l=15},
|
||||
label='clear',
|
||||
key='CUSTOM_CTRL_C',
|
||||
on_activate=do_clear,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
function OrdersOverlay:render(dc)
|
||||
if not is_orders_panel_visible() then return false end
|
||||
OrdersOverlay.super.render(self, dc)
|
||||
end
|
||||
|
||||
function OrdersOverlay:onInput(keys)
|
||||
if not is_orders_panel_visible() then return false end
|
||||
OrdersOverlay.super.onInput(self, keys)
|
||||
end
|
||||
|
||||
OVERLAY_WIDGETS = {
|
||||
overlay=OrdersOverlay,
|
||||
}
|
||||
|
||||
return _ENV
|
Loading…
Reference in New Issue