Wesnoth Lua Pack: Development Thread

Discussion of Lua and LuaWML support, development, and ideas.

Moderators: Forum Moderators, Developers

Post Reply
User avatar
vultraz
Community Manager
Posts: 927
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: Wesnoth Lua Pack: Development Thread

Post by vultraz » August 13th, 2015, 11:25 pm

Without looking at the code, I can say if [scatter_units] is using get_locations, the fix (on 1.13.x only, however) would be to add an { include_borders = no } key to the WML table.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?

User avatar
Celtic_Minstrel
Developer
Posts: 1186
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: Wesnoth Lua Pack: Development Thread

Post by Celtic_Minstrel » August 14th, 2015, 7:53 am

Sorry, I do not have a test case available. (And I'm running this on 1.12.)
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

User avatar
Elvish_Hunter
Developer
Posts: 1371
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Wesnoth Lua Pack: Development Thread

Post by Elvish_Hunter » August 14th, 2015, 9:25 am

Thanks anyway, I'll work on a solution to fix it on 1.12.
Current maintainer of these add-ons:
1.14: The Sojournings of Grog, A Rough Life, The White Troll (co-author)
1.12: Children of Dragons, Wesnoth Lua Pack
Active again until mid-October

User avatar
Celtic_Minstrel
Developer
Posts: 1186
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: Wesnoth Lua Pack: Development Thread

Post by Celtic_Minstrel » August 16th, 2015, 6:53 pm

...come to think of it, it also might've been an off-map location (eg x=0). Still, even if that was it, it's reasonable to get WLP to put up a better error message, right?
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

User avatar
Celtic_Minstrel
Developer
Posts: 1186
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: Wesnoth Lua Pack: Development Thread

Post by Celtic_Minstrel » March 19th, 2018, 1:15 am

So, is this still alive? It might be nice to have it as an includable resource pack in 1.14.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

User avatar
Elvish_Hunter
Developer
Posts: 1371
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Wesnoth Lua Pack: Development Thread

Post by Elvish_Hunter » July 1st, 2018, 9:17 am

Celtic_Minstrel wrote:
March 19th, 2018, 1:15 am
So, is this still alive?
As soon as I manage to port it and all my other add-ons to 1.14. I just passed a few heavy months...
Current maintainer of these add-ons:
1.14: The Sojournings of Grog, A Rough Life, The White Troll (co-author)
1.12: Children of Dragons, Wesnoth Lua Pack
Active again until mid-October

Choicerer
Posts: 238
Joined: April 29th, 2017, 11:37 pm

Re: Wesnoth Lua Pack: Development Thread

Post by Choicerer » July 2nd, 2018, 7:13 pm

Great idea, I wish I'd known about this earlier.
Well, in 1.14 the tooltip for unit names is broken (I should report it on Github), so this is a very basic function to decrease the fontsize if the unit name is too long (part of Better Names, now):

Code: Select all

local old_unit_name = wesnoth.theme_items.unit_name
function wesnoth.theme_items.unit_name()
	local u = wesnoth.get_displayed_unit()
	if not u then return {} end
	local t = old_unit_name()
	if string.len(t[1][2]["text"]) > 21 then --14 characters +7 chars of formatting code
		t[1][2]["text"] = "<span size='small'>"..t[1][2]["text"].."</span>"
	end
	return t
end
Of course you could get more inventive with this, filtering for how many upper case characters there are, since they take more space. The <span size='small'> font size could probably be slightly enlarged too.

Second thing you might find useful:
viewtopic.php?f=58&t=48233

EDIT: BTW, I know you guys use this approach for other elements, too. And sadly some translations extend those strings and then they get cut off, even though they might be more important than this one, for example the side number in Polish. I think this approach would work better.

User avatar
Elvish_Hunter
Developer
Posts: 1371
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Wesnoth Lua Pack: Development Thread

Post by Elvish_Hunter » August 9th, 2018, 10:25 am

Just a quick message to let you know that I moved the development of the WLP from Wesnoth-UMC-Dev to GitHub. The new repo is here: https://github.com/Elvish-Hunter/Wesnoth_Lua_Pack.
Current maintainer of these add-ons:
1.14: The Sojournings of Grog, A Rough Life, The White Troll (co-author)
1.12: Children of Dragons, Wesnoth Lua Pack
Active again until mid-October

User avatar
Celtic_Minstrel
Developer
Posts: 1186
Joined: August 3rd, 2012, 11:26 pm
Contact:

Re: Wesnoth Lua Pack: Development Thread

Post by Celtic_Minstrel » August 9th, 2018, 12:29 pm

Nice! Maybe I'll open a PR later to update deprecated things.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.

Post Reply