Page 1 of 1

Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 8:30 am
by Glyph
So here's a couple of freebies.

Health & win/loss bars
In the function game_spacer_image - in game_shared_display.php, if it hasn't been rearranged - replace /images/layout/spacer.gif (which no longer exists) with /images/spacer.gif (which still does).
Code: Select all
function game_spacer_image($w = 1, $h = 1, $alt = '')
{
    $w = max(intval($w), 1);
    $h = max(intval($h), 1);
    $alt = htmlentities($alt);
    return sprintf(
        '<img src="/images/spacer.gif" width="%d" height="%d" border="0" alt="%s" />',
        $w,
        $h,
        $alt
    
);
}
  

There may be other broken links to /images/layout/spacer.gif scattered around - I think I caught most of the hardcoded ones and replaced them with the game_spacer_image function, but I may not have got them all.

Colour picker palette
To make the palette show up correctly in the first place:
In character_edit.php, find the printf() call which draws the palette boxes. The template begins with:
Code: Select all
<td style="padding-top: 10px; background-color: %s"
and the first argument is:
Code: Select all
color_rgb2html($rgb)

Change 'background-color: %s' in the template to 'background-color: #%s'.

To fix the dynamic palette:
In the Javascript embedded in character_edit.php, add the following function:
Code: Select all
function hexstring (rgb)
{
    return '#' + int2base(rgb[0] * 255, 16) + int2base(rgb[1] * 255, 16) + int2base(rgb[2] * 255, 16);
}

Then, in the update_sat amd update_val functions:
Code: Select all
function update_sat (hue)
{
   curr_hue = hue;

   failsafe = 50;

   for (var i = 0; i < SAT_NUM_STEPS; i++) {
      failsafe--;
      if (failsafe <= 0) {
         alert ('Failsafe kicked in at i=' + i + ', its=' + its + '!');
         break;
      }

      rgb = hsv2rgb(hue, SAT_MIN + (i * SAT_STEP), VAL_MAX);
      cell = document.getElementById('cp_sat' + i);
      cell.style.backgroundColor = hex_string(rgb);
   }

   update_val (curr_sat);
}


function update_val (sat, new_val)
{
   hue = curr_hue;
   curr_sat = sat;

   failsafe = 50;

   for (var i = 0; i < VAL_NUM_STEPS; i++) {
      failsafe--;
      if (failsafe <= 0) {
         alert ('Failsafe kicked in at i=' + i + ', its=' + its + '!');
         break;
      }

      cell = document.getElementById('cp_val' + i);
      rgb = hsv2rgb(hue, sat, VAL_MIN + (i * VAL_STEP));
      cell.style.backgroundColor = hex_string(rgb);
   }
}
(That is, move the calls to int2base into a new function which also - this is the important bugfix - prepends '#' to the hex string.)

Also, the 'failsafe' loop is junk debug code that should be safe to remove.

Also also, you may want to call update_sat and update_val on page load, to ensure they take account of any pre-selection in the hue row.


HTH 8)

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 8:42 am
by Redimus
It really is annoying, it really is.

Here's hoping someone listens...

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 8:58 am
by Tammuz
i've missed you glyph.

but don't get you hopes up, OS doesn't seem inclined to work on HMW.

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 9:02 am
by Psychout
Ill leave it where he cant help but trip over it...

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 10:39 am
by Omega Sentinel
Tammuz wrote:but don't get you hopes up, OS doesn't seem inclined to work on HMW.
Indeed

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 10:51 am
by Redimus
*Sigh*

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 3:10 pm
by Absolute Zero
Maybe Glyph should come back and fix some of the problems?

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 3:20 pm
by Sharpwing
Maybe some people need to be patient.

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 3:25 pm
by Wingspan
Maybe I can finally get my cookie?

I came to the darkside; I want my cookie!!

Image

All will come in due time - or after sever nut-kickery - moderators choice.

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 3:49 pm
by Tammuz
Sharpwing wrote:Maybe some people need to be patient.



there's patience, and there's infinite patience; OS pretty much inferred he wants to wash his hands of V1, so why not let someone else look after it while OS is doing what ever OS is doing?

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 4:03 pm
by Absolute Zero
Tammuz wrote:
Sharpwing wrote:Maybe some people need to be patient.



there's patience, and there's infinite patience; OS pretty much inferred he wants to wash his hands of V1, so why not let someone else look after it while OS is doing what ever OS is doing?


Exactly.

Of course, it's easier to be patient when we know something's coming or being done and not being kept in the dark about some top secret black project like it's some governement military thing.

Don't let the yokles know nuttin. Who knows what they might do. They might get excited and spontaneously combust. :P

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 7:51 pm
by Redimus
Yeah, its been made pretty obvious that you are doing a 'V2' so why not admit it. At least then the general populace will see you are doing *something*, whereas right now it apears nothing is being done, and you are taking a damn long time in doing it.

We all dont mind waiting if we know something is being worked on.

We arnt asking for a final date, cuase most of us know that real life and programming problems will delay any date chosen.

All we want is for a little bit of honesty.

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 8:27 pm
by Absolute Zero
Not true. I'd like some cake.

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Mon Dec 01, 2008 10:51 pm
by Loki God Of Mischief
Who is Glyph and why is he so awesome? If he has that level of programming skill to provide fixes for the game just like that he should totally be programming with OS. The game would only be better for it.

Absolute Zero wrote:Not true. I'd like some cake.


It is delicious cake. You must eat it.

Re: Wow, those Firefox bar / palette glitches are annoying

PostPosted: Tue Dec 02, 2008 12:12 am
by Omega Sentinel
Fearless Echoes wrote:Yeah, its been made pretty obvious that you are doing a 'V2' so why not admit it. At least then the general populace will see you are doing *something*, whereas right now it apears nothing is being done, and you are taking a damn long time in doing it.
If I cared what you people thought of my performance or if you were my boss in any way, shape or form you would have an argument. Just know that I am doing nothing, I am worthless and do not have the ability to program my way out of a sack, let alone fix a status bar.

Fearless Echoes wrote:
We all dont mind waiting if we know something is being worked on.

We arnt asking for a final date, cuase most of us know that real life and programming problems will delay any date chosen.

All we want is for a little bit of honesty.
Honesty? Here's some honesty... You eagerly await any single word I might type in this forum to lynch mob it with a fury and then wonder why I never post anything. Its actually pretty funny. Its never really criticism but typically personal attacks. I get it. You don't like me. So now we have a little bit of honesty.

Merc With A Mouth wrote:Who is Glyph and why is he so awesome? If he has that level of programming skill to provide fixes for the game just like that he should totally be programming with OS. The game would only be better for it.
He was the former programmer whom I replaced. There were reasons for it which I am not at liberty to discuss here. What you are seeing here is the fact that he was liked by the mob and I am not. HMW is currently under a code freeze which is why you aren't seeing any enhancements/fixes right now.