mIRC Home    About    Download    Register    News    Help

Topic Options
#219936 - 03/04/10 02:24 AM drawtext color (7.0 beta16)
Horstl Offline
Hoopy frood

Registered: 03/11/06
Posts: 1559
Loc: Germany
Code:
; /drawtest <text color number>
alias drawtest {
  var %win = @drawtest
  if ($window(%win)) { window -c %win }
  window -pCBk0d +bnf %win 0 0 178 150

  var %c(te) = $1

  var %c(bg) = 00, %c(bo) = 01, %c(fi) = 15, %font = Tahoma
  var %x = 30, %y = 30, %w = 115, %h = 60, %e = 18
  drawfill %win %c(bg) %c(bg) 0 0
  drawrect -dn %win %c(bo) 0 %x %y %w %h %e %e
  drawrect -fdn %win %c(fi) 0 $calc(%x +1) $calc(%y +1) $calc(%w -2) $calc(%h -2) %e %e
  drawtext -n %win %c(te) %font 25 $calc(%x +10) $calc(%y +15) TEST %c(te)
  drawpic %win
}

6.35 draws the text in white for "/drawtest 00" and in black for "/drawtest 01" - as expected.
7.00 beta16 oddly draws in white (or better: in color 00) for both commands smirk...

PS: Big Thanks for the new version! smile
PPS, as related to colors: In general, I like the new internal check for "same foreground/background colors". Scripted sollutions had been a bit long winded. However, now there's no way left to "enforce" same colors (for whatever reason)... maybe new switches for echo and aline...? But then, I'm sure there will be a discussion about the feature anyway and I don't want to anticipate it here in bug reports.


Edited by Horstl (03/04/10 02:52 AM)

Top
#219939 - 03/04/10 03:01 AM Re: drawtext color (7.0 beta16) [Re: Horstl]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3462
Loc: France
Quote:
7.00 beta16 oddly draws in white (or better: in color 00) for both commands smirk...
Must be a typo, because I get black text for 00 and 01 on 7.00
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#219942 - 03/04/10 04:25 AM Re: drawtext color (7.0 beta16) [Re: Wims]
Horstl Offline
Hoopy frood

Registered: 03/11/06
Posts: 1559
Loc: Germany
Nope, but it depends on your $color(background). smile
Note that I didn't change the colors of the palette itself, I only picked a different color for "background" at view > color.
The behaviour is in some way related to aforesaid new feature. But, in my opinion, that feature must not affect /draw* at all.

If you got white (00) for "background" (not at /drawfill - in the dialog), it will drawtext 00 in $color(normal) and 01 in black. If you set a black (01) BG, it will drawtext 00 in white and 01 in $color(normal). And if you picked red (04) as your background color, it will drawtext 00 as white, 01 as black but... you guess right: not red for 04, but $color(normal).
Note that $color(normal) again may digress from the color you picked - if it's the same as $color(background). Example: if (for whatever reason) you set "normal text" and "background" both to white, mIRC attempts to draw the text in a readable way. The result ironically is quite the contrary: /drawtext 00 won't draw in "white" or "black" but in grey (15) - the very grey of the box in my example script laugh


Edited by Horstl (03/04/10 04:40 AM)

Top
#219960 - 03/04/10 10:40 AM Re: drawtext color (7.0 beta16) [Re: Horstl]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4343
Loc: London, UK
Thanks, I agree, the new foreground/background color check should not apply to /drawtext - this has been fixed for the next beta. I may add a switch to /drawtext to enable the option as well.

Top
#219999 - 04/04/10 12:33 AM Re: drawtext color (7.0 beta16) [Re: Khaled]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
This seems to also be true for normal text.

04,04 test

Results in default text color on a red background.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#220004 - 04/04/10 01:29 AM Re: drawtext color (7.0 beta16) [Re: Riamus2]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3462
Loc: France
This is a feature, it is just unwanted for /drawing
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#220005 - 04/04/10 01:30 AM Re: drawtext color (7.0 beta16) [Re: Wims]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Far as I am concerned, it's unwanted for text as well. If I want something to be "hidden", it should be possible. If the foreground and background colors are specified, then it's meant to be the same and mIRC shouldn't try to "fix" what is done on purpose.

Example of usage:
Trivia scripts sometimes place random "hidden" characters between words to help prevent cheating. Yes, those can be bypassed, but it takes a little more knowledge to do so, so it does cut down on it.

Creating a bar of some sort can be done by using a "hidden" character repeated over and over. This one can be done by using control characters that aren't visible, but doubles the length of the line because you have to use a control character between every space.

When using hotlinking, if you need to hotlink multiple words and don't want a space between the words to be unclickable, you can "hide" a character between the words. That lets you click anywhere, including between the words and it's not visible unless highlighted/copied.

There are other reasons why you'd want to have the same foreground and background colors. Having this be a setting or switch or whatever is not a good idea either. Yes, a setting or switch is fine locally. But when sending something over the network (/msg, /say, etc), you can end up showing really messed up text that many users won't have any idea how to fix (such as for those trivia scripts).

I really strongly recommend NOT trying to fix what we purposely do.


Edited by Riamus2 (04/04/10 02:11 AM)
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#220006 - 04/04/10 01:33 AM Re: drawtext color (7.0 beta16) [Re: Riamus2]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3462
Loc: France
I agree, it should be optional, should have a switch for /draw* /echo (maybe /msg ?) and an option in mirc to disable this for incoming message
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#220025 - 04/04/10 12:49 PM Re: drawtext color (7.0 beta16) [Re: Riamus2]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4343
Loc: London, UK
This is actually a basic usability issue: it should never have been the case that users with one color scheme cannot read text from those with a different color scheme, eg. if you have your background set to white and someone else has it set to black, and you then say "^K1Hello", it will be invisible to the other user. Communicated text should always be visible.

A good example of this is the server MOTD for irc.paraphysics.org, where they use a white foreground color for some of the text which makes it invisible in the default mIRC color scheme.

I think it might be possible to resolve this issue without removing the feature: if only a foreground color is being used, mIRC will check for duplicate foreground/background colors and fix the foreground color if necessary. However if both a foreground and background color are used, no check is performed.

Does that make sense/sound reasonable?

Top
#220026 - 04/04/10 12:50 PM Re: drawtext color (7.0 beta16) [Re: Wims]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4343
Loc: London, UK
Making this an option would result in more display inconsistency across clients unfortunately.

Top
#220029 - 04/04/10 02:02 PM Re: drawtext color (7.0 beta16) [Re: Khaled]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3462
Loc: France
The feature is good in itself, but as you can see, some people use the same background and foreground color on purpose.
Quote:
it should never have been the case that users with one color scheme cannot read text from those with a different color scheme
It has been like that for years and noone seems to complain wink .
Imo, the feature should be applied regardeless of how the line is, but it have to be optionnal (per channel and per network would be really good) or you will have frustrated users frown
Quote:

Making this an option would result in more display inconsistency across clients unfortunately.
Not sure how, people that don't want the feature will just disable it and will see the message as usual, others will make use of the feature.Most users are already overriding the display with a script and are already displaying a different line comparing to the original anyway


Edited by Wims (04/04/10 02:34 PM)
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#220032 - 04/04/10 02:44 PM Re: drawtext color (7.0 beta16) [Re: Wims]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4343
Loc: London, UK
I have received many comments on this issue in the past, and it has been on my to-do list for years, that is the reason I made the change.

As Riamus2 explained, scripters want to be able to control the display of text for aesthetic or other reasons. If I make this an option, it will 1) make it impossible for scripters to know whether using a certain color format will appear the way that they expect since it will depend on a user's settings, unless 2) I add a special identifier that indicates whether this feature is on or off, which will 3) require scripters to display text in at least two different ways depending on the setting.

That is just too complicated. This was meant to be a small change to improve readibility, not to add another layer of complexity. I have removed this feature from the next version for now.

Top
#220033 - 04/04/10 03:18 PM Re: drawtext color (7.0 beta16) [Re: Khaled]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Originally Posted By: Khaled
I think it might be possible to resolve this issue without removing the feature: if only a foreground color is being used, mIRC will check for duplicate foreground/background colors and fix the foreground color if necessary. However if both a foreground and background color are used, no check is performed.

Does that make sense/sound reasonable?


Yes, that sounds like the perfect solution. I have no problems with it changing the color to make it visible if no background color is used. It's only when the background color is used that it matters. If we use a background color, then it doesn't matter what mIRC's background color is because we're setting our own background color, so it shouldn't try to fix anything.

The good thing with the fix when no background color is applied is that Invision can drop Visufix, which also fixes text to make it visible, though it takes it a step further and tries to keep the color as close to the original as possible while still being visible instead of just making it the default color.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#220038 - 04/04/10 04:41 PM Re: drawtext color (7.0 beta16) [Re: Khaled]
Horstl Offline
Hoopy frood

Registered: 03/11/06
Posts: 1559
Loc: Germany
Likewise to me,
a) If no bg color for some text is given, one can asume that identical colors of text and $color(back) are by accident, and apply the feature.
b) If the text has bg coloring, one can assume that identical colors are indeed intended, and keep the display as-is.
I don't see a need for a general switch (options checkbox) plus $identifier, nor the need for switches for /echo and /aline either, if the feature will account for b).

My "bug" report was only about /drawtext - as you may have not 2-3 but an infinite no. of color "layers" in a picwin. In addition, /drawtext is imho not used incidentally but by "advanced" scripts. At least to a high degree one can assume any color overlaps are "intended" here.
And the possible switch for /drawtext you brought up would comfortably allow scripters to display their text visible even if they don't want to /drawfill or the like a specific color first, but use the window's default bg color.
smile

Top
#220042 - 04/04/10 05:17 PM Re: drawtext color (7.0 beta16) [Re: Khaled]
genius_at_work Offline
Hoopy frood

Registered: 08/10/05
Posts: 1741
I agree that the ideal solution seems to be to only apply this auto-color-change functionality when no background color is explicitly given. As others have stated, if someone chooses to specify fg and bg colors that are difficult or impossible to read, then that is their decision, and the text should be displayed without being changed.

-genius_at_work

Top
#220165 - 06/04/10 04:19 PM Re: drawtext color (7.0 beta16) [Re: Khaled]
eXonyte Offline
Pikka bird

Registered: 18/08/07
Posts: 12
Originally Posted By: Khaled
I think it might be possible to resolve this issue without removing the feature: if only a foreground color is being used, mIRC will check for duplicate foreground/background colors and fix the foreground color if necessary. However if both a foreground and background color are used, no check is performed.

Does that make sense/sound reasonable?


As someone who used the default mIRC theme with color tweaks for over 10 years, I have to agree with this option. I always wanted the feature but it was just too much trouble to write a new theme just to have it.

Top
#220404 - 13/04/10 01:20 PM Re: drawtext color (7.0 beta16) [Re: Horstl]
bitmaster Offline
Nutrimatic drinks dispenser

Registered: 18/05/03
Posts: 8
Loc: The Netherlands
I also noticed text being shown where it should have been 'hidden'. I came to the forum to see if anything has been reported about it and found this topic.

I use 'hidden' characters (color 1,1) in my server MOTD which are now shown and make everything look improper. I used them with good reason:

In the old days, I used to make a lot of drawings, usually lighter colors on a black background; I filled every line with the same amount of characters to get a nice black rectangle around it to make it look good for viewers using a white background. At first I used spaces to fill the empty space with blackness, but then I noticed there were IRC clients/addons that cropped multiple spaces to one single space. This problem could be solved in two ways: I could give every space a new colorcode to not have those clients/addons crop the multiple spaces. But that made drawings a bit hoggy, since the client had to parse a colorcode for every character. It also made lines very long and limited the possibilities. I chose for the second way: to use different characters than a space to fill my drawing. It didn't matter what characters I used to fill empty space because you wouldn't see them... But with the latest change in the beta, you do.
_________________________
Blizzard.NL.EU.synIRC.Net

Top
#220497 - 16/04/10 07:36 AM Re: drawtext color (7.0 beta16) [Re: bitmaster]
bitmaster Offline
Nutrimatic drinks dispenser

Registered: 18/05/03
Posts: 8
Loc: The Netherlands
I see that in the latest BETA release 7.01, Khaled has restored it. This is a great relief to me... Thanks.
_________________________
Blizzard.NL.EU.synIRC.Net

Top