Refactor NotifyValue: optimize value setting and modification tracking with move semantics and improved method names

This commit is contained in:
scawful
2025-02-28 01:13:16 -05:00
parent a28ad9c516
commit 7d77c51a27
2 changed files with 26 additions and 11 deletions

View File

@@ -139,8 +139,8 @@ absl::Status Tile16Editor::UpdateBlockset() {
EndChild();
if (!blockset_canvas_.points().empty()) {
notify_tile16.mutable_get() = blockset_canvas_.GetTileIdFromMousePos();
notify_tile16.apply_changes();
notify_tile16.edit() = blockset_canvas_.GetTileIdFromMousePos();
notify_tile16.commit();
if (notify_tile16.modified()) {
current_tile16_ = notify_tile16.get();
@@ -246,8 +246,8 @@ absl::Status Tile16Editor::DrawTileEditControls() {
Text("Tile16 ID: %d", current_tile16_);
Text("Tile8 ID: %d", current_tile8_);
Text("Options:");
gui::InputHexByte("Palette", &notify_palette.mutable_get());
notify_palette.apply_changes();
gui::InputHexByte("Palette", &notify_palette.edit());
notify_palette.commit();
if (notify_palette.modified()) {
auto palette = palettesets_[current_palette_].main_;
auto value = notify_palette.get();