diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/char_select.cpp | 6 | ||||
-rw-r--r-- | src/gui/char_server.cpp | 2 | ||||
-rw-r--r-- | src/gui/inventory.cpp | 1 | ||||
-rw-r--r-- | src/gui/inventory.h | 5 | ||||
-rw-r--r-- | src/gui/login.cpp | 4 | ||||
-rw-r--r-- | src/gui/shop.cpp | 24 | ||||
-rw-r--r-- | src/gui/shop.h | 5 |
7 files changed, 36 insertions, 11 deletions
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp index 6aa8c176..056cd724 100644 --- a/src/gui/char_select.cpp +++ b/src/gui/char_select.cpp @@ -19,6 +19,8 @@ along with The Mana World; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + By ElvenProgrammer aka Eugenio Favalli (umperio@users.sourceforge.net) + */ #include "char_select.h" @@ -73,7 +75,7 @@ void char_select() { int gui_exit = 1; while ((!key[KEY_ESC])&&(gui_exit)&&(!key[KEY_ENTER])) { clear_bitmap(buffer); - if(stretch_mode!=0)blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, 80, 60, 640, 480); + if(stretch_mode!=0)blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, 0, 0, 800, 600); else blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, -120, -90, 640, 480); gui_exit = gui_update(player); blit(buffer, screen, 0, 0, 0, 0, 800, 600); @@ -161,7 +163,7 @@ void server_char_delete() { int gui_exit = 1; while ((!key[KEY_ESC])&&(gui_exit)) { clear_bitmap(buffer); - if(stretch_mode!=0)blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, 80, 60, 640, 480); + if(stretch_mode!=0)blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, 0, 0, 800, 600); else blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, -120, -90, 640, 480); gui_exit = gui_update(player); blit(buffer, screen, 0, 0, 0, 0, 800, 600); diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp index 752604f1..1d28bad7 100644 --- a/src/gui/char_server.cpp +++ b/src/gui/char_server.cpp @@ -55,7 +55,7 @@ void char_server() { if(n_server==0)char_server_dialog[2].flags |= D_DISABLED; while ((!key[KEY_ESC])&&(gui_exit)&&(!key[KEY_ENTER])) { clear_bitmap(buffer); - if(stretch_mode!=0)blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, 80, 60, 640, 480); + if(stretch_mode!=0)blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, 0, 0, 800, 600); else blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, -120, -90, 640, 480); gui_exit = gui_update(player); blit(buffer, screen, 0, 0, 0, 0, 800, 600); diff --git a/src/gui/inventory.cpp b/src/gui/inventory.cpp index 6b806f1d..2bf7474a 100644 --- a/src/gui/inventory.cpp +++ b/src/gui/inventory.cpp @@ -106,6 +106,5 @@ int TmwInventory::use_item(int index, int id) { // Note: id is dest of item, usually player_node->account_ID WFIFOSET(8); while((out_size>0))flush(); - return 0; } diff --git a/src/gui/inventory.h b/src/gui/inventory.h index 653d99db..ee16d56b 100644 --- a/src/gui/inventory.h +++ b/src/gui/inventory.h @@ -45,7 +45,7 @@ struct itemHolder { // the holder of a item //int index; // item position }; -class TmwInventory{ +class TmwInventory { public: TmwInventory() {}; ~TmwInventory() {}; @@ -61,8 +61,9 @@ class TmwInventory{ int increase_quantity(int index, int quantity); // increase quantity of a item int use_item(int index, int id); //END API - private: + itemHolder items[INVENTORY_SIZE]; // this is the holder of items + private: DATAFILE *itemset; bool show_inventory; }; diff --git a/src/gui/login.cpp b/src/gui/login.cpp index b27a0dab..a4fa3592 100644 --- a/src/gui/login.cpp +++ b/src/gui/login.cpp @@ -19,6 +19,8 @@ along with The Mana World; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + By ElvenProgrammer aka Eugenio Favalli (umperio@users.sourceforge.net) + */ #include "login.h" @@ -49,7 +51,7 @@ DIALOG login_dialog[] = { int gui_exit = 1; while ((!key[KEY_ESC])&&(gui_exit)&&(state!=EXIT)&&(!key[KEY_ENTER])) { clear_bitmap(buffer); - if(stretch_mode!=0)blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, 80, 60, 640, 480); + if(stretch_mode!=0)blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, 0, 0, 800, 600); else blit((BITMAP *)graphic[LOGIN_BMP].dat, buffer, 0, 0, -120, -90, 640, 480); gui_exit = gui_update(player); diff --git a/src/gui/shop.cpp b/src/gui/shop.cpp index 530df8f4..3065f8ea 100644 --- a/src/gui/shop.cpp +++ b/src/gui/shop.cpp @@ -25,8 +25,6 @@ #include "shop.h" -#include <allegro.h> - int n_items; ITEM_SHOP *shop = NULL; @@ -50,7 +48,27 @@ char *shop_list(int index, int *list_size) { } } -void add_item(short id, int price) { +void add_buy_item(short id, int price) { + ITEM_SHOP *item_shop = (ITEM_SHOP *)malloc(sizeof(ITEM_SHOP)); + if(id-501>=0 && id-501<=2) + sprintf(item_shop->name, "%s %i gp", item_db[id-501], price); + else + sprintf(item_shop->name, "Unknown item %i gp", price); + item_shop->price = price; + item_shop->id = id; + item_shop->next = NULL; + if(shop==NULL) + shop = item_shop; + else { + ITEM_SHOP *temp = shop; + while(temp->next) + temp = temp->next; + temp->next = item_shop; + } +} + +void add_sell_item(short index, int price) { + int id = inventory.items[index].id; ITEM_SHOP *item_shop = (ITEM_SHOP *)malloc(sizeof(ITEM_SHOP)); if(id-501>=0 && id-501<=2) sprintf(item_shop->name, "%s %i gp", item_db[id-501], price); diff --git a/src/gui/shop.h b/src/gui/shop.h index b8051536..5aa8548a 100644 --- a/src/gui/shop.h +++ b/src/gui/shop.h @@ -29,6 +29,8 @@ #include <stdlib.h> #include <stdio.h> +#include "../graphic/graphic.h" + struct ITEM_SHOP { char name[30]; int price; @@ -39,7 +41,8 @@ struct ITEM_SHOP { extern int n_items; char *shop_list(int index, int *list_size); -void add_item(short id, int price); +void add_buy_item(short id, int price); +void add_sell_item(short index, int price); void close_shop(); short get_item_id(int index); |