-
Notifications
You must be signed in to change notification settings - Fork 0
Tutorial Create an Editor Module
friznit edited this page Feb 12, 2016
·
1 revision
h1. Tutorial - Create an Editor Module
git checkout -b f_sys_modulename
where:
- f - feature
- sys - the category
- modulename - full name (try to avoid abbreviations and all lowercase)
f_sys_modulename
#include "script_component.hpp" #include "\x\alive\addons\main\CfgPatches.hpp" #include "\x\alive\addons\main\CfgMods.hpp" #include "CfgVehicles.hpp" #include "CfgFunctions.hpp"
Add/remove CfgFunctions as required.
#define COMPONENT sys_modulename // #define DEBUG_MODE_FULL #ifdef DEBUG_ENABLED_MAIN #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_MAIN #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN #endif #include "\x\alive\addons\main\script_mod.hpp" #include "\x\alive\addons\main\script_macros.hpp"
Modify the first line (sys_modulename) with the name of your module.
class CfgVehicles { class Logic; class ADDON : Logic { displayName = "$STR_ALIVE_ADMIN_ACTIONS"; icon = "x\alive\addons\sys_modulename\icon_sys_modulename.paa"; picture = "x\alive\addons\sys_modulename\icon_sys_modulename.paa"; vehicleClass = "Modules"; class Eventhandlers { init = "[player] call compile preprocessFile 'x\alive\addons\sys_modulename\main.sqf';"; }; }; };
Modify the displayName, icon, picture and init lines with the correct stringtable reference and paths.
class cfgFunctions { class PREFIX { class COMPONENT { file = "\x\alive\addons\sys_adminactions\functions"; class main { description = "The main class"; }; }; }; };
(ALiVE) Requires ALiVE (ALiVE) Erfordern ALiVE (ALiVE) Richiedono ALiVE (ALiVE) Requieren ALiVE (ALiVE) Exiger ALiVE (ALiVE) Vyžadovat ALiVE (ALiVE) Требовать ALiVE (ALiVE) Wymagaj ALiVE (ALiVE) Igénylése ALiVE
Find an existing alive\images\icon_xxx.png and modify accordingly representing the icon for your module
Using Tex2View, convert the PNG file to a PAA file, and copy into your alive\addons\sys_modulename directory
- Module - the data for your module including data that will be persisted
- Controller - the process used to coordinate the View component with the Model
- View - the component that controls the visual display for the player Example:
*Model - no visual just reference data* - server side object only - ghosting enabled - teleport enabled - ACE spectator enabled *Controller - coordination* - frequent check if player is server admin *View - purely visual* - initialise menu - frequent check to modify menu and display status