262 ammo_categories[ammo.ammo_category] = ammo_categories[ammo.ammo_category].."[item="..ammo.name.."]" |
274 ammo_categories[ammo.ammo_category] = ammo_categories[ammo.ammo_category].."[item="..ammo.name.."]" |
263 elseif string.sub(ammo_categories[ammo.ammo_category], -3, -1) ~= "..." |
275 elseif string.sub(ammo_categories[ammo.ammo_category], -3, -1) ~= "..." |
264 then |
276 then |
265 ammo_categories[ammo.ammo_category] = ammo_categories[ammo.ammo_category] .. "..." |
277 ammo_categories[ammo.ammo_category] = ammo_categories[ammo.ammo_category] .. "..." |
266 end |
278 end |
267 end |
279 end |
268 |
280 |
269 ---@param proto data.Prototype |
281 ---@param proto data.Prototype |
270 ---@param tooltip_field LocalisedString |
282 ---@param tooltip_field data.CustomTooltipField |
271 local function generic_add_description(proto, tooltip_field) |
283 local function generic_add_description(proto, tooltip_field) |
272 if not proto.custom_tooltip_fields |
284 if not proto.custom_tooltip_fields |
273 then |
285 then |
274 proto.custom_tooltip_fields = {} |
286 proto.custom_tooltip_fields = {} |
275 end |
287 end |
276 table.insert(proto.custom_tooltip_fields, tooltip_field) |
288 table.insert(proto.custom_tooltip_fields, tooltip_field) |
|
289 end |
|
290 |
|
291 ---@param proto data.Prototype |
|
292 ---@param attack_parameters data.AttackParameters |
|
293 local function add_ammo_from_attack_parameters(proto, attack_parameters) |
|
294 if attack_parameters.ammo_category and ammo_categories[attack_parameters.ammo_category] |
|
295 then |
|
296 generic_add_description(proto, { |
|
297 name = {"more-descriptions-mod.gun-accepts-ammo"}, |
|
298 value = ammo_categories[attack_parameters.ammo_category], |
|
299 order = generic_order(10), |
|
300 }) |
|
301 end |
|
302 for _, category in pairs(attack_parameters.ammo_categories or {}) |
|
303 do |
|
304 if ammo_categories[category] |
|
305 then |
|
306 generic_add_description(proto, { |
|
307 name = {"more-descriptions-mod.gun-accepts-ammo"}, |
|
308 value = ammo_categories[category], |
|
309 order = generic_order(0), |
|
310 }) |
|
311 end |
|
312 end |
277 end |
313 end |
278 |
314 |
279 for _, item_type in pairs(item_categories) |
315 for _, item_type in pairs(item_categories) |
280 do |
316 do |
281 for _, item in pairs(data.raw[item_type] or {}) |
317 for _, item in pairs(data.raw[item_type] or {}) |
328 if refining_recipe ~= nil |
346 if refining_recipe ~= nil |
329 then |
347 then |
330 add_description{ |
348 add_description{ |
331 name = {"more-descriptions-mod.refining-cost"}, |
349 name = {"more-descriptions-mod.refining-cost"}, |
332 value = seconds(refining_recipe.energy_required), |
350 value = seconds(refining_recipe.energy_required), |
|
351 order = generic_order(1), |
333 } |
352 } |
334 elseif recycling_recipe ~= nil |
353 elseif recycling_recipe ~= nil |
335 then |
354 then |
336 add_description{ |
355 add_description{ |
337 name = {"more-descriptions-mod.cannot-be-refined"}, |
356 name = {"more-descriptions-mod.cannot-be-refined"}, |
338 value = ""} |
357 value = "", |
|
358 order = generic_order(1), |
|
359 } |
339 end |
360 end |
340 end |
361 end |
341 |
362 |
342 if item.type == "ammo" and (item.reload_time or 0) > 0 |
363 if item.type == "ammo" and (item.reload_time or 0) > 0 |
343 then |
364 then |
344 add_description{ |
365 add_description{ |
345 name = {"more-descriptions-mod.reload-time"}, |
366 name = {"more-descriptions-mod.reload-time"}, |
346 value = seconds(tostring(item.reload_time / 60.0)), |
367 value = seconds(tostring(item.reload_time / 60.0)), |
|
368 order = specific_order(0), |
347 } |
369 } |
348 end |
370 end |
349 |
371 |
350 if item.type == "active-defense-equipment" and item.automatic |
372 if item.type == "active-defense-equipment" and item.automatic |
351 then |
373 then |
352 add_description{ |
374 add_description{ |
353 name = {"more-descriptions-mod.fires-automatically"}, |
375 name = {"more-descriptions-mod.fires-automatically"}, |
354 value = "", |
376 value = "", |
|
377 order = specific_order(0), |
355 } |
378 } |
356 end |
379 end |
357 |
380 |
358 if item.type == "armor" and item.provides_flight |
381 if item.type == "armor" and item.provides_flight |
359 then |
382 then |
360 add_description{ |
383 add_description{ |
361 name = {"more-descriptions-mod.armor-provides-flight"}, |
384 name = {"more-descriptions-mod.armor-provides-flight"}, |
362 value = "", |
385 value = "", |
|
386 order = specific_order(0), |
363 } |
387 } |
364 end |
388 end |
365 |
389 |
366 if item.type == "gun" |
390 if item.type == "gun" |
367 then |
391 then |
368 add_ammo_from_attack_parameters(item.attack_parameters) |
392 add_ammo_from_attack_parameters(item, item.attack_parameters) |
369 end |
|
370 |
|
371 local entity = item.place_result and find_entity(item.place_result) or nil |
|
372 if entity ~= nil |
|
373 then |
|
374 if entity.collision_box |
|
375 then |
|
376 local cb = entity.collision_box |
|
377 local width = math.ceil(cb[2][1] - cb[1][1]) |
|
378 local height = math.ceil(cb[2][2] - cb[1][2]) |
|
379 add_description{ |
|
380 name = {"more-descriptions-mod.entity-size"}, |
|
381 value = { |
|
382 "more-descriptions-mod.size", |
|
383 tostring(width), |
|
384 tostring(height), |
|
385 }, |
|
386 } |
|
387 end |
|
388 |
|
389 if entity.drops_full_belt_stacks |
|
390 then |
|
391 add_description{ |
|
392 name = {"more-descriptions-mod.drops-full-belt-stacks"}, |
|
393 value = ""} |
|
394 end |
|
395 |
|
396 if entity.heat_buffer and entity.heat_buffer.specific_heat |
|
397 then |
|
398 add_description{ |
|
399 name = {"more-descriptions-mod.specific-heat"}, |
|
400 value = { |
|
401 "more-descriptions-mod.energy-per-degrees-celsius", |
|
402 entity.heat_buffer.specific_heat, |
|
403 }, |
|
404 } |
|
405 elseif entity.energy_source |
|
406 and entity.energy_source.type == "heat" |
|
407 and entity.energy_source.specific_heat |
|
408 then |
|
409 add_description{ |
|
410 name = {"more-descriptions-mod.specific-heat"}, |
|
411 value = entity.energy_source.specific_heat, |
|
412 } |
|
413 end |
|
414 |
|
415 if entity.is_military_target |
|
416 then |
|
417 add_description{ |
|
418 name = {"more-descriptions-mod.is-military-target"}, |
|
419 value = "", |
|
420 } |
|
421 end |
|
422 |
|
423 if not energy_zero(entity.heating_energy or "0W") |
|
424 then |
|
425 local value = entity.heating_energy |
|
426 if entity.type == "underground-belt" or entity.type == "pipe-to-ground" |
|
427 then |
|
428 value = {"more-descriptions-mod.value-per-end", value} |
|
429 end |
|
430 add_description{ |
|
431 name = {"more-descriptions-mod.heating-energy"}, |
|
432 value = value, |
|
433 } |
|
434 elseif freezable_entity_categories[entity.type] |
|
435 then |
|
436 add_description{ |
|
437 name = {"more-descriptions-mod.no-heating-energy"}, |
|
438 value = "", |
|
439 } |
|
440 end |
|
441 |
|
442 if entity.type == "agricultural-tower" |
|
443 then |
|
444 local cb = entity.collision_box |
|
445 local W = math.ceil(cb[2][1] - cb[1][1]) |
|
446 local w = (entity.growth_grid_tile_size or 3) |
|
447 -- width of the "buffer" area around the agricultural tower |
|
448 local z = (2 * w * math.ceil((W - w) / 2 / w)) + w |
|
449 -- num of growth cells extending from the edges of the tower |
|
450 local r = math.floor(entity.radius) -- why is it double..? |
|
451 add_description{ |
|
452 name = {"more-descriptions-mod.agricultural-tower-num-inputs"}, |
|
453 value = tostring(entity.input_inventory_size) |
|
454 } |
|
455 add_description{ |
|
456 name = {"more-descriptions-mod.agricultural-tower-growth-cell-size"}, |
|
457 value = { |
|
458 "more-descriptions-mod.size", |
|
459 tostring(w), |
|
460 tostring(w), |
|
461 } |
|
462 } |
|
463 add_description{ |
|
464 name = {"more-descriptions-mod.agricultural-tower-growth-cell-count"}, |
|
465 value = tostring(4 * r * (r + (z / w))) |
|
466 } |
|
467 total_size = tostring(z + 2 * r * w) |
|
468 add_description{ |
|
469 name = {"more-descriptions-mod.agricultural-tower-total-size"}, |
|
470 value = { |
|
471 "more-descriptions-mod.size", |
|
472 total_size, |
|
473 total_size, |
|
474 }, |
|
475 } |
|
476 elseif entity.type == "ammo-turret" |
|
477 then |
|
478 if entity.energy_per_shot ~= nil |
|
479 then |
|
480 add_description{ |
|
481 name = {"more-descriptions-mod.energy-per-shot-fired"}, |
|
482 value = entity.energy_per_shot} |
|
483 end |
|
484 add_ammo_from_attack_parameters(entity.attack_parameters) |
|
485 elseif entity.type == "beacon" |
|
486 then |
|
487 add_description{ |
|
488 name = {"more-descriptions-mod.beacon-supply-area-distance"}, |
|
489 value = tostring(entity.supply_area_distance) |
|
490 } |
|
491 elseif entity.type == "car" |
|
492 then |
|
493 local immunities = "" |
|
494 if (entity.immune_to_tree_impacts or false) |
|
495 then |
|
496 immunities = immunities.."[entity=tree-01]" |
|
497 end |
|
498 if (entity.immune_to_rock_impacts or false) |
|
499 then |
|
500 immunities = immunities.."[entity=big-rock]" |
|
501 end |
|
502 if (entity.immune_to_cliff_impacts or true) |
|
503 then |
|
504 immunities = immunities.."[entity=cliff]" |
|
505 end |
|
506 if immunities ~= "" |
|
507 then |
|
508 add_description{ |
|
509 name = {"more-descriptions-mod.car-immune-to-impacts"},value = immunities} |
|
510 end |
|
511 elseif entity.type == "constant-combinator" |
|
512 then |
|
513 -- used by pushbutton mod |
|
514 if (entity.pulse_duration or 0) > 60 |
|
515 then |
|
516 add_description{ |
|
517 name = {"more-descriptions-mod.constant-combinator-pulse-duration"}, |
|
518 value = seconds(entity.pulse_duration / 60.0), |
|
519 } |
|
520 elseif (entity.pulse_duration or 0) > 0 |
|
521 then |
|
522 add_description{ |
|
523 name = {"more-descriptions-mod.constant-combinator-pulse-duration"}, |
|
524 value = { |
|
525 "more-descriptions-mod.ticks", |
|
526 tostring(entity.pulse_duration), |
|
527 }, |
|
528 } |
|
529 end |
|
530 elseif (entity.type == "container" or entity.type == "logistic-container") |
|
531 then |
|
532 if entity.inventory_type == "with_filters_and_bar" |
|
533 then |
|
534 add_description{ |
|
535 name = {"more-descriptions-mod.container-filters"}, |
|
536 value = "", |
|
537 } |
|
538 end |
|
539 elseif entity.type == "cargo-wagon" |
|
540 then |
|
541 -- all cargo wagons support filters |
|
542 add_description{ |
|
543 name = {"more-descriptions-mod.container-filters"}, |
|
544 value = "", |
|
545 } |
|
546 elseif entity.type == "display-panel" |
|
547 then |
|
548 add_description{ |
|
549 name = {"more-descriptions-mod.display-panel-max-text-width"}, |
|
550 value = tostring(entity.max_text_width or 400), |
|
551 } |
|
552 elseif entity.type == "logistic-robot" or entity.type == "construction-robot" |
|
553 then |
|
554 if entity.speed_multiplier_when_out_of_energy > 0 |
|
555 then |
|
556 add_description{ |
|
557 name = {"more-descriptions-mod.robot-speed-multiplier-when-out-of-energy"}, |
|
558 value = tostring(entity.speed_multiplier_when_out_of_energy * 100), |
|
559 } |
|
560 else |
|
561 add_description{ |
|
562 name = {"more-descriptions-mod.robot-crashes-when-out-of-energy"}, |
|
563 value = "", |
|
564 } |
|
565 end |
|
566 elseif entity.type == "inserter" |
|
567 then |
|
568 if entity.bulk |
|
569 then |
|
570 add_description{ |
|
571 name = {"more-descriptions-mod.inserter-bulk"}, |
|
572 value = tostring(entity.filter_count), |
|
573 } |
|
574 end |
|
575 if entity.wait_for_full_hand |
|
576 then |
|
577 add_description{ |
|
578 name = {"more-descriptions-mod.inserter-wait-for-full-hand"}, |
|
579 value = "", |
|
580 } |
|
581 end |
|
582 if entity.enter_drop_mode_if_held_stack_spoiled |
|
583 then |
|
584 add_description{ |
|
585 name = {"more-descriptions-mod.inserter-enters-drop-mode-if-held-stack-spoils"}, |
|
586 value = "", |
|
587 } |
|
588 end |
|
589 elseif entity.type == "land-mine" |
|
590 then |
|
591 add_description{ |
|
592 name = {"more-descriptions-mod.land-mine-timeout"}, |
|
593 value = seconds((entity.timeout or 120) / 60.0), |
|
594 } |
|
595 elseif entity.type == "radar" |
|
596 then |
|
597 if entity.connects_to_other_radars ~= false |
|
598 then |
|
599 add_description{ |
|
600 name = {"more-descriptions-mod.radar-connection"}, |
|
601 value = "", |
|
602 } |
|
603 end |
|
604 end |
|
605 if entity.filter_count |
|
606 then |
|
607 add_description{ |
|
608 name = {"more-descriptions-mod.filter-count"}, |
|
609 value = tostring(entity.filter_count), |
|
610 } |
|
611 end |
|
612 for _, flag in pairs(entity.flags or {}) |
|
613 do |
|
614 if flag == "no-automated-item-insertion" |
|
615 then |
|
616 add_description{ |
|
617 name = {"more-descriptions-mod.no-automated-item-insertion"}, |
|
618 value = "", |
|
619 } |
|
620 end |
|
621 end |
|
622 end |
393 end |
623 end |
394 end |
624 end |
395 end |
625 |
396 |
626 for _, recipe in pairs(data.raw.recipe) |
397 for _, recipe in pairs(data.raw.recipe) |
659 value = "", |
430 value = "", |
660 } |
431 } |
661 end |
432 end |
662 end |
433 end |
663 |
434 |
664 -- Stuff mostly specific for entities that you don't place with items (like biters) |
|
665 for _, entity_category in pairs(entity_categories) |
435 for _, entity_category in pairs(entity_categories) |
666 do |
436 do |
667 for _, entity in pairs(data.raw[entity_category] or {}) |
437 for _, entity in pairs(data.raw[entity_category] or {}) |
668 do |
438 do |
669 ---@param tooltip_field data.CustomTooltipField |
439 ---@param tooltip_field data.CustomTooltipField |
670 local function add_description(tooltip_field) |
440 local function add_description(tooltip_field) |
671 generic_add_description(entity, tooltip_field) |
441 generic_add_description(entity, tooltip_field) |
672 end |
442 end |
|
443 if entity.collision_box |
|
444 then |
|
445 local cb = entity.collision_box |
|
446 local width = math.ceil(cb[2][1] - cb[1][1]) |
|
447 local height = math.ceil(cb[2][2] - cb[1][2]) |
|
448 add_description{ |
|
449 name = {"more-descriptions-mod.entity-size"}, |
|
450 value = { |
|
451 "more-descriptions-mod.size", |
|
452 tostring(width), |
|
453 tostring(height), |
|
454 }, |
|
455 order = basic_order(0), |
|
456 } |
|
457 end |
673 |
458 |
674 if entity.minable |
459 if entity.minable |
675 then |
460 then |
676 add_description{ |
461 add_description{ |
677 name = {"more-descriptions-mod.mining-time"}, |
462 name = {"more-descriptions-mod.mining-time"}, |
678 value = seconds(entity.minable.mining_time), |
463 value = seconds(entity.minable.mining_time), |
|
464 order = basic_order(1), |
679 } |
465 } |
680 end |
466 end |
681 |
467 |
682 for _, flag in pairs(entity.flags or {}) |
468 for _, flag in pairs(entity.flags or {}) |
683 do |
469 do |
684 if flag == "breaths-air" |
470 if flag == "breaths-air" |
685 then |
471 then |
686 add_description{ |
472 add_description{ |
687 name = {"more-descriptions-mod.breathes-air"}, |
473 name = {"more-descriptions-mod.breathes-air"}, |
688 value = "", |
474 value = "", |
|
475 order = generic_order(0), |
689 } |
476 } |
690 end |
477 end |
691 end |
478 end |
692 |
479 |
693 if entity.type == "unit-spawner" |
480 if entity.type == "unit-spawner" |
695 if (entity.time_to_capture or 0) > 0 |
482 if (entity.time_to_capture or 0) > 0 |
696 then |
483 then |
697 add_description{ |
484 add_description{ |
698 name = {"more-descriptions-mod.unit-spawner-time-to-capture"}, |
485 name = {"more-descriptions-mod.unit-spawner-time-to-capture"}, |
699 value = seconds(entity.time_to_capture / 60.0), |
486 value = seconds(entity.time_to_capture / 60.0), |
|
487 order = specific_order(0), |
|
488 } |
|
489 end |
|
490 end |
|
491 |
|
492 if entity.drops_full_belt_stacks |
|
493 then |
|
494 add_description{ |
|
495 name = {"more-descriptions-mod.drops-full-belt-stacks"}, |
|
496 value = "", |
|
497 order = generic_order(10), |
|
498 } |
|
499 end |
|
500 |
|
501 if entity.heat_buffer and entity.heat_buffer.specific_heat |
|
502 then |
|
503 add_description{ |
|
504 name = {"more-descriptions-mod.specific-heat"}, |
|
505 value = { |
|
506 "more-descriptions-mod.energy-per-degrees-celsius", |
|
507 entity.heat_buffer.specific_heat, |
|
508 }, |
|
509 order = generic_order(10), |
|
510 } |
|
511 elseif entity.energy_source |
|
512 and entity.energy_source.type == "heat" |
|
513 and entity.energy_source.specific_heat |
|
514 then |
|
515 add_description{ |
|
516 name = {"more-descriptions-mod.specific-heat"}, |
|
517 value = entity.energy_source.specific_heat, |
|
518 order = generic_order(10), |
|
519 } |
|
520 end |
|
521 |
|
522 if entity.is_military_target |
|
523 then |
|
524 add_description{ |
|
525 name = {"more-descriptions-mod.is-military-target"}, |
|
526 value = "", |
|
527 order = generic_order(11), |
|
528 } |
|
529 end |
|
530 |
|
531 if not energy_zero(entity.heating_energy or "0W") |
|
532 then |
|
533 local value = entity.heating_energy |
|
534 if entity.type == "underground-belt" or entity.type == "pipe-to-ground" |
|
535 then |
|
536 value = {"more-descriptions-mod.value-per-end", value} |
|
537 end |
|
538 add_description{ |
|
539 name = {"more-descriptions-mod.heating-energy"}, |
|
540 value = value, |
|
541 order = basic_order(5), |
|
542 } |
|
543 elseif freezable_entity_categories[entity.type] |
|
544 then |
|
545 add_description{ |
|
546 name = {"more-descriptions-mod.no-heating-energy"}, |
|
547 value = "", |
|
548 order = basic_order(5), |
|
549 } |
|
550 end |
|
551 |
|
552 if entity.type == "agricultural-tower" |
|
553 then |
|
554 local cb = entity.collision_box |
|
555 local W = math.ceil(cb[2][1] - cb[1][1]) |
|
556 local w = (entity.growth_grid_tile_size or 3) |
|
557 -- width of the "buffer" area around the agricultural tower |
|
558 local z = (2 * w * math.ceil((W - w) / 2 / w)) + w |
|
559 -- num of growth cells extending from the edges of the tower |
|
560 local r = math.floor(entity.radius) -- why is it double..? |
|
561 add_description{ |
|
562 name = {"more-descriptions-mod.agricultural-tower-num-inputs"}, |
|
563 value = tostring(entity.input_inventory_size) |
|
564 } |
|
565 add_description{ |
|
566 name = {"more-descriptions-mod.agricultural-tower-growth-cell-size"}, |
|
567 value = { |
|
568 "more-descriptions-mod.size", |
|
569 tostring(w), |
|
570 tostring(w), |
|
571 }, |
|
572 order = specific_order(0), |
|
573 } |
|
574 add_description{ |
|
575 name = {"more-descriptions-mod.agricultural-tower-growth-cell-count"}, |
|
576 value = tostring(4 * r * (r + (z / w))), -- maths |
|
577 order = specific_order(1), |
|
578 } |
|
579 total_size = tostring(z + 2 * r * w) |
|
580 add_description{ |
|
581 name = {"more-descriptions-mod.agricultural-tower-total-size"}, |
|
582 value = { |
|
583 "more-descriptions-mod.size", |
|
584 total_size, |
|
585 total_size, |
|
586 }, |
|
587 order = specific_order(2), |
|
588 } |
|
589 elseif entity.type == "ammo-turret" |
|
590 then |
|
591 if entity.energy_per_shot ~= nil |
|
592 then |
|
593 add_description{ |
|
594 name = {"more-descriptions-mod.energy-per-shot-fired"}, |
|
595 value = entity.energy_per_shot, |
|
596 order = generic_order(11), |
|
597 } |
|
598 end |
|
599 add_ammo_from_attack_parameters(entity, entity.attack_parameters) |
|
600 elseif entity.type == "beacon" |
|
601 then |
|
602 add_description{ |
|
603 name = {"more-descriptions-mod.beacon-supply-area-distance"}, |
|
604 value = tostring(entity.supply_area_distance), |
|
605 order = specific_order(0), |
|
606 } |
|
607 elseif entity.type == "car" |
|
608 then |
|
609 local immunities = "" |
|
610 if (entity.immune_to_tree_impacts or false) |
|
611 then |
|
612 immunities = immunities.."[entity=tree-01]" |
|
613 end |
|
614 if (entity.immune_to_rock_impacts or false) |
|
615 then |
|
616 immunities = immunities.."[entity=big-rock]" |
|
617 end |
|
618 if (entity.immune_to_cliff_impacts or true) |
|
619 then |
|
620 immunities = immunities.."[entity=cliff]" |
|
621 end |
|
622 if immunities ~= "" |
|
623 then |
|
624 add_description{ |
|
625 name = {"more-descriptions-mod.car-immune-to-impacts"},value = immunities, |
|
626 order = specific_order(0), |
|
627 } |
|
628 end |
|
629 elseif entity.type == "constant-combinator" |
|
630 then |
|
631 -- used by pushbutton mod |
|
632 if (entity.pulse_duration or 0) > 60 |
|
633 then |
|
634 add_description{ |
|
635 name = {"more-descriptions-mod.constant-combinator-pulse-duration"}, |
|
636 value = seconds(entity.pulse_duration / 60.0), |
|
637 order = specific_order(0), |
|
638 } |
|
639 elseif (entity.pulse_duration or 0) > 0 |
|
640 then |
|
641 add_description{ |
|
642 name = {"more-descriptions-mod.constant-combinator-pulse-duration"}, |
|
643 value = { |
|
644 "more-descriptions-mod.ticks", |
|
645 tostring(entity.pulse_duration), |
|
646 }, |
|
647 order = specific_order(0), |
|
648 } |
|
649 end |
|
650 elseif (entity.type == "container" or entity.type == "logistic-container") |
|
651 then |
|
652 if entity.inventory_type == "with_filters_and_bar" |
|
653 then |
|
654 add_description{ |
|
655 name = {"more-descriptions-mod.container-filters"}, |
|
656 value = "", |
|
657 order = specific_order(0), |
|
658 } |
|
659 end |
|
660 elseif entity.type == "cargo-wagon" |
|
661 then |
|
662 -- all cargo wagons support filters |
|
663 add_description{ |
|
664 name = {"more-descriptions-mod.container-filters"}, |
|
665 value = "", |
|
666 order = specific_order(0), |
|
667 } |
|
668 elseif entity.type == "display-panel" |
|
669 then |
|
670 add_description{ |
|
671 name = {"more-descriptions-mod.display-panel-max-text-width"}, |
|
672 value = tostring(entity.max_text_width or 400), |
|
673 order = specific_order(0), |
|
674 } |
|
675 elseif entity.type == "logistic-robot" or entity.type == "construction-robot" |
|
676 then |
|
677 if entity.speed_multiplier_when_out_of_energy > 0 |
|
678 then |
|
679 add_description{ |
|
680 name = {"more-descriptions-mod.robot-speed-multiplier-when-out-of-energy"}, |
|
681 value = tostring(entity.speed_multiplier_when_out_of_energy * 100), |
|
682 order = specific_order(0), |
|
683 } |
|
684 else |
|
685 add_description{ |
|
686 name = {"more-descriptions-mod.robot-crashes-when-out-of-energy"}, |
|
687 value = "", |
|
688 order = specific_order(0), |
|
689 } |
|
690 end |
|
691 elseif entity.type == "inserter" |
|
692 then |
|
693 if entity.bulk |
|
694 then |
|
695 add_description{ |
|
696 name = {"more-descriptions-mod.inserter-bulk"}, |
|
697 value = "", |
|
698 order = specific_order(0), |
|
699 } |
|
700 end |
|
701 if entity.wait_for_full_hand |
|
702 then |
|
703 add_description{ |
|
704 name = {"more-descriptions-mod.inserter-wait-for-full-hand"}, |
|
705 value = "", |
|
706 order = specific_order(1), |
|
707 } |
|
708 end |
|
709 if entity.enter_drop_mode_if_held_stack_spoiled |
|
710 then |
|
711 add_description{ |
|
712 name = {"more-descriptions-mod.inserter-enters-drop-mode-if-held-stack-spoils"}, |
|
713 value = "", |
|
714 order = specific_order(2), |
|
715 } |
|
716 end |
|
717 elseif entity.type == "land-mine" |
|
718 then |
|
719 add_description{ |
|
720 name = {"more-descriptions-mod.land-mine-timeout"}, |
|
721 value = seconds((entity.timeout or 120) / 60.0), |
|
722 order = specific_order(0), |
|
723 } |
|
724 elseif entity.type == "radar" |
|
725 then |
|
726 if entity.connects_to_other_radars ~= false |
|
727 then |
|
728 add_description{ |
|
729 name = {"more-descriptions-mod.radar-connection"}, |
|
730 value = "", |
|
731 order = specific_order(0), |
|
732 } |
|
733 end |
|
734 end |
|
735 if entity.filter_count |
|
736 then |
|
737 add_description{ |
|
738 name = {"more-descriptions-mod.filter-count"}, |
|
739 value = tostring(entity.filter_count), |
|
740 order = basic_order(5), |
|
741 } |
|
742 end |
|
743 for _, flag in pairs(entity.flags or {}) |
|
744 do |
|
745 if flag == "no-automated-item-insertion" |
|
746 then |
|
747 add_description{ |
|
748 name = {"more-descriptions-mod.no-automated-item-insertion"}, |
|
749 value = "", |
|
750 order = basic_order(6), |
700 } |
751 } |
701 end |
752 end |
702 end |
753 end |
703 end |
754 end |
704 end |
755 end |