From 174b524aae261d96ab8f85e5825f336fc9be515c Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 12 Jun 2021 14:46:34 -0400 Subject: [PATCH] Undo the [print] -> [floating_label] rename --- .../09_Blood_is_Thicker_Than_Water.cfg | 4 ++-- data/campaigns/tutorial/utils/utils.cfg | 8 ++++---- data/core/macros/ai_controller.cfg | 12 +++++------ data/lua/wml-tags.lua | 20 ++----------------- 4 files changed, 14 insertions(+), 30 deletions(-) diff --git a/data/campaigns/Under_the_Burning_Suns/scenarios/09_Blood_is_Thicker_Than_Water.cfg b/data/campaigns/Under_the_Burning_Suns/scenarios/09_Blood_is_Thicker_Than_Water.cfg index 447760586196..b404bee099d1 100644 --- a/data/campaigns/Under_the_Burning_Suns/scenarios/09_Blood_is_Thicker_Than_Water.cfg +++ b/data/campaigns/Under_the_Burning_Suns/scenarios/09_Blood_is_Thicker_Than_Water.cfg @@ -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] diff --git a/data/campaigns/tutorial/utils/utils.cfg b/data/campaigns/tutorial/utils/utils.cfg index 45fbad797d8b..97ae40e5d073 100644 --- a/data/campaigns/tutorial/utils/utils.cfg +++ b/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 diff --git a/data/core/macros/ai_controller.cfg b/data/core/macros/ai_controller.cfg index 8c51f67069d4..58591f986927 100644 --- a/data/core/macros/ai_controller.cfg +++ b/data/core/macros/ai_controller.cfg @@ -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 @@ -523,10 +523,10 @@ [/goal] )} - [floating_label] + [print] text=" " # wmllint: ignore duration=1 - [/floating_label] + [/print] [fire_event] name=menu item ai_controller @@ -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] diff --git a/data/lua/wml-tags.lua b/data/lua/wml-tags.lua index 84e8bc242047..7e0148dfab10 100644 --- a/data/lua/wml-tags.lua +++ b/data/lua/wml-tags.lua @@ -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 @@ -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} @@ -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)