[REL] ProfilePic+ [72996]

Discussion in 'Released Mods' started by LavaSnake, November 5, 2013.

  1. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    On line 19 you have
    Code:
    var Username = model.displayName();
    Change that to this to get the forum name.
    Code:
    var Username = model.uberName();
    For me, model.displayName() == "Captain Conundrum" and model.uberName() == "cptconundrum"
  2. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Thanks! I just released a bug fix that fixes those issues. I can't really make it transparent since that would just show the menu div beneath it which doesn't look any better.
    Quitch and cptconundrum like this.
  3. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    What's with the bar under the picture with a white box in it?
  4. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    That's your PA Stats Ladder data. It's the sig pic that can be found on the ladder for any player that uses PA Stats.
    Quitch likes this.
  5. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    For some reason clicking on it does nothing. It did the first time I loaded PA with the mod, but not anymore, even if I quit and reload the game. Click my profile pic still works fine.

    My profile pic didn't show up, I just got a grey box. If I manually enter the URL of the picture it works fine, but I'd like the autoload functionality. Unfortunately I don't recall what the default URL was, something something facebook.jpg.

    Awesome additions BTW.
    Last edited: February 24, 2014
  6. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Thanks! Do you know how to use the UI debugger tool? If so I can give you a command that will reset your pic setting so you can get the default one again. Also, the PA Stats Ladder box isn't supposed to do anything when clicked.
  7. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    I guess I must have missed it and hit the picture then.

    I haven't used the debugger before but I'm sure I can figure it out. Hit me with the command!
  8. mishtakashi

    mishtakashi Active Member

    Messages:
    369
    Likes Received:
    217
    Nice job on the ladder inclusion :)
  9. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Thanks!

    ok, so follow these steps and post the results here please.
    1. Launch PA and log in but stay on the main menu.
    2. Go to your PA install directory (for windows it's along the lines of C:\Program Files (x86)\Planetary Annihilation).
    3. From there find \PA\Coherent\Debugger\. Then open the folder that matches your system and launch the Debugger program found in there.
    4. In the debugger window click go, then the top link, then the red x in the bottom right hand corner.
    5. Now near the bottom you will see a > that you can type next to. Paste this command there:
      Code:
      model.uberName()
      and post the result.
    6. Now run this command:
      Code:
      localStorage.removeItem("LProfilePic_URL")
      This will reset your setting for the profile pic.
    7. Now switch back to PA and hit F5 to reload the UI.
    8. Go back to the debugger and copy the last group of logged items that start with "LProfilePic". It should include a line that says "Pic found to use as default...". That will include the default URL it generated.
    9. After you post that here you can set your picture again and go back to enjoying the mod while I try to figure this out.
    Quitch likes this.
  10. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    model.uberName()
    quitch

    LProfilePic: Waiting for sign in
    LProfilePic: Pic found to use as default: https://forums.uberent.com/data/avatars/l/face/facebook.com.jpg
    LProfilePic: Settings checked.
    LProfilePic: Config UI added.
    LProfilePic: Ladder pic done.
    LProfilePic: Post sign in setup done.
    GET http://pastats-ladder.gamestown24.de/avatars/Quitch.png 404 (Not Found) pastats-ladder.gamestown24.de/avatars/Quitch.png:1
    GET https://forums.uberent.com/data/avatars/l/face/facebook.com.jpg 404 (Not Found) forums.uberent.com/data/avatars/l/face/facebook.com.jpg:1
    LProfilePic: UI updated.
    GET https://forums.uberent.com/data/avatars/l/face/facebook.com.jpg 404 (Not Found) facebook.com.jpg:1

    It can't get the ladder info I presume because that URL is no longer valid, the ladder moved to http://ladder.pastats.tk/ and the link should apparently be http://ladder.pastats.tk/avatars/3829.png
    LavaSnake likes this.
  11. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Here you go, this works for me:
    Code:
    var image = $(xhr.responseText).find(".avatarScaler").find("img");
    var url = image.attr("src");
    window.localStorage.LProfilePic_URL = "https://forums.uberent.com/" + url;
    It's much easier to use JQuery to do the finding than to use string manipulation.
    Quitch likes this.
  12. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Well thanks a ton! I didn't know you could use jQuery like that on a string.
    Last edited: February 25, 2014
  13. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Thanks! It seems that I'm using the wrong URL system for PA Stats Ladder. I'll ask the modder who made it for the best way to get the new player id for that. Once that's figured out I'll combine it with Raevn's fix and update this mod. That should fix both of your issues.
    Quitch likes this.
  14. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Yeah it's handy :) Just wrap a html string in $() and it becomes a JQuery object.
    LavaSnake likes this.
  15. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    I'm releasing raevn's bug fix now. The update that will fix the PA Stats Ladder will come in a couple days once Cola_Colin finishes adding the URL for me to call.
    Quitch likes this.
  16. Quitch

    Quitch Post Master General

    Messages:
    5,850
    Likes Received:
    6,045
    I updated and it still didn't show, but I assumed that's because it was set too facebook.jpg, so I used the command you gave me to clear the variable

    localStorage.removeItem("LProfilePic_URL")

    Still doesn't work:

    I did this with every other mod disabled. The mod is showing as version 1.66.
  17. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Odd, could you post the URL it found for your pic too? It's in the config dialog. I removed that from the debugging log since I TRUSTED RAEVN WHEN HE SAID HE TESTED IT!! lol, now I wonder what's wrong...
  18. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,327
    Likes Received:
    2,125
    Tsk tsk, your mod, your responsibility. :p
    LavaSnake likes this.
  19. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    I know, and I did test it too. I was just poking fun at him because it might actually still be broken.
  20. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,327
    Likes Received:
    2,125
    I know, but I was simply poking fun at you. ;)

Share This Page