From 3d059c72e17972bdd590789dca428a148f8b78e9 Mon Sep 17 00:00:00 2001 From: Paco Hope Date: Sat, 13 Aug 2022 16:50:56 -0400 Subject: [PATCH] broke types out to its own doc file --- docs/source/types.rst | 66 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 docs/source/types.rst diff --git a/docs/source/types.rst b/docs/source/types.rst new file mode 100644 index 0000000..f72498a --- /dev/null +++ b/docs/source/types.rst @@ -0,0 +1,66 @@ + +TFScript Types +=================== + +The moment we've all been waiting for, the types. These are the crux of any TFScript file, and the bulk of what's important. In fact, they're so important I'm just going to write the important bits right now and leave the rest to be completed by release 1.0.0 + +Impulse +------------------------------ + +Overview: + +.. function:: impulse + Bind a key to a simple command + + :param command: the command to do when the key is pressed + +Binds the associated key to the command provided by ``text``. + +Also has shortcuts for ``voice``, ``build``, and ``destroy`` + +Example +^^^^^^^^^^ + +.. code-block:: + :caption: impulse example + + e: + impulse: voice medic + +Double +------------------------------ + +Overview: + +.. function:: double + This creates a double thingie + + :param primary: + :param secondary: + :param condition: + :param type: <"held" or "toggle", default "held"> + :param cancel both: + :param solo: + + +While the ``condition`` is satisfied, the associated key behaves as ``secondary``, otherwise it behaves as ``primary``. ``primary`` and ``secondary`` are both types defined above, like ``impulse`` or ``hold``, and follow the exact same syntax. + +If the type is "held", the condition is satified while the ``condition`` key is held down, but if the type is "toggle" then the condition will be satisfied when the condition button is pushed, and continue being satisfied until it is pushed again (so the ``condition`` key toggles the associated key between the secondary and primary behaviours). + +If ``cancel both`` is true and either of ``primary`` or ``secondary`` are of the type ``hold``, releasing the associated key will execute the ``release`` block of both keys or otherwise stop both actions from continuing. Otherwise the two keys will behave completely independently of each other. + +If the ``condition`` key already has other keys that change with it, then the ``condition`` key will change *all* of them to their secondary action. However, if ``solo`` is set to true, it will only toggle the given key and not any of the others. + +Example +^^^^^^^^^^^ + +.. code-block:: + :caption: double example + + double: + primary: + impulse: voice medic + secondary: + impulse voice activate uber + condition: mouse4 +