|
|
@ -140,12 +140,12 @@ function collect_orders()
|
|
|
|
stockpile = stockpile,
|
|
|
|
stockpile = stockpile,
|
|
|
|
entry = entry,
|
|
|
|
entry = entry,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
found = true
|
|
|
|
found = true
|
|
|
|
break
|
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if not found then
|
|
|
|
if not found then
|
|
|
|
print("Unmatched stockflow entry for stockpile #"..stockpile.stockpile_number..": "..entry.value.." ("..order_number..")")
|
|
|
|
print("Unmatched stockflow entry for stockpile #"..stockpile.stockpile_number..": "..entry.value.." ("..order_number..")")
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -174,7 +174,7 @@ function reaction_entry(reactions, job_type, values, name)
|
|
|
|
-- We could warn about it; in any case, don't add it to the list.
|
|
|
|
-- We could warn about it; in any case, don't add it to the list.
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
local order = df.manager_order:new()
|
|
|
|
local order = df.manager_order:new()
|
|
|
|
-- These defaults differ from the newly created order's.
|
|
|
|
-- These defaults differ from the newly created order's.
|
|
|
|
order:assign{
|
|
|
|
order:assign{
|
|
|
@ -420,7 +420,7 @@ function collect_reactions()
|
|
|
|
local name = string.gsub(reaction.name, "^.", string.upper)
|
|
|
|
local name = string.gsub(reaction.name, "^.", string.upper)
|
|
|
|
reaction_entry(result, job_types.CustomReaction, {reaction_name = reaction.code}, name)
|
|
|
|
reaction_entry(result, job_types.CustomReaction, {reaction_name = reaction.code}, name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- Reactions generated by the game.
|
|
|
|
-- Reactions generated by the game.
|
|
|
|
for _, reaction in ipairs(df.global.world.raws.reactions) do
|
|
|
|
for _, reaction in ipairs(df.global.world.raws.reactions) do
|
|
|
|
if reaction.source_enid == entity.id then
|
|
|
|
if reaction.source_enid == entity.id then
|
|
|
@ -751,7 +751,7 @@ function collect_reactions()
|
|
|
|
{job_types.MakeBracelet, "Make", "Bracelet"},
|
|
|
|
{job_types.MakeBracelet, "Make", "Bracelet"},
|
|
|
|
{job_types.MakeEarring, "Make", "Earring"},
|
|
|
|
{job_types.MakeEarring, "Make", "Earring"},
|
|
|
|
}, mat)
|
|
|
|
}, mat)
|
|
|
|
|
|
|
|
|
|
|
|
if not mat.cloth then
|
|
|
|
if not mat.cloth then
|
|
|
|
material_reactions(result, {
|
|
|
|
material_reactions(result, {
|
|
|
|
{job_types.MakeCrown, "Make", "Crown"},
|
|
|
|
{job_types.MakeCrown, "Make", "Crown"},
|
|
|
@ -759,7 +759,7 @@ function collect_reactions()
|
|
|
|
{job_types.MakeRing, "Make", "Ring"},
|
|
|
|
{job_types.MakeRing, "Make", "Ring"},
|
|
|
|
{job_types.MakeGem, "Make Large", "Gem"},
|
|
|
|
{job_types.MakeGem, "Make Large", "Gem"},
|
|
|
|
}, mat)
|
|
|
|
}, mat)
|
|
|
|
|
|
|
|
|
|
|
|
if not mat.short then
|
|
|
|
if not mat.short then
|
|
|
|
material_reactions(result, {
|
|
|
|
material_reactions(result, {
|
|
|
|
{job_types.MakeScepter, "Make", "Scepter"},
|
|
|
|
{job_types.MakeScepter, "Make", "Scepter"},
|
|
|
@ -798,29 +798,29 @@ screen = gui.FramedScreen {
|
|
|
|
|
|
|
|
|
|
|
|
function screen:onRenderBody(dc)
|
|
|
|
function screen:onRenderBody(dc)
|
|
|
|
-- Emulates the built-in manager screen.
|
|
|
|
-- Emulates the built-in manager screen.
|
|
|
|
|
|
|
|
|
|
|
|
if not (self.page_size == self.frame_rect.height - ExtraLines) then
|
|
|
|
if not (self.page_size == self.frame_rect.height - ExtraLines) then
|
|
|
|
-- The screen size has changed.
|
|
|
|
-- The screen size has changed.
|
|
|
|
self:refilter()
|
|
|
|
self:refilter()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- Top instruction line.
|
|
|
|
-- Top instruction line.
|
|
|
|
dc:seek(1, 1):string("Type in parts of the name to narrow your search. ", COLOR_WHITE)
|
|
|
|
dc:seek(1, 1):string("Type in parts of the name to narrow your search. ", COLOR_WHITE)
|
|
|
|
dc:key("LEAVESCREEN"):string(" to abort.", COLOR_WHITE)
|
|
|
|
dc:key("LEAVESCREEN"):string(" to abort.", COLOR_WHITE)
|
|
|
|
|
|
|
|
|
|
|
|
-- Search term, if any.
|
|
|
|
-- Search term, if any.
|
|
|
|
dc:seek(1, FirstRow + self.page_size + 1):string(self.search_string, COLOR_LIGHTCYAN)
|
|
|
|
dc:seek(1, FirstRow + self.page_size + 1):string(self.search_string, COLOR_LIGHTCYAN)
|
|
|
|
|
|
|
|
|
|
|
|
-- Bottom instruction line.
|
|
|
|
-- Bottom instruction line.
|
|
|
|
dc:seek(1, FirstRow + self.page_size + 2)
|
|
|
|
dc:seek(1, FirstRow + self.page_size + 2)
|
|
|
|
dc:key("STANDARDSCROLL_UP"):key("STANDARDSCROLL_DOWN")
|
|
|
|
dc:key("STANDARDSCROLL_UP"):key("STANDARDSCROLL_DOWN")
|
|
|
|
dc:key("STANDARDSCROLL_PAGEUP"):key("STANDARDSCROLL_PAGEDOWN")
|
|
|
|
dc:key("STANDARDSCROLL_PAGEUP"):key("STANDARDSCROLL_PAGEDOWN")
|
|
|
|
dc:key("STANDARDSCROLL_LEFT"):key("STANDARDSCROLL_RIGHT")
|
|
|
|
dc:key("STANDARDSCROLL_LEFT"):key("STANDARDSCROLL_RIGHT")
|
|
|
|
dc:string(": Select", COLOR_WHITE)
|
|
|
|
dc:string(": Select", COLOR_WHITE)
|
|
|
|
|
|
|
|
|
|
|
|
dc:seek(CenterCol, FirstRow + self.page_size + 2)
|
|
|
|
dc:seek(CenterCol, FirstRow + self.page_size + 2)
|
|
|
|
dc:key("SETUPGAME_SAVE_PROFILE_ABORT"):string(": No order", COLOR_WHITE)
|
|
|
|
dc:key("SETUPGAME_SAVE_PROFILE_ABORT"):string(": No order", COLOR_WHITE)
|
|
|
|
|
|
|
|
|
|
|
|
-- Reaction lines.
|
|
|
|
-- Reaction lines.
|
|
|
|
for _, item in ipairs(self.displayed) do
|
|
|
|
for _, item in ipairs(self.displayed) do
|
|
|
|
dc:seek(item.x, item.y):string(item.name, item.color)
|
|
|
|
dc:seek(item.x, item.y):string(item.name, item.color)
|
|
|
@ -954,7 +954,7 @@ function screen:refilter()
|
|
|
|
-- * Yellow: At least one word starts with at least one search term
|
|
|
|
-- * Yellow: At least one word starts with at least one search term
|
|
|
|
-- * Grey: Each search term is found in the middle of a word
|
|
|
|
-- * Grey: Each search term is found in the middle of a word
|
|
|
|
self.page_size = self.frame_rect.height - ExtraLines
|
|
|
|
self.page_size = self.frame_rect.height - ExtraLines
|
|
|
|
|
|
|
|
|
|
|
|
local filtered = {}
|
|
|
|
local filtered = {}
|
|
|
|
local needles = splitstring(self.search_string, " ")
|
|
|
|
local needles = splitstring(self.search_string, " ")
|
|
|
|
for key, value in ipairs(reaction_list) do
|
|
|
|
for key, value in ipairs(reaction_list) do
|
|
|
@ -1094,6 +1094,7 @@ end
|
|
|
|
-- Place a new copy of the order onto the manager's queue.
|
|
|
|
-- Place a new copy of the order onto the manager's queue.
|
|
|
|
function create_orders(order, amount)
|
|
|
|
function create_orders(order, amount)
|
|
|
|
local new_order = order:new()
|
|
|
|
local new_order = order:new()
|
|
|
|
|
|
|
|
amount = math.floor(amount)
|
|
|
|
new_order.amount_left = amount
|
|
|
|
new_order.amount_left = amount
|
|
|
|
new_order.amount_total = amount
|
|
|
|
new_order.amount_total = amount
|
|
|
|
-- Todo: Create in a validated state if the fortress is small enough?
|
|
|
|
-- Todo: Create in a validated state if the fortress is small enough?
|
|
|
|