-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scripting/properties): add Cinemascope, PlayerControls and Playe…
…rInterface classes
- Loading branch information
1 parent
639113a
commit 8602998
Showing
4 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { ScriptProperty } from '@scripting/ScriptProperty.js' | ||
|
||
/** | ||
* A ScriptProperty for enabling or disabling cinematic borders | ||
* | ||
* @extends ScriptProperty | ||
* @see https://wiki.arx-libertatis.org/Script:cinemascope | ||
*/ | ||
export class Cinemascope extends ScriptProperty<boolean> { | ||
isSliding: boolean | ||
|
||
constructor(value: boolean, isSliding: boolean = false) { | ||
super(value) | ||
this.isSliding = isSliding | ||
} | ||
|
||
toString() { | ||
return `cinemascope ${this.isSliding === true ? '-s' : ''} ${this.value === true ? 'on' : 'off'}` | ||
} | ||
|
||
static get on() { | ||
return new Cinemascope(true) | ||
} | ||
|
||
static get off() { | ||
return new Cinemascope(false) | ||
} | ||
|
||
static get slideIn() { | ||
return new Cinemascope(true, true) | ||
} | ||
|
||
static get slideOut() { | ||
return new Cinemascope(false, true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ScriptProperty } from '@scripting/ScriptProperty.js' | ||
|
||
/** | ||
* A ScriptProperty for enabling and disabling user input. | ||
* Disabling player controls are necessary during cutscenes. | ||
* | ||
* @extends ScriptProperty | ||
* @see https://wiki.arx-libertatis.org/Script:setplayercontrols | ||
*/ | ||
export class PlayerControls extends ScriptProperty<boolean> { | ||
toString() { | ||
return `setplayercontrols ${this.value === true ? 'on' : 'off'}` | ||
} | ||
|
||
static get on() { | ||
return new PlayerControls(true) | ||
} | ||
|
||
static get off() { | ||
return new PlayerControls(false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { ScriptProperty } from '@scripting/ScriptProperty.js' | ||
|
||
/** | ||
* A ScriptProperty for showing and hiding a good chunk of the HUD. | ||
* This command does not fully hide the HUD, only some parts of it. | ||
* Currently the equipment indicators, inventories and minimap remain visible. | ||
* | ||
* @extends ScriptProperty | ||
* @see https://wiki.arx-libertatis.org/Script:playerinterface | ||
*/ | ||
export class PlayerInterface extends ScriptProperty<boolean> { | ||
isSliding: boolean | ||
|
||
constructor(value: boolean, isSliding: boolean = false) { | ||
super(value) | ||
this.isSliding = isSliding | ||
} | ||
|
||
toString() { | ||
return `playerinterface ${this.isSliding === true ? '-s' : ''} ${this.value === true ? 'on' : 'off'}` | ||
} | ||
|
||
static get on() { | ||
return new PlayerInterface(true) | ||
} | ||
|
||
static get off() { | ||
return new PlayerInterface(false) | ||
} | ||
|
||
static get slideIn() { | ||
return new PlayerInterface(true, true) | ||
} | ||
|
||
static get slideOut() { | ||
return new PlayerInterface(false, true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters