Skip to content

Instantly share code, notes, and snippets.

@cmann1
Last active November 17, 2021 14:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmann1/44c9b0dd86b931b07aa1be616fe6bb30 to your computer and use it in GitHub Desktop.
Save cmann1/44c9b0dd86b931b07aa1be616fe6bb30 to your computer and use it in GitHub Desktop.
  • General:
    • Fix save/load state related crash
    • Fix unloaded entities still being detected by end flags in Dustmod
    • Fix DX12 device error
    • Fix segments overwriting checkpoint when unloading
    • Fix player movement FX positions when player is scaled
    • Fix weird tome scroll behaviour when using arrow keys after searching
    • Fix score screen not shown for OOB/unload
    • OOB/Unload now works on dustmod maps
    • Door/tome titles will no longer overlap in multiplayer - only the title for the active camera is drawn
    • PIP rendered using the PIP camera fog, instead of the main camera fog
    • Clipboard support - text can now be copied and pasted into text boxes and triggers
    • In game console (F12)
      • Type "help" for a list of commands
      • Ctrl + F12 to open normal console
  • Tools:
    • Fix text trigger text not drawn when Show Triggers is on
    • Fix dragging debug camera lag when game speed < 1
  • Editor:
    • Fix still being able to select an entity/position while panning the camera with Space
    • Fix not being able to tab into play because a hidden control can still have keyboard focus
    • Fix [angle] control indicator line when set to radians
    • Fix crash when undoing deleted camera node
    • Fix not being able to open wind/particle when editor panels are hidden
    • Fix F5 trying load nexus scripts in editor, locking the UI
    • Fix rotating prop by 1 degree increments (ctrl+shift) also changing layer
    • Fix tooltips and var_info path returned for nested arrays
    • Fix script variable changes lost when compiling or entering playing
    • Prevent Alt+Click drawing tiles while GVB_LEFT_CLICK is cleared via script
    • Allow inserting a space into text fields while holding Space
  • Dustscript API:
    • Fix not being able to disable script camera
    • Fix dropdowns for strings, non-sequential, or values not starting at 0
    • Fix spring blobs not triggering hit/hurt callbacks
    • Add save_checkpoint overload that can use the x and y arguments
    • editor_tab will now return "Wind" and "Particle" when instead of "" and "Help" when the wind and particle editor are open
    • Added the input_api for direct mouse and keyboard access
    • Deprecated all editor_api keyboard methods - use the new input_api
class input_api {
	/* Returns text input recorded over the last frame. */
	string get_text();
	void set_text(string text);

	/* Returns the clipboard text. */
	string get_clipboard();
	/* Returns false on failure?? */
	bool set_clipboard(string text);

	/* Returns the x coordinate of the mouse in the hud coordinate space. If scale
	* is set to true will auto scale the coordinates to simulate a 1600-900
	* screen size. Will range between -width/2 and width/2. */
	float mouse_x_hud(bool scale);
	/* Equivalent to mouse_x_hud(false) */
	float mouse_x_hud();

	/* Returns the y coordinate of the mouse in the hud coordinate space. If scale
	* is set to true will auto scale the coordinates to simulate a 1600-900
	* screen size. Will range between -height/2 and height/2. */
	float mouse_y_hud(bool scale);
	/* Equivalent to mouse_y_hud(false) */
	float mouse_y_hud();

	/* Returns the x coordinate of the mouse for the given layer. */
	float mouse_x_world(int layer);

	/* Returns the y coordinate of the mouse for the given layer. */
	float mouse_y_world(int layer);

	/* Return the current screen width in pixels. */
	float screen_width();
	/* Return the current screen height in pixels. */
	float screen_height();

	/* Returns the mouse state as a bitmask. The
	bits correspond to the following button states:

	0x1: wheel up
	0x2: wheel down
	0x4: left down
	0x8: right down
	0x10: middle down
	0x20: left pressed
	0x40: right pressed
	0x80: middle pressed
	0x100: left release
	0x200: right release
	0x400: middle release */
	int mouse_state();

	/* Returns true if the key is currently pressed. vk should be a
	* virtual key keycode. See
	* https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes.
	* This is raw access to the underlying key state and will never work
	* in net games. Button states should only be accessed in step() functions. */
	bool key_check_vk(int vk);
	/* Returns true if the key was pressed this frame. */
	bool key_check_pressed_vk(int vk);
	/* Returns true if the key was released this frame. */
	bool key_check_released_vk(int vk);

	/* Returns true if the "global virtual button" is currently pressed.
	* Refer to the GLOBAL_VIRTUAL_BUTTON enum for options for this value.
	* These button states are fully managed in net games. */
	bool key_check_gvb(int gvb);
	/* Returns true if the global virtual button is pressed this frame. */
	bool key_check_pressed_gvb(int gvb);
	/* Returns true if the global virtual button is released this frame. */
	bool key_check_released_gvb(int gvb);
	/* Unset the global virtual button state. */
	void key_clear_gvb(int gvb);

	/* Returns true if the "player virtual button" is currently pressed.
	* Refer to the PLAYER_VIRTUAL_BUTTON enum for options for this value.
	* These button states are fully managed in net games. */
	bool key_check_vb(int player, int vb);
	/* Returns true if the global virtual button is pressed this frame. */
	bool key_check_pressed_vb(int player, int vb);
	/* Unset the global virtual button state. */
	void key_clear_vb(int player, int vb);

	/* Returns true if a UI control has focus */
	bool has_focus();
	/* Returns true if a UI control,
	* e.g. a text box, is taking keyboard input */
	bool is_polling_keyboard();
	/* Polls the keyboard for one frame, blocking shortcuts such as
	* frame advance */
	bool poll_keyboard();
}

class scene {
	/* Trigger a checkpoint to be saved. Note that the checkpoint is only saved at
	 * the start of the next frame.
	 * If use_position is false (the default due to a bug and for backwards
	 * compatibility reasons) x and y are ignored and the player's current
	 * position is used instead. */
	void save_checkpoint(int x, int y, bool use_position);
}

class user_script {
	/* Get input api object if currently in editor mode. */
	get_input_api();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment