Hpl3:Community:scripting:custom depth:station

From Frictional Wiki
Jump to navigation Jump to search

Station Gui

To use functions on this page, add #include "helper_imgui_station.hps" to the top of your script file.


Background

StationGuiBG_Scanlines

void StationGuiBG_Scanlines(
				float afZ = 10.0f, 
				const tString &in asFile = "station/scanlines/standard_tileable")

Parameters

  • (Optional) afZ: The z-order index of the effect.
  • (Optional) asFile: The source image file of the effect.

Remarks

This function draws a terminal-style scan line effect over the terminal screen.


StationGuiBG_Backdrop

void StationGuiBG_Backdrop(
				const tString &in asFile = "background_logo_pathOS", 
				cVector2f avRelPos = cVector2f(0.1,0.45), 
				float avRelSize = 0.5f, 
				float afZ = 0.0f)

Parameters

  • (Optional) asFile: The source image file of the image.
  • (Optional) avRelPos: The normalized position of the image.
  • (Optional) avRelSize: The normalized size of the image.
  • (Optional) afZ: The z-order index of the image.

Remarks

This function draws an image as a background overlay. The image is a Pathos II symbol by default.


StationGuiBG_FlatColor

void StationGuiBG_FlatColor(
				float afZ = 0.0f, 
				const cColor &in aCol = cColor(0,1))

Parameters

  • (Optional) afZ: The z-order index of the effect.
  • (Optional) aCol: The color of the effect.

Remarks

This function fills the entire terminal screen with a single color.


StationGuiBG_OrnamentTopLeft

void StationGuiBG_OrnamentTopLeft(
				const tString &in asFile = "station/ornament/corner_topleft", 
				const cVector2f &in avSize = cVector2f(0.25f), 
				eImGuiSizeType aSizeType = eImGuiSizeType_CorrectAspectWidthNormalized, 
				const cColor &in aCol = cColor_White, 
				const cVector2f &in avOffset = cVector2f_Zero, 
				float afZ = 0.2f)

Parameters

  • (Optional) asFile: The source image file of the image.
  • (Optional) avSize: The normalized size of the image.
  • (Optional) aSizeType: The sizing mode of the image.
  • (Optional) cColor: The color multiplier for the image.
  • (Optional) avOffset: The non-normalized offset for the image.
  • (Optional) afZ: The z-order index of the image.

Remarks

This function draws an ornament image in the top left corner of the screen.


StationGuiBG_OrnamentTopRight

void StationGuiBG_OrnamentTopRight(
				const tString &in asFile = "station/ornament/corner_topright", 
				const cVector2f &in avSize = cVector2f(0.25f), 
				eImGuiSizeType aSizeType = eImGuiSizeType_CorrectAspectWidthNormalized, 
				const cColor &in aCol = cColor(1,0.75f), 
				const cVector2f &in avOffset = cVector2f_Zero, 
				float afZ = 0.2f)

Parameters

  • (Optional) asFile: The source image file of the image.
  • (Optional) avSize: The normalized size of the image.
  • (Optional) aSizeType: The sizing mode of the image.
  • (Optional) cColor: The color multiplier for the image.
  • (Optional) avOffset: The non-normalized offset for the image.
  • (Optional) afZ: The z-order index of the image.

Remarks

This function draws an ornament image in the top right corner of the screen.


StationGuiBG_OrnamentBottomLeft

void StationGuiBG_OrnamentBottomLeft(
				const tString &in asFile = "station/ornament/corner_bottomleft", 
				const cVector2f &in avSize = cVector2f(0.25f), 
				eImGuiSizeType aSizeType = eImGuiSizeType_CorrectAspectWidthNormalized, 
				const cColor &in aCol = cColor(1,0.75f), 
				const cVector2f &in avOffset = cVector2f_Zero, 
				float afZ = 0.2f)

Parameters

  • (Optional) asFile: The source image file of the image.
  • (Optional) avSize: The normalized size of the image.
  • (Optional) aSizeType: The sizing mode of the image.
  • (Optional) cColor: The color multiplier for the image.
  • (Optional) avOffset: The non-normalized offset for the image.
  • (Optional) afZ: The z-order index of the image.

Remarks

This function draws an ornament image in the bottom left corner of the screen.


StationGuiBG_OrnamentBottomRight

void StationGuiBG_OrnamentBottomRight(
				const tString &in asFile = "station/ornament/corner_bottomright", 
				const cVector2f &in avSize = cVector2f(0.25f), 
				eImGuiSizeType aSizeType = eImGuiSizeType_CorrectAspectWidthNormalized, 
				const cColor &in aCol = cColor(1,0.75f), 
				const cVector2f &in avOffset = cVector2f_Zero, 
				float afZ = 0.2f)

Parameters

  • (Optional) asFile: The source image file of the image.
  • (Optional) avSize: The normalized size of the image.
  • (Optional) aSizeType: The sizing mode of the image.
  • (Optional) cColor: The color multiplier for the image.
  • (Optional) avOffset: The non-normalized offset for the image.
  • (Optional) afZ: The z-order index of the image.

Remarks

This function draws an ornament image in the bottom right corner of the screen.


StationGuiBG_Taskbar

void StationGuiBG_Taskbar(
				const tString &in asStation = "lambda", 
				const tString &in asBackgroundFile = "stationV2/background/taskbar")

Parameters

  • (Optional) asStation: The key for the station image. (See Remarks)
  • (Optional) asBackgroundFile: The source image for the taskbar.

Remarks

This function draws a taskbar along the bottom of the screen. Along with a bar, it also displays a Pathos II station logo in the lower right corner of the screen. The logo drawn depends upon the first parameter given. The options are available are "delta", "lambda", "omicron", "phi", "tau", "theta", or "upsilon". Alternatively, an empty string ("") will cause no logo to be drawn. Any other value will result in a solid white square being drawn where the logo would normally be.

Remarks

This function draws an ornament image in the bottom right corner of the screen.


StationGuiBG_DatapadTaskbar

void StationGuiBG_DatapadTaskbar(
				const tString &in asBackgroundFile = "stationV2/background/taskbar")

Parameters

  • (Optional) asBackgroundFile: The source image for the taskbar.

Remarks

This function draws a taskbar along the bottom of the screen. The taskbar is formatted differently for datapad terminal displays.

Helpers

StationGui_DoWindowStart

void StationGui_DoWindowStart(
				const tString &in asCaption, 
				const cImGuiWindowData &in aWindow, 
				const cVector3f &in avPos, 
				const cVector2f &in avSize, 
				bool abDrawOrnaments, 
				bool abClip = false)

Parameters

  • asCaption: The text to draw at the top of the window.
  • aWindow: The data to use for the window.
  • avPos: The position of the window.
  • avSize: The size of the window.
  • abDrawOrnaments: Whether the default StationGui ornaments should be drawn.
  • (Optional)abClip: Whether any widgets within the window should be clipped to the bounds of the window.

Remarks

This function starts a window layout, optionally using the default StationGui ornaments. Remember to use StationGui_DoWindowEnd after you are done with the window.


StationGui_DoWindowEnd

void StationGui_DoWindowEnd()

Remarks

This is a utility function for ending the window layout and cleaning up some ImGui settings after a call to StationGui_DoWindowStart.


StationGui_GetActiveApp

int StationGui_GetActiveApp(
				int alDefaultApp = -1)

Parameters

  • (Optional)alDefaultApp: The default value to return if StationGui has not yet been set with an active app.

Returns

  • int: The index of the current active StationGui app.

Remarks

This function deals with a global app setting, which can affect multiple terminals. If you are using more than one terminal with the StationGui setup, use the overload for this function.


StationGui_GetActiveApp

int StationGui_GetActiveApp(
				const tString &in asEntityName,
				int alDefaultApp = -1)

Parameters

  • asEntityName: The name of the terminal to retrieve the active app from.
  • (Optional)alDefaultApp: The default value to return if StationGui has not yet been set with an active app.

Returns

  • int: The index of the current active StationGui app.

Remarks

This function gets the active app for the terminal specified by the first parameter.


StationGui_SetActiveApp

void StationGui_SetActiveApp(
				int alAppIndex)

Parameters

  • alAppIndex: The new index of the app.

Remarks

This function deals with a global app setting, which can affect multiple terminals. If you are using more than one terminal with the StationGui setup, use the overload for this function.


StationGui_SetActiveApp

void StationGui_SetActiveApp(
				const tString &in asEntityName,
				int alAppIndex)

Parameters

  • asEntityName: The name of the terminal to set the active app for.
  • alAppIndex: The new index of the app.

Remarks

This function sets the active app for the terminal specified by the first parameter.


StationGui_DrawAppIcon

void StationGui_DrawAppIcon(
				const tString &in asIcon)

Parameters

  • asIcon: The image file source for the icon.

Remarks

This function draws an icon in the bottom left corner of the screen. It is generally used internally by other StationGui functions.


StationGui_BackButton

bool StationGui_BackButton(
				bool abEnabled = true, 
				int alState = -1, 
				bool abSound = true)

Parameters

  • (Optional)abEnabled: Whether the button is enabled or grayed out.
  • (Optional)alState: The index of the app to switch to when the button is pressed.
  • (Optional)abSound: Whether a sound is played when the button is pressed.

Returns

  • bool: Whether the button was pressed.

Remarks

This function switches the current app of the global app setting. If you are using more than one terminal with the StationGui setup, switch the current app using StationGui_SetActiveApp function.


StationGui_DatapadBackButton

bool StationGui_DatapadBackButton(
				bool abEnabled = true, 
				int alState = -1, 
				bool abSound = true)

Parameters

  • (Optional)abEnabled: Whether the button is enabled or grayed out.
  • (Optional)alState: The index of the app to switch to when the button is pressed.
  • (Optional)abSound: Whether a sound is played when the button is pressed.

Returns

  • bool: Whether the button was pressed.

Remarks

This version of the back button is formatted differently for datapad terminal displays.

This function switches the current app of the global app setting. If you are using more than one terminal with the StationGui setup, switch the current app using StationGui_SetActiveApp function.


StationGui_FileList

int StationGui_FileList(
				const tString &in asCaption, 
				int alFileCount, 
				const cVector3f &in avPos = cVector3f_Zero, 
				const cVector2f &in avSize = ImGui_NrmSizeGroup(cVector2f(0.35, 0.875)))

Parameters

  • asCaption: The text to draw at the top of the file list.
  • alFileCount: The number of files in the list.
  • (Optional)avPos: The position of the file list.
  • (Optional)avSize: The size of the file list.

Returns

  • int: The index of the selected file, or 0 if no file is selected. (The first index is 0.)

Remarks

This function draws a list of "files". You can add files to the list by using ImGui_AddItemString.

Preloading

StationGui_PreloadDefault

void StationGui_PreloadDefault()

Remarks

This function preloads all the resources for StationGui terminals. While not strictly necessary, it's recommended to put a call to this function in the PreloadData function of your script file.


OmnitoolGui_Preload

void OmnitoolGui_Preload()

Remarks

This function preloads all the resources for Omnitool terminals. While not strictly necessary, it's recommended to put a call to this function in the PreloadData function of your script file.


Data Restoration

StationGui_DataRestoration

bool StationGui_DataRestoration(
				int alFileCount, 
				float fLoadTime, 
				int &out alRestoredFiles, 
				cStationGui_DataRestorationSettings aSettings = cStationGui_DataRestorationSettings())

Parameters

  • alFileCount: The number of files to process.
  • fLoadTime: The length of time to complete the process.
  • out alRestoredFiles: The number of files successfully restored.
  • (Optional)aSettings: The settings to use for the process.

Returns

  • bool: True if the process is completed, otherwise false.

Remarks

This is a process function that simulates the corruption and subsequant restoration of data files. First, it shows a dialog box alerting the prescence of corrupted data files. Second, it shows a progress bar that lasts the duration of fLoadTime. Finally, it shows a dialog box alerting that partial data restoration has been successful. The messages displayed in the various stages can be customized by supplying a cStationGui_DataRestorationSettings object as a fourth parameter.

Maps

StationGui_YouAreHereIcon

void StationGui_YouAreHereIcon(
				const cVector3f &in avPos, 
				const cVector2f &in avSize)

Parameters

  • avPos: The position of the icon.
  • avSize: The size of the icon.

Remarks

This function displays an animated icon at the position and size supplied.