Hpl3:Community:scripting:custom depth:station apps common

From Frictional Wiki
Jump to navigation Jump to search

Station Gui - Common

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


StationGui_LoadingWindow

bool StationGui_LoadingWindow(const tString &in asName, const tString &in asCaption, const tString &in asText, float afLoadTime, bool abReset, const cVector2f &in avNrmSize = cVector2f(0.6, 0.2), float afZ=1.5f)

Parameters

  • asName: The internal name of the loading window.
  • asCaption: The caption to display at the top of the window.
  • asText: The text to display above the loading bar.
  • afLoadTime: The amount of time in seconds for the window to load.
  • abReset: Sets whether the loading value should be reset to 0 when the loading has completed. (Used for reusable loading windows.)
  • (Optional) avNrmSize: The size of the window.

Returns

  • bool: Returns true if the loading gauge has reached 100%, otherwise returns false.

Remarks

The loading window does not hide itself when the loading has finished. Use this window with an if-then statement and the StationGui app system in order to navigate to a different screen when the loading has completed.


StationGui_BigStatusMessage

void StationGui_BigStatusMessage(const tString&in asText, cStationGui_BigStatusMessageSettings &in aSettings = cStationGui_BigStatusMessageSettings())

Parameters

  • asText: The text to display.
  • (Optional) aSettings: The settings to use for the message.

Returns

Displays a large message in the center of the terminal screen.


StationGui_AddApp

void StationGui_AddApp(const tString &in asName, bool abEnabled = true, bool abChangeState = true)

Parameters

  • asName: The name of the app. This name will be displayed in the button.
  • (Optional) abEnabled: Whether the button is enabled. If false, the button will be grayed out.
  • (Optional) abChangeState: Whether the app will automatically change when the button is pressed.

Remarks

Adds an app to the current StationGui main menu. (This function must be called before any calls to StationGui_MainMenu.)

This function will automatically create state values for each app. The first app created will be "0", the next app will be "1", etc.


StationGui_AddApp

void StationGui_AddApp(const tString &in asName, bool abEnabled, int alCustomState)

Parameters

  • asName: The name of the app. This name will be displayed in the button.
  • abEnabled: Whether the button is enabled. If false, the button will be grayed out.
  • alCustomState: The custom state value for this app.

Remarks

Adds an app to the current StationGui main menu. (This function must be called before any calls to StationGui_MainMenu.)

This function will use the given value as its state value. This is usually accomplished by defining a series of enumerations specific to the terminal. (e.g. eTerminalState_MainMenu, eTerminalState_SubApp, etc.)


StationGui_ClearApps

StationGui_ClearApps()

Remarks

Clears the current list of apps. (Keep in mind that StationGui_MainMenu clears the list of apps automatically.)


StationGui_MainMenu

int StationGui_MainMenu(const cStationGui_MainMenuSettings &in aSettings = cStationGui_MainMenuSettings())

Parameters

  • (Optional)aSettings : The settings to use for the main menu window.

Returns

  • int: The state value of the pressed app button, or -1 if no button was pressed.

Remarks

Draws each app added through calls to StationGui_AddApp as a button.


StationGui_TextReaderSingle

void StationGui_TextReaderSingle(const tString&in asCaption, const tString&in asText, const cStationGui_TextReaderSettings &in aSettings = cStationGui_TextReaderSettings(), cVector3f avWindowNrmPosGroup=cVector3f(0.05, 0.02, 1), cVector2f avWindowNrmSizeGroup=cVector2f(0.9, 0.775)))

Parameters

  • asCaption: The caption to display at the top of the reader.
  • asText: The text to display within the reader.
  • (Optional)aSettings: The settings to use for the reader.
  • (Optional)avWindowNrmPosGroup: The position of the reader window.
  • (Optional)avWindowNrmSizeGroup: The size of the reader window.

Remarks

This widget is a text reader widget, used for showing single letters or logs.


StationGui_TextReaderSingle

void StationGui_TextReaderSingle(const tString&in asTransCat, const tString&in asCaption, const tString&in asText, const cStationGui_TextReaderSettings &in aSettings = cStationGui_TextReaderSettings(), cVector3f avWindowNrmPosGroup=cVector3f(0.05, 0.05, 1), cVector2f vWindowNrmSizeGroup=cVector2f(0.9, 0.8))

Parameters

  • asTransCat: The translation category to use for the reader.
  • asCaption: The caption to display at the top of the reader.
  • asText: The text to display within the reader.
  • (Optional)aSettings: The settings to use for the reader.
  • (Optional)avWindowNrmPosGroup: The position of the reader window.
  • (Optional)avWindowNrmSizeGroup: The size of the reader window.

Remarks

This widget is a text reader widget, used for showing single letters or logs.

This overload of the function adds a convenience parameter for specifying a translation category for the reader.


StationGui_TextReaderSingle

void StationGui_TextReaderSingle(const cStationGui_TextReaderSettings &in aSettings = cStationGui_TextReaderSettings(), cVector3f avWindowNrmPosGroup=cVector3f(0.05, 0.02, 1), cVector2f avWindowNrmSizeGroup=cVector2f(0.9, 0.775))

Parameters

  • (Optional)aSettings: The settings to use for the reader.
  • (Optional)avWindowNrmPosGroup: The position of the reader window.
  • (Optional)avWindowNrmSizeGroup: The size of the reader window.

Remarks

This widget is a text reader widget, used for showing single letters or logs.

This overload of the function removes all non-optional parameters, instead getting its caption and text information through a call to Depth_ImGui_AddTextFile.


StationGui_TextReaderMulti

int StationGui_TextReaderMulti(const tString&in asCaption, const tString&in asFileContentPrefix, const tString&in asFileNamePrefix, int alFileCount, cStationGui_TextReaderSettings &in aSettings = cStationGui_TextReaderSettings())()

Parameters

  • asCaption: The caption to display at the top of the reader.
  • asFileContentPrefix: The prefix string of the text entries to use for the file contents.
  • asFileNamePrefix: The prefix string of the text entries to use for the file names.
  • alFileCount: The total number of text files.
  • (Optional) aSettings: The settings to use for the reader.

Returns

  • int: The index of the currently selected text file.

Remarks

This widget is a text reader widget, used for displaying multiple selectable text files. The widget includes a navigation bar along the left side of the window to browse the available text files.

The widget assumes that in the translation category supplied, there are a number of entries specified by alFileCount prefixed by asFileContentPrefix and asFileNamePrefix. For example, if asFileContentPrefix is "fileContent", asFileNamePrefix is "fileName", and alFileCount is 2, then this function assumes that there are lang categories "fileName_1", "fileName_2", "fileContent_1", and "fileContent_2".


StationGui_TextReaderMulti

int StationGui_TextReaderMulti(const tString&in asTransCat, const tString&in asCaption, const tString&in asFileContentPrefix, const tString&in asFileNamePrefix, int alFileCount, const cStationGui_TextReaderSettings &in aSettings = cStationGui_TextReaderSettings())

Parameters

  • asTransCat: The translation category to use for the reader.
  • asCaption: The caption to display at the top of the reader.
  • asFileContentPrefix: The prefix string of the text entries to use for the file contents.
  • asFileNamePrefix: The prefix string of the text entries to use for the file names.
  • alFileCount: The total number of text files.
  • (Optional) aSettings: The settings to use for the reader.

Returns

  • int: The index of the currently selected text file.

Remarks

This widget is a text reader widget, used for displaying multiple selectable text files. The widget includes a navigation bar along the left side of the window to browse the available text files.

The widget assumes that in the translation category supplied, there are a number of entries specified by alFileCount prefixed by asFileContentPrefix and asFileNamePrefix. For example, if asFileContentPrefix is "fileContent", asFileNamePrefix is "fileName", and alFileCount is 2, then this function assumes that there are lang categories "fileName_1", "fileName_2", "fileContent_1", and "fileContent_2".

This overload of the function adds a convenience parameter for specifying a translation category for the reader.


StationGui_TextReaderMulti

int StationGui_TextReaderMulti(const cStationGui_TextReaderSettings &in aSettings = cStationGui_TextReaderSettings())

Parameters

  • (Optional) aSettings: The settings to use for the reader.

Returns

  • int: The index of the currently selected text file.

Remarks

This widget is a text reader widget, used for displaying multiple selectable text files. The widget includes a navigation bar along the left side of the window to browse the available text files.

The widget assumes that in the translation category supplied, there are a number of entries specified by alFileCount prefixed by asFileContentPrefix and asFileNamePrefix. For example, if asFileContentPrefix is "fileContent", asFileNamePrefix is "fileName", and alFileCount is 2, then this function assumes that there are lang categories "fileName_1", "fileName_2", "fileContent_1", and "fileContent_2".

This overload of the function removes all non-optional parameters, instead getting its caption and text information through a call to Depth_ImGui_AddTextFile.


StationGui_DialogBox_Start

void StationGui_DialogBox_Start(const tString&in asCaption, const tString&in asText, const cVector2f &in avNrmSize = cVector2f(0.6, 0.2), float afZ = 1.5f, const cVector2f &in avFontSizeMul = 1.0f)

Parameters

  • asCaption: The caption to display at the top of the window.
  • asText: The text to display within the window.
  • (Optional) avNrmSize: The size of the window.
  • (Optional) afZ: The z-order index of the window.
  • (Optional) avFontSizeMul: The font size multiplier of text within the window.

Remarks

This widget is a simple dialog box in the center of the window. Be sure to call StationGui_DialogBox_End after calling this function.


StationGui_DialogBox_Text

void StationGui_DialogBox_Text(const tString&in asText, const cVector2f &in avFontSizeMul =1.0f)

Parameters

  • asText: The text to display within the window.
  • (Optional) avFontSizeMul: The font size multiplier of text within the window.

Remarks

This function draws text where a default dialog box's text would be located. Calling this function after StationGui_DialogBox_Start causes the text from the two functions to be overlapped.


StationGui_DialogBox_End

void StationGui_DialogBox_End()

Remarks

This is a utility function for cleaning up some ImGui settings after a call to StationGui_DialogBox_Start.


StationGui_Graph

void StationGui_Graph(const cImGuiGfx &in aBaseGfx, const tString &in asHeader="", const cStationGui_GraphSettings &in aSettings = cStationGui_GraphSettings())

Parameters

  • aBaseGfx: A background image to be drawn behind the graph.
  • asHeader: The text to display at the top of the graph.
  • (Optional) aSettings: The settings to use for the graph.

Remarks

Images to be used as graph values are added with calls to Depth_ImGui_AddGraphOverlay.


StationGui_ResetGraph

StationGui_ResetGraph()

Remarks

Resets the current state of the graph.


Depth_ImGui_WauLeechGibberish

void Depth_ImGui_WauLeechGibberish(const cColor &in aColorMul, float afDistortion, float afZ = 2.0f)

Parameters

  • aColorMul: The color multiplier of the effect.
  • afDistortion: The level of distortion of the effect.
  • (Optional) afZ: The z-order index for the effect.

Remarks

This function adds a visual effect for creating distorted terminal gibberish.