BIS fnc showAANArticle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Text replacement - "\[ +" to "[")
 
(30 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma3
____________________________________________________________________________________________
|version1= 1.76


| arma3 |= Game name
|gr1= GUI


|1.00|= Game version
|gr2= Interaction
____________________________________________________________________________________________


| <pre>/*
|descr= Show an AAN article.


Description:
|s1= [arrayOfArrays, display, fade] call [[BIS_fnc_showAANArticle]]
Show AAN article


Parameter(s):
|p1= arrayOfArrays: [[Array|array]] of [[Array|arrays]]; each subarray defines part of an article, can be:
0: ARRAY of ARRAYS - each subarray defines part of an article, can be:
* Article title: ["title", <text:string>]
* Article author and date: ["meta", [<author:string>, <date:array Y,M,D,H,M>, <timezoneName:string>]]
* Paragraph: ["text",<text:string>]
* Bold paragraph: ["textbold",<text:string>]
* Locked paragraph: ["textlocked",[<text:string>,<prompt:string>]] - ''Locked paragraph with subscriber prompt. There should be no paragraph after it.''
* Image with description: ["image", [<path:string>, <description:string>, <source:string>]] - ''The image should have 2:1 ratio.''
* Link to another "fake" article displayed on left: ["box",[<path:string>, <description:string>]] - ''The image should have 2:1 ratio.''
* Author's bio: ["author",[<path:string>, <description:string>]] - ''The image should have 1:1 ratio.''
* Draft notification: ["draft",[<text:string>, <color:arrayRGB>]] - ''Text and color are optional, default notification will be shown when they're undefined.''


["title", <text:string>]
|p2= display: [[Display]] - a display to make the AAN article a child of it
Article title


Article author and date
|p3= fade: [[Boolean]] - (Optional, default false) true to fade from black


["text",<text:string>]
|r1= [[Display]] - the AAN article display
Paragraph


["textbold",<text:string>]
|x1= [[File:a3 orange aan.jpg|thumb|480px|Result]]
Bold paragraph
<sqf>
 
[
["textlocked",[<text:string>,<prompt:string>]]
[
Locked paragraph with subscriber prompt. There should be no paragraph after it.
 
["image",[<path:string>, <description:string>, <source:string>]]
Image with description. The image should have 2:1 ratio.
 
["box",[<path:string>, <description:string>]]
Link to another "fake" article displayed on left. The image should have 2:1 ratio.
 
["author",[<path:string>, <description:string>]]
Author's bio. The iage should have 1:1 ratio.
 
["draft",[<text:string>, <color:arrayRGB>]]
Draft notification. Text and color are optional, default notification will be shown when they're undefined.
 
1: DISPLAY - parent display
2: BOOL - true to fade from black (default: false)
 
Returns:
DISPLAY
*/
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
 
| <!-- [] call [[BIS_fnc_showAANArticle]]; --> |= Syntax
 
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
 
|x1= <pre>
[  
[  
["title","My Title"],  
["title","My Title"],  
["meta",["Katherine Bishop",[2035,2,24,11,38],"CET"]],  
["meta",["Katherine Bishop",[2035,2,24,11,38],"CET"]],  
Line 70: Line 42:
["author",["\a3\Missions_F_Orange\Data\Img\avatar_journalist_ca.paa","Katherine Bishop is a journalist"]]  
["author",["\a3\Missions_F_Orange\Data\Img\avatar_journalist_ca.paa","Katherine Bishop is a journalist"]]  
]
]
] call bis_fnc_showAANArticle;
] call BIS_fnc_showAANArticle;
</pre>
</sqf>


'''Result:'''
|seealso= [[BIS_fnc_AAN]]
 
}}
[[File:a3 orange aan.jpg|480px]]
|=
____________________________________________________________________________________________


| |= See also
{{Note
|user= Freddo3000
|timestamp= 20210612234200
|text= Can be added to [[Diary Record|diary records]] using an {{hl|&lt;expression&gt;}} tag, with a clickable link leading to the article.
<sqf>
TAG_fnc_myArticle = {
[
[
["title", "My Article"],
["text", "Flavour text"]
]
] call BIS_fnc_showAANArticle
};


player createDiaryRecord ["diary", ["articles", "<execute expression='[] call TAG_fnc_myArticle'>My Article 1</execute>"]];
</sqf>
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Misc|{{uc:showAANArticle}}]]
[[Category:Functions|{{uc:showAANArticle}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:showAANArticle}}]]

Latest revision as of 18:16, 8 November 2023

Hover & click on the images for description

Description

Description:
Show an AAN article.
Execution:
call
Groups:
GUIInteraction

Syntax

Syntax:
[arrayOfArrays, display, fade] call BIS_fnc_showAANArticle
Parameters:
arrayOfArrays: array of arrays; each subarray defines part of an article, can be:
  • Article title: ["title", <text:string>]
  • Article author and date: ["meta", [<author:string>, <date:array Y,M,D,H,M>, <timezoneName:string>]]
  • Paragraph: ["text",<text:string>]
  • Bold paragraph: ["textbold",<text:string>]
  • Locked paragraph: ["textlocked",[<text:string>,<prompt:string>]] - Locked paragraph with subscriber prompt. There should be no paragraph after it.
  • Image with description: ["image", [<path:string>, <description:string>, <source:string>]] - The image should have 2:1 ratio.
  • Link to another "fake" article displayed on left: ["box",[<path:string>, <description:string>]] - The image should have 2:1 ratio.
  • Author's bio: ["author",[<path:string>, <description:string>]] - The image should have 1:1 ratio.
  • Draft notification: ["draft",[<text:string>, <color:arrayRGB>]] - Text and color are optional, default notification will be shown when they're undefined.
display: Display - a display to make the AAN article a child of it
fade: Boolean - (Optional, default false) true to fade from black
Return Value:
Display - the AAN article display

Examples

Example 1:
Result
[ [ ["title","My Title"], ["meta",["Katherine Bishop",[2035,2,24,11,38],"CET"]], ["textbold","This is a bold text"], ["image",["\a3\Missions_F_Orange\Data\Img\orange_overview_ca.paa","Some image description"]], ["box",["\a3\Missions_F_Orange\Data\Img\Faction_IDAP_overview_CA.paa","You won't believe how playing Showcase Laws of War can change your life!"]], ["text","Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi tincidunt pretium ultricies. Etiam ac ornare est, quis posuere nisl. Mauris facilisis lectus eu turpis maximus consequat. Donec ut metus nec risus tristique mattis. Ut posuere rutrum tellus, ut molestie orci mattis id. Cras ultrices euismod diam, in venenatis nunc commodo eget. Interdum et malesuada fames ac ante ipsum primis in faucibus. Morbi congue dolor rutrum lectus euismod, ac faucibus magna molestie. Aliquam in libero sit amet eros sagittis tristique. Nam pellentesque dignissim aliquam."], ["textlocked",["Sed non est risus. Nulla condimentum at leo sed bibendum. Phasellus laoreet sit amet leo tincidunt consequat. Curabitur nec hendrerit purus. Nam massa nisi, mattis in aliquet consectetur, ornare eget nibh. Nunc dignissim, nibh sit amet ultrices tincidunt, mi nulla fermentum quam, non condimentum dolor eros vulputate massa.","SUBSCRIBE PLZ"]], ["author",["\a3\Missions_F_Orange\Data\Img\avatar_journalist_ca.paa","Katherine Bishop is a journalist"]] ] ] call BIS_fnc_showAANArticle;

Additional Information

See also:
BIS_fnc_AAN

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Freddo3000 - c
Posted on Jun 12, 2021 - 23:42 (UTC)
Can be added to diary records using an <expression> tag, with a clickable link leading to the article.
TAG_fnc_myArticle = { [ [ ["title", "My Article"], ["text", "Flavour text"] ] ] call BIS_fnc_showAANArticle }; player createDiaryRecord ["diary", ["articles", "<execute expression='[] call TAG_fnc_myArticle'>My Article 1</execute>"]];