diff options
-rw-r--r-- | csgo_images.qrc | 33 | ||||
-rw-r--r-- | parse_file.cpp | 44 | ||||
-rw-r--r-- | parse_file.h | 5 | ||||
-rw-r--r-- | stats_display_window.cpp | 63 | ||||
-rw-r--r-- | stats_display_window.h | 8 | ||||
-rw-r--r-- | stats_display_window.ui | 82 | ||||
-rw-r--r-- | user_select_dialog.cpp | 15 | ||||
-rw-r--r-- | user_select_dialog.h | 7 | ||||
-rw-r--r-- | weapons/ak47.png | bin | 13352 -> 899 bytes | |||
-rw-r--r-- | weapons/aug.png | bin | 13048 -> 1060 bytes | |||
-rw-r--r-- | weapons/awp.png | bin | 9509 -> 586 bytes | |||
-rw-r--r-- | weapons/bizon.png | bin | 16292 -> 1599 bytes | |||
-rw-r--r-- | weapons/cz75a.png | bin | 0 -> 1637 bytes | |||
-rw-r--r-- | weapons/deagle.png | bin | 11812 -> 645 bytes | |||
-rw-r--r-- | weapons/decoy.png | bin | 0 -> 980 bytes | |||
-rw-r--r-- | weapons/decoy_impact.png | bin | 0 -> 2198 bytes | |||
-rw-r--r-- | weapons/domination.png | bin | 0 -> 1127 bytes | |||
-rw-r--r-- | weapons/elite.png | bin | 19207 -> 1001 bytes | |||
-rw-r--r-- | weapons/famas.png | bin | 13738 -> 868 bytes | |||
-rw-r--r-- | weapons/fiveseven.png | bin | 10752 -> 562 bytes | |||
-rw-r--r-- | weapons/flashbang.png | bin | 0 -> 1144 bytes | |||
-rw-r--r-- | weapons/flashbang_impact.png | bin | 0 -> 2198 bytes | |||
-rw-r--r-- | weapons/g3sg1.png | bin | 11262 -> 966 bytes | |||
-rw-r--r-- | weapons/galil.png | bin | 0 -> 896 bytes | |||
-rw-r--r-- | weapons/glock.png | bin | 8708 -> 606 bytes | |||
-rw-r--r-- | weapons/grenade.png | bin | 0 -> 756 bytes | |||
-rw-r--r-- | weapons/headshot.png | bin | 0 -> 753 bytes | |||
-rw-r--r-- | weapons/hegrenade.png | bin | 9162 -> 821 bytes | |||
-rw-r--r-- | weapons/hegrenade_impact.png | bin | 0 -> 2094 bytes | |||
-rw-r--r-- | weapons/hkp2000.png | bin | 8376 -> 846 bytes | |||
-rw-r--r-- | weapons/incgreande.png | bin | 0 -> 766 bytes | |||
-rw-r--r-- | weapons/incgreande_impact.png | bin | 0 -> 2441 bytes | |||
-rw-r--r-- | weapons/knife.png | bin | 34170 -> 1386 bytes | |||
-rw-r--r-- | weapons/m4a1.png | bin | 0 -> 1300 bytes | |||
-rw-r--r-- | weapons/mac10.png | bin | 10180 -> 938 bytes | |||
-rw-r--r-- | weapons/mag7.png | bin | 8815 -> 1009 bytes | |||
-rw-r--r-- | weapons/molotov.png | bin | 0 -> 646 bytes | |||
-rw-r--r-- | weapons/molotov_impact.png | bin | 0 -> 2258 bytes | |||
-rw-r--r-- | weapons/mp7.png | bin | 10298 -> 996 bytes | |||
-rw-r--r-- | weapons/mpn.png | bin | 0 -> 1218 bytes | |||
-rw-r--r-- | weapons/negev.png | bin | 15850 -> 1800 bytes | |||
-rw-r--r-- | weapons/nova.png | bin | 10379 -> 1154 bytes | |||
-rw-r--r-- | weapons/p250.png | bin | 11730 -> 841 bytes | |||
-rw-r--r-- | weapons/p90.png | bin | 16426 -> 814 bytes | |||
-rw-r--r-- | weapons/penetrate.png | bin | 0 -> 867 bytes | |||
-rw-r--r-- | weapons/revenge.png | bin | 0 -> 1757 bytes | |||
-rw-r--r-- | weapons/revolver.png | bin | 0 -> 998 bytes | |||
-rw-r--r-- | weapons/sawedoff.png | bin | 7111 -> 1100 bytes | |||
-rw-r--r-- | weapons/scar17.png | bin | 0 -> 1327 bytes | |||
-rw-r--r-- | weapons/scar20.png | bin | 12024 -> 1750 bytes | |||
-rw-r--r-- | weapons/scout.png | bin | 0 -> 745 bytes | |||
-rw-r--r-- | weapons/sg550.png | bin | 0 -> 842 bytes | |||
-rw-r--r-- | weapons/sg552.png | bin | 0 -> 1019 bytes | |||
-rw-r--r-- | weapons/sg556.png | bin | 14664 -> 1282 bytes | |||
-rw-r--r-- | weapons/smokegrenade.png | bin | 0 -> 589 bytes | |||
-rw-r--r-- | weapons/smokegrenade_impact.png | bin | 0 -> 2287 bytes | |||
-rw-r--r-- | weapons/ssg08.png | bin | 12112 -> 1391 bytes | |||
-rw-r--r-- | weapons/suicide.png | bin | 0 -> 1026 bytes | |||
-rw-r--r-- | weapons/taser.png | bin | 0 -> 1071 bytes | |||
-rw-r--r-- | weapons/tec9.png | bin | 9724 -> 999 bytes | |||
-rw-r--r-- | weapons/ump45.png | bin | 12000 -> 949 bytes | |||
-rw-r--r-- | weapons/usp.png | bin | 0 -> 1009 bytes | |||
-rw-r--r-- | weapons/xm1014.png | bin | 11950 -> 745 bytes | |||
-rw-r--r-- | weapons2/ak47.png | bin | 0 -> 13352 bytes | |||
-rw-r--r-- | weapons2/ak472.png | bin | 0 -> 899 bytes | |||
-rw-r--r-- | weapons2/aug.png | bin | 0 -> 13048 bytes | |||
-rw-r--r-- | weapons2/awp.png | bin | 0 -> 9509 bytes | |||
-rw-r--r-- | weapons2/bizon.png | bin | 0 -> 16292 bytes | |||
-rw-r--r-- | weapons2/deagle.png | bin | 0 -> 11812 bytes | |||
-rw-r--r-- | weapons2/elite.png | bin | 0 -> 19207 bytes | |||
-rw-r--r-- | weapons2/famas.png | bin | 0 -> 13738 bytes | |||
-rw-r--r-- | weapons2/fiveseven.png | bin | 0 -> 10752 bytes | |||
-rw-r--r-- | weapons2/g3sg1.png | bin | 0 -> 11262 bytes | |||
-rw-r--r-- | weapons2/galilar.png (renamed from weapons/galilar.png) | bin | 13944 -> 13944 bytes | |||
-rw-r--r-- | weapons2/glock.png | bin | 0 -> 8708 bytes | |||
-rw-r--r-- | weapons2/hegrenade.png | bin | 0 -> 9162 bytes | |||
-rw-r--r-- | weapons2/hkp2000.png | bin | 0 -> 8376 bytes | |||
-rw-r--r-- | weapons2/knife.png | bin | 0 -> 34170 bytes | |||
-rw-r--r-- | weapons2/m249.png (renamed from weapons/m249.png) | bin | 15132 -> 15132 bytes | |||
-rw-r--r-- | weapons2/m4.png (renamed from weapons/m4.png) | bin | 14944 -> 14944 bytes | |||
-rw-r--r-- | weapons2/mac10.png | bin | 0 -> 10180 bytes | |||
-rw-r--r-- | weapons2/mag7.png | bin | 0 -> 8815 bytes | |||
-rw-r--r-- | weapons2/mp7.png | bin | 0 -> 10298 bytes | |||
-rw-r--r-- | weapons2/negev.png | bin | 0 -> 15850 bytes | |||
-rw-r--r-- | weapons2/nova.png | bin | 0 -> 10379 bytes | |||
-rw-r--r-- | weapons2/p250.png | bin | 0 -> 11730 bytes | |||
-rw-r--r-- | weapons2/p90.png | bin | 0 -> 16426 bytes | |||
-rw-r--r-- | weapons2/sawedoff.png | bin | 0 -> 7111 bytes | |||
-rw-r--r-- | weapons2/scar20.png | bin | 0 -> 12024 bytes | |||
-rw-r--r-- | weapons2/sg556.png | bin | 0 -> 14664 bytes | |||
-rw-r--r-- | weapons2/ssg08.png | bin | 0 -> 12112 bytes | |||
-rw-r--r-- | weapons2/tec9.png | bin | 0 -> 9724 bytes | |||
-rw-r--r-- | weapons2/ump45.png | bin | 0 -> 12000 bytes | |||
-rw-r--r-- | weapons2/xm1014.png | bin | 0 -> 11950 bytes |
94 files changed, 222 insertions, 35 deletions
diff --git a/csgo_images.qrc b/csgo_images.qrc index 6d5f5ae..40362d2 100644 --- a/csgo_images.qrc +++ b/csgo_images.qrc @@ -8,31 +8,56 @@ <file>weapons/aug.png</file> <file>weapons/awp.png</file> <file>weapons/bizon.png</file> + <file>weapons/cz75a.png</file> <file>weapons/deagle.png</file> + <file>weapons/decoy.png</file> + <file>weapons/decoy_impact.png</file> + <file>weapons/domination.png</file> <file>weapons/elite.png</file> <file>weapons/famas.png</file> <file>weapons/fiveseven.png</file> + <file>weapons/flashbang.png</file> + <file>weapons/flashbang_impact.png</file> <file>weapons/g3sg1.png</file> - <file>weapons/galilar.png</file> + <file>weapons/galil.png</file> <file>weapons/glock.png</file> + <file>weapons/grenade.png</file> + <file>weapons/headshot.png</file> <file>weapons/hegrenade.png</file> + <file>weapons/hegrenade_impact.png</file> <file>weapons/hkp2000.png</file> + <file>weapons/incgreande.png</file> + <file>weapons/incgreande_impact.png</file> <file>weapons/knife.png</file> - <file>weapons/m4.png</file> - <file>weapons/m249.png</file> + <file>weapons/m4a1.png</file> <file>weapons/mac10.png</file> <file>weapons/mag7.png</file> + <file>weapons/molotov.png</file> + <file>weapons/molotov_impact.png</file> <file>weapons/mp7.png</file> + <file>weapons/mpn.png</file> <file>weapons/negev.png</file> <file>weapons/nova.png</file> - <file>weapons/p90.png</file> <file>weapons/p250.png</file> + <file>weapons/p90.png</file> + <file>weapons/penetrate.png</file> + <file>weapons/revenge.png</file> + <file>weapons/revolver.png</file> <file>weapons/sawedoff.png</file> + <file>weapons/scar17.png</file> <file>weapons/scar20.png</file> + <file>weapons/scout.png</file> + <file>weapons/sg550.png</file> + <file>weapons/sg552.png</file> <file>weapons/sg556.png</file> + <file>weapons/smokegrenade.png</file> + <file>weapons/smokegrenade_impact.png</file> <file>weapons/ssg08.png</file> + <file>weapons/suicide.png</file> + <file>weapons/taser.png</file> <file>weapons/tec9.png</file> <file>weapons/ump45.png</file> + <file>weapons/usp.png</file> <file>weapons/xm1014.png</file> </qresource> </RCC> diff --git a/parse_file.cpp b/parse_file.cpp index b939a7d..2193a04 100644 --- a/parse_file.cpp +++ b/parse_file.cpp @@ -47,3 +47,47 @@ QString parse_file::parse_csgo_data(QString option) } return "null"; } + +void parse_file::parse_users() +{ + /* + * This function populates our dropdown menu with users + * + * example users.dat file: + * + * daniel_j=76561198055087665 + * ScruffyRules=76561198046533376 + * + */ + usernames.clear(); + userids.clear(); + + QFile inputFile("users.dat"); + if (inputFile.open(QIODevice::ReadOnly)) + { + QTextStream in(&inputFile); + while (!in.atEnd()) + { + QString line = in.readLine(); + if (line.contains("=")) + { + usernames.append(line.split("=")[0]); + userids.append(line.split("=")[1]); + } + } + inputFile.close(); + } else + { + qDebug() << "No users loaded."; + } +} + +QStringList parse_file::get_usernames() +{ + return usernames; +} + +QStringList parse_file::get_ids() +{ + return userids; +} diff --git a/parse_file.h b/parse_file.h index 3ee8b0d..e12a66f 100644 --- a/parse_file.h +++ b/parse_file.h @@ -10,6 +10,11 @@ public: parse_file(); QString parse_user_data(QString option, QString split); QString parse_csgo_data(QString option); + void parse_users(); /* parse file */ + QStringList get_usernames(); /* returns pre parsed data */ + QStringList get_ids(); /* returns pre parsed data */ + QStringList usernames; + QStringList userids; }; #endif // PARSE_FILE_H diff --git a/stats_display_window.cpp b/stats_display_window.cpp index 1b71f7e..ffe3569 100644 --- a/stats_display_window.cpp +++ b/stats_display_window.cpp @@ -69,8 +69,8 @@ void stats_display_window::setup_user() void stats_display_window::setup_csgo_data() { /* most of the things in this function are images */ - int w = 100; - int h = 50; + int w = 80; + int h = 40; ui->weapon_table->setColumnCount(2); ui->weapon_table->setRowCount(29); /* mvp */ @@ -83,6 +83,17 @@ void stats_display_window::setup_csgo_data() user.time_ingame = parse.parse_csgo_data("total_time_played"); QString time_in_game = "Hours in CS:GO: " + QString::number(user.time_ingame.toInt() / 3600); ui->time_in_label->setText(time_in_game); + /* total kills */ + user.total_kills = parse.parse_csgo_data("total_kill"); + ui->total_kills_label->setText("Total kills: " + QString::number(user.total_kills.toInt())); + /* total deaths */ + user.total_deaths = parse.parse_csgo_data("total_deaths"); + ui->total_deaths_label->setText("Total deaths: " + QString::number(user.total_deaths.toInt())); + /* k/d ratio */ + user.kd_ratio = QString::number(user.total_kills.toFloat() / user.total_deaths.toFloat()).toFloat(); + ui->kd_ratio_label->setText("K/D Ratio: " + QString::number(user.kd_ratio)); + /* WEAPONS */ + /* awp */ QLabel *awp_label = new QLabel(this); QLabel *awp_kills_label = new QLabel(this); @@ -107,7 +118,7 @@ void stats_display_window::setup_csgo_data() QLabel *deagle_label = new QLabel(this); QLabel *deagle_kills_label = new QLabel(this); QPixmap deagle(":/weapons/weapons/deagle.png"); - deagle_label->setPixmap(deagle.scaled(w / 2, h)); + deagle_label->setPixmap(deagle.scaled(w, h)); user.deagle_kills = parse.parse_csgo_data("total_kills_deagle"); QString deagle_kills_text = user.deagle_kills + " kills"; deagle_kills_label->setText(deagle_kills_text); @@ -116,7 +127,7 @@ void stats_display_window::setup_csgo_data() /* m4 */ QLabel *m4_label = new QLabel(this); QLabel *m4_kills_label = new QLabel(this); - QPixmap m4(":/weapons/weapons/m4.png"); + QPixmap m4(":/weapons/weapons/m4a1.png"); m4_label->setPixmap(m4.scaled(w, h)); user.m4_kills = parse.parse_csgo_data("total_kills_m4"); QString m4_kills_text = user.m4_kills + " kills"; @@ -167,7 +178,7 @@ void stats_display_window::setup_csgo_data() QLabel *fiveseven_label = new QLabel(this); QLabel *fiveseven_kills_label = new QLabel(this); QPixmap fiveseven(":/weapons/weapons/fiveseven.png"); - fiveseven_label->setPixmap(fiveseven.scaled(w / 2, h)); + fiveseven_label->setPixmap(fiveseven.scaled(w , h)); user.fiveseven_kills = parse.parse_csgo_data("total_kills_fiveseven"); QString fiveseven_kills_text = user.fiveseven_kills + " kills"; fiveseven_kills_label->setText(fiveseven_kills_text); @@ -186,7 +197,7 @@ void stats_display_window::setup_csgo_data() /* galilar */ QLabel *galilar_label = new QLabel(this); QLabel *galilar_kills_label = new QLabel(this); - QPixmap galilar(":/weapons/weapons/galilar.png"); + QPixmap galilar(":/weapons/weapons/galil.png"); galilar_label->setPixmap(galilar.scaled(w, h)); user.galilar_kills = parse.parse_csgo_data("total_kills_galilar"); QString galilar_kills_text = user.galilar_kills + " kills"; @@ -197,7 +208,7 @@ void stats_display_window::setup_csgo_data() QLabel *glock_label = new QLabel(this); QLabel *glock_kills_label = new QLabel(this); QPixmap glock(":/weapons/weapons/glock.png"); - glock_label->setPixmap(glock.scaled(w / 2, h)); + glock_label->setPixmap(glock.scaled(w , h)); user.glock_kills = parse.parse_csgo_data("total_kills_glock"); QString glock_kills_text = user.glock_kills + " kills"; glock_kills_label->setText(glock_kills_text); @@ -217,7 +228,7 @@ void stats_display_window::setup_csgo_data() QLabel *hkp2000_label = new QLabel(this); QLabel *hkp2000_kills_label = new QLabel(this); QPixmap hkp2000(":/weapons/weapons/hkp2000.png"); - hkp2000_label->setPixmap(hkp2000.scaled(w / 2, h)); + hkp2000_label->setPixmap(hkp2000.scaled(w , h)); user.hkp2000_kills = parse.parse_csgo_data("total_kills_hkp2000"); QString hkp2000_kills_text = user.hkp2000_kills + " kills"; hkp2000_kills_label->setText(hkp2000_kills_text); @@ -227,7 +238,7 @@ void stats_display_window::setup_csgo_data() QLabel *knife_label = new QLabel(this); QLabel *knife_kills_label = new QLabel(this); QPixmap knife(":/weapons/weapons/knife.png"); - knife_label->setPixmap(knife.scaled(w / 2, h)); + knife_label->setPixmap(knife.scaled(w, h / 2)); user.knife_kills = parse.parse_csgo_data("total_kills_knife"); QString knife_kills_text = user.knife_kills + " kills"; knife_kills_label->setText(knife_kills_text); @@ -237,7 +248,7 @@ void stats_display_window::setup_csgo_data() QLabel *mac10_label = new QLabel(this); QLabel *mac10_kills_label = new QLabel(this); QPixmap mac10(":/weapons/weapons/mac10.png"); - mac10_label->setPixmap(mac10.scaled(w / 2, h)); + mac10_label->setPixmap(mac10.scaled(w , h)); user.mac10_kills = parse.parse_csgo_data("total_kills_mac10"); QString mac10_kills_text = user.mac10_kills + " kills"; mac10_kills_label->setText(mac10_kills_text); @@ -257,7 +268,7 @@ void stats_display_window::setup_csgo_data() QLabel *mp7_label = new QLabel(this); QLabel *mp7_kills_label = new QLabel(this); QPixmap mp7(":/weapons/weapons/mp7.png"); - mp7_label->setPixmap(mp7.scaled(w / 2, h)); + mp7_label->setPixmap(mp7.scaled(w , h)); user.mp7_kills = parse.parse_csgo_data("total_kills_mp7"); QString mp7_kills_text = user.mp7_kills + " kills"; mp7_kills_label->setText(mp7_kills_text); @@ -287,7 +298,7 @@ void stats_display_window::setup_csgo_data() QLabel *p250_label = new QLabel(this); QLabel *p250_kills_label = new QLabel(this); QPixmap p250(":/weapons/weapons/p250.png"); - p250_label->setPixmap(p250.scaled(w / 2, h)); + p250_label->setPixmap(p250.scaled(w , h)); user.p250_kills = parse.parse_csgo_data("total_kills_p250"); QString p250_kills_text = user.p250_kills + " kills"; p250_kills_label->setText(p250_kills_text); @@ -347,7 +358,7 @@ void stats_display_window::setup_csgo_data() QLabel *tec9_label = new QLabel(this); QLabel *tec9_kills_label = new QLabel(this); QPixmap tec9(":/weapons/weapons/tec9.png"); - tec9_label->setPixmap(tec9.scaled(w / 2, h)); + tec9_label->setPixmap(tec9.scaled(w , h)); user.tec9_kills = parse.parse_csgo_data("total_kills_tec9"); QString tec9_kills_text = user.tec9_kills + " kills"; tec9_kills_label->setText(tec9_kills_text); @@ -373,6 +384,7 @@ void stats_display_window::setup_csgo_data() xm1014_kills_label->setText(xm1014_kills_text); ui->weapon_table->setCellWidget(28, 0, xm1014_label); ui->weapon_table->setCellWidget(28, 1, xm1014_kills_label); + /* holy shit, find a better way to do this */ } void stats_display_window::reload_profile() @@ -398,6 +410,21 @@ void stats_display_window::reload_profile() } } +void stats_display_window::load_players() +{ + /* fill our lists and dropdown box with user data */ + ui->users_dropdown->clear(); + usernames.clear(); + userids.clear(); + parse.parse_users(); + usernames = parse.get_usernames(); + userids = parse.get_ids(); + for (int x = 0; x < usernames.length(); x++) + { + ui->users_dropdown->addItem(usernames.at(x)); + } +} + void stats_display_window::showEvent(QShowEvent *ev) { emit window_loaded(); @@ -409,18 +436,28 @@ void stats_display_window::window_open() * this slot is called when our stats window is opened * we will call our user setup function * we will then call our csgo data setup function + * we then need to load our players into the drop down box and lists */ setup_user(); setup_csgo_data(); + load_players(); } void stats_display_window::on_refresh_button_clicked() { reload_profile(); + load_players(); } void stats_display_window::on_new_id_button_clicked() { user.user_64id = ui->new_steam_id->text(); reload_profile(); + load_players(); +} + +void stats_display_window::on_users_dropdown_currentIndexChanged(int index) +{ + if (!usernames.isEmpty() && index != -1) + ui->new_steam_id->setText(userids.at(index)); } diff --git a/stats_display_window.h b/stats_display_window.h index 2784e6f..6504d7f 100644 --- a/stats_display_window.h +++ b/stats_display_window.h @@ -27,6 +27,7 @@ private: void setup_user(); void setup_csgo_data(); void reload_profile(); + void load_players(); struct user_info { /* contains our user data for both steam and csgo */ QString username; @@ -36,6 +37,9 @@ private: QString status; QString time_ingame; QString mvp_count; + QString total_kills; + QString total_deaths; + float kd_ratio; /* weapon stats */ QString ak47_kills; QString deagle_kills; @@ -68,9 +72,10 @@ private: QString ump45_kills; QString xm1014_kills; } user; - file_download download; parse_file parse; + QStringList usernames; + QStringList userids; signals: void window_loaded(); @@ -78,6 +83,7 @@ private slots: void window_open(); void on_refresh_button_clicked(); void on_new_id_button_clicked(); + void on_users_dropdown_currentIndexChanged(int index); }; #endif // STATS_DISPLAY_WINDOW_H diff --git a/stats_display_window.ui b/stats_display_window.ui index dcbace5..9023077 100644 --- a/stats_display_window.ui +++ b/stats_display_window.ui @@ -24,13 +24,30 @@ </property> </widget> </item> - <item row="4" column="1"> + <item row="6" column="1"> <widget class="QLineEdit" name="new_steam_id"> <property name="placeholderText"> - <string>New steam account ID here</string> + <string>New Steam account ID here</string> </property> </widget> </item> + <item row="7" column="0"> + <widget class="QPushButton" name="close_button"> + <property name="text"> + <string>Close</string> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QPushButton" name="new_id_button"> + <property name="text"> + <string>New ID</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QComboBox" name="users_dropdown"/> + </item> <item row="0" column="0"> <layout class="QFormLayout" name="stats_layout"> <item row="0" column="0"> @@ -69,13 +86,6 @@ </property> </widget> </item> - <item row="5" column="0"> - <widget class="QLabel" name="mvp_label"> - <property name="text"> - <string>MVP_IMAGE</string> - </property> - </widget> - </item> <item row="4" column="0"> <widget class="QLabel" name="time_in_label"> <property name="text"> @@ -90,6 +100,34 @@ </property> </widget> </item> + <item row="7" column="0"> + <widget class="QLabel" name="total_kills_label"> + <property name="text"> + <string>total kills</string> + </property> + </widget> + </item> + <item row="8" column="0"> + <widget class="QLabel" name="total_deaths_label"> + <property name="text"> + <string>total deaths</string> + </property> + </widget> + </item> + <item row="9" column="0"> + <widget class="QLabel" name="kd_ratio_label"> + <property name="text"> + <string>K/D ratio</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="mvp_label"> + <property name="text"> + <string>MVP_IMAGE</string> + </property> + </widget> + </item> </layout> </item> <item row="0" column="1"> @@ -165,15 +203,25 @@ </item> </layout> </item> - <item row="4" column="0"> - <widget class="QPushButton" name="new_id_button"> - <property name="text"> - <string>New ID</string> - </property> - </widget> - </item> </layout> </widget> <resources/> - <connections/> + <connections> + <connection> + <sender>close_button</sender> + <signal>clicked()</signal> + <receiver>stats_display_window</receiver> + <slot>close()</slot> + <hints> + <hint type="sourcelabel"> + <x>259</x> + <y>382</y> + </hint> + <hint type="destinationlabel"> + <x>177</x> + <y>386</y> + </hint> + </hints> + </connection> + </connections> </ui> diff --git a/user_select_dialog.cpp b/user_select_dialog.cpp index 6a6f4b2..1ba0593 100644 --- a/user_select_dialog.cpp +++ b/user_select_dialog.cpp @@ -6,6 +6,7 @@ user_select_dialog::user_select_dialog(QWidget *parent) : ui(new Ui::user_select_dialog) { ui->setupUi(this); + load_players(); } user_select_dialog::~user_select_dialog() @@ -49,6 +50,8 @@ void user_select_dialog::download_info() { qDebug() << "Downloaded everything"; /* file could be ANYTHING or empty! */ n_window.show(); + usernames.clear(); + userids.clear(); this->hide(); } else @@ -63,5 +66,17 @@ void user_select_dialog::download_info() void user_select_dialog::load_players() { + parse.parse_users(); + usernames = parse.get_usernames(); + userids = parse.get_ids(); + for (int x = 0; x < usernames.length(); x++) + { + ui->player_dropdown->addItem(usernames.at(x)); + } +} +void user_select_dialog::on_player_dropdown_currentIndexChanged(int index) +{ + if (!usernames.isEmpty()) + ui->steam_url_text->setText(userids.at(index)); } diff --git a/user_select_dialog.h b/user_select_dialog.h index 3420bad..5e8253f 100644 --- a/user_select_dialog.h +++ b/user_select_dialog.h @@ -3,8 +3,10 @@ #include <QMainWindow> #include <QDebug> +#include <QFile> #include "file_download.h" #include "stats_display_window.h" +#include "parse_file.h" namespace Ui { class user_select_dialog; @@ -21,12 +23,17 @@ public: private slots: void on_select_account_button_clicked(); + void on_player_dropdown_currentIndexChanged(int index); + private: Ui::user_select_dialog *ui; file_download download; stats_display_window n_window; + parse_file parse; void download_info(); void load_players(); + QStringList usernames; + QStringList userids; }; #endif // USER_SELECT_DIALOG_H diff --git a/weapons/ak47.png b/weapons/ak47.png Binary files differindex 2f42900..9c95e48 100644 --- a/weapons/ak47.png +++ b/weapons/ak47.png diff --git a/weapons/aug.png b/weapons/aug.png Binary files differindex dc36dc8..b6e5be2 100644 --- a/weapons/aug.png +++ b/weapons/aug.png diff --git a/weapons/awp.png b/weapons/awp.png Binary files differindex 35f7218..b61853c 100644 --- a/weapons/awp.png +++ b/weapons/awp.png diff --git a/weapons/bizon.png b/weapons/bizon.png Binary files differindex 2c6787b..f0bbc7d 100644 --- a/weapons/bizon.png +++ b/weapons/bizon.png diff --git a/weapons/cz75a.png b/weapons/cz75a.png Binary files differnew file mode 100644 index 0000000..d5a8ba9 --- /dev/null +++ b/weapons/cz75a.png diff --git a/weapons/deagle.png b/weapons/deagle.png Binary files differindex 7242a50..91cc1cd 100644 --- a/weapons/deagle.png +++ b/weapons/deagle.png diff --git a/weapons/decoy.png b/weapons/decoy.png Binary files differnew file mode 100644 index 0000000..78077ef --- /dev/null +++ b/weapons/decoy.png diff --git a/weapons/decoy_impact.png b/weapons/decoy_impact.png Binary files differnew file mode 100644 index 0000000..dd58723 --- /dev/null +++ b/weapons/decoy_impact.png diff --git a/weapons/domination.png b/weapons/domination.png Binary files differnew file mode 100644 index 0000000..9c9e8b5 --- /dev/null +++ b/weapons/domination.png diff --git a/weapons/elite.png b/weapons/elite.png Binary files differindex ad54d7b..b7752e3 100644 --- a/weapons/elite.png +++ b/weapons/elite.png diff --git a/weapons/famas.png b/weapons/famas.png Binary files differindex 5765214..0881cf2 100644 --- a/weapons/famas.png +++ b/weapons/famas.png diff --git a/weapons/fiveseven.png b/weapons/fiveseven.png Binary files differindex fc686b9..1a56666 100644 --- a/weapons/fiveseven.png +++ b/weapons/fiveseven.png diff --git a/weapons/flashbang.png b/weapons/flashbang.png Binary files differnew file mode 100644 index 0000000..b8439ce --- /dev/null +++ b/weapons/flashbang.png diff --git a/weapons/flashbang_impact.png b/weapons/flashbang_impact.png Binary files differnew file mode 100644 index 0000000..dd58723 --- /dev/null +++ b/weapons/flashbang_impact.png diff --git a/weapons/g3sg1.png b/weapons/g3sg1.png Binary files differindex 74fdb23..1e28143 100644 --- a/weapons/g3sg1.png +++ b/weapons/g3sg1.png diff --git a/weapons/galil.png b/weapons/galil.png Binary files differnew file mode 100644 index 0000000..e45807f --- /dev/null +++ b/weapons/galil.png diff --git a/weapons/glock.png b/weapons/glock.png Binary files differindex 5cebb4a..fff7fc6 100644 --- a/weapons/glock.png +++ b/weapons/glock.png diff --git a/weapons/grenade.png b/weapons/grenade.png Binary files differnew file mode 100644 index 0000000..6b0fb26 --- /dev/null +++ b/weapons/grenade.png diff --git a/weapons/headshot.png b/weapons/headshot.png Binary files differnew file mode 100644 index 0000000..38fc625 --- /dev/null +++ b/weapons/headshot.png diff --git a/weapons/hegrenade.png b/weapons/hegrenade.png Binary files differindex ad175be..f37d5de 100644 --- a/weapons/hegrenade.png +++ b/weapons/hegrenade.png diff --git a/weapons/hegrenade_impact.png b/weapons/hegrenade_impact.png Binary files differnew file mode 100644 index 0000000..4c2793b --- /dev/null +++ b/weapons/hegrenade_impact.png diff --git a/weapons/hkp2000.png b/weapons/hkp2000.png Binary files differindex 6891efa..43665ad 100644 --- a/weapons/hkp2000.png +++ b/weapons/hkp2000.png diff --git a/weapons/incgreande.png b/weapons/incgreande.png Binary files differnew file mode 100644 index 0000000..2aa1b07 --- /dev/null +++ b/weapons/incgreande.png diff --git a/weapons/incgreande_impact.png b/weapons/incgreande_impact.png Binary files differnew file mode 100644 index 0000000..1ae4ad4 --- /dev/null +++ b/weapons/incgreande_impact.png diff --git a/weapons/knife.png b/weapons/knife.png Binary files differindex f614ed7..28329b7 100644 --- a/weapons/knife.png +++ b/weapons/knife.png diff --git a/weapons/m4a1.png b/weapons/m4a1.png Binary files differnew file mode 100644 index 0000000..700e301 --- /dev/null +++ b/weapons/m4a1.png diff --git a/weapons/mac10.png b/weapons/mac10.png Binary files differindex d05c3c2..c862676 100644 --- a/weapons/mac10.png +++ b/weapons/mac10.png diff --git a/weapons/mag7.png b/weapons/mag7.png Binary files differindex 5fa1541..d88324b 100644 --- a/weapons/mag7.png +++ b/weapons/mag7.png diff --git a/weapons/molotov.png b/weapons/molotov.png Binary files differnew file mode 100644 index 0000000..983e33f --- /dev/null +++ b/weapons/molotov.png diff --git a/weapons/molotov_impact.png b/weapons/molotov_impact.png Binary files differnew file mode 100644 index 0000000..051a40e --- /dev/null +++ b/weapons/molotov_impact.png diff --git a/weapons/mp7.png b/weapons/mp7.png Binary files differindex 4bbf199..ef27b31 100644 --- a/weapons/mp7.png +++ b/weapons/mp7.png diff --git a/weapons/mpn.png b/weapons/mpn.png Binary files differnew file mode 100644 index 0000000..908dcf7 --- /dev/null +++ b/weapons/mpn.png diff --git a/weapons/negev.png b/weapons/negev.png Binary files differindex 3dc15dc..453f03d 100644 --- a/weapons/negev.png +++ b/weapons/negev.png diff --git a/weapons/nova.png b/weapons/nova.png Binary files differindex c85a1d5..a759e4a 100644 --- a/weapons/nova.png +++ b/weapons/nova.png diff --git a/weapons/p250.png b/weapons/p250.png Binary files differindex 1013168..a005908 100644 --- a/weapons/p250.png +++ b/weapons/p250.png diff --git a/weapons/p90.png b/weapons/p90.png Binary files differindex 6eceaa3..2b1d5d0 100644 --- a/weapons/p90.png +++ b/weapons/p90.png diff --git a/weapons/penetrate.png b/weapons/penetrate.png Binary files differnew file mode 100644 index 0000000..5fc0073 --- /dev/null +++ b/weapons/penetrate.png diff --git a/weapons/revenge.png b/weapons/revenge.png Binary files differnew file mode 100644 index 0000000..f4618aa --- /dev/null +++ b/weapons/revenge.png diff --git a/weapons/revolver.png b/weapons/revolver.png Binary files differnew file mode 100644 index 0000000..b945557 --- /dev/null +++ b/weapons/revolver.png diff --git a/weapons/sawedoff.png b/weapons/sawedoff.png Binary files differindex 4335ef5..a440e24 100644 --- a/weapons/sawedoff.png +++ b/weapons/sawedoff.png diff --git a/weapons/scar17.png b/weapons/scar17.png Binary files differnew file mode 100644 index 0000000..3faf47d --- /dev/null +++ b/weapons/scar17.png diff --git a/weapons/scar20.png b/weapons/scar20.png Binary files differindex 1cda9f9..c71ecac 100644 --- a/weapons/scar20.png +++ b/weapons/scar20.png diff --git a/weapons/scout.png b/weapons/scout.png Binary files differnew file mode 100644 index 0000000..9437ebe --- /dev/null +++ b/weapons/scout.png diff --git a/weapons/sg550.png b/weapons/sg550.png Binary files differnew file mode 100644 index 0000000..65bcfc0 --- /dev/null +++ b/weapons/sg550.png diff --git a/weapons/sg552.png b/weapons/sg552.png Binary files differnew file mode 100644 index 0000000..483ffac --- /dev/null +++ b/weapons/sg552.png diff --git a/weapons/sg556.png b/weapons/sg556.png Binary files differindex b777b98..0fcae10 100644 --- a/weapons/sg556.png +++ b/weapons/sg556.png diff --git a/weapons/smokegrenade.png b/weapons/smokegrenade.png Binary files differnew file mode 100644 index 0000000..ed12214 --- /dev/null +++ b/weapons/smokegrenade.png diff --git a/weapons/smokegrenade_impact.png b/weapons/smokegrenade_impact.png Binary files differnew file mode 100644 index 0000000..107687a --- /dev/null +++ b/weapons/smokegrenade_impact.png diff --git a/weapons/ssg08.png b/weapons/ssg08.png Binary files differindex 1992ef1..cae430a 100644 --- a/weapons/ssg08.png +++ b/weapons/ssg08.png diff --git a/weapons/suicide.png b/weapons/suicide.png Binary files differnew file mode 100644 index 0000000..0468e5a --- /dev/null +++ b/weapons/suicide.png diff --git a/weapons/taser.png b/weapons/taser.png Binary files differnew file mode 100644 index 0000000..64a4442 --- /dev/null +++ b/weapons/taser.png diff --git a/weapons/tec9.png b/weapons/tec9.png Binary files differindex a3f2717..e73e3e1 100644 --- a/weapons/tec9.png +++ b/weapons/tec9.png diff --git a/weapons/ump45.png b/weapons/ump45.png Binary files differindex 9e3ede9..3075ad4 100644 --- a/weapons/ump45.png +++ b/weapons/ump45.png diff --git a/weapons/usp.png b/weapons/usp.png Binary files differnew file mode 100644 index 0000000..db7a44c --- /dev/null +++ b/weapons/usp.png diff --git a/weapons/xm1014.png b/weapons/xm1014.png Binary files differindex fc41286..6dbe910 100644 --- a/weapons/xm1014.png +++ b/weapons/xm1014.png diff --git a/weapons2/ak47.png b/weapons2/ak47.png Binary files differnew file mode 100644 index 0000000..2f42900 --- /dev/null +++ b/weapons2/ak47.png diff --git a/weapons2/ak472.png b/weapons2/ak472.png Binary files differnew file mode 100644 index 0000000..9c95e48 --- /dev/null +++ b/weapons2/ak472.png diff --git a/weapons2/aug.png b/weapons2/aug.png Binary files differnew file mode 100644 index 0000000..dc36dc8 --- /dev/null +++ b/weapons2/aug.png diff --git a/weapons2/awp.png b/weapons2/awp.png Binary files differnew file mode 100644 index 0000000..35f7218 --- /dev/null +++ b/weapons2/awp.png diff --git a/weapons2/bizon.png b/weapons2/bizon.png Binary files differnew file mode 100644 index 0000000..2c6787b --- /dev/null +++ b/weapons2/bizon.png diff --git a/weapons2/deagle.png b/weapons2/deagle.png Binary files differnew file mode 100644 index 0000000..7242a50 --- /dev/null +++ b/weapons2/deagle.png diff --git a/weapons2/elite.png b/weapons2/elite.png Binary files differnew file mode 100644 index 0000000..ad54d7b --- /dev/null +++ b/weapons2/elite.png diff --git a/weapons2/famas.png b/weapons2/famas.png Binary files differnew file mode 100644 index 0000000..5765214 --- /dev/null +++ b/weapons2/famas.png diff --git a/weapons2/fiveseven.png b/weapons2/fiveseven.png Binary files differnew file mode 100644 index 0000000..fc686b9 --- /dev/null +++ b/weapons2/fiveseven.png diff --git a/weapons2/g3sg1.png b/weapons2/g3sg1.png Binary files differnew file mode 100644 index 0000000..74fdb23 --- /dev/null +++ b/weapons2/g3sg1.png diff --git a/weapons/galilar.png b/weapons2/galilar.png Binary files differindex 1ef8a5c..1ef8a5c 100644 --- a/weapons/galilar.png +++ b/weapons2/galilar.png diff --git a/weapons2/glock.png b/weapons2/glock.png Binary files differnew file mode 100644 index 0000000..5cebb4a --- /dev/null +++ b/weapons2/glock.png diff --git a/weapons2/hegrenade.png b/weapons2/hegrenade.png Binary files differnew file mode 100644 index 0000000..ad175be --- /dev/null +++ b/weapons2/hegrenade.png diff --git a/weapons2/hkp2000.png b/weapons2/hkp2000.png Binary files differnew file mode 100644 index 0000000..6891efa --- /dev/null +++ b/weapons2/hkp2000.png diff --git a/weapons2/knife.png b/weapons2/knife.png Binary files differnew file mode 100644 index 0000000..f614ed7 --- /dev/null +++ b/weapons2/knife.png diff --git a/weapons/m249.png b/weapons2/m249.png Binary files differindex 6095922..6095922 100644 --- a/weapons/m249.png +++ b/weapons2/m249.png diff --git a/weapons/m4.png b/weapons2/m4.png Binary files differindex 2fe2db7..2fe2db7 100644 --- a/weapons/m4.png +++ b/weapons2/m4.png diff --git a/weapons2/mac10.png b/weapons2/mac10.png Binary files differnew file mode 100644 index 0000000..d05c3c2 --- /dev/null +++ b/weapons2/mac10.png diff --git a/weapons2/mag7.png b/weapons2/mag7.png Binary files differnew file mode 100644 index 0000000..5fa1541 --- /dev/null +++ b/weapons2/mag7.png diff --git a/weapons2/mp7.png b/weapons2/mp7.png Binary files differnew file mode 100644 index 0000000..4bbf199 --- /dev/null +++ b/weapons2/mp7.png diff --git a/weapons2/negev.png b/weapons2/negev.png Binary files differnew file mode 100644 index 0000000..3dc15dc --- /dev/null +++ b/weapons2/negev.png diff --git a/weapons2/nova.png b/weapons2/nova.png Binary files differnew file mode 100644 index 0000000..c85a1d5 --- /dev/null +++ b/weapons2/nova.png diff --git a/weapons2/p250.png b/weapons2/p250.png Binary files differnew file mode 100644 index 0000000..1013168 --- /dev/null +++ b/weapons2/p250.png diff --git a/weapons2/p90.png b/weapons2/p90.png Binary files differnew file mode 100644 index 0000000..6eceaa3 --- /dev/null +++ b/weapons2/p90.png diff --git a/weapons2/sawedoff.png b/weapons2/sawedoff.png Binary files differnew file mode 100644 index 0000000..4335ef5 --- /dev/null +++ b/weapons2/sawedoff.png diff --git a/weapons2/scar20.png b/weapons2/scar20.png Binary files differnew file mode 100644 index 0000000..1cda9f9 --- /dev/null +++ b/weapons2/scar20.png diff --git a/weapons2/sg556.png b/weapons2/sg556.png Binary files differnew file mode 100644 index 0000000..b777b98 --- /dev/null +++ b/weapons2/sg556.png diff --git a/weapons2/ssg08.png b/weapons2/ssg08.png Binary files differnew file mode 100644 index 0000000..1992ef1 --- /dev/null +++ b/weapons2/ssg08.png diff --git a/weapons2/tec9.png b/weapons2/tec9.png Binary files differnew file mode 100644 index 0000000..a3f2717 --- /dev/null +++ b/weapons2/tec9.png diff --git a/weapons2/ump45.png b/weapons2/ump45.png Binary files differnew file mode 100644 index 0000000..9e3ede9 --- /dev/null +++ b/weapons2/ump45.png diff --git a/weapons2/xm1014.png b/weapons2/xm1014.png Binary files differnew file mode 100644 index 0000000..fc41286 --- /dev/null +++ b/weapons2/xm1014.png |