everyone *g*
well your idea with the global object in the plugins config sounds weird and conflict-provoking if two addon writers make a "users" variable-database-thing.
additionally - as a fan of oop - I hate the thought that some magically vars exists outside of the object-context and you don't know where they come from ^^
ah well js... it's stupid and cool at the same time
i have some "get car infos info from prism and display cars on map" code lying around (the one on github is outdated) f someone wants to give it a try... i also have som multithreading example code which i could provide ^^
But multiple insim connections don't share buttons/clickids?
At least that's what I found out by starting prism twice and clicking a button; only one instance got the BTC packet.
Actually... it's not even html 5 as there is no canvas element involved
It's some wtf-html generation that creates a triangle by creating a div for each pixel-line with differing width's...
Ok, I promised Dygear to continue working on this, so this thread should be the central discussion topic for the ButtonManager/Button classes.
Let's start by specifying
The user (i.e. plugin writer) should be able to create new buttons with callbacks like in any other insim application. As prism is a multiuser/plugin system the user does not know which ClickIDs and areas of the screen are not already occupied by other plugins.
-> The main task of the Button system is to coordinate the assignment of ClickIDs to used buttons, so that no two plugins use the same ClickIDs.
Planned/partially implemented features:
Assignment of unique ClickIDs to buttons on a user/host basis
Restricting the ClickIDs in the hosts configuration
Named buttons. e.g. Deleting buttons by key
Grouping of buttons. e.g. Defining 5 buttons with the same group key and deleting them all with a single line of code
Callback functions to buttons for clicks and text input
Proposed features:
Reservation of an area on the screen to place buttons
Automatic update of an button on "Content" change
Throttling mechanism like Krammeh's for the above feature
TTL - automatic deletion after x seconds
Automatic deletion of buttons on certain events like race restarts
The assignment of the ClickIDs is the most important point which has to respect certain criterias:
- Upon sending a button has to have an unique ClickID
- After deletion the ClickID may be reassigned to another button
- Sending a button to all users should find a single ClickID which is not used for all users or one button for each user must be sent with user specific ClickIDs
-> The ClickIDs have to be on a host/user basis.
--
The current git version in the official repository is not ready to use. i.e. will probably crash after adding 240 buttons etc.
Please provide feedback on the proposed feature list and perhaps you even have more features to propose.
And while victor is on that he could add custom widgets for lfs world (or let's say custom "windows" which just involve an iframe and automatically sending the auth token to a specified url)
jeah thats one of the things i wasnt sure of. so its 239 buttons per conn and if you send a button to ucid 255 the clickid would need to be free for every user?
Setup:
Freshly downloaded and unlocked LFS Z28. No configuration of any kind changed!
Steps to reproduce:
- Start singleplayer
- shift+u
- enable autox editor
- place starting line (no camera movement)
- press alt+f4
Outcome:
Car is steerably with the mouse but LFS has already partially shut down.
i.e. no hud, no sound, no key inputs
LFS can only be closed by killing the process.
Last edited by Flame CZE, .
Reason : bug fixed in 0.6E11