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

Feature events #160

Merged
merged 4 commits into from
Sep 18, 2022
Merged

Feature events #160

merged 4 commits into from
Sep 18, 2022

Conversation

Lemonymous
Copy link
Contributor

@Lemonymous Lemonymous commented Sep 3, 2022

Migrated events and functions from libraries squadEvents, difficultyEvents and detectDeployment from LemonymousMods. In addition, this PR will nuke the libraries from adding their own events/functions.

Squad Events

  • modApi.events.onSquadEnteredGame
  • modApi.events.onSquadExitedGame

Difficulty Events

  • modApi.events.onDifficultyChanged

Deployment Functions

  • modApi.deployment.isDeploymentPhase
  • modApi.deployment.isLandingPhase
  • modApi.deployment.getSelected
  • modApi.deployment.getDeployed
  • modApi.deployment.getRemaining

Deployment Events

  • modApi.events.onDeploymentPhaseStart
  • modApi.events.onLandingPhaseStart
  • modApi.events.onDeploymentPhaseEnd
  • modApi.events.onPawnUnselectedForDeployment
  • modApi.events.onPawnSelectedForDeployment
  • modApi.events.onPawnDeployed
  • modApi.events.onPawnUndeployed
  • modApi.events.onPawnLanding
  • modApi.events.onPawnLanded

Game State Events

  • modApi.events.onGameStateChanged
  • modApi.events.onIslandLeft

Test Mod

Events.zip

It will log out to the console when each event fires.
There is also commented out code for testing deployment events added via compatibility code in the same way the original deployment library did it.

Also nuke external library with same events.
Also nuke external library with the same event.
Add compatibility for event `onRealDifficultyChanged`, referencing `onDifficultyChanged`.
### Functions
- modApi.deployment.isDeploymentPhase
- modApi.deployment.isLandingPhase
- modApi.deployment.getSelected
- modApi.deployment.getDeployed
- modApi.deployment.getRemaining

### Events
- modApi.events.onDeploymentPhaseStart
- modApi.events.onLandingPhaseStart
- modApi.events.onDeploymentPhaseEnd
- modApi.events.onPawnUnselectedForDeployment
- modApi.events.onPawnSelectedForDeployment
- modApi.events.onPawnDeployed
- modApi.events.onPawnUndeployed
- modApi.events.onPawnLanding
- modApi.events.onPawnLanded
## Events
- modApi.events.onGameStateChanged:dispatch(newGameState, oldGameState)
- modApi.events.onIslandLeft:dispatch(island)

Game States:
```
Main_Menu
Hangar
End_Game_Screen
Map
Island
Mission
Mission_Test
```
@KnightMiner KnightMiner merged commit 0243c66 into master Sep 18, 2022
@KnightMiner KnightMiner deleted the feature-events branch September 18, 2022 20:21
@KnightMiner KnightMiner added the enhancement New feature or request label Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants