1
0
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:
danielmartin0 2024-10-15 12:27:17 +01:00 committed by Gerkiz
parent bacb47fe3e
commit 5d259e2877
15 changed files with 72 additions and 31 deletions

View File

@ -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,

View File

@ -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',

View File

@ -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
}
)

View File

@ -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
}
)

View File

@ -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,

View File

@ -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,

View File

@ -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'

View File

@ -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,

View File

@ -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
}

View File

@ -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,

View File

@ -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,

View File

@ -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',

View File

@ -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
}
)

View File

@ -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,

View File

@ -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
}
)