Commit Graph

204 Commits

Author SHA1 Message Date
jonpas
e7dbcd7b58 Replace delayed execution functions with new CBA counterparts 2016-05-22 15:29:01 +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
commy2
4a8e727ba5 end spectator by global mission end event from server (#3659)
* end spectator by global mission end event from server

* add ;
2016-05-07 22:17:21 +02:00
commy2
82086efca0 manual merge 2016-02-10 10:11:33 +01:00
SilentSpike
ca5f6df3d0 Merge pull request #3147 from acemod/spectatorBandAid
Restart specatator display if player in unitList
2016-01-19 20:15:24 +00:00
SilentSpike
dbcf94153d Merge pull request #3155 from acemod/spectatorFix
Fix some spectator errors
2016-01-15 15:43:45 +00:00
SilentSpike
49c814ccb3 Merge branch 'master' into spectatorUpdates 2016-01-13 19:19:00 +00:00
SilentSpike
d870a1f448 Fix nil spectator Draw3D event handler index
Minor oversight introduced in pabst's fix for #2989, the icon handler is a mission event handler that isn't self terminating so the index needs to be preserved until after it is removed via `removeMissionEventHandler`. It is safe to let the `onUnload` event take care of that (and preferable so that icons disappear while temporarily closed).
2016-01-13 19:03:24 +00:00
SilentSpike
65e981373b Store spectator display in a uiNamespace variable
This allows me to explicitly close the right display and hopefully fix the interface staying open upon mission end.

@Commy2's theory is that perhaps the main display `46` is killed upon mission end, meaning that `findDisplay` can't find the spectator display to close it because the game thinks it doesn't exist.
2016-01-13 18:38:51 +00:00
PabstMirror
091c807708 Restart specatator display if player in unitList
Possible fix for #2677
2016-01-12 00:30:03 -06:00
PabstMirror
79a7bb54aa Kill Spectator PFEH when exiting spectator
Should fix #2989
There is a race condition between these 4 PFEH and the "onUnload" event
in handleInterface.
If the PFEHs run first they will use nil variables and throw a script
error.
This sets them to nil immediately when exiting spectator
2016-01-01 00:14:48 -06:00
Glowbal
c1fa81f28b Fix tabs in sqf files 2015-12-21 17:05:48 +01:00
commy2
34d351c652 fix exitWith capitalization 2015-11-30 17:14:05 +01:00
commy2
e5c4d35969 1.55 use new selectRandom command 2015-11-29 16:33:25 +01:00
SilentSpike
d2538c6ff2 Add spectator text chat
Turns out custom radio channels are kind of a pain to work with. However this should work fine assuming the radioChannelAdd commands will work on client machines.
2015-11-22 20:03:10 +00:00
SilentSpike
f8e293d04d Localise spectator hotkeys in help window 2015-11-18 15:18:21 +00:00
SilentSpike
23e110d7ce Remove depreciated spectator hotkey 2015-11-17 15:26:34 +00:00
SilentSpike
cf368f240f Remove ear ringing upon spectator entry
Volume updating was disabled, however any existing ringing would persist. Setting the volume to 0 should make the hearing PFH stop playing sound.
2015-11-13 13:00:04 +00:00
SilentSpike
b6dd7b941f Reduce overhead of spectator map icons
Fixes #2514 by only rendering individual unit icons when zoomed in and only rendering the units currently within the screen bounds.

Behaves as expected, but whether or not it has a significant performance increase under scaled up testing conditions remains to be seen.
2015-10-17 13:23:51 +01:00
SilentSpike
780e0aa270 Add vision mode support to spectator external cam
Since external view is actually another camera, vision modes should also apply to it too.
2015-10-04 19:26:53 +01:00
SilentSpike
4079ca354e Update spectator function headers 2015-10-04 18:30:07 +01:00
SilentSpike
c1dc8a6493 Fix spectator 3D icons not rendering
Fixes #2676 as per voiperr's suggestion (working with camera can be really strange, I swear this worked before)
2015-10-04 18:17:07 +01:00
SilentSpike
52d703c2eb Improve spectator seagull handling
Previously they were only hidden, but this didn't account for the annoying audio they play so now they're entirely staged like a spectator unit would be.
2015-10-04 18:17:02 +01:00
SilentSpike
0beaa40fbc Add API parameter to allow for unforced spectator
Adds an optional boolean paremeter to the setSpectator function for forcing the interface. It is forced by default, so if `false` is passed as the value the spectator will be able to close the interface with the escape button.
2015-10-04 13:52:54 +01:00
Cuel
dcbf977d6d fix spectator view if called instantly
If you call setSpectator directly from init.sqf you'll be put into some
weird limbo mode with borders and spectator not working. This should fix
it
2015-09-25 12:51:13 +02:00
Glowbal
7e5ab07e32 Merge pull request #2387 from acemod/FixHCPPE
Fix that PPEffects Throw a error on HC
2015-09-15 21:04:37 +02:00
SilentSpike
e6c2916a14 Fix spectator template for negligible respawnDelay
When the value of respawn delay is 0 the timing of the killed and respawn events can be a little strange and result in spectator being entered but never exited. The respawn template should just do nothing when the delay is so small.
2015-09-12 14:02:42 +01:00
jokoho48
b7e02da1cc remove if (!hasInterface) from PFH
move ! in ()
2015-09-11 16:58:26 +02:00
SilentSpike
aa7b6cf39f Improve angular behaviour of spectator camera
Changes the position calculation of the external spectator camera to correctly retain the pan and tilt of the free camera. Makes transitioning between the two less disorienting for the user.
2015-09-11 14:46:21 +01:00
SilentSpike
77c2b99ee5 Change spectator external camera behaviour
Using the "external" view is limited by the server difficulty setting. Instead the spectator external camera has been replaced with an oribtal camera as was originally planned to be added alongside the default views.
2015-09-11 14:46:21 +01:00
SilentSpike
200f44d963 Adjust spectator camera speed based on height
Slows the camera movement close to the ground as it feels more natural when spectating units up close and such
2015-08-29 16:05:04 +01:00
SilentSpike
152faf6388 Improve spectator interface entry and exit
- Use a display rather than a dialog (contextually makes more sense).
- Move the entry/exit functionality to the setSpectator function. Preserves the handleInterface function for purely display related events and makes more sense.
- Fix missing semi-colon
2015-08-24 00:43:20 +01:00
SilentSpike
21b0ee087a Add spectator UI interrupt system
A public API system to allow external systems to interrupt and resume the spectator interface. Also made use of it for the escape menu and zeus support.
2015-08-22 00:26:43 +01:00
SilentSpike
95aa9f604b Fix manual pre-setting of spectator camera unit
If the spectator camera unit was set before the camera had ever opened then the unit list wouldn't be populated and as such the camera would automatically abort to free mode since the unit wasn't available to spectate.

So now I'm running the updateUnits function before opening the camera to pre-populate the list.
2015-08-11 13:53:55 +01:00
SilentSpike
c30cb45bd6 Optimize spectator UI held key prevention system 2015-08-09 20:59:57 +01:00
SilentSpike
182eef39de Adjust spectator camera pan and tilt with zoom 2015-08-08 18:41:38 +01:00
SilentSpike
213deeffb4 Add keys to adjust spectator camera speed and zoom
Allows for finer control of the speed and zoom, as well as a quick way to reset either.
2015-08-08 18:31:37 +01:00
SilentSpike
be7b156c49 Add "focus on unit" to spectator free camera
Pressing F will move the free camera to a position viewing the unit currently selected in the list. Fixes map teleporting functionality also.
2015-08-08 15:49:07 +01:00
SilentSpike
5b881224c5 Allow admins to use chat in the spectator UI 2015-08-08 13:31:10 +01:00
SilentSpike
e59f0ce822 Fix spectator respawn template for types 0 and 1
Type 0 worked, but the mission didn't end when all players were killed.
Type 1 didn't work because isPlayer isn't true for seagulls. So spectator virtual state is now entirely unassociated from objects in the game.
2015-08-08 12:33:34 +01:00
SilentSpike
57bda372f0 Adjust spectator free camera speed with zoom 2015-08-07 19:00:31 +01:00
SilentSpike
c5d9ec5d50 Add speed boost button to spectator free camera
Sometimes you just want a burst of speed rather than to adjust it and then adjust it back. Also swapped the speed/zoom scrolling modifier around.
2015-08-07 18:59:48 +01:00
SilentSpike
1c79c8fa45 Update spectator UI styling
Adds a title to the unit tree to match the help list and enters the title text.
2015-08-07 15:15:04 +01:00
SilentSpike
702e50b731 Improve spectator UI respawn counter blending
When the BI respawn counter is blended with the spectator UI its colours are also updated to match
2015-08-07 12:30:50 +01:00
SilentSpike
f143db7fc0 Draw player names on spectator map 2015-08-07 12:20:39 +01:00
SilentSpike
485f9438bb Change spectator UI toggle to include help window
With new layout of help window the toggle UX also changes. User expects help window to toggle as part of overall UI.
2015-08-07 01:51:46 +01:00
SilentSpike
043c5c47c5 Improve spectator help window layout
Having the help window in the centre of the screen blocked too much of the users view and also clashed with the MPTable element (the table that appears on death, aka "respawnDialog"). It was moved to the right of the screen and now mirrors the unit list. To save screen space, the action keys are given as tooltips for the listbox entries so users must mouse over for more info.
2015-08-07 01:44:32 +01:00
SilentSpike
f59536b5a3 Remove legacy spectator settings module argument 2015-08-07 00:28:54 +01:00
SilentSpike
4c9b6e94cf Overhaul and improve spectator unit tree UX
The old method of refreshing the tree on each update would reset all expanded/collapsed nodes. Now the code will cull any units/groups/sides no longer spectatable from the list and cache the ones that are still valid. The cached data is then used to populate the list with new units.

Add coloured unit icons beside units in the list for quick user reference of side and type.

Store group netIDs in respective nodes for possible use in code.
2015-08-07 00:06:22 +01:00