Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Nov 13, 2025

Separates the OptionPreferences class from UserPreferences.h and OptionsMenu.cpp into dedicated files and unified them in Core

Changes

New files created in Core:

  • Core/GameEngine/Include/Common/OptionPreferences.h - Class declaration
  • Core/GameEngine/Source/Common/OptionPreferences.cpp - Implementation

@bobtista bobtista force-pushed the bobtista/separate-option-preferences-files branch from 0b163bd to 32c7126 Compare November 13, 2025 03:44
@bobtista bobtista marked this pull request as ready for review December 3, 2025 19:54
@bobtista bobtista force-pushed the bobtista/separate-option-preferences-files branch from 10f65f6 to f7e888b Compare January 14, 2026 21:12
@xezon xezon added Gen Relates to Generals ZH Relates to Zero Hour Refactor Edits the code with insignificant behavior changes, is never user facing labels Jan 24, 2026
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

The opening post says that files were added to Core, but that is not correct. And they cant be added to Core, because the files are not yet merged.

Source/Common/Thing/ThingFactory.cpp
Source/Common/Thing/ThingTemplate.cpp
Source/Common/UserPreferences.cpp
Source/Common/OptionPreferences.cpp
Copy link

Choose a reason for hiding this comment

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

This is meant to be alphabetically sorted.


Bool getShowMoneyPerMinute(void) const;
};
// TheSuperHackers @refactor bobtista 13/11/2025 Moved OptionPreferences to separate files.
Copy link

Choose a reason for hiding this comment

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

This does not need to be documented.

#include "Common/GameAudio.h"
#include "Common/GameEngine.h"
#include "Common/UserPreferences.h"
#include "Common/OptionPreferences.h"
Copy link

Choose a reason for hiding this comment

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

Sort alphabetically

Bool getShowMoneyPerMinute(void) const;
};
// TheSuperHackers @refactor bobtista 13/11/2025 Moved OptionPreferences to separate files.
#include "Common/OptionPreferences.h"
Copy link

Choose a reason for hiding this comment

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

Why is this include here? It is very unusual and unexpected to put an include in the middle of a header.

#include "Common/OptionPreferences.h"

//-----------------------------------------------------------------------------
// LANPreferences class
Copy link

Choose a reason for hiding this comment

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

After this is merged, you can also move this class into separate files.

#include "Common/GameAudio.h"
#include "Common/GameEngine.h"
#include "Common/UserPreferences.h"
#include "Common/OptionPreferences.h"
Copy link

Choose a reason for hiding this comment

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

When you include this, then you can remove #include "Common/UserPreferences.h"

AsciiString m_filename;
};

//-----------------------------------------------------------------------------
Copy link

Choose a reason for hiding this comment

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

Now this moved away, I think you can remove the forward declarations above.

@xezon
Copy link

xezon commented Jan 24, 2026

I think it would be good to merge and move user preferences to Core first, but it will require merging #2180 first.

@xezon
Copy link

xezon commented Jan 24, 2026

I have merged the UserPreferences code and moved it to Core with #2182. So when that is merged you can directly split off to Core and do not need 2 copies for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals Refactor Edits the code with insignificant behavior changes, is never user facing ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move OptionPreferences class into separate files

3 participants