Add an SDF picker for selecting a stuff done flag and optionally giving it a name.

In effect, this is a combination of two of the previous pickers:
the location picker, and the editable string picker.

This required quite a significant rework of how the tilemap places its children.

Currently it's only used in special node editing.
I plan to add its use in many other places too though.
This commit is contained in:
2025-03-02 00:38:58 -05:00
committed by Celtic Minstrel
parent 413b274b61
commit 3d48cb14e7
27 changed files with 504 additions and 62 deletions

View File

@@ -0,0 +1,38 @@
//
// scen.sdfpicker.hpp
// BoE Scenario Editor
//
// Created by Celtic Minstrel on 2025-03-02.
//
#ifndef BoE_scen_sdfpicker_h
#define BoE_scen_sdfpicker_h
#include <string>
#include "location.hpp"
#include "dialogxml/dialogs/dialog.hpp"
class cTilemap;
class cStuffDonePicker {
cDialog dlog;
location initial_sdf, chosen_sdf, viewport;
cTilemap* grid;
cTilemap* row_labels;
cTilemap* col_labels;
int rows, cols;
bool skipNextFocus = true;
void clamp_sdf();
void fill_names();
void save_names();
void select_active();
bool handle_close(std::string item_hit);
bool handle_scroll(std::string item_hit);
bool handle_select(bool losing);
bool handle_focus(std::string item_hit, bool losing);
public:
cStuffDonePicker(location sdf);
location run();
};
#endif