Repository navigation
GForcePause
Up | Previous | Next | Русский
Below is the full source of the class in documentation form. The comments inside the block explain the purpose of the parts of the class, but they are not stored in the working file GForcePause.java: the production code stays clean and the explanations live in the wiki.
package com.velitask.plugin.official;
/* What to show while the frame falls into a pause in the G-force sensor recording. JSON stores the index (ordinal). */
public enum GForcePause {
/* The point in the center and a dash instead of the values (index 0, the default). */
CENTER,
/* The last value before the pause (index 1). */
LAST
}GForcePause is a helper enum shared by GForceIndicator and GForceTextIndicator. It describes what to show when the frame time falls into a pause in the G-force sensor recording. It has no indicator or setting of its own in a project: it is used as the type of the pause property (EnumArrayProperty<GForcePause>).
The enum has two options in this order: CENTER (index 0, the default) and LAST (index 1). The pause property stores exactly the index in JSON: {"value": 0} or {"value": 1}.
How the indicators treat the options (the pause flag comes from CurrentAtom.inPause()):
| Option | Circular indicator | Text indicator |
|---|---|---|
CENTER |
The point in the center of the circle; the total value and the components are replaced with a dash —; the trail is not drawn. |
— is output instead of the template. |
LAST |
The point and the captions follow the values at the end of the window of the last recording before the pause; the trail is not drawn. | The template substitutes the values at the end of the window of the last recording before the pause. |
The enum does not build the captions of the options for the selection list: each indicator builds them itself in defineTitles() of its pause property, with the same technique as for the other lists: GForcePause[] vs = GForcePause.values() and, for each option, localized(KEY_PAUSE + "." + vs[i].name().toLowerCase()). In both indicators KEY_PAUSE is Plugin.Indicator.gforce.pause, so the option captions of both are the same ("Center and dash" and "Last value"), while the setting title ("During a pause") is set by each indicator itself.
- The order of the options defines the saved index: reordering or inserting options in the middle is not allowed without a migration.
- The captions are not hard-coded in the enum: the keys
Plugin.Indicator.gforce.pause.centerandPlugin.Indicator.gforce.pause.lastare needed in the plugin strings, otherwise the list shows a raw key. - Outside the recording (neither a recording nor a pause with a recording before it) the indicators draw nothing regardless of this setting.