Friday, December 18, 2009

Chrome YouTube Logo Middle-Click Extension

*Update - Version 1.50 of this extension also fixes the middle-click behavior of the video links in my_videos, my_favorites, and my_subscriptions.*

After finally switching from Firefox to Chrome as my main browser, I found a somewhat annoying bug in Chrome. While browsing YouTube, I noticed that middle clicking on the logo at the top didn't open a new tab as expected, but instead loaded the main page in the current tab. This was particularly annoying since I like to keep multiple tabs open when I browse, and I used the logo often to open a fresh tab for YouTube.

So, I decided to take some time to write a small extension to fix this; after about an hour (most of it spent on making icons; the actual javascript code for the fix is one line), I ended up with the "YouTube Logo Middle-Click Extension" (creative name huh?). While it's mostly just a workaround for an issue that should be addressed directly, I hope some people find it useful until the bug gets fixed.


Thursday, November 12, 2009

CSPSP: update



-new buy menu design (weapon stat bars still in progress)
-redid the held gun graphicns since reloading animation shows the entire gun
-fixed a bug where explosions would skip some players (was sorting the player list inside a loop)
-fixed a bug in the collision ray traversal code (forgot to break after reaching the final cell)

Monday, November 9, 2009

CSPSP: update



-new radar (enemies are shown only when they fire)
-if you die while throwing a nade, the nade still goes off
-found another potential multiplayer bug (dropping a gun/throwing a nade right before getting the dying message from the server would unsync the client)

Saturday, October 31, 2009

Wednesday, July 29, 2009

CSPSP: feet

Finally brought myself to work on cspsp again. I'm having second thoughts about dropping the counterstrike theme, since it doesn't seem like all of the effort to change things would be really worth it (the code is a ridiculous mess and I basically have to relearn what I wrote everytime I restart work on it. Seriously though, I once spent like thirty minutes trying to figure out why two files had blocks of the same exact collision code. Turns out I had tried to do some refactoring and moved the collision function to another class, but decided to just leave the previous code there [not sure what I was thinking {also, nested parentheses :b}]).

Anyways, I'm still planning to at least redo some of the graphics for cspsp. Today I managed to finish adding feet, which do actually make the players look a lot more like people (instead of crabs):















I'm actually considering just using solid colors for the players. I mean, I really do think that the plain white sprites (which were just for testing) in the screenshot above look better than the ugly normal sprites :/.

(those numbers in the screenshot are just the angle that the player is currently facing - I completely forgot the range and orientation of the angle >_>)

Friday, July 3, 2009

CSPSP code fail

So I was working on the clan system for CSPSP yesterday. Since it required changes to the player's model schema (clan was changed from a StringProperty to a ReferenceProperty), I decided to test out the small maintenance mode I had written into CSPSP (or thought I had written). Basically, it should have just given the player an "under maintenance" message when the state was set to STAGE_MAINTENANCE. Unfortunately, I failed at code copy-and-pasting, and this is what happened:
...
else if (mStage == STAGE_SUSPENDED) {
 mRenderer->FillRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,ARGB(255,0,0,0));
 gFont->DrawString("[O] Return",SCREEN_WIDTH_2,SCREEN_HEIGHT_F-20,JGETEXT_CENTER);

 gFont->SetScale(1.0f);
 char buffer[128];
 sprintf(buffer,"You are suspended for %i hour(s)",mSuspendHours);
 gFont->DrawString(buffer,SCREEN_WIDTH_2,SCREEN_HEIGHT_2-10,JGETEXT_CENTER);

 strcpy(buffer,"");
 sprintf(buffer,"Reason: %s",mSuspendReason);
 gFont->DrawString(buffer,SCREEN_WIDTH_2,SCREEN_HEIGHT_2+10,JGETEXT_CENTER);
}
else if (mStage == STAGE_SUSPENDED) {
 mRenderer->FillRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,ARGB(255,0,0,0));
 gFont->DrawString("[O] Return",SCREEN_WIDTH_2,SCREEN_HEIGHT_F-20,JGETEXT_CENTER);

 gFont->SetScale(1.0f);
 gFont->DrawString("The online system is currently under maintenance.",SCREEN_WIDTH_2,SCREEN_HEIGHT_2,JGETEXT_CENTER);
}
...

yeahhh...should have been mStage == STAGE_MAINTENANCE. Oh well. Means that for about half an hour people were unable to login properly (app engine was probably spitting out errors during that time).

Edit: Also, I hate naming variables. What would you name the reference variable of the Clan a Player leads? leadsClan? clanLeader? thisistheclanthatilead? And how about the date someone joined? joinDate or dateJoined? damnit ):

Edit2: eventually decided on leadsClan :|