Fandom

武装突袭 Wiki

Eden Editor: Configuring Menu Bar

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

Menu Bar is the central control element of the Eden Editor, where all available options and tools are available. When adding a new functionality to the editor, you should strongly consider listing the feature there.

The menu bar is configured as a CT_MENU_STRIP, and it's possible to freely modify it from an addon. Because anyone can access the configuration, remember to tag your class names to make them unique (i.e., MyTag_AwesomeTool instead of just AwesomeTool).

Following code examples will show the most common ways how to extend the menu bar.

Tool 编辑

When you're adding a tool which has its own isolated functionality, Tools section is the best place where to put it.

Single 编辑

468px

class ctrlMenuStrip;
class display3DEN
{
	class Controls
	{
		class MenuStrip: ctrlMenuStrip
		{
			class Items
			{
				class Tools
				{
					items[] += {"ME_MyTool"}; // += must be used; you want to expand the array, not override it!
				};
				class ME_MyTool
				{
					text = "My Awesome Tool"; // Item text
					picture = "\MyAddon\data\myAwesomeTool_ca.paa"; // Item picture
					// Expression called upon clicking; ideally, it should call your custom function
					action = "[] call ME_fnc_MyAwesomeTool;";
				};
			};
		};
	};
};

Folder 编辑

If your feature is more complex and one menu item would not be enough to control it, you can instead add a folder with all required options inside. 468px

class ctrlMenuStrip;
class display3DEN
{
	class Controls
	{
		class MenuStrip: ctrlMenuStrip
		{
			class Items
			{
				class Tools
				{
					items[] += {"ME_MyFolder"};
				};
				class ME_MyFolder
				{
					text = "My Awesome Folder...";
					items[] = {ME_MyTool1, ME_MyTool1}; // Links to items inside the folder
				};
				class ME_MyTool1
				{
					text = "My Awesome Tool 1";
				};
				class ME_MyTool2
				{
					text = "My Awesome Tool 1";
				};
			};
		};
	};
};

Scenario Attributes 编辑

When you add a new window with scenario attributes (see Attributes Modding to learn how it can be achieved), the user will still need a way how to access it. The best way is to add a link to the window at the end of Attributes option.

468px

class ctrlMenuStrip;
class display3DEN
{
	class Controls
	{
		class MenuStrip: ctrlMenuStrip
		{
			class Items
			{
				class Attributes
				{
					items[] += {"ME_MyAttributes"};
				};
				class ME_MyAttributes
				{
					text = "My Awesome Attributes";
					action = "edit3DENMissionAttributes 'MyScenarioAttributes';";
				};
			};
		};
	};
};

更多维基

随机维基