mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-28 03:57:22 +02:00
Port target_offset in modules
This commit is contained in:
parent
bacb47fe3e
commit
5d259e2877
@ -1878,8 +1878,10 @@ function player_icon_add(player)
|
||||
rendering.draw_text(
|
||||
{
|
||||
text = storage.table_of_properties[player.force.name].icon,
|
||||
target = player.character,
|
||||
target_offset = { 0, -3.7 },
|
||||
target = {
|
||||
entity = player.character,
|
||||
offset = { 0, -3.7 },
|
||||
},
|
||||
surface = player.surface,
|
||||
color = table_of_colors.white,
|
||||
scale = 2,
|
||||
|
@ -555,8 +555,10 @@ function Public.create_char(data)
|
||||
rendering.draw_text {
|
||||
text = player.name .. "'s drone #" .. index,
|
||||
surface = player.surface,
|
||||
target = entity,
|
||||
target_offset = { 0, -2.25 },
|
||||
target = {
|
||||
entity = entity,
|
||||
offset = { 0, -2.25 },
|
||||
},
|
||||
color = Color.orange,
|
||||
scale = 1.00,
|
||||
font = 'default-large-semibold',
|
||||
|
@ -57,8 +57,10 @@ local function create_boss_healthbar(entity, size)
|
||||
x_scale = size * 15,
|
||||
y_scale = size,
|
||||
render_layer = 'light-effect',
|
||||
target = entity,
|
||||
target_offset = { 0, -2.5 },
|
||||
target = {
|
||||
entity = entity,
|
||||
offset = { 0, -2.5 },
|
||||
},
|
||||
surface = entity.surface
|
||||
}
|
||||
)
|
||||
|
@ -233,8 +233,10 @@ local function create_boss_healthbar(entity, size)
|
||||
x_scale = size * 15,
|
||||
y_scale = size,
|
||||
render_layer = 'light-effect',
|
||||
target = entity,
|
||||
target_offset = { 0, -2.5 },
|
||||
target = {
|
||||
entity = entity,
|
||||
offset = { 0, -2.25 },
|
||||
},
|
||||
surface = entity.surface
|
||||
}
|
||||
)
|
||||
|
@ -32,8 +32,10 @@ local function tame_unit_effects(player, entity)
|
||||
rendering.draw_text {
|
||||
text = '~' .. player.name .. "'s pet~",
|
||||
surface = player.surface,
|
||||
target = entity,
|
||||
target_offset = { 0, -2.6 },
|
||||
target = {
|
||||
entity = entity,
|
||||
offset = { 0, -2.6 },
|
||||
},
|
||||
color = {
|
||||
r = player.color.r * 0.6 + 0.25,
|
||||
g = player.color.g * 0.6 + 0.25,
|
||||
|
@ -47,8 +47,10 @@ local function on_console_chat(event)
|
||||
rendering.draw_text {
|
||||
text = event.message,
|
||||
surface = player.surface,
|
||||
target = player.character,
|
||||
target_offset = { -0.05, y_offset },
|
||||
target = {
|
||||
entity = player.character,
|
||||
offset = { -0.05, y_offset },
|
||||
},
|
||||
color = {
|
||||
r = player.color.r * 0.6 + 0.25,
|
||||
g = player.color.g * 0.6 + 0.25,
|
||||
|
@ -114,8 +114,10 @@ local function built_entity(event)
|
||||
rendering.draw_text {
|
||||
text = '♾',
|
||||
surface = entity.surface,
|
||||
target = entity,
|
||||
target_offset = { 0, -0.6 },
|
||||
target = {
|
||||
entity = entity,
|
||||
offset = { 0, -0.6 },
|
||||
},
|
||||
scale = 2,
|
||||
color = { r = 0, g = 0.6, b = 1 },
|
||||
alignment = 'center'
|
||||
|
@ -465,7 +465,10 @@ local function draw_level_text(player)
|
||||
rendering.draw_text {
|
||||
text = 'lvl ' .. rpg_t[player.index].level,
|
||||
surface = player.surface,
|
||||
target = { entity = player.character, offset = { 0, -3.25 } },
|
||||
target = {
|
||||
entity = player.character,
|
||||
offset = { 0, -3.25 },
|
||||
},
|
||||
color = {
|
||||
r = player.color.r * 0.6 + 0.25,
|
||||
g = player.color.g * 0.6 + 0.25,
|
||||
|
@ -54,7 +54,10 @@ local function create_healthbar(player, size)
|
||||
x_scale = size * 8,
|
||||
y_scale = size - 0.2,
|
||||
render_layer = 'light-effect',
|
||||
target = { entity = player.character, offset = { 0, -2.5 } },
|
||||
target = {
|
||||
entity = player.character,
|
||||
offset = { 0, -2.5 },
|
||||
},
|
||||
surface = player.surface
|
||||
}
|
||||
)
|
||||
@ -68,7 +71,10 @@ local function create_manabar(player, size)
|
||||
x_scale = size * 8,
|
||||
y_scale = size - 0.2,
|
||||
render_layer = 'light-effect',
|
||||
target = { entity = player.character, offset = { 0, -2.0 } },
|
||||
target = {
|
||||
entity = player.character,
|
||||
offset = { 0, -2.0 },
|
||||
},
|
||||
surface = player.surface
|
||||
}
|
||||
)
|
||||
@ -1278,8 +1284,10 @@ show_cooldown =
|
||||
min_radius = 0.4,
|
||||
start_angle = start_angle,
|
||||
angle = fade * angle_multipler,
|
||||
target = player.character,
|
||||
target_offset = { x = 0, y = -2 },
|
||||
target = {
|
||||
entity = player.character,
|
||||
offset = { x = 0, y = -2 },
|
||||
},
|
||||
surface = player.surface,
|
||||
time_to_live = time_to_live
|
||||
}
|
||||
|
@ -483,7 +483,10 @@ function Public.draw_level_text(player)
|
||||
rendering.draw_text {
|
||||
text = 'lvl ' .. rpg_t.level,
|
||||
surface = player.surface,
|
||||
target = { entity = player.character, offset = { 0, -3.25 } },
|
||||
target = {
|
||||
entity = player.character,
|
||||
offset = { 0, -3.25 },
|
||||
},
|
||||
color = {
|
||||
r = player.color.r * 0.6 + 0.25,
|
||||
g = player.color.g * 0.6 + 0.25,
|
||||
|
@ -869,7 +869,10 @@ local function tame_unit_effects(player, entity)
|
||||
rendering.draw_text {
|
||||
text = '~' .. player.name .. "'s pet~",
|
||||
surface = player.surface,
|
||||
target = { entity = entity, offset = { 0, -2.6 } },
|
||||
target = {
|
||||
entity = entity,
|
||||
offset = { 0, -2.6 },
|
||||
},
|
||||
color = {
|
||||
r = player.color.r * 0.6 + 0.25,
|
||||
g = player.color.g * 0.6 + 0.25,
|
||||
|
@ -400,8 +400,10 @@ function Public.found(event)
|
||||
rendering.draw_text {
|
||||
text = 'HP: ' .. town_center.health .. ' / ' .. town_center.max_health,
|
||||
surface = surface,
|
||||
target = town_center.market,
|
||||
target_offset = {0, -2.5},
|
||||
target = {
|
||||
entity = town_center.market,
|
||||
offset = {0, -2.5},
|
||||
},
|
||||
color = {200, 200, 200},
|
||||
scale = 1.00,
|
||||
font = 'default-game',
|
||||
@ -413,8 +415,10 @@ function Public.found(event)
|
||||
rendering.draw_text {
|
||||
text = player.name .. "'s Town",
|
||||
surface = surface,
|
||||
target = town_center.market,
|
||||
target_offset = {0, -3.25},
|
||||
target = {
|
||||
entity = town_center.market,
|
||||
offset = {0, -3.25},
|
||||
},
|
||||
color = town_center.color,
|
||||
scale = 1.30,
|
||||
font = 'default-game',
|
||||
|
@ -8,8 +8,10 @@
|
||||
x_scale = size * 15,
|
||||
y_scale = size,
|
||||
render_layer = 'light-effect',
|
||||
target = entity,
|
||||
target_offset = {0, -2.5},
|
||||
target = {
|
||||
entity = entity,
|
||||
offset = {0, -2.5},
|
||||
},
|
||||
surface = entity.surface
|
||||
}
|
||||
)
|
||||
|
@ -550,8 +550,10 @@ local function testnoise()
|
||||
rendering.draw_text {
|
||||
text = math.round(noise, 4),
|
||||
surface = surface,
|
||||
target = entity,
|
||||
target_offset = {0, 0},
|
||||
target = {
|
||||
entity = entity,
|
||||
offset = {0, 0},
|
||||
},
|
||||
color = {0, 255, 0},
|
||||
scale = 0.88,
|
||||
-- font = default,
|
||||
|
@ -13,8 +13,10 @@ local function add_light(e)
|
||||
minimum_darkness = 0,
|
||||
oriented = false,
|
||||
color = color,
|
||||
target = e,
|
||||
target_offset = {0, -0.5},
|
||||
target = {
|
||||
entity = e,
|
||||
offset = {0, -0.5},
|
||||
},
|
||||
surface = e.surface
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user