Accessing UIElements for PlayerIcons on Minimap
#1
Hi,

I am currently working on accessing the UIElements for PlayerIcons on the minimap and showing/hiding them.

What I have already found is the parent's UIElement (minimap)

I have two possibilities in mind, how to
1) find UIELements for playerIcons
2) find out the respective pid for the icon

(I) Finding an adress where the playerIcons are initialized and grabbing the pid
(II) Starting from the minimap elements and iterating through all children elements and grabbing the pid


This is what I got from documentation

Code:
  /* 0x68 */ UIControlCollection m_children;

Source: https://github.com/mkwcat/mkw-tournament...trol.h#L98

and

Code:
struct UIControlCollection {
    UIControlCollection();
    ~UIControlCollection();

    void init(UIControl* parent, int count);
    void set(int index, UIControl* control);

    /* 0x00 */ UIControl** m_children;
    /* 0x04 */ UIControl** m_children2;
    /* 0x08 */ UIControl* m_parent;
    /* 0x0C */ UIControl* m_root;
    /* 0x10 */ int m_count;
};

Source: https://github.com/mkwcat/mkw-tournament...trol.h#L32

So as the m_children and m_children2 are 2 bytes each I guess this value is some sort of index of the collection and not the item itself?
1) How do I iterate through all child objects
2) How do I get the pid of the player the icon represents?
Reply
#2
In case you might want to hide/show particular PlayerIcons yourself:

1) at 0x807ea318 the pointer to the array of the Elements is stored in r3
2) each element has a length of 0x1cc
3) Element for n-th Player is then stored at r3 + (n - 1)*0x1cc
4) the type is inhereted from UIElement so the bit to hide is 0x80 (1 = hide, 0 = visible)
5) each frame CtrlRace2DMapCharacter_calcSelf is called and the bit is set to 1 if the player's a ghost and 0 if not. So you want to NOP those instructions at 0x807eb2c4 and 0x807eb2d0 (otherwise they will interfere with you manually setting the bits)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)