BattleTag Above Portrait  display problem menu

User Tag List

Results 1 to 8 of 8
  1. #1
    dcac's Avatar Member
    Reputation
    1
    Join Date
    Mar 2019
    Posts
    38
    Thanks G/R
    5/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    BattleTag Above Portrait display problem

    In the plugin code below,
    Can't I make my battletag username always appear first above the portrait?

    I want my name to always appear first.



    When I start a game in a room with other players, my name appears second, so I want to fix it to be first.

    If there's a way, please help me.

    Code:
     { layout = FontNames.GetTextLayout(player.BattleTagAbovePortrait); FontNames.DrawText(layout, x + 360 , y + 30  ); x+= sizex + 250;  } ;

    BattleTag Above Portrait  display problem
  2. #2
    RNN's Avatar Legendary
    Reputation
    873
    Join Date
    Sep 2018
    Posts
    1,148
    Thanks G/R
    108/835
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    That code doesn't apply any order, I don't know if I understood your question correctly, because you use the words "above" and "first".
    If you are displaying information about players, and you want to do it in a certain way by displaying yours first, you could use PortraitIndex (IPlayer) . Your portrait always appears first and its index is 0, and then they are assigned downwards 1, 2, 3.
    You just have to order them using OrderBy (you will need the line using System.Linq; at the beginning of the file).
    Example :


    var players = Hud.Game.Players.OrderBy(p => p.PortraitIndex);
    foreach (var player in players)
    {
    FontNames.DrawText(FontNames.GetTextLayout(player.BattleTagAbovePortrait), 200 , 200 + 20 * player.PortraitIndex);
    }
    (This code displays a list of player names vertically, starting with yours at position (200,200) and the following ones every 20 pixels)

  3. #3
    dcac's Avatar Member
    Reputation
    1
    Join Date
    Mar 2019
    Posts
    38
    Thanks G/R
    5/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the answer.

    I always want to be index number 0 = me
    And if you could also tell me the sentences that are arranged horizontally, I would really appreciate it.

  4. #4
    RNN's Avatar Legendary
    Reputation
    873
    Join Date
    Sep 2018
    Posts
    1,148
    Thanks G/R
    108/835
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    PortraitIndex is useful for sorting. To save data about characters, it's best to use Index or HeroId
    To display the names horizontally you either add them to a string in the foreach and then show them all at once, or you show them on the screen one by one increasing the X coordinate.

    Code:
    var nameslist = string.Empty
    foreach (var player in players)
    {
    	namelist = namelist + " " + player.BattleTagAbovePortrait;	// or namelist += " " + player.BattleTagAbovePortrait;
    }
    FontNames.DrawText(FontNames.GetTextLayout(namelist), 200 , 200);
    --- or ---

    Code:
    var xPos = 200;
    foreach (var player in players)
    {
    	var layout = FontNames.GetTextLayout(player.BattleTagAbovePortrait);
    	FontNames.DrawText(layout, xPos , 200);
    	xPos = xPos + layout.Metrics.Width + 5;    // or xPos += layout.Metrics.Width + 5;		
    }

  5. #5
    dcac's Avatar Member
    Reputation
    1
    Join Date
    Mar 2019
    Posts
    38
    Thanks G/R
    5/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you sooooooo much.
    It is so helpful to me, a layman.

    Thank you again and I will apply it well.
    I hope you have a day full of luck and happiness.

  6. #6
    dcac's Avatar Member
    Reputation
    1
    Join Date
    Mar 2019
    Posts
    38
    Thanks G/R
    5/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    var players = Hud.Game.Players.Where(p => p.HeroClassDefinition.HeroClass == HeroClass.Wizard);
    var players = Hud.Game.Players.OrderBy(p => p.PortraitIndex);

    I don't know how to apply both at the same time. (index & HeroClass)
    Sorry, but can you tell me?

  7. #7
    RNN's Avatar Legendary
    Reputation
    873
    Join Date
    Sep 2018
    Posts
    1,148
    Thanks G/R
    108/835
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Like this:
    var players = Hud.Game.Players.Where(p => p.HeroClassDefinition.HeroClass == HeroClass.Wizard).OrderBy(o => o.PortraitIndex);

  8. #8
    dcac's Avatar Member
    Reputation
    1
    Join Date
    Mar 2019
    Posts
    38
    Thanks G/R
    5/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by RNN View Post
    Like this:
    var players = Hud.Game.Players.Where(p => p.HeroClassDefinition.HeroClass == HeroClass.Wizard).OrderBy(o => o.PortraitIndex);
    oh p=>p o=>o ok

    I will try.

    I am so grateful for your knowledge and kindness.

    thank you.

Similar Threads

  1. Replies: 4
    Last Post: 11-19-2020, 04:18 PM
  2. Wowme problem :"failed to find a suitable display device
    By bobo_monkey in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 06-22-2009, 06:51 PM
  3. Display Problem
    By gtcool in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 12-19-2008, 05:28 PM
  4. Display ID problem
    By erebos in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 03-31-2008, 02:23 PM
  5. Display problem.
    By galcybele in forum World of Warcraft Emulator Servers
    Replies: 20
    Last Post: 10-19-2007, 05:44 AM
All times are GMT -5. The time now is 11:59 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search