Commit Graph

251 Commits

Author SHA1 Message Date
mharis001
7877ce3116 Spectator - Add setting for follow camera max distance (#6989)
* Add setting for follow camera max distance

* Convert spectator settings to CBA function
2019-05-11 23:32:13 -05:00
Dedmen Miller
d034324e88 More trivial code cleanup (#6859)
* Added a3 include pboprefix

* Add defineDIKCodes header

* defineDIKCodes include case correct

* Use ui_f dikcodes

* Fix fnc_checkfiles macro and dll condition

* Incorrect macro usage in fnc_getVehiclePos

* Incorrect macro usage in fnc_getVehiclePosComplex

* Add defineResincl ui_f include

* Remove include guard from defineResincl

* Incorrect macro usage in fnc_handleMouseButton

* Incorrect macro usage in fnc_setMarkerJIP

* Semicolon after include

* Add defineResinclDesign ui_f include

* Incorrect macro usage fnc_rearmSuccessLocal

* Incorrect macro usage fnc_rearmSuccessLocal

* Stray backslash in fnc_camshake

* Incorrect macro usage in fnc_startNozzleInHandsPFH

* Incorrect amcro usage in fnc_tag

* Incorrect macro usage in fnc_moduleGlobalSetSkill

* Reenable linux checkFiles

* Non-captialized requiredAddons

* Non-captialized requiredAddons
2019-03-21 08:52:32 -05:00
Dedmen Miller
e2ac18a05d [WIP] Fix script errors reporting wrong line numbers (#6407)
* advanced_ballistics

* advanced_fatigue

* advanced_throwing

* ai

* aircraft

* arsenal

* atragmx

* attach

* backpacks

* ballistics

* captives

* cargo

* chemlights

* common

* concertina_wire

* cookoff

* dagr

* disarming

* disposable

* dogtags

* dragging

* explosives

* fastroping

* fcs

* finger

* frag

* gestures

* gforces

* goggles

* grenades

* gunbag

* hearing

* hitreactions

* huntir

* interact_menu

* interaction

* inventory

* kestrel4500

* laser

* laserpointer

* logistics_uavbattery

* logistics_wirecutter

* magazinerepack

* map

* map_gestures

* maptools

* markers

* medical

* medical_ai

* medical_blood

* medical_menu

* microdagr

* minedetector

* missileguidance

* missionmodules

* mk6mortar

* modules

* movement

* nametags

* nightvision

* nlaw

* optics

* optionsmenu

* overheating

* overpressure

* parachute

* pylons

* quickmount

* rangecard

* rearm

* recoil

* refuel

* reload

* reloadlaunchers

* repair

* respawn

* safemode

* sandbag

* scopes

* slideshow

* spectator

* spottingscope

* switchunits

* tacticalladder

* tagging

* trenches

* tripod

* ui

* vector

* vehiclelock

* vehicles

* viewdistance

* weaponselect

* weather

* winddeflection

* yardage450

* zeus

* arsenal defines.hpp

* optionals

* DEBUG_MODE_FULL 1

* DEBUG_MODE_FULL 2

* Manual fixes

* Add SQF Validator check for #include after block comment

* explosives fnc_openTimerUI

* fix uniqueItems
2018-09-17 14:19:29 -05:00
Dystopian
c35a53ba79 Clean up deprecated in 3.13 2018-05-05 21:54:13 +03:00
Mark Ruffner
f46082a1fe fix (another) missing call (#6079) 2018-01-24 08:18:42 +01:00
Mark Ruffner
8ba81c53a3 Add spectator handling of grenades (#6012)
* Handle non-local vanilla grenade tosses

* handle advanced throwing grenades

* Track through events

* Add missing calls
2018-01-23 00:31:44 +01:00
SilentSpike
dbe6a04e8a Optimise spectator loops (#6021)
* Optimise spectator loops

`count` is only quicker than `forEach` when the final command returns a
boolean or nil. `forEach` is quicker if the final command returns any
other data type.

* Use `forEach` instead of `count`
2018-01-06 01:30:15 +01:00
SilentSpike
fd815c5ed8
Serialize spectator help control variable (#6023)
Could result in an on-screen error if the spectator API was used in a scheduled environment.
2018-01-05 20:41:43 +00:00
SilentSpike
fb3fc09997
Center spectator map correctly in FPP (#6010)
Instead of centering on the camera object use `positionCameraToWorld` to get the actual viewpoint
2018-01-04 18:03:38 +00:00
SilentSpike
845f3656d4
Remove deprecated functionality for 3.12.0 (#5878)
* Remove deprecated functionality for 3.12.0
* Remove associated deprecated module icon
* Restore a dummy version of old module

This is just to prevent existing missions from breaking due to a missing
object.
2017-12-10 13:38:32 +00:00
jonpas
82f3a57e22 Use ACRE2 add display passthrough keys API in spectator (#5735)
* Use ACRE2 add display passthrough keys API
* Assure backwards compatibility with older ACRE2 versions
2017-12-08 23:08:30 +00:00
SilentSpike
c15966c79a
Fix draw3D in specator free camera when perma-dead (#5868)
This is a weird engine behaviour where draw3D doesn't work if the
current camera unit is not alive (or going to respawn), so we switch to
a temporary agent unit while in free camera to work around this edge
case.
2017-12-07 21:45:30 +00:00
SilentSpike
e0ae842ff0
Remove some pp effects while in spectator (#5846)
Closes #5708
2017-12-03 16:35:51 +00:00
PabstMirror
82aa953e66 Fix BIS_fnc_lerp causing crash in 3rd person spectator (#5844)
* Fix BIS_fnc_lerp causing crash in 3rd person spectator
* Clarify spectator 3PP camera distance code
2017-12-03 16:10:48 +00:00
commy2
7cfb2b865c Fix enum errors (#5834)
* Fix enum errors

* Update fnc_paradropItem.sqf

* Update fnc_actionPlaceInBodyBag.sqf

* Update fnc_compat_spectatorBI.sqf

* Update ACE_ZeusActions.hpp
2017-12-01 10:34:27 -06:00
SilentSpike
1f987c0f3d Prevent virtual spectators falling into water (#5832)
Fix #5775
2017-11-30 16:51:34 -06:00
PabstMirror
c20ec6599d
Spectator - Fix script error in ui_draw3d (#5722) 2017-11-04 11:03:51 -05:00
Cuel
c815a9cae8 (spectator) unhide/unmute unit on exiting (#5699)
* unhide/unmute unit on exiting

* Update fnc_setSpectator.sqf
2017-10-28 11:23:18 -05:00
Cuel
7acff1848b Set correct state (#5684) 2017-10-27 00:40:06 +02:00
SilentSpike
51a61653f4 Update spectator docs (#5362)
* Add player initilization safety to setSpectator

Public function which should wait for player unit to exist before running.
With this change an additional variable is now set on the player unit which
can be used to check whether players are spectators or not (part of
grander plans).

* Add UI initalization safety to setSpectator

Should make it so that calling the public function before the main display
has initalized will correctly wait until it has before starting spectator

* Overhaul spectator

Initial WIP overhaul of spectator component. Based on BI's End Game
Spectator and AACO's work on POTATO spectate. The essential functionality
is in place, but some things are broken and some are still to be
transferred.

* Remove redundant canInteract condition

Spectator UI will be open anyway so this is pointless.

* Fix follow camera controls

Also ensure unit camera modes have a target more consistently

* Fix widget weapon icon for unarmed

* Fix follow camera zooming

* Fix entity list not updating correctly

* Remove redundant conditions

* Fix list click behaviour

* Remove a bunch of old debug

* Alter behaviour of camera speed

* Restructure the spectator addon

* Fix camera tracking behaviour

* Fix very fast camera toggle

* Fix initial camera mode

* Fix double click behaviour

* Make AI name display consistent

* Add UI toggle

* Fix current camera mode button highlighting

* Fix focus info widget when clicked on in 3D world

* Improve key handling

Use of `inputAction` could result in weirdness when multiple keys pressed
at the same time. Hardcoded for now.

* Implement dynamic help UI element

* Remove some redundant code

* Fix follow camera jitter

* Add projectile drawing

Technically the capability to draw projectiles has been in since the
start. However it took me a bit of time to figure out how best to
add/remove the required event handlers.

I decided to add them during the process of finding things to draw, since
I'm iterating over the list of spectatable entities here anyway. With an
additional GVAR containing up to date entities, the fired EHs can remove
themselves when applicable. This avoids any granularity issues with adding
EHs en masse.

* Improve naming convention related to drawing

* Remove outdated unit and side settings

Also re-add unit whitelisting/blacklisting support

* Rename public function for consistency

Adds a deprecated warning to the old function name.

* Update stringtable

Some entries are replaced with BI translations, others are no longer
needed. I pieced together one of the camera mode settings by combining the
BI translations of the individual versions.

* Add location public functions and list population

Just need to take care of drawing and then camera interaction now

* Add location 2D and 3D drawing

* Respect whitelist and blacklist correctly

* Add location camera focus capability

* Fix local helicopters follow mode bug

* Add compatibility with `counter` template

Simply repositions the counter UI to the top of the screen out of the way

* Update respawn template

This template is only compatible with respawn types 2 & 3

* Rename compatibility function

* Add compatibility for respawn types 1,4 and 5

* Update setCameraAttributes function

* Fix draw3D for respawn types 1,4 and 5

* Fix screeching seagulls #4265

* Fix script command typo

* SQF Linter Pass

* Add obsolete warning for public func params

* Deprecate interrupt function

* Fix incorrect function call

* Make playable virtual spectator work

* Improve focus handling in public function

- User might want to reset focus for free cam, in which case objNull
  cannot be reserved for random
- Focus is still required for unit camera
- Update some function headers

* Note explicitly the use of `player`

* Remove unused base classes

* Improve seagull culling

* Add projectile drawing to vehicles

* Fix same tab selection clearing list

* Make projectile lines last 1 frame longer

* Add true zeus compatibility

- Re-opens spectator when zeus closes
- Transfers the curator module over in the respawn template
- Only handle uiForced in setSpectator to avoid issues with esc key
- Add safety to setFocus so that it only updates the UI when applicable

* Fix player moving in FPP

* Fix zeus transfer and re-opening

* Consolidate icon definitions

* Fix AI setting for player groups

* Improve handling of alive spectators

Instead of disabling simulation, just stage them automatically if alive.

* Fix respawn template for types 2 & 3

* Fix pre-set camera mode with no focus

- Improve handling of UI updates in camera related functions
- More explicit UI initalisation
- Find a focus if one wasn't pre-set for a camera mode which requires a
  focus

* Localise key names

* Fix camera mode and vision settings on init

When spectator starts the available camera modes and vision modes should
be consulted to ensure they are respected upon opening.

* Fix key localisation

* Add next/prev entity keys

* Fix vision modes update while camera active

- Updates the camera vision mode in case the current was removed

* Add public getCameraAttributes function

* Fix spectator zeus compatibility

- Camera control wasn't returned on exit due to change in fnc_ui

* Improve vision mode handling

- Curator now resets vision mode on entry
- First person also reset vision mode so that it is consistent between
  camera changes

* Improve location handling

- It makes more sense to specifiy the position ATL since the text is going
  to be rendered there and a z of 0 is then ground height.
- Updates the ui immediately if the list is already on locations

* Disable list keyboard search

* Fix handling of forced camera mode with no focus

* Fix handling of free mode removal while no target

* Fix locations respecting available modes

* Fix list entry removal code

- Replace getTargetGroups with getTargetEntities for consolidated
  filtering.
- Fix the step of the removal loops and make them go to index 0 instead of
  1

* Improve side handling of unit list

- Accounts for possibly of whitelisted random objects that belong to other
  sides
- Move the index decrement to loop, not within every loop

* Add linter ignore directive

* Fix list code

* Improve entity fetching

- Change whitelist/blacklist application to optimize the code

* Include dead units in the list

- Allow getTargetEntities to return dead units too
- Iterate over allGroups in list updates to reduce overhead

* Take care of TODOs

* Mark stageSpectator as non-public

* Fix updating list focus

* Adjust default camera speed

* Include the function file

* Generalise camera button UI

- Makes it easier to extend with future camera mode buttons
- Removes potential error when display doesn't exist

* Remove obsolete staged event

- Add vision toggle to help
- Restructure some function PREP

* Add public function to return all spectators

* Change default briefing name used on map display

* Fix the order of 4 main sides in list

* Restore non-toggle behaviour of camera speed

* Fix UI gap between list and tabs

* Force update UI list when player is staged

Hopefully this fixes any issues related to the player appearing in the
list

* Update controls strings

* Fix entity tooltips showing short name

- Also revert changes to common function and just handle in this component

* Include dead in unit switching

* Show rank and vehicle icon in list

- Rank is shown in tooltip
- Vehicle icon is used to see which units in the list are mounted

* Change default vehicle icon

* Show whether medic/engineer in tooltip

* Improve list double click behaviour

* Improve group icon handling

* Use dynamic group icons for drawing

* Fix EFUNC call

* Update all function headers

* All the changes I had staged before arma broke git

Arma managed to crash my whole system again, breaking my git repo and I
resorted to nuking it and pasting the changes I had comitted locally back
in. From memory:

- Fix icon paths
- use distanceSqr for minor speed boost
- Add setting to show map locations in the UI
- Limit location rendering based on distance
- Probably some other crap

* Fix squared comparisons

* Remove unnecessary variable publicity

* Deprecate fnc_stageSpectator

The function was a source of confusion alongside fnc_setSpectator and so
it is replaced by an additional parameter to hide the unit as part of
fnc_setSpectator. No longer is the unit moved either, to reduce complexity
and give more control to mission maker.

* Fix undefined variable

* Update spectator framework doc

* Update spectator feature doc

* Fix typos and grammar

* Revent version introduced number

* Update with new changes
2017-10-17 20:19:10 +02:00
Dedmen Miller
81e02a7336 Refactor private ARRAY to private keyword (#5598)
* Everything

* Fixed missing ;

* Fix missing ; and double private

* Fixed cannot isNull on number

* Turn _temparture back to isNil

* Fix error from merge
2017-10-10 09:39:59 -05:00
SilentSpike
b0c27d1071 Add uiNamespace variable to spectator display (#5520)
* Add uiNamespace variable to spectator UI

* Update spectator keys to match docs branch
2017-09-16 15:20:32 -05:00
SilentSpike
2a9358ab03 Fix virtual spectator breaking if template active (#5466)
* Simplify virtual spectator code
* Rename camTarget GVAR for linter
* Fix respawn template breaking virtual spectators
2017-08-30 16:36:53 +01:00
SilentSpike
1ab7a886e7 Improve spectator drawing and selection (#5457)
* Optimise cursor object updates
* Restrict distance units can be selected from
* Fix potential for no icons to render in FPP
* Limit projectile drawing distance
* Optimise icon updates
* Fix group names not being drawn in vehicles
* Fix selection nameplate not drawing for vehicles
* Fix selection of non-spectatable entities
2017-08-30 11:40:12 +01:00
SilentSpike
4afcc546e7 Improve spectator focus widget (#5452)
* Optimize widget updates
* Improve focus widget vehicle position display
* Remove insignia from widget
* Add current throwable to widget
* Fix padding/spacing of widget items
* Fix incorrect vehicle cargo icon being used
2017-08-26 19:16:24 +01:00
SilentSpike
43ac39f06c Improve spectator tab fading (#5441)
* Cleanup spectator PFH variable

* Improve spectator tab fading

Looks better
2017-08-22 14:11:34 -05:00
SilentSpike
85c5fbabe9 Remove locations tab from spectator (#5431)
* Fix incorrect function input for spectator hiding
* Remove locations tab from spectator

- Doesn't add much value, adds complexity and the implementation is half
baked. Would rather add back in at a later date (if at all) with a
better implementation.
- I have an idea to replace the locations tab with a meta tab so users
can toggle things like projectile drawing via the UI and are not forced
to use a hotkey. Might also be a good place to display the extended controls.
2017-08-17 12:50:43 +01:00
SilentSpike
407df4433a Disable spect camera movement while map is open (#5427)
- Prevents camera panning when right-click dragging the map around
2017-08-14 11:31:19 +01:00
SilentSpike
d3ce75daef Spectator overhaul (#5171)
- Overhauls the spectator module entirely to share a similar UX to BI's "End Game Spectator" while maintaining some of the extended flexibility of ACE Spectator.
- Simplifies spectator setup by reducing the number of settings. More advanced setup is still possible via the API functions provided.
2017-08-12 14:25:48 +01:00
Phyma
ffaa195fe5 Conform function headers to coding guidelines (#5255)
* Fixed headers to work with silentspike python script

* Fixed rest of the files

* Fixed ace-team
2017-06-08 15:31:51 +02:00
SilentSpike
b3889d9d7e Fix accidental numerical change (#5235) 2017-06-02 19:56:24 -05:00
Rebel
bf4b49a213 Fix spectator icons and camera jitter (#5067)
* Use `Visual` commands for icons and external camera position
2017-06-03 01:38:29 +01:00
SilentSpike
6394f2b975 Fix #5081
The default values of the arrays manipulated by these functions overwrite
any changes applied before settings have finished initalising. This won't
be an issue after #4456 is merged in future.
2017-05-05 23:02:19 +01:00
SilentSpike
74399be109 Optimize spectator unit list function
Making good use of the new `select` CODE syntax.
2017-05-05 23:02:19 +01:00
SilentSpike
9ee2f10f63 Simplify spectator compass code 2017-05-05 23:02:19 +01:00
PabstMirror
dfca4fdcf8 Pass functions by "reference" to bis event handlers (#4898)
* Pass functions by "reference" to bis event handlers

* Add Doc

* Fix
2017-02-14 10:54:37 -06:00
commy2
05d30c5573 convert log macros to cba versions (#4282)
* convert log macros to cba versions

* Add changes to AB

* remove obsolete macro
2016-10-02 12:55:31 +02:00
Glowbal
b489750d5b Minor optimizations using private, params, and isEqualType (#4323)
* Optimizations with private, params, and isEqualType

* Fixed tab being used instead of space

* Fixed tabs inserted by notepad++

* More usage of new private syntax and params

- changed a few checks for an array being empty to `_arr isEqualTo []`
rather than `count _arr == 0`
- added more uses of `private` on the same line as the variable is
declared
- added more uses of params to assign variables passed as parameters
- removed unnecessary parentheses
- removed several unnecessary variable declarations with private array
syntax

* clean up and formatting
2016-09-04 16:44:22 +02:00
PabstMirror
9cc0e64b46 Fix spectator map click not changing cam pos
Fix #3842
PFEH FUNC(handleCamera) will set camera position using GVAR(camPos)
2016-07-23 14:07:03 -05:00
SilentSpike
90ebf9638b Update common event names to meet new standard 2016-06-04 11:12:56 +01:00
PabstMirror
db78dd53a8 Cleanup Merge and remoteFnc events 2016-06-02 19:59:18 -05:00
PabstMirror
d7f9c52c2f Merge branch 'master' into cbaEventSystem 2016-06-02 19:29:30 -05:00
jonpas
590d4fa70b Merge branch 'master' into abolishExecRemoteFnc 2016-06-02 14:28:43 +02:00
jonpas
26fbc36cab Merge branch 'master' into cbaEventSystem 2016-05-31 22:36:08 +02:00
SilentSpike
c4b75160a4 Run event renaming script 2016-05-24 14:13:11 +01:00
SilentSpike
108ff4f644 Replace ACE event system calls with CBA counterparts
Regex used:

\[(.+?),(.+?),(.+?)\]\s+call\s+E?FUNC\((common,)?(target|object)Event\)
[$1,$3,$2] call CBA_fnc_targetEvent

E?FUNC\((common,)?(server|global|local)Event\)
CBA_fnc_$2Event

E?FUNC\((common,)?(add|remove)EventHandler\)
CBA_fnc_$2EventHandler
2016-05-22 16:47:39 +01:00
jonpas
e7dbcd7b58 Replace delayed execution functions with new CBA counterparts 2016-05-22 15:29:01 +02:00
jonpas
d902d1182a Replace ace_common_fnc_execRemoteFunc with events 2016-05-21 23:55:48 +02:00
SilentSpike
1b1329b350 Increase spectator unit tree refresh rate
Reduce the time between automated refreshing of the unit tree. Also makes an initial call to the tree populating code upon first opening to remove the initial delay.
2016-05-11 16:01:07 +01:00
SilentSpike
9364ae60df Fix spectator unit tree refreshing
- Account for decrement in node index when culling the tree of sides/groups/units
- Fix non-zero-based index `to` value when navigating the units in the tree
2016-05-11 13:30:17 +01:00