summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game.cpp5
-rw-r--r--src/graphic/graphic.cpp33
-rw-r--r--src/graphic/graphic.h1
-rw-r--r--src/gui/chat.cpp20
-rw-r--r--src/gui/gui.cpp38
-rw-r--r--src/gui/gui.h7
-rw-r--r--src/gui/stats.cpp22
-rw-r--r--tmw.ini2
8 files changed, 26 insertions, 102 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 407d87b3..5b776845 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -265,9 +265,6 @@ void do_input() {
action_time = false;
} else if(key[KEY_I]) {
inventory.toggle();
- action_time = false;
- } else if(key[KEY_T]) {
- show_stats_dialog = !show_stats_dialog;
action_time = false;
}
}
@@ -534,7 +531,7 @@ void do_parse() {
char_info->lv = RFIFOW(4);
break;
}
- //update_stats_dialog();
+ update_stats_dialog();
if(char_info->hp==0) {
ok("Message", "You're now dead, press ok to restart");
WFIFOW(0) = net_w_value(0x00b2);
diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp
index 59d10b1b..48d1b5c7 100644
--- a/src/graphic/graphic.cpp
+++ b/src/graphic/graphic.cpp
@@ -38,16 +38,13 @@ DATAFILE *tileset;
char itemCurrenyQ[10] = "0";
char page_num;
int map_x, map_y, camera_x, camera_y;
-DIALOG_PLAYER *chat_player, *npc_player, *skill_player, *buy_sell_player, *buy_player, *sell_player, *player_stats_player, *stats_player;
+DIALOG_PLAYER *chat_player, *npc_player, *skill_player, *buy_sell_player, *buy_player, *sell_player, *stats_player;
char speech[255] = "";
char npc_text[1000] = "";
TmwInventory inventory;
-char statsString[255] = "n/a";
-char statsString2[255] = "n/a";
Chat chatlog("./docs/chatlog.txt", 20);
int show_npc_dialog = 0;
bool show_skill_dialog = false;
-bool show_stats_dialog = false;
DIALOG npc_dialog[] = {
/* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
@@ -57,15 +54,6 @@ DIALOG npc_dialog[] = {
{ NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
};
-DIALOG player_stats_dialog[] = {
- /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
- { tmw_dialog_proc, 350, 200, 300, 45, 0, -1, 0, 0, 0, 0, statsString, NULL, NULL },
- { tmw_text_proc, 355, 220, 180, 10, 0, 0, 0, 0, 0, 0, (char *)"Hp:", NULL, NULL },
- { tmw_bar_proc, 375, 225, 60, 18, 0, 0, '1', 0, 1, 1, NULL, NULL, NULL },
- { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
-};
-
-
DIALOG buy_sell_dialog[] = {
/* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
{ tmw_dialog_proc, 350, 200, 100, 105, 0, 0, 0, 0, 0, 0, (char *)"Shop", NULL, NULL },
@@ -154,12 +142,9 @@ void init_graphic() {
chat_player = init_dialog(chat_dialog, -1);
npc_player = init_dialog(npc_dialog, -1);
position_dialog(npc_dialog, 300, 200);
-
skill_player = init_dialog(skill_dialog, -1);
- //stats_player = init_dialog(stats_dialog, -1);
+ stats_player = init_dialog(stats_dialog, -1);
buy_sell_player = init_dialog(buy_sell_dialog, -1);
- player_stats_player = init_dialog(player_stats_dialog, -1);
- position_dialog(player_stats_dialog, 50, 5);
buy_player = init_dialog(buy_dialog, -1);
sell_player = init_dialog(sell_dialog, -1);
gui_bitmap = double_buffer;
@@ -281,15 +266,7 @@ void do_graphic(void) {
chatlog.chat_draw(double_buffer, 8, gui_font);
gui_update(chat_player);
- if(show_stats_dialog)
- {
- sprintf(statsString,"%s Lv: %i Exp: %i",char_info->name,char_info->lv,char_info->xp);
- player_stats_dialog[2].d1 = char_info->hp;
- player_stats_dialog[2].d2 = char_info->max_hp;
- dialog_message(player_stats_dialog, MSG_DRAW, 0, 0);
- gui_update(player_stats_player);
- }
-
+
switch(show_npc_dialog) {
case 1:
dialog_message(npc_dialog, MSG_DRAW, 0, 0);
@@ -362,8 +339,8 @@ void do_graphic(void) {
}
// character status display
- //update_stats_dialog();
- //gui_update(stats_player);
+ update_stats_dialog();
+ gui_update(stats_player);
alfont_textprintf(double_buffer, gui_font, 0, 0, MAKECOL_WHITE, "FPS:%i", fps);
diff --git a/src/graphic/graphic.h b/src/graphic/graphic.h
index 2b323a5c..2ba3cc74 100644
--- a/src/graphic/graphic.h
+++ b/src/graphic/graphic.h
@@ -46,7 +46,6 @@ extern char speech[255];
extern char npc_text[1000];
extern Chat chatlog;
extern bool show_skill_dialog;
-extern bool show_stats_dialog;
extern int show_npc_dialog;
extern TmwInventory inventory;
extern int map_x, map_y, camera_x, camera_y;
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 5401948d..10823e3c 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -21,13 +21,7 @@
*/
-#include "../main.h"
#include "chat.h"
-#include <list>
-#include <string>
-#include <fstream>
-
-using namespace std;
/**
Simple ChatLog Object v0.5 (i'd say...)
@@ -41,7 +35,7 @@ using namespace std;
/**
*/
Chat::Chat(const char * logfile, int item_num) {
- chatlog_file.open(logfile, ios::out | ios::app);
+ chatlog_file.open(logfile, std::ios::out | std::ios::app);
items = 0;
items_keep = item_num;
}
@@ -69,7 +63,7 @@ void Chat::chat_dlgrsize(int) {
i already store the width in pixel in the list rather than
calculating it again and again on every draw event. ;-)
*/
-void Chat::chat_log(string line, int own, ALFONT_FONT * font) {
+void Chat::chat_log(std::string line, int own, ALFONT_FONT * font) {
int pos;
CHATLOG tmp;
@@ -181,7 +175,7 @@ void Chat::chat_draw(BITMAP * bmp, int n, ALFONT_FONT * font) {
// for simple message by a user /- message
chatlog.chat_send("Zaeiru", "Hello to all users on the screen!");
*/
-char * Chat::chat_send(string nick, string msg) {
+char * Chat::chat_send(std::string nick, std::string msg) {
short packid;
// prepare command
@@ -223,8 +217,8 @@ char * Chat::chat_send(string nick, string msg) {
*/
/** constructs failed messages for actions */
-string Chat::const_msg(CHATSKILL action) {
- string msg;
+std::string Chat::const_msg(CHATSKILL action) {
+ std::string msg;
if(action.success == SKILL_FAILED && action.skill == SKILL_BASIC) {
switch(action.bskill) {
case BSKILL_TRADE :
@@ -299,7 +293,7 @@ string Chat::const_msg(CHATSKILL action) {
return msg;
}
-string const_msg(int own) {
- string msg;
+std::string const_msg(int own) {
+ std::string msg;
return msg;
}
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 0ca829d9..10021020 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -299,22 +299,7 @@ void loadListboxSkin() {
}
}
-void loadBarSkin() {
-BITMAP *temp1 = load_bitmap("data/bar.bmp", NULL);
-BITMAP *temp2 = load_bitmap("data/bar_filled.bmp", NULL);
-gui_skin.bar.bg.grid[0] = create_bitmap(3,11);
-gui_skin.bar.bg.grid[1] = create_bitmap(1,11);
-gui_skin.bar.bg.grid[2] = create_bitmap(3,11);
-blit(temp1, gui_skin.bar.bg.grid[0], 0, 0, 0, 0, 3, 11);
-blit(temp1, gui_skin.bar.bg.grid[1], 4, 0, 0, 0, 1, 11);
-blit(temp1, gui_skin.bar.bg.grid[2], 13, 0, 0, 0, 3, 11);
-gui_skin.bar.bg.grid[3] = create_bitmap(3,11);
-gui_skin.bar.bg.grid[4] = create_bitmap(1,11);
-gui_skin.bar.bg.grid[5] = create_bitmap(3,11);
-blit(temp2, gui_skin.bar.bg.grid[3], 0, 0, 0, 0, 3, 11);
-blit(temp2, gui_skin.bar.bg.grid[4], 4, 0, 0, 0, 1, 11);
-blit(temp2, gui_skin.bar.bg.grid[5], 13, 0, 0, 0, 3, 11);
-}
+
void loadDialogSkin() {
char **tokens;
int tokenCount;
@@ -396,7 +381,6 @@ int gui_load_skin(const char* skinname) {
loadTextboxSkin();
loadListboxSkin();
loadDialogSkin();
- loadBarSkin();
pop_config_state();
set_mouse_sprite((BITMAP *)gui_gfx[7].dat);
@@ -1037,26 +1021,6 @@ int tmw_list_proc(int msg, DIALOG *d, int c) {
}
return D_O_K;
}
-int tmw_bar_proc(int msg, DIALOG *d, int c)
-{
-float share2 = ((float)d->d1 / (float)d->d2);
-if(share2!=0)
- masked_blit(gui_skin.bar.bg.grid[3], gui_bitmap, 0, 0, d->x, d->y, gui_bitmap->w, gui_bitmap->h);
-else
- masked_blit(gui_skin.bar.bg.grid[0], gui_bitmap, 0, 0, d->x, d->y, gui_bitmap->w, gui_bitmap->h);
-
-for(int i = 3; i < (d->w-3); i++)
- if(i<share2*d->w-3)
- masked_blit(gui_skin.bar.bg.grid[4], gui_bitmap, 0, 0, d->x+1*i, d->y, gui_bitmap->w, gui_bitmap->h);
- else
- masked_blit(gui_skin.bar.bg.grid[1], gui_bitmap, 0, 0, d->x+1*i, d->y, gui_bitmap->w, gui_bitmap->h);
-
-if(share2==1)
- masked_blit(gui_skin.bar.bg.grid[5], gui_bitmap, 0, 0, d->x+d->w-3, d->y, gui_bitmap->w, gui_bitmap->h);
-else
- masked_blit(gui_skin.bar.bg.grid[2], gui_bitmap, 0, 0, d->x+d->w-3, d->y, gui_bitmap->w, gui_bitmap->h);
-return D_O_K;
-}
/**
dialog box w/ left centered head
diff --git a/src/gui/gui.h b/src/gui/gui.h
index e14a0140..47362466 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -80,11 +80,6 @@ typedef struct {
} LexDialog;
typedef struct {
- LexSkinnedRect bg;
-} LexBar;
-
-
-typedef struct {
LexButton button;
LexSlider slider;
LexCheckbox checkbox;
@@ -92,7 +87,6 @@ typedef struct {
LexTextbox textbox;
LexListbox listbox;
LexDialog dialog;
- LexBar bar;
} LexSkin;
extern LexSkin gui_skin;
@@ -121,7 +115,6 @@ int tmw_dialog_proc(int msg, DIALOG *d, int c);
int tmw_ldialog_proc(int msg, DIALOG *d, int c);
int tmw_textbox_proc(int msg, DIALOG *d, int c);
int tmw_bitmap_proc(int msg, DIALOG *d, int c);
-int tmw_bar_proc(int msg, DIALOG *d, int c);
void ok(const char *title, const char *message);
unsigned int yes_no(const char *title, const char *message);
diff --git a/src/gui/stats.cpp b/src/gui/stats.cpp
index bd9c413d..d036c58b 100644
--- a/src/gui/stats.cpp
+++ b/src/gui/stats.cpp
@@ -23,26 +23,26 @@
#include "stats.h"
-char stats_name[48];
+char stats_name[42];
char stats_hp[24];
char stats_sp[24];
char stats_zeny[24];
DIALOG stats_dialog[] = {
- /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
- { tmw_ldialog_proc, 493, 0, 300, 55, 0, 0, 0, 0, 0, 0, stats_name, NULL, NULL },
- { tmw_text_proc, 497, 22, 296, 100, 0, 0, 0, 0, 0, 0, stats_hp, NULL, NULL },
- { tmw_text_proc, 607, 22, 296, 100, 0, 0, 0, 0, 0, 0, stats_zeny, NULL, NULL },
- { tmw_text_proc, 497, 34, 296, 100, 0, 0, 0, 0, 0, 0, stats_sp, NULL, NULL },
- { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
+ /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
+ { tmw_ldialog_proc, 493, 0, 300, 55, 0, 0, 0, 0, 0, 0, stats_name, NULL, NULL },
+ { tmw_text_proc, 497, 22, 296, 100, 0, 0, 0, 0, 0, 0, stats_hp, NULL, NULL },
+ { tmw_text_proc, 607, 22, 296, 100, 0, 0, 0, 0, 0, 0, stats_zeny, NULL, NULL },
+ { tmw_text_proc, 497, 34, 296, 100, 0, 0, 0, 0, 0, 0, stats_sp, NULL, NULL },
+ { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
};
/**
updates stats_dialog w/ values from PLAYER_INFO *char_info
*/
void update_stats_dialog() {
- sprintf(stats_name, "%s Lvl:% 2i Job:% 2i", char_info->name, char_info->lv, char_info->job_lv);
- sprintf(stats_hp, "HP % 4d / % 4d", char_info->hp, char_info->max_hp);
- sprintf(stats_zeny, "Zeny % 5i", char_info->zeny);
- sprintf(stats_sp, "SP % 4d / % 4d", char_info->sp, char_info->max_sp);
+ sprintf(stats_name, "%s Lvl: % 2i Job: % 2i", char_info->name, char_info->lv, char_info->job_lv);
+ sprintf(stats_hp, "HP % 4d / % 4d", char_info->hp, char_info->max_hp);
+ sprintf(stats_zeny, "Zeny % 5i", char_info->zeny);
+ sprintf(stats_sp, "SP % 4d / % 4d", char_info->sp, char_info->max_sp);
}
diff --git a/tmw.ini b/tmw.ini
index 04616453..8dcd01dd 100644
--- a/tmw.ini
+++ b/tmw.ini
@@ -29,4 +29,4 @@ stretch = 1
[login]
remember = 1
-username = test
+username = kth5