diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-09-25 02:05:52 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-09-25 02:05:52 +0300 |
| commit | 923548c99746858846764e47fa96899e7c5ef2ab (patch) | |
| tree | 5418619cdc32395229c87227ae8ba3f9c13c0a01 /include | |
| parent | 7097053723bab5cb91c312abaafeb69dc07dd4ac (diff) | |
Hellcommit of doom and suffering
Create two new helper functions - get_chat_markdown and remake read_char_ini_tag to be read_ini_tags for more general purpose
Modify aolineedit to support preserving selection after unfocusing (building this for using dropdown list for setting colors), as well as remove the setReadOnly functionality and use it in signals instead
Overhaul the color system to get rid of inline colors, allow full customization of colors and usage of configuration files for every facet of how a color functions (should we be talking, should we remove that markdown char, etc.)
Complete overhaul of color markdowns system
TODO: Make this thing not lag to hell, fix chat messages hogging the IC as the animation never ends apparently
Diffstat (limited to 'include')
| -rw-r--r-- | include/aoapplication.h | 5 | ||||
| -rw-r--r-- | include/aolineedit.h | 11 | ||||
| -rw-r--r-- | include/courtroom.h | 16 | ||||
| -rw-r--r-- | include/datatypes.h | 15 |
4 files changed, 17 insertions, 30 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h index fef299b2..89bfaa26 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -242,6 +242,9 @@ public: //Returns the color with p_identifier from p_file QColor get_color(QString p_identifier, QString p_file); + // Returns the markdown symbol used for specified p_identifier such as colors + QString get_chat_markdown(QString p_identifier, QString p_file); + // Returns the color from the misc folder. QColor get_chat_color(QString p_identifier, QString p_chat); @@ -261,7 +264,7 @@ public: QString read_char_ini(QString p_char, QString p_search_line, QString target_tag); //Returns a QStringList of all key=value definitions on a given tag. - QStringList read_char_ini_tag(QString p_char, QString target_tag); + QStringList read_ini_tags(QString p_file, QString target_tag = ""); //Sets the char.ini p_search_line key under tag target_tag to value. void set_char_ini(QString p_char, QString value, QString p_search_line, QString target_tag); diff --git a/include/aolineedit.h b/include/aolineedit.h index ce17680d..09521729 100644 --- a/include/aolineedit.h +++ b/include/aolineedit.h @@ -11,16 +11,17 @@ class AOLineEdit : public QLineEdit public: AOLineEdit(QWidget *parent); + void preserve_selection(bool toggle) {p_selection = toggle;} + +private: + bool p_selection = false; + protected: void mouseDoubleClickEvent(QMouseEvent *e); + void focusOutEvent(QFocusEvent *ev); signals: void double_clicked(); - -private slots: - void on_enter_pressed(); - - }; #endif // AOLINEEDIT_H diff --git a/include/courtroom.h b/include/courtroom.h index 5aad1cb4..72dec046 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -168,12 +168,6 @@ public: //sets desk and bg based on pos in chatmessage void set_scene(QString f_desk_mod, QString f_side); - //sets text color based on text color in chatmessage - void set_text_color(); - - // And gets the color, too! - QColor get_text_color(QString color); - //takes in serverD-formatted IP list as prints a converted version to server OOC //admittedly poorly named void set_ip_list(QString p_list); @@ -213,7 +207,7 @@ public: //This function filters out the common CC inline text trickery, for appending to //the IC chatlog. - QString filter_ic_text(QString p_text, bool colorize = false, int pos = -1, int default_color = WHITE); + QString filter_ic_text(QString p_text, bool colorize = false, int pos = -1, int default_color = 0); //adds text to the IC chatlog. p_name first as bold then p_text then a newlin //this function keeps the chatlog scrolled to the top unless there's text selected @@ -360,6 +354,9 @@ private: int realization_state = 0; int screenshake_state = 0; int text_color = 0; + static const int max_colors = 12; //How many unique user colors are possible + QVector<int> color_row_to_number; //Current color list indexes to real color references + bool is_presenting_evidence = false; QString effect = ""; @@ -440,7 +437,7 @@ private: QListWidget *ui_pair_list; QSpinBox *ui_pair_offset_spinbox; - QLineEdit *ui_ic_chat_message; + AOLineEdit *ui_ic_chat_message; QLineEdit *ui_ic_chat_name; QLineEdit *ui_ooc_chat_message; @@ -625,7 +622,7 @@ private slots: QString get_char_sfx(); int get_char_sfx_delay(); - void on_evidence_name_edited(QString text); + void on_evidence_name_edited(); void on_evidence_image_name_edited(); void on_evidence_image_button_clicked(); void on_evidence_clicked(int p_id); @@ -654,6 +651,7 @@ private slots: void on_prosecution_plus_clicked(); void on_text_color_changed(int p_color); + void set_text_color_dropdown(); void on_music_slider_moved(int p_value); void on_sfx_slider_moved(int p_value); diff --git a/include/datatypes.h b/include/datatypes.h index 1917482a..835cf8f4 100644 --- a/include/datatypes.h +++ b/include/datatypes.h @@ -110,19 +110,4 @@ enum CHAT_MESSAGE EFFECTS }; -enum COLOR -{ - WHITE = 0, - GREEN, - RED, - ORANGE, - BLUE, - YELLOW, - RAINBOW, - PINK, - CYAN, - GRAY, - BLANK -}; - #endif // DATATYPES_H |
