Thread: Time Stamps in chat

Results 1 to 7 of 7
  1. #1 Time Stamps in chat 


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    22
    Posts
    9,747
    Thanks given
    1,756
    Thanks received
    3,096
    Rep Power
    5000


    Code:
        public static String getTime() {
            Calendar calendar = new GregorianCalendar();
            String meridiem;
            int hour = calendar.get(Calendar.HOUR);
            int minute = calendar.get(Calendar.MINUTE);
            meridiem = calendar.get(Calendar.AM_PM) == 0 ? "AM" : "PM";
            return "[" + hour + ":" + minute + " " + meridiem + "]";
        }
    compare&replace
    Code:
    if ((chatType == 1 || chatType == 2)
                                && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
                            if (chatTypeView == 1 || chatTypeView == 0) {
                                int xPos = 11;
                                if (Configuration.enableTimeStamps) {
                                    newRegularFont.drawBasicString(timeStamp, xPos, yPos + yOffset,
                                            changeChatArea ? 0xFFFFFF : 0, shadow);
                                    xPos += newRegularFont.getTextWidth(timeStamp);
                                }
                                if (playerRights >= 1) {
                                    modIcons[playerRights - 1].drawSprite(xPos, yPos - 12 + yOffset);
                                    xPos += 16;
                                }
                                newRegularFont.drawBasicString(title + s1 + ":", xPos - 3, yPos + yOffset,
                                        changeChatArea ? 0xFFFFFF : 0, shadow);
                                xPos += newRegularFont.getTextWidth(title + s1) + 8;
                                newRegularFont.drawBasicString(" " + chatMessages[k], xPos - 8, yPos + yOffset,
                                        changeChatArea ? 0x7FA9FF : 255, shadow);
                                j++;
                                j77++;
                            }
                        }
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jan 2011
    Posts
    1,916
    Thanks given
    368
    Thanks received
    331
    Rep Power
    0
    Thanks for this!
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Apr 2014
    Posts
    1,432
    Thanks given
    39
    Thanks received
    521
    Rep Power
    563
    i think galkon had this in his runelimited client
    Reply With Quote  
     

  4. Thankful user:


  5. #4  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    22
    Posts
    9,747
    Thanks given
    1,756
    Thanks received
    3,096
    Rep Power
    5000
    Quote Originally Posted by Zion View Post
    i think galkon had this in his runelimited client
    I think so, but not where this op post came from though.
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  6. #5  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    22
    Posts
    4,441
    Thanks given
    889
    Thanks received
    1,517
    Rep Power
    3031
    Thanks for the share
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #6  
    I need some more coffee

    Jason's Avatar
    Join Date
    Aug 2009
    Age
    23
    Posts
    5,872
    Thanks given
    2,174
    Thanks received
    2,554
    Rep Power
    3244
    Code:
    private final LocalTimeStringConverter converter = new LocalTimeStringConverter(FormatStyle.SHORT);
    
    String getTime() {
        return converter.toString(LocalTime.now());
    }
    Doesn't need to be anything more than that. It would return X:XX AM or X:XX PM because of the parameter FormatStyle.SHORT. None the less, good job.
    Reply With Quote  
     

  8. Thankful user:


  9. #7  
    Respected Member


    Galkon's Avatar
    Join Date
    Nov 2007
    Age
    14
    Posts
    7,521
    Thanks given
    1,744
    Thanks received
    2,790
    Rep Power
    5000
    Ripped straight from old clients lmao
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ][Only registered and activated users can see links. ][Only registered and activated users can see links. ]
    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: 6
    Last Post: 04-28-2009, 02:12 PM
  2. Replies: 18
    Last Post: 04-01-2009, 07:17 PM
  3. Changing the (arterisk) * In Chat And others
    By mr smith in forum Tutorials
    Replies: 7
    Last Post: 01-19-2009, 09:56 PM
  4. Replies: 1
    Last Post: 11-01-2008, 10:19 AM
  5. Total Time Online (in minutes)
    By Evil in forum Tutorials
    Replies: 8
    Last Post: 10-26-2008, 02:48 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •