Jump to content

[REL] Custom GUI Widget System


AriosJentu

Recommended Posts

Suggestion: Make ":setFont" method for all elements in your script. like: Edits, Memos, Tabs(Title), Window(Title).
It's easy because i already made those in my version.

Problem(Maybe not): When i use Dark red theme with my window, (into the window) i made my Tab panels the Labels, Check boxes(Label) Comes with gray color and this make it hard to read.
( I solve this by make the entire Labels, Check boxes again with dark red theme )  

  • Like 1
Link to comment
1 hour ago, iMr.WiFi..! said:

Suggestion: Make ":setFont" method for all elements in your script. like: Edits, Memos, Tabs(Title), Window(Title).
It's easy because i already made those in my version.

Problem(Maybe not): When i use Dark red theme with my window, (into the window) i made my Tab panels the Labels, Check boxes(Label) Comes with gray color and this make it hard to read.
( I solve this by make the entire Labels, Check boxes again with dark red theme )  

Thank you for suggestion and reporting :)

About problem - I understand it. The reason is - tabpanel's tab now haven't option to save color scheme from it's parent. I think I'll add it in future.

About fonts - I'll add them soon.

Edited by AriosJentu
Link to comment

Update: Added CustomStaticImage widgets:

- Added CustomStaticImage widgets. When using this as parent, it saves to object Color Scheme. Used with fixing next bug:

- Fixed bug when adding element to TabPanel, it wont saves color scheme of TabPanel

- Added functions setFont, setFontSize and setSystemFont for some widgets, like Window, Edits, Labels, Buttons, and etc. Almost for all widgets.

*setFont function used for set custom font (.ttf), and setSystemFont used for set default MTA fonts for widget.

  • Like 1
Link to comment
22 minutes ago, AriosJentu said:

Thank you. It now fixed.

Oki, I'll add it soon.

 

24 minutes ago, iMr.WiFi..! said:

And for Custom dialog too.

I recently edit the reply check it.


+

Problem (Line: 4981):
Using ":setSystemFont" of checkbox doesn't change font.
I solve this by changing line to: "checkbox.Label:setSystemFont(font)"

Edited by iMr.WiFi..!
  • Like 1
Link to comment
2 hours ago, iMr.WiFi..! said:

 

I recently edit the reply check it.


+

Problem (Line: 4981):
Using ":setSystemFont" of checkbox doesn't change font.
I solve this by changing line to: "checkbox.Label:setSystemFont(font)"

Thank you. In current version fixed bug with checkboxes and buttons, and added font functions to dialogs. In next update I'll try to add them for Tooltips.

Link to comment
1 hour ago, MrDadosz said:

Nevermind, there were commented lines in meta.xml. Really nice, but my i5-6500 can't handle it. 100% core usage when I'm moving my mouse on GUI from this resource :/

Give me example, where (or on what widget) you moving mouse and CPU usage is overloads. Is it on all widgets? 

Cuz I have i5-7200U, and U series are for laptops, and I haven't loading more than 20% of this resource.

Link to comment
On 22/09/2018 at 01:52, AriosJentu said:

Give me example, where (or on what widget) you moving mouse and CPU usage is overloads. Is it on all widgets? 

Cuz I have i5-7200U, and U series are for laptops, and I haven't loading more than 20% of this resource.

I used example.lua file included with script. I tested it today and I have big lagspikes when I'm moving main window to the bottom of the screen (left - right, right - left, down - up works normally, but moving it from top to bottom causes lag spikes).

Video:

 

Edited by MrDadosz
  • Like 1
Link to comment
  • Scripting Moderators
5 hours ago, MrDadosz said:

I used example.lua file included with script. I tested it today and I have big lagspikes when I'm moving main window to the bottom of the screen (left - right, right - left, down - up works normally, but moving it from top to bottom causes lag spikes).

Video:

 

try to create gui element, and move your cursor, then you will find the same thing.

Link to comment
9 hours ago, MrDadosz said:

I used example.lua file included with script. I tested it today and I have big lagspikes when I'm moving main window to the bottom of the screen (left - right, right - left, down - up works normally, but moving it from top to bottom causes lag spikes).

Video:

 

I know about this troubles. One of the reasons is events, like OnClientRender and OnClientCursorMove. In this events there is too many calculations per frame - getting and setting gui positions. And I haven't any ideas how to fix this, cuz this events must be as main events of system, used to moving/resizing functions, widget animations and etc.

Link to comment
10 hours ago, AriosJentu said:

OnClientCursorMove

shrink this events with variable to get last x and last y

if u didn't understood what i mean download my dxlib and search for  "onClientDxWindowMove" and you will got understand also if u want understand more just check "dxSetPosition"

Edited by Master_MTA
Link to comment
  • Scripting Moderators
1 hour ago, Master_MTA said:

shrink this events with variable to get last x and last y

if u didn't understood what i mean download my dxlib and search for  "onClientDxWindowMove" and you will got understand also if u want understand more just check "dxSetPosition"

This GUI Widget System is not based on dx

Link to comment
8 hours ago, Master_MTA said:

yeah i know am talking about calculation method 

Your calculation method can't be used here, because it needs to update position every time - every frame will be exec function "guiSetPosition", and it will have more lags, because this fuction executes in onClientRender, and it haven't any optimizations.

Link to comment

Update: Added Custom Text Boxes (CustomEdits analog, but with custom design)

- It can be fully transparent, and can be putted on some your-own objects

- Added functions to get caret selection parameters

For current time its not merged in win.lua, cuz now testing for bugs. You also can send me bug reports.

Note: This boxes will never get fonts for memo boxes, because coefficient of difference between two lines are different for all fonts.

Screenshot: (notice that this style is not recommending to use in current windows system style, but it demonstrate how does them looks like)

UMZasgP.jpg

And, of course, this can be overload your CPU, because it's GUI :D In future, I hope, I'll port this system to DX, but for now I haven't any ideas how to make on them layering and hiding parts of images in some frames (for scroll panes, for example)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...