Made final adjustments

Centred prompts, fixed erroneous if statement, adjusted function
headers.
This commit is contained in:
SAM 2015-05-14 18:25:41 +02:00
parent 3480168e05
commit 8c7d752fcc
4 changed files with 21 additions and 22 deletions

View File

@ -12,7 +12,7 @@
* Example:
* [] call ace_viewdistance_fnc_adaptViewDistance;
*
* Public: Yes
* Public: No
*/
#include "script_component.hpp"

View File

@ -13,23 +13,23 @@
* Example:
* [] call ace_viewdistance_fnc_changeViewDistance;
*
* Public: Yes
* Public: No
*/
#include "script_component.hpp"
private ["_text","_new_view_distance","_view_distance_limit","_object_view_distance_coeff"];
PARAMS_2(_index_requested,_show_prompt);
_new_view_distance = [_index_requested] call FUNC(returnValue); // change the index into an actual view distance value
_object_view_distance_coeff = [GVAR(objectViewDistanceCoeff)] call FUNC(returnObjectCoeff);
_new_view_distance = [_index_requested] call FUNC(returnValue); // changes the setting index into an actual view distance value
_object_view_distance_coeff = [GVAR(objectViewDistanceCoeff)] call FUNC(returnObjectCoeff); // changes the setting index into a coefficient.
_view_distance_limit = GVAR(limitViewDistance); // Grab the limit
if (_new_view_distance <= _view_distance_limit) then {
if (_show_prompt) then {
//_text = composeText ["View distance successfully changed to: ",str(_new_view_distance)];
_text = format ["View distance successfully changed to: %1, Object View Distance Coefficient is: %2",str(_new_view_distance),str(_object_view_distance_coeff)];
[_text,3] call EFUNC(common,displayTextStructured);
_text = parseText format ["<t align='center'>View Distance: %1<br />Object View Distance Coefficient: %2</t>",str(_new_view_distance),str(_object_view_distance_coeff)];
[_text,2] call EFUNC(common,displayTextStructured);
};
setViewDistance _new_view_distance;
if (_object_view_distance_coeff > 0) then {
@ -38,12 +38,11 @@ if (_new_view_distance <= _view_distance_limit) then {
}
else {
if (_show_prompt) then {
//_text = composeText ["That option is invalid! The limit is: ",str(_view_distance_limit)];
_text = format ["That option is invalid! The limit is: %1, Object View Distance Coefficient is: %2",str(_view_distance_limit),str(_object_view_distance_coeff)];
[_text,3] call EFUNC(common,displayTextStructured);
setViewDistance _view_distance_limit;
if (_object_view_distance_coeff > 0) then {
setObjectViewDistance (_object_view_distance_coeff * _view_distance_limit);
};
_text = parseText format ["<t align='center'>That option is invalid! The limit is: %1<br />Object View Distance Coefficient: %2</t>",str(_view_distance_limit),str(_object_view_distance_coeff)];
[_text,2] call EFUNC(common,displayTextStructured);
};
setViewDistance _view_distance_limit;
if (_object_view_distance_coeff > 0) then {
setObjectViewDistance (_object_view_distance_coeff * _view_distance_limit);
};
};

View File

@ -22,13 +22,13 @@ PARAMS_1(_index);
private ["_return"];
_return = switch (_index) do {
case 0: {0.00}; // Off
case 1: {0.20}; // Very Low
case 2: {0.40}; // Low
case 3: {0.60}; // Medium
case 4: {0.80}; // High
case 5: {1.00}; // Very High
default {0.50}; // something broke if this returns
case 0: {0.00}; // Off
case 1: {0.20}; // Very Low
case 2: {0.40}; // Low
case 3: {0.60}; // Medium
case 4: {0.80}; // High
case 5: {1.00}; // Very High
default {0.50}; // something broke if this returns
};
_return;

View File

@ -12,7 +12,7 @@
* Example:
* [2] call ace_viewdistance_fnc_returnViewDistanceValue;
*
* Public: Yes
* Public: No
*/
#include "script_component.hpp"