Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 12x 12x 12x 13x 13x 1x 12x | /** * Exports object instance set switch variable value function. * * @module object-instance/switches/set-switch-value.function */ import type { AgtkObjectInstance } from '@agogpixel/pgmmv-ts/api/agtk/object-instance/object-instance'; import { ObjectInstanceAccessorType } from '../object-instance-accessor-type.enum'; import { resolveId } from '../resolve-id.function'; /** * Set switch value in object instance. * * @param objectInstance Object instance. * @param key Switch ID or name. * @param value Value to be set. */ export function setSwitchValue(objectInstance: AgtkObjectInstance, key: number | string, value: boolean) { const id = resolveId(objectInstance, ObjectInstanceAccessorType.Switches, key); if (id === -1) { return; } objectInstance.switches.get(id).setValue(value); } |