Difference between revisions of "Template:Command Panel UI Button"
Jump to navigation
Jump to search


Debug data:
(Always add title and alt text.) |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <div style="width:53px;height:49px | + | <div style="width:53px;height:49px;border:#356 solid 2px;border-radius:4px;background-color:#233;padding:0;margin:0;position:relative"><img src="//raw.githubusercontent.com/ZeroK-RTS/Zero-K/master/LuaUI/Images/nested_buildmenu/frame_{{{frame|Mobile}}}.png" style="width:53px;height:{{#if:{{{price|}}}|40|47}}px;margin:0;border:none;position:absolute;top:0;left:0" alt="({{{frame|Mobile}}}) "><img src="//manual.zero-k.info/unitpics/{{{unitpic|cloakraid}}}.png" style="width:53px;height:{{#if:{{{price|}}}|40|47}}px;margin:0;border:none;position:absolute;top:0;left:0" alt="{{{name|{{{1|{{UnitData getData|{{{unitpic|cloakraid}}}|name}}}}}}}}" title="{{{name|{{{1|{{UnitData getData|{{{unitpic|cloakraid}}}|name}}}}}}}}"> |
− | {{#if:{{{price|}}}|<div style="line-height:19px;color:#0f0;text-shadow:1px 1px 2px #000;position:absolute;top:0;left:5px;font-family:FreeSans,Arial,sans-serif;font-weight:bold;font-size:11px">{{{ | + | {{#if:{{{price|}}}|<div style="line-height:19px;color:#0f0;text-shadow:1px 1px 2px #000;position:absolute;top:0;left:5px;font-family:FreeSans,Arial,sans-serif;font-weight:bold;font-size:11px">{{{hotkey|W}}}</div> |
− | <div style="line-height:22px;color:#eee;text-shadow:1px 1px 2px #000;position:absolute;top:33px;left:5px;font-family:FreeSans,Arial,sans-serif;font-weight:bold;font-size:12px">{{{price| | + | <div style="line-height:22px;color:#eee;text-shadow:1px 1px 2px #000;position:absolute;top:33px;left:5px;font-family:FreeSans,Arial,sans-serif;font-weight:bold;font-size:12px">{{{price|{{UnitData getData|{{{unitpic|cloakraid}}}|cost}}}}}</div> |
}} | }} | ||
− | {{#if:{{{queued|}}}|<div style="line-height:26px;color:#fff;text-shadow:1px 1px 2px #000;position:absolute;top:25px;left:0;width:47px;font-family:FreeSans,Arial,sans-serif;font-weight:bold;font-size:15px;text-align:right">{{{queued|0}}}</div> | + | {{#if:{{{queued|{{{2|}}}}}}|<div style="line-height:26px;color:#fff;text-shadow:1px 1px 2px #000;position:absolute;top:25px;left:0;width:47px;font-family:FreeSans,Arial,sans-serif;font-weight:bold;font-size:15px;text-align:right">{{{queued|{{{2|0}}}}}}</div> |
− | {{#if:{{{progress| | + | {{#if:{{{progress|{{{3|}}}}}}|<div style="width:{{#expr:{{{progress|{{{3|0}}}}}}*0.53}}px;height:43px;margin:0;border:none;position:absolute;top:2;left:2;background:rgba(192, 192, 96, 0.55)"></div>}}}} |
</div><noinclude>{{Documentation}}</noinclude> | </div><noinclude>{{Documentation}}</noinclude> |
Latest revision as of 18:14, 23 June 2024


Command Panel UI Button is a template to insert a picture of a UI panel button without having to resort to taking a screen shot. A simple wiki table effectively groups multiple buttons.
It is called like this:
{{Command Panel UI Button|unitpic=cloakraid
|Glaive
|18
|25
}}
This results in a nice button that shows a Glaive which is 25% completed.


18
The unitpic
parameter is required. It provides the name of the image file to be used for the unit's picture. All images are assumed to be in .png format.
Everything else is optional. The following parameters are allowed:
- The first unnamed one or
name
is the name of the unit. - The second unnamed one or
queued
is how many units are waiting in the queue to be built. - The third unnamed one or
percentage
is how much of the unit has already completed building, in percent. It shows the transparent yellow progress bar on the button. frame
is the rectangle around the unit. It defaults toMobile
, but other values includeFac
for builders andMisc
for radars and jammers. When in doubt, look at the frame in the actual game.hotkey
is the shortcut key assigned to the button.price
is the price of the unit in Metal and Energy.
A full or partial panel can be simulated using wiki tables:
![]() ![]() Q
120
|
![]() ![]() W
65
|
![]() ![]() E
90
| |
![]() ![]() H
600
| |||
![]() ![]() 1
|
![]() ![]() 3
|
![]() ![]() 5
|
![]() ![]() 1
|
The above documentation is transcluded from Template:Command Panel UI Button/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |
Debug data:
[SQLBagOStuff] MainObjectStash using store ReplicatedBagOStuff
[objectcache] MainWANObjectCache using store EmptyBagOStuff
IP: 18.218.146.21
Start request GET /mediawiki/index.php?diff=cur&oldid=8598&title=Template%3ACommand_Panel_UI_Button
HTTP HEADERS:
CONTENT-TYPE:
CONTENT-LENGTH: 0
USER-AGENT: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HOST: zero-k.info
ACCEPT-ENCODING: gzip, br, zstd, deflate
ACCEPT: */*
CONNECTION: close[localisation] LocalisationCache: using store LCStoreDB
[session] SessionManager using store SqlBagOStuff
[DBReplication] Cannot use ChronologyProtector with EmptyBagOStuff
[DBReplication] Wikimedia\Rdbms\LBFactory::getChronologyProtector: request info {
"IPAddress": "18.218.146.21",
"UserAgent": "Mozilla\/5.0 AppleWebKit\/537.36 (KHTML, like Gecko; compatible; ClaudeBot\/1.0; +claudebot@anthropic.com)",
"ChronologyProtection": false,
"ChronologyPositionIndex": 0,
"ChronologyClientId": false
}[DBConnection] Wikimedia\Rdbms\LoadBalancer::lazyLoadReplicationPositions: executed chronology callback.
[DBConnection] Wikimedia\Rdbms\LoadBalancer::getLocalConnection: connected to database 0 at 'localhost'.
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
[session] SessionBackend "1b0gf9po6okjq24ipfthh9ojc013jd2l" is unsaved, marking dirty in constructor
[session] SessionBackend "1b0gf9po6okjq24ipfthh9ojc013jd2l" save: dataDirty=1 metaDirty=1 forcePersist=0
[cookie] already deleted setcookie: "wikidb229_mw__session", "", "1715623166", "/", "", "", "1"
[cookie] already deleted setcookie: "wikidb229_mw_UserID", "", "1715623166", "/", "", "", "1"
[cookie] already deleted setcookie: "wikidb229_mw_Token", "", "1715623166", "/", "", "", "1"
[cookie] already deleted setcookie: "forceHTTPS", "", "1715623166", "/", "", "", "1"
[DBConnection] Wikimedia\Rdbms\LoadBalancer::getLocalConnection: connected to database 0 at 'localhost'.
Title::getRestrictionTypes: applicable restrictions to [[Template:Command Panel UI Button]] are {edit,move}
[ContentHandler] Created handler for wikitext: WikitextContentHandler
Article::view: showing diff page
DifferenceEngine old '8598' new 'cur' rcid ''
[MessageCache] MessageCache using store SqlBagOStuff
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
[SQLBagOStuff] SqlBagOStuff::lock failed due to timeout for wikidb229-mw_:messages:en.
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
[MessageCache] MessageCache::load: Loading en... local cache is empty, global cache is expired/volatile, loading from database
ParserFactory: using preprocessor: Preprocessor_Hash
Unstubbing $wgLang on call of $wgLang::_unstub from ParserOptions->__construct
DifferenceEngine old '0' new '0' rcid '0'
[GlobalTitleFail] MessageCache::parse called by DifferenceEngine->getMultiNotice/DifferenceEngine::intermediateEditsMsg/Message->parse/Message->toString/Message->parseText/MessageCache->parse with no title set.
WikiPage::getParserOutput: using parser cache: yes
[caches] parser: SqlBagOStuff
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
Parser cache options found.
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
[SQLBagOStuff] Connection mysql object #127 (handle id #121) will be used for SqlBagOStuff
ParserOutput cache found.
MediaWiki::preOutputCommit: primary transaction round committed
MediaWiki::preOutputCommit: pre-send deferred updates completed
MediaWiki::preOutputCommit: session changes committed
MediaWiki::preOutputCommit: LBFactory shutdown completed
Title::getRestrictionTypes: applicable restrictions to [[Template:Command Panel UI Button]] are {edit,move}