Skip to content

Commit

Permalink
Undo the [print] -> [floating_label] rename
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Jun 12, 2021
1 parent 8b21108 commit 174b524
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 30 deletions.
Expand Up @@ -1270,12 +1270,12 @@
[/filter_condition]

# Print a reminder of the time limit
[floating_label]
[print]
text= _ "$(16 - $turn_number) turns remain to free $number_merfolk_caged| merfolk"
size=24
duration=5000
color=200,200,255
[/floating_label]
[/print]
[/event]

[event]
Expand Down
8 changes: 4 additions & 4 deletions data/campaigns/tutorial/utils/utils.cfg
@@ -1,18 +1,18 @@
#textdomain wesnoth-tutorial

#define PRINT STRING
[floating_label]
[print]
text={STRING}
size=18
duration=10000
color=255,255,255
[/floating_label]
[/print]
#enddef

#define CLEAR_PRINT
[floating_label]
[print]
text="" # wmllint: ignore
[/floating_label]
[/print]
#enddef

#define GENDER MALE_WML FEMALE_WML
Expand Down
12 changes: 6 additions & 6 deletions data/core/macros/ai_controller.cfg
Expand Up @@ -485,11 +485,11 @@
{VARIABLE ai_controller_{AFFIX}.defend_location.original_controller_invokation_y $y1}
{VARIABLE ai_controller_finished yes}

[floating_label]
[print]
text= _ "Right-click to select a location to defend"
duration=100
{COLOR_WHITE}
[/floating_label]
[/print]

[set_menu_item]
id=ai_controller_defend_location_picker
Expand Down Expand Up @@ -523,10 +523,10 @@
[/goal]
)}

[floating_label]
[print]
text=" " # wmllint: ignore
duration=1
[/floating_label]
[/print]

[fire_event]
name=menu item ai_controller
Expand All @@ -551,11 +551,11 @@
[then]
{VARIABLE ai_controller_{AFFIX}.defend_location.picker_active no}

[floating_label]
[print]
text= _ "Location selection canceled"
duration=100
{COLOR_WHITE}
[/floating_label]
[/print]
[/then]
[/if]
[/event]
Expand Down
20 changes: 2 additions & 18 deletions data/lua/wml-tags.lua
Expand Up @@ -769,11 +769,10 @@ end

local wml_floating_label = {valid = false}
function wml_actions.print(cfg)
wesnoth.deprecated_message('[print]', 1, nil, 'use [floating_label] instead')
local label_text, lifetime = {cfg.text}, {}
if wml_floating_label.valid then
wml_floating_label:remove()
end
local label_text = {cfg.text}
if cfg.size then
table.insert(label_text, cfg.size)
end
Expand All @@ -782,21 +781,6 @@ function wml_actions.print(cfg)
elseif cfg.red or cfg.green or cfg.blue then
table.insert(label_text, {cfg.red or 0, cfg.green or 0, cfg.blue or 0})
end

wml_floating_label = wesnoth.interface.add_floating_label(label_text, cfg.duration or 50)
end

function wml_actions.floating_label(cfg)
local label_text, lifetime = {cfg.text}, {}
if wml_floating_label.valid then
wml_floating_label:remove()
end
if cfg.size then
table.insert(label_text, cfg.size)
end
if cfg.color then
table.insert(label_text, stringx.split(cfg.color))
end
local offset = nil
if cfg.x_offset or cfg.y_offset then
offset = {cfg.x_offset or 0, cfg.y_offset or 0}
Expand All @@ -808,7 +792,7 @@ function wml_actions.floating_label(cfg)
lifetime.fade_time = cfg.fade_time
end

wml_floating_label = wesnoth.interface.add_floating_label(label_text, lifetime, offset)
wml_floating_label = wesnoth.interface.add_overlay_text(label_text, lifetime, offset)
end

function wml_actions.unsynced(cfg)
Expand Down

0 comments on commit 174b524

Please sign in to comment.