Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions/events to make more responsive UIs #433

Closed
znepb opened this issue Apr 29, 2020 · 4 comments
Closed

Functions/events to make more responsive UIs #433

znepb opened this issue Apr 29, 2020 · 4 comments
Labels
area-Core This affects CC's core (the Lua runtime, APIs, computer internals). enhancement An extension of a feature or a new feature. feedback wanted Tell me what you want, what you really really want. wontfix A bug which I won't fix or an enhancement which won't be implemented.

Comments

@znepb
Copy link
Contributor

znepb commented Apr 29, 2020

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.

@znepb znepb added the enhancement An extension of a feature or a new feature. label Apr 29, 2020
@dmarcuse
Copy link
Contributor

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?

@znepb
Copy link
Contributor Author

znepb commented Apr 29, 2020

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

@Lemmmy Lemmmy mentioned this issue Apr 30, 2020
3 tasks
@SquidDev SquidDev added area-Core This affects CC's core (the Lua runtime, APIs, computer internals). feedback wanted Tell me what you want, what you really really want. labels Apr 30, 2020
@SquidDev SquidDev linked a pull request Apr 30, 2020 that will close this issue
3 tasks
@SquidDev
Copy link
Member

SquidDev commented Jul 3, 2020

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.

@SquidDev SquidDev closed this as completed Jul 3, 2020
@SquidDev SquidDev added the wontfix A bug which I won't fix or an enhancement which won't be implemented. label Jul 3, 2020
@Lemmmy
Copy link
Contributor

Lemmmy commented Jul 14, 2020

thank god for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Core This affects CC's core (the Lua runtime, APIs, computer internals). enhancement An extension of a feature or a new feature. feedback wanted Tell me what you want, what you really really want. wontfix A bug which I won't fix or an enhancement which won't be implemented.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants