diff options
| author | Crystalwarrior <varsash@gmail.com> | 2019-09-17 18:51:40 +0300 |
|---|---|---|
| committer | Crystalwarrior <varsash@gmail.com> | 2019-09-17 18:51:40 +0300 |
| commit | 9d20cf03222add2ef04d4d2cc305458bdf00fcad (patch) | |
| tree | c9d587da32ac0bb5ffe934f27dbe723cab3d48b6 /include | |
| parent | 6747bfdd5edee3693144c088ad1e732b5748fb8b (diff) | |
Streamlined ini swapping so the user can set up multiple character folders associated with a character.
This will save to the character folder's iniswaps.ini. You can click on the dropdown and edit the text inside to add an iniswap, and press the [X] button that'll appear next to it to remove the ini swap.
Recode the enter_courtroom and add a new update_character feature - the two are now separate and responsible for different things. The courtroom will reload the whole theme and widgets while the character is only responsible for all ui elements related to the character. This drastically improves performance when switching characters using /switch or something
Add a set_char_ini helper function that allows you to modify the character variables. For now only used to set name= field when iniswapping
Diffstat (limited to 'include')
| -rw-r--r-- | include/aoapplication.h | 5 | ||||
| -rw-r--r-- | include/courtroom.h | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h index c33130f4..f26c8161 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -202,6 +202,9 @@ public: //Returns the list of words in callwords.ini QStringList get_call_words(); + //returns all of the file's lines in a QStringList + QStringList get_list_file(QString p_file); + //Process a file and return its text as a QString QString read_file(QString filename); @@ -259,6 +262,8 @@ public: //Returns a QStringList of all key=value definitions on a given tag. QStringList read_char_ini_tag(QString p_char, 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); //Returns the text between target_tag and terminator_tag in p_file QString get_stylesheet(QString p_file); diff --git a/include/courtroom.h b/include/courtroom.h index 0a7002bc..91f1f9ac 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -184,8 +184,11 @@ public: QString get_current_char() {return current_char;} QString get_current_background() {return current_background;} + //updates character to p_cid and updates necessary ui elements + void update_character(int p_cid); + //properly sets up some varibles: resets user state - void enter_courtroom(int p_cid); + void enter_courtroom(); //helper function that populates ui_music_list with the contents of music_list void list_music(); @@ -461,6 +464,9 @@ private: QComboBox *ui_emote_dropdown; QComboBox *ui_pos_dropdown; + QComboBox *ui_iniswap_dropdown; + AOButton *ui_iniswap_remove; + AOImage *ui_defense_bar; AOImage *ui_prosecution_bar; @@ -602,6 +608,10 @@ private slots: void on_emote_dropdown_changed(int p_index); void on_pos_dropdown_changed(int p_index); + void on_iniswap_dropdown_changed(int p_index); + + void set_iniswap_dropdown(); + void on_iniswap_remove_clicked(); void on_evidence_name_edited(QString text); void on_evidence_image_name_edited(); |
