Thread: Clients Public Chat Name :

Results 1 to 5 of 5
  1. #1 Clients Public Chat Name : 
    Registered Member
    Join Date
    Jun 2017
    Posts
    30
    Thanks given
    1
    Thanks received
    0
    Rep Power
    26
    So, for ironmen, they're name appears over the : in the chatbox but not in public chat. Anyone know where to find this? I can only find the public chat and private messages part of it but not the standard part where it overlaps with the :



    Reply With Quote  
     

  2. #2  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    941
    Thanks given
    46
    Thanks received
    146
    Rep Power
    354
    The bottom of your "drawChatArea" method (don't quote me on the exact name) should look something like this:
    Code:
    DrawingArea.defaultDrawingAreaSize();
        clnt.anInt1211 = j * 14 + 7 + 5;
        if(clnt.anInt1211 < 111)
            clnt.anInt1211 = 111;
        clnt.drawScrollbar(114, clnt.anInt1211 - Client.anInt1089 - 113, 7, 496, clnt.anInt1211);
        String s;
        if(Client.myPlayer != null && Client.myPlayer.name != null)
            s = Client.myPlayer.name;
        else
            s = TextClass.fixName(Client.myUsername);
        textDrawingArea.drawTextLeft(0, s + ":", 133, 11);
        textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidthExclCode(s + ": "), clnt.inputString + "*", 133, false);
        DrawingArea.drawHorizontalLine(121, 0x807660, 506, 7);
    }
    drawChannelButtons();
    if (Client.menuOpen) {
        clnt.drawMenu(0, 338);
    }
    chatAreaImageProducer.drawGraphics(338, clnt.graphics, 0);
    Client.mainScreenImageProducer.initDrawingArea();
    Texture.lineOffsets = Client.anIntArray1182;
    I've marked the related parts in bold red. The 11 and 12 you see there are parts you want to look at.
    Most likely the 11.
    My informative threads:
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jun 2017
    Posts
    30
    Thanks given
    1
    Thanks received
    0
    Rep Power
    26
    Quote Originally Posted by TheChosenOne View Post
    The bottom of your "drawChatArea" method (don't quote me on the exact name) should look something like this:
    Code:
    DrawingArea.defaultDrawingAreaSize();
        clnt.anInt1211 = j * 14 + 7 + 5;
        if(clnt.anInt1211 < 111)
            clnt.anInt1211 = 111;
        clnt.drawScrollbar(114, clnt.anInt1211 - Client.anInt1089 - 113, 7, 496, clnt.anInt1211);
        String s;
        if(Client.myPlayer != null && Client.myPlayer.name != null)
            s = Client.myPlayer.name;
        else
            s = TextClass.fixName(Client.myUsername);
        textDrawingArea.drawTextLeft(0, s + ":", 133, 11);
        textDrawingArea.drawChatInput(255, 12 + textDrawingArea.getTextWidthExclCode(s + ": "), clnt.inputString + "*", 133, false);
        DrawingArea.drawHorizontalLine(121, 0x807660, 506, 7);
    }
    drawChannelButtons();
    if (Client.menuOpen) {
        clnt.drawMenu(0, 338);
    }
    chatAreaImageProducer.drawGraphics(338, clnt.graphics, 0);
    Client.mainScreenImageProducer.initDrawingArea();
    Texture.lineOffsets = Client.anIntArray1182;
    I've marked the related parts in bold red. The 11 and 12 you see there are parts you want to look at.
    Most likely the 11.
    Code:
    String s;
    				if (myPlayer != null && myPlayer.name != null && myPlayer.title.length() > 1)
    					s = myPlayer.title + " " + myPlayer.name;
    				else
    					s = TextClass.fixName(capitalize(myUsername));
    				int xOffset = 10;
    				if (myPlayer.getRights() > 0) {
    					modIcons[myPlayer.getRights() - 1].drawSprite(9, 122 + yOffset);
    					newRegularFont.drawBasicString(fixedString + "", 22, 133 + yOffset, 0, -1);
    					xOffset += modIcons[myPlayer.getRights() - 1].myWidth;
    				} else {
    					xOffset += 1;
    					newRegularFont.drawBasicString(fixedString + "", 10, 133 + yOffset, 0, -1);
    				}
    				textDrawingArea.method385(0, ": ", 133 + yOffset, (xOffset + textDrawingArea.getTextWidth(s))); //chat box
    				if (!isFieldInFocus())
    					newRegularFont.drawBasicString(inputString + ((loopCycle % 40 < 20) ? "*" : "*"),
    							xOffset + textDrawingArea.getTextWidth(s + ": "), 133 + yOffset, 255, -1);
    				DrawingArea.method339(120 + yOffset, 0x807660, 506, 7);
    			}
    Marked in red is the : that I am needing, thank you for that. However, why is it that only the ironman icon pushes the name to the right and no other icon but it's fine in public chat?
    Reply With Quote  
     

  4. #4  
    Registered Member
    TheChosenOne's Avatar
    Join Date
    Jan 2013
    Posts
    941
    Thanks given
    46
    Thanks received
    146
    Rep Power
    354
    I have just aligned your screenshots and in the ironman example the playername is placed too far to the right. The ':' is fine.
    That makes me think the icon is the result of a playerRight and since the icon is smaller than the modIcon, the '22' offset is incorrect.
    You should not make this fixed. Instead, make it relate to the icon width and the xOffset.

    Instead of:
    Code:
    if (myPlayer.getRights() > 0) {
    	modIcons[myPlayer.getRights() - 1].drawSprite(9, 122 + yOffset);
    	newRegularFont.drawBasicString(fixedString + "", 22, 133 + yOffset, 0, -1);
    	xOffset += modIcons[myPlayer.getRights() - 1].myWidth;
    } else {
    	xOffset += 1;
    	newRegularFont.drawBasicString(fixedString + "", 10, 133 + yOffset, 0, -1);
    }
    You could use:
    Code:
    if (myPlayer.getRights() > 0) {
    	modIcons[myPlayer.getRights() - 1].drawSprite(9, 122 + yOffset);
    	xOffset += modIcons[myPlayer.getRights() - 1].myWidth - 2; //<<< Change the value here until it looks ok.
    }
    newRegularFont.drawBasicString(fixedString + "", xOffset, 133 + yOffset, 0, -1);
    xOffset += 1;
    Basicly your icon is smaller than the mod icon. You calculate the place of the ':' based on the icon width (which is correct) but you place your name at a fixed position of '22'.
    Since your ironman icon is smaller, the offset of '22' should be smaller as well (for the ironman icon). So you have to calculate the '22' based on the actual icon width (+ or - some pixels to make it look nicer).
    My informative threads:
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Registered Member
    Join Date
    Jun 2017
    Posts
    30
    Thanks given
    1
    Thanks received
    0
    Rep Power
    26
    Quote Originally Posted by TheChosenOne View Post
    I have just aligned your screenshots and in the ironman example the playername is placed too far to the right. The ':' is fine.
    That makes me think the icon is the result of a playerRight and since the icon is smaller than the modIcon, the '22' offset is incorrect.
    You should not make this fixed. Instead, make it relate to the icon width and the xOffset.

    Instead of:
    Code:
    if (myPlayer.getRights() > 0) {
    	modIcons[myPlayer.getRights() - 1].drawSprite(9, 122 + yOffset);
    	newRegularFont.drawBasicString(fixedString + "", 22, 133 + yOffset, 0, -1);
    	xOffset += modIcons[myPlayer.getRights() - 1].myWidth;
    } else {
    	xOffset += 1;
    	newRegularFont.drawBasicString(fixedString + "", 10, 133 + yOffset, 0, -1);
    }
    You could use:
    Code:
    if (myPlayer.getRights() > 0) {
    	modIcons[myPlayer.getRights() - 1].drawSprite(9, 122 + yOffset);
    	xOffset += modIcons[myPlayer.getRights() - 1].myWidth - 2; //<<< Change the value here until it looks ok.
    }
    newRegularFont.drawBasicString(fixedString + "", xOffset, 133 + yOffset, 0, -1);
    xOffset += 1;
    Basicly your icon is smaller than the mod icon. You calculate the place of the ':' based on the icon width (which is correct) but you place your name at a fixed position of '22'.
    Since your ironman icon is smaller, the offset of '22' should be smaller as well (for the ironman icon). So you have to calculate the '22' based on the actual icon width (+ or - some pixels to make it look nicer).
    My man, thank you!
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 07-11-2015, 03:09 PM
  2. Client Public Chat
    By Bow in forum Help
    Replies: 6
    Last Post: 05-27-2012, 07:35 PM
  3. How to change Public chat off, on, hide etc
    By tucybro in forum Tutorials
    Replies: 3
    Last Post: 06-20-2009, 02:14 AM
  4. [508]Enter CLan Chat name...Interface
    By Anthony-| in forum Requests
    Replies: 8
    Last Post: 06-06-2009, 11:24 AM
  5. Public chat being handled wrong?
    By Zee Best in forum RS 503+ Client & Server
    Replies: 13
    Last Post: 03-31-2009, 09:02 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •