diff options
| author | in1tiate <32779090+in1tiate@users.noreply.github.com> | 2021-01-29 11:41:53 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-29 20:41:53 +0300 |
| commit | 5cafb011f5b3cc2aef780f767e0bf054d18efc0f (patch) | |
| tree | 091b63d78d343c989c752339894fdd9f79642498 /include | |
| parent | 4a9480afdc189021cef1b5c85b580d89f57f464b (diff) | |
Fix music_display not stretching properly, reconsolidate ForegroundLayer into InterjectionLayer, rename InterjectionLayer to SplashLayer (#436)
* more intelligent separation
* separation 2 electric boogaloo
* rename InterjectionLayer to SplashLayer
* remove redundant layer type
* comments and cleanup
* fix incorrect use of continuous
* remove nonfunctional check
* fix additive not coloring correctly
Co-authored-by: Crystalwarrior <varsash@gmail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/aolayer.h | 46 | ||||
| -rw-r--r-- | include/courtroom.h | 8 |
2 files changed, 33 insertions, 21 deletions
diff --git a/include/aolayer.h b/include/aolayer.h index 6265cec6..8510edfb 100644 --- a/include/aolayer.h +++ b/include/aolayer.h @@ -10,6 +10,27 @@ class AOApplication; +// "Brief" explanation of what the hell this is: +// +// AOLayer handles all animations both inside and outside +// the viewport. It was originally devised as a layering +// system, but turned into a full refactor of the existing +// animation code. +// +// AOLayer has six subclasses, all of which differ mainly in +// how they handle path resolution. +// +// - BackgroundLayer: self-explanatory, handles files found in base/background +// - CharLayer: handles all the "wonderful" quirks of character path resolution +// - SplashLayer: handles elements that can either be provided by a misc/ directory +// or by the theme - speedlines, shouts, WT/CE, et cetera +// - EffectLayer: this is basically a dummy layer since effects do their own wonky +// path resolution in a different file +// - InterfaceLayer: handles UI elements like the chat arrow and the music display +// - StickerLayer: Crystalwarrior really wanted this. Handles "stickers," whatever those are. +// +// For questions comments or concerns, bother someone else + class AOLayer : public QLabel { Q_OBJECT @@ -24,6 +45,11 @@ public: bool play_once = false; // Whether to loop this animation or not bool cull_image = true; // if we're done playing this animation, should we // hide it? also controls durational culling + // Are we loading this from the same frame we left off on? + bool continuous = false; + // Whether or not to forcibly bypass the simple check done by start_playback + // and use the existent value of continuous instead + bool force_continuous = false; Qt::TransformationMode transform_mode = Qt::FastTransformation; // transformation mode to use for this image bool stretch = false; // Should we stretch/squash this image to fill the screen? @@ -72,7 +98,7 @@ protected: QElapsedTimer actual_time; // Usually used to turn seconds into milliseconds such as for [Time] tag in - // char.ini + // char.ini (which is no longer used) const int tick_ms = 60; // These are the X and Y values before they are fixed based on the sprite's @@ -91,12 +117,6 @@ protected: int speed = 100; bool m_flipped = false; - // Are we loading this from the same frame we left off on? TODO: actually make - // this work - bool continuous = false; - // Whether or not to forcibly bypass the simple check done by start_playback - // and use the existent value of continuous instead - bool force_continuous = false; int duration = 0; @@ -129,14 +149,6 @@ public: void load_image(QString p_filename); }; -class ForegroundLayer : public AOLayer { - Q_OBJECT -public: - ForegroundLayer(QWidget *p_parent, AOApplication *p_ao_app); - QString miscname; //'misc' folder to search. we fetch this based on p_charname below - void load_image(QString p_filename, QString p_charname); -}; - class CharLayer : public AOLayer { Q_OBJECT public: @@ -191,10 +203,10 @@ signals: void play_sfx(QString sfx); }; -class InterjectionLayer : public AOLayer { +class SplashLayer : public AOLayer { Q_OBJECT public: - InterjectionLayer(QWidget *p_parent, AOApplication *p_ao_app); + SplashLayer(QWidget *p_parent, AOApplication *p_ao_app); void load_image(QString p_filename, QString p_charname, QString p_miscname); }; diff --git a/include/courtroom.h b/include/courtroom.h index 04b166f2..cebdfe24 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -605,7 +605,7 @@ private: QWidget *ui_viewport; BackgroundLayer *ui_vp_background; - ForegroundLayer *ui_vp_speedlines; + SplashLayer *ui_vp_speedlines; CharLayer *ui_vp_player_char; CharLayer *ui_vp_sideplayer_char; BackgroundLayer *ui_vp_desk; @@ -614,10 +614,10 @@ private: QLabel *ui_vp_showname; InterfaceLayer *ui_vp_chat_arrow; QTextEdit *ui_vp_message; - InterfaceLayer *ui_vp_testimony; - InterjectionLayer *ui_vp_wtce; + SplashLayer *ui_vp_testimony; + SplashLayer *ui_vp_wtce; EffectLayer *ui_vp_effect; - InterjectionLayer *ui_vp_objection; + SplashLayer *ui_vp_objection; QTextEdit *ui_ic_chatlog; |
