summaryrefslogtreecommitdiff
path: root/stats_display_window.h
blob: aef88c3e2b7b0a17a626bfc6e654875c44583526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#ifndef STATS_DISPLAY_WINDOW_H
#define STATS_DISPLAY_WINDOW_H

#include <QWidget>
#include <QDebug>
#include <QLabel>
#include <message_box.h>
#include "file_download.h"
#include "parse_file.h"
#include "user_management.h"
#include "game_integration_window.h"
#include <graphical_stats.h>
#include <QtCharts/QChartView>
#include <QtCharts/QPieSeries>
#include <QtCharts/QPieSlice>
#include <QtCharts>

namespace Ui {
class stats_display_window;
}

class stats_display_window : public QWidget
{
    Q_OBJECT


protected:
      void showEvent(QShowEvent *ev);

public:
    explicit stats_display_window(QWidget *parent = 0);
    ~stats_display_window();
      QStringList get_most_kills_gun();

private:
    Ui::stats_display_window *ui;
    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;
        QString realname;
        QString avatar_url;
        QString user_64id;
        QString status;
        QString time_ingame;
        QString mvp_count;
        QString total_kills;
        QString total_deaths;
        float kd_ratio;
        QString maps[20][6] = {
            /* map name | image location | rounds total | rounds win | rounds lost | win percent*/
            {"cs_assault", ":/maps/maps/cs_assault.png", "", "", ""},
            {"cs_italy", ":/maps/maps/cs_italy.png", "", "", "", ""},
            {"cs_office", ":/maps/maps/cs_office.png", "", "", "", ""},
            {"de_aztec", ":/maps/maps/de_aztec.png", "", "", "", ""},
            {"de_cbble", ":/maps/maps/de_cbble.png", "", "", "", ""},
            {"de_dust2", ":/maps/maps/de_dust2.png", "", "", "", ""},
            {"de_dust", ":/maps/maps/de_dust.png", "", "", "", ""},
            {"de_inferno", ":/maps/maps/de_inferno.png", "" "", "", ""},
            {"de_nuke", ":/maps/maps/de_nuke.png", "", "", "", ""},
            {"de_train", ":/maps/maps/de_train.png", "", "", "", ""},
            {"de_lake", ":/maps/maps/de_lake.png", "", "", "", ""},
            {"de_stmarc", ":/maps/maps/de_stmarc.png", "", "", "", ""},
            {"de_safehouse", ":/maps/maps/de_safehouse.png", "" "", "" , ""},
            {"ar_baggage", ":/maps/maps/ar_baggage.png", "", "", "", ""},
            {"ar_shoots", ":/maps/maps/ar_shoots.png", "", "", "", ""},
            {"de_bank", ":/maps/maps/de_bank.png", "", "", "", ""},
            {"ar_monas", ":/maps/maps/ar_monastery.png", "" "", "", ""},
            {"de_vertigo", ":/maps/maps/de_vertigo.png", "", "", "", ""},
            {"de_sugarcane", ":/maps/maps//de_sugarcane.png", "", "", "", ""},
            {"cs_militia", ":/maps/maps/cs_militia.png", "", "", "", ""},
        };
        QList<QLabel *> map_labels;
        QList<QLabel *> map_stat_labels;
        QString weapons[33][6] = {
        /*weapon name | image location | kills | shots | hits | ratio of hits to shots */
            {"ak47", ":/weapons/weapons/weapon_ak47.png", "0", "0", "0", "0"},
            {"awp", ":/weapons/weapons/weapon_awp.png", "0", "0", "0", "0"},
            {"p90", ":/weapons/weapons/weapon_p90.png", "0", "0", "0", "0"},
            {"deagle", ":/weapons/weapons/weapon_deagle.png", "0", "0", "0", "0"},
            {"m4", ":/weapons/weapons/weapon_m4a1.png", "0", "0", "0", "0"},
            {"knife", ":/weapons/weapons/weapon_knife.png", "0", "0", "0", "0"},
            {"fiveseven", ":/weapons/weapons/weapon_fiveseven.png", "0", "0", "0", "0"},
            {"hkp2000", ":/weapons/weapons/weapon_hkp2000.png", "0", "0", "0", "0"},
            {"glock", ":/weapons/weapons/weapon_glock.png", "0", "0", "0", "0"},
            {"p250", ":/weapons/weapons/weapon_p250.png", "0", "0", "0", "0"},
            {"mp7", ":/weapons/weapons/weapon_mp7.png", "0", "0", "0", "0"},
            {"galil", ":/weapons/weapons/weapon_galil.png", "0", "0", "0", "0"},
            {"ump45", ":/weapons/weapons/weapon_ump45.png", "0", "0", "0", "0"},
            {"tec9", ":/weapons/weapons/weapon_tec9.png", "0", "0", "0", "0"},
            {"negev", ":/weapons/weapons/weapon_negev.png", "0", "0", "0", "0"},
            {"m249", ":/weapons/weapons/weapon_m249.png", "0", "0", "0", "0"},
            {"g3sg1", ":/weapons/weapons/weapon_g3sg1.png", "0", "0", "0", "0"},
            {"scar20", ":/weapons/weapons/weapon_scar20.png", "0", "0", "0", "0"},
            {"aug", ":/weapons/weapons/weapon_aug.png", "0", "0", "0", "0"},
            {"sg556", ":/weapons/weapons/weapon_sg556.png", "0", "0", "0", "0"},
            {"nova", ":/weapons/weapons/weapon_nova.png", "0", "0", "0", "0"},
            {"sawedoff", ":/weapons/weapons/weapon_sawedoff.png", "0", "0", "0", "0"},
            {"xm1014", ":/weapons/weapons/weapon_xm1014.png", "0", "0", "0", "0"},
            {"mag7", ":/weapons/weapons/weapon_mag7.png", "0", "0", "0", "0"},
            {"mp9", ":/weapons/weapons/weapon_mpn.png", "0", "0", "0", "0"},
            {"ssg08", ":/weapons/weapons/weapon_ssg08.png", "0", "0", "0", "0"},
            {"bizon", ":/weapons/weapons/weapon_bizon.png", "0", "0", "0", "0"},
            {"mac10", ":/weapons/weapons/weapon_mac10.png", "0", "0", "0", "0"},
            {"famas", ":/weapons/weapons/weapon_famas.png", "0", "0", "0", "0"},
            {"hegrenade", ":/weapons/weapons/weapon_hegrenade.png", "0", "0", "0", "0"},
            {"elite", ":/weapons/weapons/weapon_elite.png", "0", "0", "0", "0"},
            {"taser", ":/weapons/weapons/weapon_taser.png", "0", "0", "0", "0"},
            {"molotov", ":/weapons/weapons/weapon_molotov.png", "0", "0", "0", "0"},
        };
        QList<QLabel *> weapon_labels;
        QList<QLabel *> stat_labels;
    } user;
    file_download download;
    parse_file parse;
    QStringList usernames;
    QStringList userids;
    user_management manage;
    message_box msgbox;
    graphical_stats graphs;
    game_integration_window game;
signals:
      void window_loaded();

private slots:
    void window_open();
    void on_refresh_button_clicked();
    void on_new_id_button_clicked();
    void on_users_dropdown_currentIndexChanged(int index);
    void on_manage_users_button_clicked();
    void on_graphical_view_button_clicked();
    void on_game_integration_button_clicked();
};

#endif // STATS_DISPLAY_WINDOW_H