Skip to content

Max lair/added save on the go#1101

Open
Boombaastical wants to merge 18 commits intoPokemonAutomation:mainfrom
Boombaastical:MaxLair/AddedSaveOnTheGo
Open

Max lair/added save on the go#1101
Boombaastical wants to merge 18 commits intoPokemonAutomation:mainfrom
Boombaastical:MaxLair/AddedSaveOnTheGo

Conversation

@Boombaastical
Copy link
Contributor

As I often ran these Max Lair adventures, I thought that stopping on each new boss that one wants to save takes quite a bit more time than saving them automatically on the go. This would be especially interesting for those who just start with the Max Lair and keep the paths for the difficult bosses (e.g. Zygarde) directly.

Not sure if the code is proper, I tried to use the same style as was there before with a while loop. I tested it a few times and it works smoothly, I added extra time to make sure not to lose button presses because it's quite an important task.

@Mysticial
Copy link
Collaborator

Looks like you included a ton of your local changes that are irrelevant.

console, context,
save_path,
global_state
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Try not to deviate too much from our formatting standard. While we don't document it, there is a pattern to try to adhere to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated this, I thought I reverted back to the original, should've checked before sending the PR, sorry.

#include "Common/Cpp/Options/BooleanCheckBoxOption.h"
#include "Common/Cpp/Options/ConfigOption.h"
#include <vector>
#include <memory>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here applies with general formatting. We generally order our includes as:

  • C++ system headers <>
  • OS-specific system headers <>
  • Qt system headers <>
  • Our headers in approximate order of dependency. So "Common/" is almost always at the top.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now should be the right logic, indeed I didn't notice the order, but thanks for clarifying!

VideoStream& stream,
Language language,
const ImageViewRGB32& screen
) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

formatting

for (int i = 0; i < 3; ++i) {
auto cropped = extract_box_reference(screen, NAME_BOXES[i]);
OCR::StringMatchResult result = PokemonNameReader::instance().read_substring(
stream.logger(), language, cropped, OCR::BLACK_OR_WHITE_TEXT_FILTERS(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

formatting

// Read the three currently saved paths (if any) from the entrance screen and return the index of the first slot that is NOT protected, returns -1 otherwise
int find_unprotected_slot(
const std::vector<std::string>& current_slugs,
const EndBattleDecider& actions,
Copy link
Collaborator

Choose a reason for hiding this comment

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

formatting

AdventureRuntime& runtime,
ProgramEnvironment& env, size_t console_index,
VideoStream& stream, ProControllerContext& context,
bool followed_path,
Copy link
Collaborator

Choose a reason for hiding this comment

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

formatting

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