-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caravan interrupts and more #296
Open
O5MO
wants to merge
56
commits into
pyanodon:master
Choose a base branch
from
O5MO:caravan_interrupt
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 55 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
0c1a67b
something something caravan interrupts
24ccf4d
Added initial version of edit interrupt gui
9cee5bd
Interrupts are now properly added to and stored in caravans
5f9813e
Interrupts can now be renamed
fcc700e
Made interrupt gui relative (temporarily?)
3d420f2
Added interrupt edit button and added all core elements to interrupt …
be22f47
Interrupt schedule should now be rendered
f5d4b91
circuit condition static is now a free action
c7729f6
renamed prtotypes to caravan_prototypes
9987f11
Improved several caravan tasks, increased number of fuel slots
af5a39f
Implemented changing interrupt schedule
8641d14
Fixed shuffling schedule in caravan gui
1cece08
Interrupts now add temporary stops to the schedule
846ddd9
TODO
11257df
Improved fuel slot spacing to be consitent with train gui
acc4e8e
Separated building actions gui into a separate function, changed some…
32bddae
Melon does not know the difference between left and right
f5c6f7c
Some action refactoring
534f3ca
Added "specific food" action, bug fixes
e373b89
Fixed default actions
61c22bf
Open on map button in caravan gui and slightly improved gui
63aa0bb
Added localised name to caravan gui (only affects new caravans)
afb859f
Fixed clicking on schedule in interrupt gui, fixed interrupt data res…
b054a21
Fuel inventory now supports basic stack transfer actions
bc8cadf
"View on map" button now opens the position on the camera instead of …
a7265eb
New interrupt conditions, bugfixes
6f8fed8
Added "Allow interrupting other interrupts" functionality
cc179cd
Fixed caravans of all types being smaller than intended
7d9c222
Increased selection boxes of all caravan types to better match their …
e0d7a9a
Changed load/unload actions back to using goal amount and "wait until…
e771213
Fix bug with action shuffling
0ef5873
Fix actions not accounting for when goal is nil
647d1b2
Migrations
9f32a50
Gui improvements
ecaf4bf
Interrupt tooltips
2f52403
"Add interrupt" gui improvements
808414f
Implemented deleting interrupts
73262b5
Made interrupt play button functional
308321b
Interrupt window close button
3f7b3b0
Interrupts are now copy-pastable between caravans
e0c26ad
Fuel slot tooltips now show item tooltip if present
aeae057
Action validity check and bugfixes
8da697a
bugfixes
ef652d1
bugfixes
4478d1c
"at outpost" conditions, fixes
1f17d35
Updated valid actions
3f0b3a4
Migrations
a9a8a03
EN locale
98f7120
RU locale
7f20317
RU locale
f5434e5
UK locale
777f867
Locale fix
7773c95
Check that entity is an outpost for "at outpost" actions
72ce159
Changelog
38fe9a7
Merge branch 'master' into caravan_interrupt
notnotmelon 453c763
Resolve crash when waiting at infinity chest.
notnotmelon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,82 @@ | ||
[entity-name] | ||
caravan=Караван | ||
flyavan=Повітряний караван | ||
nukavan=☢ Караван ☢ | ||
outpost=Караванна застава | ||
outpost-aerial=Повітряна застава | ||
|
||
[entity-description] | ||
caravan=Повільна наземна істота з відсутністю свободи вибору (нікого вам не нагадує?). Не надто кмітливий, але надійний. | ||
flyavan=Іноді ми заходимо занадто далеко. Сильно модифікована істота, створена з використанням генів земних китів та генома інопланетян, із заміною деяких органів та частин на аналогічний біомеханічний відповідник, що дозволяє плавати та перевозити вантаж. | ||
nukavan=Тип каравану зі "спецдоставкою". | ||
outpost=Склад речей та їжі для наземних караванів. | ||
outpost-aerial=Склад речей та їжі для повітряних караванів. | ||
|
||
[entity-status] | ||
healthy=Здоровий | ||
starved=Голодний | ||
wounded=Поранений | ||
idle=Очікує | ||
|
||
[caravan-gui] | ||
add-outpost=+ Додати пункт призначення | ||
add-action=+ Додати дію | ||
entity-position=__1__ @ {__2__, __3__} | ||
map-position={__1__, __2__} | ||
refocus=Перефокусувати | ||
favorite-foods-main=Улюблений корм:\n__1__ | ||
favorite-foods-sub=__1__ __2__ → __3__ дій | ||
wait=Дочекатись виконання | ||
hello-my-name-is=[font=default-bold]Привіт, мене звати: [color=255,210,73]__1__[/color][/font] | ||
caption=Менеджер караванів | ||
empty=Це менеджер караванів. Тут ви бачите всі розміщені каравани та їхній поточний статус. | ||
empty-2=Зараз у вас немає караванів. | ||
open=Відкрити __1__ | ||
view-on-map=Переглянути на карті | ||
current-action=Поточна дія: __1__ | ||
current-destination=__1__ м від __2__ | ||
more-items=ще __1__... | ||
the-inventory-is-empty=Інвентар порожній. | ||
|
||
[caravan-actions] | ||
time-passed=Чекати | ||
store-food=Запасати їжу | ||
fill-inventory=Заповнити вантажем | ||
empty-inventory=Розвантажити | ||
item-count=Допоки караван не міститиме N предметів | ||
inverse-item-count=Допоки у місці призначення не знаходитиметься N предметів | ||
detonate=Підірвати | ||
circuit-condition=Логічна умова | ||
circuit-condition-static=Логічна умова із статичним значенням | ||
empty-autotrash=Забрати все із сміттєвих слотів | ||
traveling=Подорожує | ||
|
||
[item-name] | ||
caravan-control=Керування караваном | ||
gastrocapacitor=Гастроконденсатор | ||
|
||
[caravan-warnings] | ||
no-destination=Пункт призначення було знищено для [item=__1__] @ [gps=__2__,__3__] | ||
|
||
[virtual-signal-name] | ||
caravan-map-tag=Мітка каравану на карті | ||
[entity-name] | ||
caravan=Караван | ||
flyavan=Повітряний караван | ||
nukavan=☢ Караван ☢ | ||
outpost=Караванна застава | ||
outpost-aerial=Повітряна застава | ||
|
||
[entity-description] | ||
caravan=Повільна наземна істота з відсутністю свободи вибору (нікого вам не нагадує?). Не надто кмітливий, але надійний. | ||
flyavan=Іноді ми заходимо занадто далеко. Сильно модифікована істота, створена з використанням генів земних китів та генома інопланетян, із заміною деяких органів та частин на аналогічний біомеханічний відповідник, що дозволяє плавати та перевозити вантаж. | ||
nukavan=Тип каравану зі "спецдоставкою". | ||
outpost=Склад речей та їжі для наземних караванів. | ||
outpost-aerial=Склад речей та їжі для повітряних караванів. | ||
|
||
[entity-status] | ||
healthy=Здоровий | ||
starved=Голодний | ||
wounded=Поранений | ||
idle=Очікує | ||
|
||
[caravan-gui] | ||
add-outpost=+ Додати пункт призначення | ||
add-action=+ Додати дію | ||
entity-position=__1__ [__2__, __3__] | ||
map-position=[gps=__1__,__2__] [__1__, __2__] | ||
refocus=Перефокусувати | ||
favorite-foods-main=Улюблений корм:\n__1__ | ||
favorite-foods-sub=__1__ __2__ → __3__ дій | ||
wait=Дочекатись виконання | ||
hello-my-name-is=[font=default-bold]Привіт, мене звати: [color=255,210,73]__1__[/color][/font] | ||
caption=Менеджер караванів | ||
empty=Це менеджер караванів. Тут ви бачите всі розміщені каравани та їхній поточний статус. | ||
empty-2=Зараз у вас немає караванів. | ||
open=Відкрити __1__ | ||
view-on-map=Переглянути на карті | ||
current-action=Поточна дія: __1__ | ||
current-destination=__1__ м від __2__ | ||
more-items=ще __1__... | ||
the-inventory-is-empty=Інвентар порожній. | ||
delete-interrupt=Видалити преривання | ||
confirm-deletion=Підтвердити видалення? | ||
cancel-deletion=Скасувати видалення | ||
caravan-inventory=Інвентар каравана | ||
not-specified=(Не вказано) | ||
|
||
[caravan-actions] | ||
time-passed=Чекати | ||
store-food=Запасати їжу | ||
store-specific-food=Запасати їжу допоки | ||
fill-inventory=Заповнити вантажем | ||
empty-inventory=Розвантажити | ||
item-count=Допоки караван не міститиме N предметів | ||
inverse-item-count=Допоки у місці призначення не знаходитиметься N предметів | ||
detonate=Підірвати | ||
circuit-condition=Логічна умова | ||
circuit-condition-static=Логічна умова із статичним значенням | ||
empty-autotrash=Забрати все із сміттєвих слотів | ||
traveling=Подорожує | ||
load-caravan=Завантажувати предмети допоки караван не містиме | ||
unload-caravan=Розвантажувати предмети допоки караван не містиме | ||
load-target=Завантажувати предмети допоки у місці призначення не знаходитиметься | ||
unload-target=Розвантажувати предмети допоки у місці призначення не знаходитиметься | ||
is-inventory-full=Інвентар повний | ||
is-inventory-empty=Інвентар порожній | ||
caravan-item-count=Кількість предметів у вантажі | ||
target-item-count=Кількість предметів у місці призначення | ||
food-count=Кількість їжі | ||
at-outpost=У вказаної застави | ||
not-at-outpost=Не у вказаної застави | ||
at-outpost2=у __1__ | ||
not-at-outpost2=не у __1__ | ||
|
||
[item-name] | ||
caravan-control=Керування караваном | ||
gastrocapacitor=Гастроконденсатор | ||
|
||
[caravan-warnings] | ||
no-destination=Пункт призначення було знищено для [item=__1__] @ [gps=__2__,__3__] | ||
|
||
[virtual-signal-name] | ||
caravan-map-tag=Мітка каравану на карті | ||
no-fuel=Паливо відсутнє |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
for unit_number, caravan_data in pairs(storage.caravans or {}) do | ||
caravan_data.interrupts = caravan_data.interrupts or {} | ||
|
||
-- Increase fuel inventory sizes | ||
local old_inventory = caravan_data.fuel_inventory | ||
local new_inventory = game.create_inventory(#old_inventory * 2) | ||
for i = 1, #old_inventory do | ||
new_inventory[i].set_stack(old_inventory[i]) | ||
end | ||
caravan_data.fuel_inventory = new_inventory | ||
old_inventory.destroy() | ||
|
||
-- Set a name for old caravan inventories | ||
local old_inventory = caravan_data.inventory | ||
local new_inventory = game.create_inventory(#old_inventory, {"caravan-gui.caravan-inventory"}) | ||
for i = 1, #old_inventory do | ||
new_inventory[i].set_stack(old_inventory[i]) | ||
end | ||
caravan_data.inventory = new_inventory | ||
old_inventory.destroy() | ||
|
||
-- Replaces one actions with two new counterparts. This clutters the schedule ui a bit, but behaves identically to the old actions | ||
for i, schedule in pairs(caravan_data.schedule or {}) do | ||
for j, action in pairs(schedule.actions or {}) do | ||
local replacements = {} | ||
if action.type == "item-count" then | ||
replacements[1] = "load-caravan" | ||
replacements[2] = "unload-caravan" | ||
end | ||
if action.type == "inverse-item-count" then | ||
replacements[1] = "load-target" | ||
replacements[2] = "unload-target" | ||
end | ||
if #replacements > 0 then | ||
action.type = replacements[1] | ||
action.localised_name = {"caravan-actions."..replacements[1]} | ||
local new_action = table.deepcopy(action) | ||
new_action.type = replacements[2] | ||
new_action.localised_name = {"caravan-actions."..replacements[2]} | ||
table.insert(schedule.actions, j + 1, new_action) | ||
if caravan_data.action_id > j then caravan_data.action_id = caravan_data.action_id + 1 end | ||
end | ||
if action.type == "store-food" then | ||
action.async = true -- Old store food behaved as if async was true | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause issues. Caravans in previous versions had different inventory sizes than 1. I would recommend to instead import
caravan-prototypes.lua
from within the migration and set this value directly toprototype.fuel_size