![]() |
VOOZH | about |
Can the module be set up to not wrap the space between the sprite and the text? It looks terrible wherever it wraps. –KnightMiner t/c 03:01, 17 March 2015 (UTC)
{{gameplay}} for Renewable resource). –KnightMiner t/c 15:35, 12 May 2015 (UTC)white-space:normal in the .sprite-text class, it allows wrapping between words without wrapping on the sprite. It a little less garbage of a solution as wrapping still exists next on the words, just on on the sprite. (example: I think we should merge {{BlockSprite}}, {{ItemSprite}}, {{EntitySprite}}, and {{EnvSprite}} with {{Sprite}}. I also think we should merge their link variants, including {{BiomeLink}}.
~From Contrapple 👁 Image
00:55, 24 March 2015 (UTC)
{{schematic}} and {{Mods/Aether/Link}}). So while there does not "need" to be a distinction, it makes things a lot easier. –KnightMiner t/c 02:04, 24 March 2015 (UTC)
{{EnvSprite}} contains the code {{ #invoke: Sprite | sprite | settings = EnvSprite }}, which runs Module:Sprite and tells it to load settings from Module:EnvSprite; Module:EnvSprite itself only contains an array with some general settings about the EnvSprite sprite sheet and loads Module:EnvSprite/IDs, which contains another array with the IDs associated with names for the sprites in the sheet). These could all be merged together, but all merging would accomplish is moving all of this information onto a single page, in a massive array that would be much more difficult to maintain than the current separate arrays. Any performance gains would also be negligible and would be related almost entirely to the fact that separate pages would no longer have to be loaded for a given sprite sheet.'foo' .. 'bar', which, when run, would give 'foobar'), since concatenation in Lua is somewhat slow and Lua strings are immutable (which means every time you change a string and store the changed value back to the same variable, Lua actually creates a copy of that variable, and all the old copies hang around until the next time it runs the garbage collector). 「ディノ奴千?!」? · ☎ Dinoguy1000 18:30, 24 March 2015 (UTC)I notice that when you substitute {{sprite}} or a similar template, you will display 👁 Unknown sprite image
. However someone might want to be able to substitute it so they can use it in signatures.71.212.10.80 16:19, 26 April 2015 (UTC)
{{{|safesubst:}}} to the templates that call it). The problem is instead that template requires Widget:FileUrl to function, as otherwise MediaWiki will not allow files to display. While that issue is fixed by CSS on the older sheets, there still is the additional issue that we would now be using the sprite sheet without knowing where it is used, as CSS does not add file links. This would mean should the sheet change (as it is going to), there would be no way to update the old usages. I suggest instead using individual images from {{grid}} if you need a specific flair of that type. –KnightMiner t/c 20:37, 26 April 2015 (UTC)I think there should be a way to display rectangles as opposed to squares. The way to do this without messing up current usages would be to add a paramater for the hight (in pixels). This value would default to {{{size|16}}}.71.212.10.80 20:37, 19 May 2015 (UTC)
We have gotten many sprites that have never been used or are on the wrong sprite sheet, especially on {{BlockSprite}}, and many redundant aliases which would be nice to remove, and it would be nice to be able to create a list containing those. One idea would be changing
if not pos and not mw.title.getCurrentTitle().isSubpage then category = '[[Category:Pages with missing sprites]]' end
to
if not pos and not mw.title.getCurrentTitle().isSubpage then category = '[[Category:Pages with missing sprites]]' elseif type( pos ) == 'table' then pos = pos[1] category = '[[Category:Pages with deprecated sprites]]' end
which allow detecting individual names marked as deprecated (marking would be done simply by surrounding the id with curly brackets, as that was a bit simpler then actual containing a keyword in the table). Since numerical ids are generally avoided, that would match nearly all cases of deprecated sprites ID, and will match deprecated aliases as well.
On a related note, it might be relevant to add an optional category (enabled using the settings pages) to mark pages using numerical ids when string ids are available. –KnightMiner t/c 17:34, 25 May 2015 (UTC)
Edit: Line 162 should also be changed from pos = line:match( '=%s*(%d+)%s*,?$' ) or '' to pos = line:match( '=%s*%{?(%d+)%}?%s*,?$' ) or ''. –KnightMiner t/c 19:42, 27 May 2015 (UTC)
['gear'] = {71},
['71'] = {71},
p.sprite(f), instead of having:if tonumber( args[1] ) then
args.pos = args[1]
else
local default = {}
...
local pos = ids[id] or ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )]
if not pos and not mw.title.getCurrentTitle().isSubpage then
category = '[[Category:Pages with missing sprites]]'
end
args.pos = pos
end
local default = {}
...
local pos = ids[id] or ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )]
args.pos = pos
if not pos and not mw.title.getCurrentTitle().isSubpage then
if tonumber( args[1] ) then
args.pos = args[1]
category = '[[Category:Pages with sprites with numeric IDs]]'
else
category = '[[Category:Pages with missing sprites]]'
end
elseif type( pos ) == 'table' then
args.pos = pos[1]
category = '[[Category:Pages with deprecated sprites]]'
end
not mw.title.getCurrentTitle().isSubpage is to prevent from adding the category on translation pages, so it would instead need to be moved to a separate "if" function to allow the numerical positions on subpages. Also, since we generally don't use numeric IDs (except in places where those are the only IDs, which skips this code entirely), I doubt it would affect performance too much.local default = {}
...
local pos = ids[id] or ids[mw.ustring.lower( id ):gsub( '[%s%+]', '-' )]
args.pos = pos
if not pos then
if tonumber( args[1] ) then
args.pos = args[1]
category = '[[Category:Pages with sprites with numeric IDs]]'
else
category = '[[Category:Pages with missing sprites]]'
end
elseif type( pos ) == 'table' then
args.pos = pos[1]
category = '[[Category:Pages with deprecated sprites]]'
end
if mw.title.getCurrentTitle().isSubpage then
category = ''
end
I think there should be animation:
{{{pos}}} and {{{text}}} can be animated{{{size}}}, {{{sheetsize}}}, {{{scale}}} and other parameters related to the icon using a number for the frame, except defaultpos (for example, {{{sheetsize2}}} would be used for the sheetsize in the second frame).
{{{link}}} cannot be animated.{{BlockLink|id=Sandstone;Red Sandstone|Talk:Red Sandstone|Sandstone}}
👁 Image
Sandstone👁 Image
Sandstone
Schematics that show redstone circuts in their on state and thier off state. 71.212.10.80 21:13, 4 June 2015 (UTC)
{{schematic}}, which could easily be suggested there. –KnightMiner t/c 17:48, 5 June 2015 (UTC)It looks like [[:Category:Pages using sprite positions]] is down to just talk pages and sandboxes. Is there a further plan? – Sealbudsman talk/contr 14:58, 15 October 2015 (UTC)
Can the maintenance categories be removed for user and talk pages? The reason is that both of those pages often will have misuses/outdated uses of the template. In the case of talk pages should not really be changed later even if it has such errors, and for user pages they really shouldn't be edited by people other than that user. –KnightMiner t/c 02:28, 29 October 2015 (UTC)
Can at least the deprecated sprite parameter be added to subpages which are not translations? It should be easy enough using {{Translation category}}. I am currently hesitant to remove any deprecated sprites as I have no idea if a subpage (such as one of the block state or data value tables) uses it. –KnightMiner t/c 01:42, 26 February 2016 (UTC)
The documentation for {{BlockGrid}} intentionally has a missing sprite, but is in Category:Pages with missing sprites. Can editors have the option to cancel the categorization? The Blobs👁 Image
18:43, 7 February 2017 (UTC)
When using one of the link templates, the default is to go to the linked value. Unfortunately this causes issues when the linked page by necessity is (or should be) a disambiguation; in particular this is a problem for {{EffectLink}} (discussion). It also causes issues for when the ID doesn't correspond with a logical page (e.g. the "old absorption" sprites). I know that it is possible to manually specify the link, but IMO it would be better if the default is useful.
I think it would be possible to fix this by adding an optional link value to the IDs pages that specifies the default link for that sprite (rather than just defaulting to the ID of the sprite). For instance, on those effects it would specify a link as Status effects#effect. I don't think this would be too hard to implement (but I am unable to actually change this template myself and lua isn't exactly my forte). I've put in some sample data for effects (hopefully this doesn't cause issues), though. --Pokechu22 (talk) 03:25, 31 December 2017 (UTC)
linkPrefix thing but assumed it was intended for namespaces; didn't think to use it for that. That does seem to work here, but I still think my idea has merit as linking for other things could benefit from it (e.g. the particle versions which are currently not useful with EffectLink). --Pokechu22 (talk) 06:39, 31 December 2017 (UTC)Ping Majr, since you would have the most to say.
The documentation feature of this module is currently causing the template expansion size to be exceeded on {{InvSprite}} where there are about 2,400 different sprite names. There is a temporary fix in place by circumnavigating {{documentation}} entirely, but for a more permanent fix we should reduce the wikitext output. I have two potential solutions that both have some disadvantages
The first solution mainly impacts the sprite editor. By inspecting the HTML I noticed an excess of sprite doc classes added to form the tables. This solution reduces the text output by switching some CSS classes to nested queries as follows:
.spritedoc-names could become .spritedoc-box > ul. Saves 24 characters per unique sprite, roughly 50,000 characters for InvSprite.<code> tags with CSS, since most of the styling is overridden anyways. Saves 11 characters per sprite name, roughly 26,000 characters for InvSprite..spritedoc-name can become .spritedoc-box > ul > li. Saves 23 characters per sprite name, roughly 55,000 characters for InvSprite.<div> wrapper on the sprite images in favor of the CSS .spritedoc-box .sprite. Saves 35 characters per sprite, roughly 77,000 characters for InvSprite..spritedoc-box with .spritedoc-boxes -> li. I'm pretty iffy on this one since it makes the CSS very ugly (.spritedoc-name becomes .spritedoc-boxes > li > ul > li), but it saves an additional 22 characters per unique sprite, roughly 50,000 total for InvSprite.This all totals around 200,000 characters, which based on around 290 characters per sprite lets us add 650 more sprites before running into issues again (if including .spritedoc-box, we have around 250,000 extra characters with around 275 characters for each sprite, allowing around 900 more). I am not sure exactly how much this affects the sprite editor's performance as I only briefly looked at its code; it would mean switching a lot of class name references to HTML element references (many nested), which could have a performance impact, but it would only affect the sprite editor.
The second solution has an impact on sprite docs even if not using the sprite editor. This solution is to remove the image caching when on the sprite docs. This saves around 120 characters per sprite, totaling roughly 260,000 characters. This means each sprite is now around 270 characters (without the first solution), allowing us around 950 more sprite names before hitting issues. Of course, this has the side effect that the sprite doc may show different images than the actual page.
–KnightMiner t/c 03:50, 17 June 2018 (UTC)
The Additions section in Java Edition 1.16 includes sprites on the right side so as not to break up the flow of text. Can we have the option to do this using a parameter?
The simplest way to do this might be to replace this:
root:node(sprite) ifspriteTextthen root:node(spriteText) end
with this:
ifspriteTextandargs['right']then root:node(spriteText) end root:node(sprite) ifspriteTextandnotargs['right']then root:node(spriteText) end
and adding this to MediaWiki:Gadget-site-styles.css:
.sprite-text+.sprite{ padding-left:0.312em; background-origin:content-box; background-clip:content-box; }
You can see this in action at Module:Sandbox/FnControlOption/Sprite (but with less elegant code since I don't have write access to MediaWiki:Gadget-site-styles.css)
— fn ⌃ ⌥ (talk · edits) 16:22, 25 September 2020 (UTC)
The sprites in this sprite module don't display anymore. Why is this the case? Is it to adapt for FandomDesktop? K1401986 Talk with me My edits 21:12, 9 June 2021 (UTC)
Currently, the nowrap class is used on the container to ensure the sprite is not visually disconnected from the text after it (when the text attribute is specified). The problem with this approach is that the text cannot be wrapped either, which tends to create scroll bars in infoboxes for some screen sizes (e.g., on my computer, the infobox on Spruce has a horizontal scroll bar). The fix for that was already suggested by KnightMiner back in 2015 (see #Nowrap): simply add white-space: normal; in the sprite-text class. I would do it myself, but I don't know where to find the stylesheets, and I likely do not have the permission to edit them. --MDLC01 13:05, 17 February 2023 (UTC)
white-space: normal; line 578. I indeed do not have the permission to edit the stylesheet. --MDLC01