Comments (6)
I see four possible solutions:
- Add a master SubtitleVisible property to control image, text and count rendering;
- Render image, text and count separately - and text only if not empty;
- Render image, text and count together, but only if all are set to valid values;
- Expose SubtitleImage property to allow manual removal of the entire subtitle;
What would you suggest? I will submit a PR.
from lemonui.
What do you mean with subtitle? Because the subtitle is the white text on a black background.
from lemonui.
What do you mean with subtitle?
The white text on a black background right under the title. In the image, 'Player' is not the subtitle, it's the first item of the menu. The subtitle background renders even when there is no subtitle nor item count.
This is how it's supposed to look when there is no subtitle.
from lemonui.
OH
I see it now.
In that case, to give more customization options, I would suggest an enum like SubtitleBehavior where it defines the behavior of the subtitle to 3 possible styles:
- Always show the background even if is empty, which should be the default (AlwaysShow = 0)
- Hide when there is no text, show when there is some (HideOnEmpty = 1)
- Always hide the subtitle and it's background (AlwaysHide = 2)
from lemonui.
This would conflict with the existing CountVisibility.
Maybe subtitle should be the entire line, which contains the Background, the Text and the Count properties? The count is already within the subtitle background anyways.
IMHO the way you're going with enums, it will get messy really fast with the multiple customizations. We could maybe try using one bit field enum to allow multiple configs, such as AutoCount, ShowText and HideBackground.
Looking at it now, might be better to have a separate Subtitle object, containing Background, Count and Text properties, and either a visibility config for each one, or a master bit field enum.
Either way, these changes imply in breaking changes, which I'm unsure how comfortable you are with. I could just create a PR with the changes I envision so you can review/modify them as you wish.
from lemonui.
I feel that it will complement CountVisibility to be honest.
With the Flag enums and Subtitle object, those would be a breaking changes which is not something I would like (NativeUI had some nasty breaking changes almost every single release before I helped with the most recent releases, and I wouldn't like to see that again).
from lemonui.
Related Issues (20)
- Make the BaseElement's properties virtual
- MsPerGameMinute used instead of GetGameTimer in Alt:V
- Replace Game.GameTime with GET_GAME_TIMER in RPH HOT 3
- Make sure that the LemonUI.RageMP.cs is included in the NuGet Package
- SubtitleFont is missing in 1.9.4+
- Submenu not displaying? HOT 3
- FiveM : Unable to use Exports when using LemonUI HOT 5
- Trying to move up or down in a menu with only separators will make the game hang HOT 2
- NativeItem's for selecting common types of values
- ForEach should raise an exception if the type is not compatible with the pool
- Add default constructors for NativeItem's that only take a Title and/or Description
- NativeItem.UpdateColors overrides don't properly call the parent UpdateColors function HOT 2
- NativeItem.Draw overrides don't draw the custom background HOT 1
- Documentation inclusion HOT 2
- FixIndexIfRequired in NativeListItem<T> might set the index under zero and cause an exception
- Typo in parameter of NativeMenu constructor HOT 1
- When using gamepad games, the icons of InstructionalButtons are still keyboard keys.
- Timer Bar Objectives Bug
- Implement SET_TEXT_DROPSHADOW in ScaledText HOT 2
- ScaledAnim does not has an override for DrawSpecific(PointF, PointF)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lemonui.