Editing Ecopedia Modding
From Eco - English Wiki
Your changes will be displayed to readers once an authorized user accepts them. (help)
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 28: | Line 28: | ||
Starting with Eco 9.4 custom pages created by Strange Loop Games can be found in your server's mod directory under '''Mods/__core__/Ecopedia.''' Editing the XML files found in this directory will effect the pages found in the Ecopedia in game. | Starting with Eco 9.4 custom pages created by Strange Loop Games can be found in your server's mod directory under '''Mods/__core__/Ecopedia.''' Editing the XML files found in this directory will effect the pages found in the Ecopedia in game. | ||
=== Adding Custom Ecopedia Pages === | === Adding Custom Ecopedia Pages === | ||
It is possible to add your own custom pages to the Ecopedia by creating XML files | It is possible to add your own custom pages to the Ecopedia by creating XML files under '''Mods/__core__/Ecopedia''', preferably in a sub-folder. These files must follow the same XML file layout as the other ones in the Ecopedia folder'''.''' We plan to introduce support for putting Ecopedia files into Mods/UserCode/Ecopedia at a later date, it is currently not supported. An example custom page can be found [https://github.com/StrangeLoopGames/EcoModKit/tree/master/Examples/EcopediaPage/Server/Ecopedia/Welcome here]. | ||
* | The example mod is comprised of three parts. | ||
*Server | * Rules.xml - The root page file for the Ecopedia chapter. | ||
* Rules;Server Rules.xml - The Server Rules sub page. | |||
* | * ServerInfo.xml - The root Ecopedia chapter that shows up in the left navigation. | ||
'''Example Chapter''' | '''Example Chapter''' | ||
A chapter file contains only the '''ecopediachapter''' tag used to define the chapter on the left navigation bar. The priority is used to sort where it will be placed in the list. | A chapter file contains only the '''ecopediachapter''' tag used to define the chapter on the left navigation bar. The priority is used to sort where it will be placed in the list.<syntaxhighlight lang="xml"> | ||
<ecopediachapter priority="0" /> | <ecopediachapter priority="0" /> | ||
</syntaxhighlight>'''Example Root Page''' | </syntaxhighlight>'''Example Root Page''' | ||
In the root page XML document we define our '''ecopedia''' tag which contains the Icon we would like to display and the chapter file that owns this page. The chapter field must match the name used in the chapter file minus the extension. Inside the '''ecopedia''' tag we define our summary text used in the Ecopedia page. | In the root page XML document we define our '''ecopedia''' tag which contains the Icon we would like to display and the chapter file that owns this page. The chapter field must match the name used in the chapter file minus the extension. Inside the '''ecopedia''' tag we define our summary text used in the Ecopedia page.<syntaxhighlight lang="xml"> | ||
<ecopedia | <ecopedia icon="PaperItem" chapter="ServerInfo"> | ||
<summary | <summary>Summary of Server Rules</summary> | ||
</ecopedia> | </ecopedia> | ||
</syntaxhighlight>'''Example Sub Page''' | </syntaxhighlight>'''Example Sub Page''' | ||
In the sub example page we define another page using the '''ecopedia''' tag and icon however we do not define a parent field as this is defined by the file name which follows the rule of "OwningPage;SubPageName.xml". Inside this file we again define our summary text we would like to display as well as our custom content. In this case a section defining our server rules. All tags supported by Eco such as the '''ecoicon''' as well as some custom tags relating to sections are supported on in this file.<syntaxhighlight lang="xml"> | In the sub example page we define another page using the '''ecopedia''' tag and icon however we do not define a parent field as this is defined by the file name which follows the rule of "OwningPage;SubPageName.xml". Inside this file we again define our summary text we would like to display as well as our custom content. In this case a section defining our server rules. All tags supported by Eco such as the '''ecoicon''' as well as some custom tags relating to sections are supported on in this file.<syntaxhighlight lang="xml"> | ||
<ecopedia | <ecopedia icon="PaperItem"> | ||
<summary | <summary>Welcome to our Eco Server!</summary> | ||
<section> | <section> | ||
1. Don't be an jerk. | 1. Don't be an jerk. | ||
Line 59: | Line 58: | ||
We hope you enjoy your stay! | We hope you enjoy your stay! | ||
</section> | </section> | ||
</ecopedia> | </ecopedia> | ||
</syntaxhighlight> | </syntaxhighlight> |