CC: Tweaked

CC: Tweaked

57M Downloads

Functions/events to make more responsive UIs

znepb opened this issue ยท 4 comments

commented

Functions and events

mouse_move (mouse_hover)

Basically, detects when the mouse is moved between CC pixels. Of course this would only work on advanced computers. What it returns would probably be similar to mouse_click. If the mouse were to move outside of the screen area, the event wouldn't be called until it goes inside the screen area again.

term.getMousePosition()

This function would return the current mouse position on the screen. If it isn't within the screen's area, it would return nil.

Why this would be useful

Currently, UIs are quite boring in CC. Adding these functions and events would give developers the opportunity to make better looking UIs.

commented

Having sat on this for a couple of months, I'm still not happy with this and so am going to close for now. It rather irks me - I can't place why I don't like the idea of it, it just feels not CC enough, and I really don't want to do something I'll later end up regretting.

commented

thank god for that

commented

This has come up quite a few times in the past - here's some of the common counterarguments for consideration.

  • CC is not exactly fast, especially on larger servers - adding more events that are updated so frequently would just add to this
  • How would it work with multiple players accessing a computer in multiplayer?
  • How would CC programs detect the mouse exiting the screen or the interface being closed?
commented

To solve the second issue, the last person who clicked would send the mouse move events. The third issue, possibly a mouse_exit event?