Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlays folder #31

Merged
merged 18 commits into from
Dec 23, 2024
Merged

Conversation

EstatoDeviato
Copy link
Collaborator

Now is possible to load overlays in a specific folder inside base folder called overlays.
In this folder should be every general overlays.
Right now overlays load priority is:

Folder written in design.ini > overlays in specific background folder > overlays folder

Copy link
Owner

@Crystalwarrior Crystalwarrior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz review if you actually set f_desk_image properly

}
else if (file_exists(get_image_suffix(
VPath("overlays/" + w_courtroom->server_overlay)))) {
f_desk_image = w_courtroom->server_overlay;
Copy link
Owner

@Crystalwarrior Crystalwarrior Dec 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what even changes? This is the same line as L147

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f_desk_image = w_courtroom->server_overlay;
f_desk_image = "overlays/" + w_courtroom->server_overlay;

src/aolayer.cpp Outdated
Comment on lines 158 to 169
QString final_path = "";
if (!desk) {
final_path = ao_app->get_image_suffix(ao_app->get_background_path(p_filename));
}
else {
if (file_exists(ao_app->get_image_suffix(ao_app->get_background_path(p_filename)))) {
final_path = ao_app->get_image_suffix(ao_app->get_background_path(p_filename));
}
else {
final_path = ao_app->get_image_suffix(VPath("overlays/" + p_filename));
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this should be done in get_pos_path, not here.

src/aolayer.cpp Outdated
@@ -144,7 +144,7 @@ void AOLayer::move_and_center(int ax, int ay)
center_pixmap(movie_frames[0]); // just use the first frame since dimensions are all that matter
}

void BackgroundLayer::load_image(QString p_filename)
void BackgroundLayer::load_image(QString p_filename, bool desk)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is bool desk necessary?

@@ -178,7 +178,7 @@ class BackgroundLayer : public AOLayer {
Q_OBJECT
public:
BackgroundLayer(QWidget *p_parent, AOApplication *p_ao_app);
void load_image(QString p_filename);
void load_image(QString p_filename, bool desk = false);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is bool desk necessary?

@@ -140,13 +140,17 @@ QString AOApplication::get_pos_path(const QString& pos, const bool desk)
QString desk_override = read_design_ini("overlays/" + f_background, get_background_path("design.ini"));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

design_ini override is checked here. But overlays/ folder override is only checked after the image is attempted to be loaded, inside the background layer itself? Doesn't that order betray the PR description?

EstatoDeviato and others added 9 commits December 9, 2024 14:02
* You refer to a pos inside of the current BG
* You refer to an overlay folder and want to draw pos from it depending on your current pos
* You refer to a pos inside of an overlay folder

Add DRO client positions.ini support
Fix niche issues where background is not shown, or where pos_remove button doesn't appear (for example, if the chara's default pos is not present on the current dropdown list)
* Fix overlays being impossible to clear
@Crystalwarrior Crystalwarrior merged commit 33366cd into Crystalwarrior:master Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants