
Originally Posted by
-DefaulT
ill giveu a hint;
Trainer level:
T-Exp * 1.25 + 0.3333
No, Sorry, that Didn't work :(
Here is what I did.
In UI.java in the client.
below "this.add(m_moneyLabel);" I added.
Code:
// Trainer data labels
m_trainerLabel.setText("Wait");
m_trainerLabel.pack();
m_trainerLabel.setLocation(110, 6);
m_trainerLabel.setVisible(true);
m_trainerLabel.setFont(GameClient.getFontLarge());
m_trainerLabel.setForeground(new Color(255, 255, 255));
this.add(m_trainerLabel);
//
Then in the Method that starts with public void update(boolean money...etc
in the first IF statement I added. This below "m_moneyLabel.pack();"
Code:
m_trainerLabel.setText(""+(GameClient.getInstance().getOurPlayer().getTrainerLevel()));
m_trainerLabel.pack();
:( it changes from "wait" to "-1" then when I goto buy a pokeball it updates to "25"<-My Level. I cant get it to loop it correctly to make it update until it is no longer -1. :)
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
Oh! nevermind, i figured it out. by adding 2 methods. I added.
this to the bottom on Ui.java.
Code:
/**
* Returns the level
* @return the level
*/
public int getlevel(){
return lvl;
}
/**
* Sets the server version to be displayed
* @param lvl
*/
public void setCorrectTrainerlevel(int lvl) {
m_trainerLabel.setText(" "+ lvl);
m_trainerLabel.pack();
}
then I went to do the TcpProtocolHandler.java and added in case 't':
Code:
GameClient.getInstance().getUi().setCorrectTrainerlevel(Integer.parseInt(message.substring(3)));
before the break;
Then i went back to the Update method I mentioned earlier in Ui.java and went to double check that the first if is
Code:
m_moneyLabel.setText("$" + String.valueOf(GameClient.getInstance().getOurPlayer().getMoney()));
m_moneyLabel.pack();
m_trainerLabel.setText(" "+GameClient.getInstance().getOurPlayer().getTrainerLevel());
m_trainerLabel.pack();
and there you have it!