diff options
author | Aaron Marks <nymacro@gmail.com> | 2005-01-04 04:46:02 +0000 |
---|---|---|
committer | Aaron Marks <nymacro@gmail.com> | 2005-01-04 04:46:02 +0000 |
commit | 52b6be101b78990d5b4523dd5c6523dc5c7c6709 (patch) | |
tree | 0990d5d596a0910d037bcab6853ecf9b073939ff /src/game.cpp | |
parent | 2be6f298a1c39dff04070588f75a3bed0c495b8b (diff) | |
download | mana-client-52b6be101b78990d5b4523dd5c6523dc5c7c6709.tar.gz mana-client-52b6be101b78990d5b4523dd5c6523dc5c7c6709.tar.bz2 mana-client-52b6be101b78990d5b4523dd5c6523dc5c7c6709.tar.xz mana-client-52b6be101b78990d5b4523dd5c6523dc5c7c6709.zip |
Converted Skills dialog from old gui to Guichan. Files modified: graphics.cpp, graphics.h, game.cpp, main.cpp, skills.h, skills.cpp. Other files are unmodified (timestamp error)
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/game.cpp b/src/game.cpp index 82973850..78cc7552 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -345,7 +345,8 @@ bool handle_key(int unicode, int scancode) } return true; case KEY_K: - show_skill_list_dialog = !show_skill_dialog; + //show_skill_list_dialog = !show_skill_dialog; + skillDialog->setVisible(!skillDialog->isVisible()); return true; } } @@ -656,7 +657,7 @@ void do_parse() { break; case 0x000c: char_info->skill_point = RFIFOW(4); - sprintf(skill_points, "Skill points: %i", char_info->skill_point); + skillDialog->setPoints(char_info->skill_point); break; case 0x0037: char_info->job_lv = RFIFOW(4); @@ -857,25 +858,22 @@ void do_parse() { sprintf(pkt_nfo, "%i %i %i %i", RFIFOL(2), RFIFOW(6), RFIFOW(8), RFIFOW(10)); //alert(pkt_nfo,"","","","",0,0); break; - // Skill list + // Skill list TAG case 0x010f: - //n_skills = 0; + { + int n_skills = (len - 4) / 37; //SKILL *temp_skill = NULL; - //n_skills = (len-4)/37; for(int k=0;k<(len-4)/37;k++) { if(RFIFOW(4+k*37+6)!=0 || RFIFOB(4+k*37+36)!=0) { - SKILL *temp_skill = is_skill(RFIFOW(4+k*37)); - if(temp_skill) { - temp_skill->lv = RFIFOW(4+k*37+6); - temp_skill->sp = RFIFOW(4+k*37+36); - if(temp_skill->sp<0)temp_skill->sp = 0; + int skillId = RFIFOW(4+k*37); + if(skillDialog->getModel()->hasSkill(skillId)) { + skillDialog->getModel()->setSkill(skillId, RFIFOW(4+k*37+6), RFIFOW(4+k*37+36)); } else { - n_skills++; - add_skill(RFIFOW(4+k*37), RFIFOW(4+k*37+6), RFIFOW(4+k*37+8)); + skillDialog->getModel()->addSkill(RFIFOW(4+k*37), RFIFOW(4+k*37+6), RFIFOW(4+k*37+8)); } } } - break; + } break; // MVP experience case 0x010b: break; |