fn_isDialog.sqf 613 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. Name: cTab_fnc_isDialog
  3. Author(s):
  4. Gundy
  5. Description:
  6. Check if interface name ends with "dlg"
  7. Parameters:
  8. 0: Name of interface
  9. Returns:
  10. BOOLEAN - True if interface name ends with "dlg"
  11. Example:
  12. // returns true
  13. ["cTab_Tablet_dlg"] call cTab_fnc_isDialog;
  14. // returns false
  15. ["cTab_TAD_dsp"] call cTab_fnc_isDialog;
  16. */
  17. private ["_interfaceName","_subArray"];
  18. _interfaceName = _this select 0;
  19. // select the last three characters from the interface name
  20. _subString = _interfaceName select [(count _interfaceName) - 3];
  21. if (_subString == "dlg") then {true} else {false};