Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Edit Terrain Location Module #751

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions addons/modules/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,13 @@ class CfgVehicles {
icon = QPATHTOF(ui\light_ca.paa);
portrait = QPATHTOF(ui\light_ca.paa);
};
class GVAR(moduleEditTerrainLocation): GVAR(moduleBase) {
category = "Environment";
displayName = CSTRING(moduleEditTerrainLocation);
icon = "\a3\3den\Data\Displays\Display3DEN\PanelLeft\entityList_location_ca.paa";
portrait = "\a3\3den\Data\Displays\Display3DEN\PanelLeft\entityList_location_ca.paa";
function = QFUNC(moduleEditTerrainLocation);
};
class GVAR(moduleMakeInvincible): GVAR(moduleBase) {
curatorCanAttach = 1;
category = QGVAR(Objects);
Expand Down
1 change: 1 addition & 0 deletions addons/modules/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ PREP(moduleHeal);
PREP(moduleHideTerrainObjects);
PREP(moduleHideZeus);
PREP(moduleLightSource);
PREP(moduleEditTerrainLocation);
PREP(moduleMakeInvincible);
PREP(moduleNuke);
PREP(moduleNukeLocal);
Expand Down
1 change: 1 addition & 0 deletions addons/modules/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class CfgPatches {
QGVAR(moduleHideTerrainObjects),
QGVAR(moduleHideZeus),
QGVAR(moduleLightSource),
QGVAR(moduleEditTerrainLocation),
QGVAR(moduleMakeInvincible),
QGVAR(moduleNuke),
QGVAR(modulePatrolArea),
Expand Down
108 changes: 108 additions & 0 deletions addons/modules/functions/fnc_moduleEditTerrainLocation.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#include "script_component.hpp"
/*
* Author: Ampersand
* Zeus module function to edit terrain locations.
*
* Arguments:
* 0: Logic <OBJECT>
*
* Return Value:
* None
*
* Example:
* [LOGIC] call zen_modules_fnc_moduleEditTerrainLocation
*
* Public: No
*/

params ["_logic"];

private _location = nearestLocation [_logic, ""];

mharis001 marked this conversation as resolved.
Show resolved Hide resolved
private _type = type _location;
private _text = text _location;
private _direction = direction _location;
private _isRectangular = rectangular _location;
private _size = size _location;
private _name = name _location;
private _side = side _location;
private _importance = importance _location;

private _types = ["Mount","Name","Strategic","StrongpointArea","FlatArea","FlatAreaCity","FlatAreaCitySmall","CityCenter","Airport","NameMarine","NameCityCapital","NameCity","NameVillage","NameLocal","Hill","ViewPoint","RockArea","BorderCrossing","VegetationBroadleaf","VegetationFir","VegetationPalm","VegetationVineyard","Area","Flag","Invisible","HistoricalSite","CivilDefense","CulturalProperty","DangerousForces","SafetyZone","HandDrawnCamp","b_unknown","o_unknown","n_unknown","b_inf","o_inf","n_inf","b_motor_inf","o_motor_inf","n_motor_inf","b_mech_inf","o_mech_inf","n_mech_inf","b_armor","o_armor","n_armor","b_recon","o_recon","n_recon","b_air","o_air","n_air","b_plane","o_plane","n_plane","b_uav","o_uav","n_uav","b_naval","o_naval","n_naval","b_med","o_med","n_med","b_art","o_art","n_art","b_mortar","o_mortar","n_mortar","b_hq","o_hq","n_hq","b_support","o_support","n_support","b_maint","o_maint","n_maint","b_service","o_service","n_service","b_installation","o_installation","n_installation","u_installation","b_antiair","o_antiair","n_antiair","c_unknown","c_car","c_ship","c_air","c_plane","group_0","group_1","group_2","group_3","group_4","group_5","group_6","group_7","group_8","group_9","group_10","group_11","respawn_unknown","respawn_inf","respawn_motor","respawn_armor","respawn_air","respawn_plane","respawn_naval","respawn_para"];
mharis001 marked this conversation as resolved.
Show resolved Hide resolved
private _sides = [
mharis001 marked this conversation as resolved.
Show resolved Hide resolved
east,
west,
independent,
civilian,
sideUnknown
];

[LSTRING(ModuleEditTerrainLocation), [
[
"COMBO",
"str_3den_trigger_attribute_type_displayname",
[_types, _types, _types find _type]
],
[
"EDIT",
"str_a3_cfgvehicles_modulecuratoraddicon_f_arguments_text",
_text
],
[
"SLIDER",
"STR_3DEN_Display3DEN_ControlsHint_Rotate",
[0, 360, _direction, EFUNC(common,formatDegrees)]
],
[
"TOOLBOX",
LSTRING(ModuleEditTerrainLocation_AreaShape),
[_isRectangular, 1, 2, ["str_3den_attributes_shapetrigger_ellipse", "str_3den_attributes_shapetrigger_rectangle"]],
true
],
[
"VECTOR",
"str_3den_trigger_attribute_size_displayname",
_size
],
[
"EDIT",
"STR_3DEN_Display3DENSave_Filter_Name_text",
_name
],
[
"COMBO",
"str_a3_rscdisplaydynamicgroups_side",
[_sides, _sides apply {[_x] call BIS_fnc_sideName}, _sides find _side]
],
[
"EDIT",
LSTRING(ModuleEditTerrainLocation_Importance),
_importance
]
], {
params ["_values", "_location"];
_values params [
"_type",
"_text",
"_direction",
"_isRectangular",
"_size",
"_name",
"_side",
"_importance"
];

private _location = createLocation [_location];
_location setType _type;
_location setText _text;
_location setDirection _direction;
_location setRectangular _isRectangular;
_location setSize _size;
_location setName _name;
_location setSide _side;
_location setImportance parseNumber _importance;

deleteLocation _location;
}, {}, _location] call EFUNC(dialog,create);

deleteVehicle _logic;
9 changes: 9 additions & 0 deletions addons/modules/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,15 @@
<Chinese>無敵</Chinese>
<Italian>Rendi invincibile</Italian>
</Key>
<Key ID="STR_ZEN_Modules_ModuleEditTerrainLocation">
<English>Edit Terrain Location</English>
</Key>
<Key ID="STR_ZEN_Modules_ModuleEditTerrainLocation_Importance">
<English>Importance</English>
</Key>
<Key ID="STR_ZEN_Modules_ModuleEditTerrainLocation_AreaShape">
<English>Area Shape</English>
</Key>
<Key ID="STR_ZEN_Modules_ModuleMakeInvincible_Invincible">
<English>Invincible</English>
<Russian>Неуязвимость</Russian>
Expand Down
Loading