MattJeanes / Joystick-Module

A joystick module for GMod, originally by NightEagle.
13 stars 14 forks source link

Show the text entity tooltip information and update the text value wh… #29

Closed dvdvideo1234 closed 3 years ago

dvdvideo1234 commented 3 years ago

…en longer than needed

dvdvideo1234 commented 3 years ago

I will now add wire_joystick_multi_ to be gathered from TOOL.Mode populated by the file name..

dvdvideo1234 commented 3 years ago

Think of adding a new button.. One that when clicker restores the convars into the control panel

dvdvideo1234 commented 3 years ago

@MattJeanes Done ;) now the tool name is taken from the file name which means no wire_joystick_multi_ flying around

dvdvideo1234 commented 3 years ago

@MattJeanes

This is because of the 17 character limit of the UID to send the feedback to the user with the actual convar value. If you do not go over the 17 character limit will be like a regular text entity and it will not trim the data ( the last character goes away ). The protection is triggered after more than 17 character are inserted and the tool-tip is automatically shown to remind the user that UID is alphanumeric only.

Please try also with non alphanumeric characters, as I see the original author intended UID to be hesh-like value, I am converting these to zeros.

Note:Joystick configurator will open when you hit world also ;)

Should the text entity stop receiving input from the user instead of trimming ?

dvdvideo1234 commented 3 years ago

Oh, and I also added presets as they were missing. Cheers !

MattJeanes commented 3 years ago

@dvdvideo1234 yes please prevent further input if the box is at capacity, the current behaviour results in weirdly overwriting the end of the string with new characters at the beginning, thanks

dvdvideo1234 commented 3 years ago

Do I need the OnLoseFocus to display the old variable value. It will be replaced with the new one anyway but it displays the convar value that is present within when you lose focus updates the panel. It will show you what was its value before you replace it.

dvdvideo1234 commented 3 years ago

@MattJeanes

Instead of the user to fill-up the text entities, he just writes a positive number and hits enter for the text field to fill-up instead with random alphanumeric string with the provided length ( negative are treated as zero ). This is a bit easier than manually inserting the hash UID like 2304gh82084h234n. It automatically fills it for you. But If you insist I can remove it ;)

MattJeanes commented 3 years ago

Oh okay I see, everything works it is not made very clear how this works ingame, maybe can you change the tooltip or something to explain how this works for users?

dvdvideo1234 commented 3 years ago

@MattJeanes

  1. Is is worth it to remove also the comments in the file like joywarn as the don't apply
  2. Is it worth to just pass i instead of local strI = tostring(i). Lua will concatenate it either way.
dvdvideo1234 commented 3 years ago

@MattJeanes It works for me: https://www.youtube.com/watch?v=Iykv3ZNWjRw

dvdvideo1234 commented 3 years ago

There is more work on the addon, for example ENT:Setup and ENT:Update are identical, but lets leave that for another PR ^_^

dvdvideo1234 commented 3 years ago

@MattJeanes Reduced the Vector() creation by using the class methods and saved trace from overwriting via GetNormalSpawn I think this is finally in a good place as long it is ok with you too. Removed the comment, because the creator is defined in Joystick\lua\entities\gmod_wire_joystick_multi\init.lua [301] May remove the other comment too, but don't know if the one is relevant.

MattJeanes commented 3 years ago

Looks to be working good now, thank you for your contribution it is much appreciated!