mes canvis de merda

This commit is contained in:
2026-04-07 21:38:23 +02:00
parent f3b113c95e
commit 0760dfc739
8 changed files with 51 additions and 30 deletions

View File

@@ -289,8 +289,6 @@ auto MapEditor::revert() -> std::string {
}
room_->setItemColors(room_data_.item_color1, room_data_.item_color2);
// Refrescar visuales de la habitación
room_->setBgColor(room_data_.bg_color);
// Restaurar el tilemap completo
for (int i = 0; i < static_cast<int>(room_data_.tile_map.size()); ++i) {
room_->setTile(i, room_data_.tile_map[i]);
@@ -521,7 +519,7 @@ void MapEditor::handleEvent(const SDL_Event& event) { // NOLINT(readability-fun
tile_picker_.on_select = [this](int tile) {
brush_tile_ = tile;
};
tile_picker_.open(room_->getTileSetFile(), current, room_data_.bg_color);
tile_picker_.open(room_->getTileSetFile(), current, 0);
}
return;
}
@@ -991,7 +989,7 @@ void MapEditor::updateStatusBarInfo() { // NOLINT(readability-function-cognitiv
conv = "right";
}
line2 = "bg:" + std::to_string(room_data_.bg_color) + " conv:" + conv;
line2 = "conv:" + conv;
line3 = "u:" + conn(room_data_.upper_room) + " d:" + conn(room_data_.lower_room) +
" l:" + conn(room_data_.left_room) + " r:" + conn(room_data_.right_room) +
" itm:" + std::to_string(room_data_.item_color1) + "/" + std::to_string(room_data_.item_color2);
@@ -1223,14 +1221,6 @@ auto MapEditor::setRoomProperty(const std::string& property, const std::string&
std::string val = toLower(value);
if (property == "BGCOLOR") {
auto color = static_cast<Uint8>(safeStoi(val, 0));
room_data_.bg_color = color;
room_->setBgColor(color);
autosave();
return "bgcolor: " + std::to_string(color);
}
if (property == "ITEMCOLOR1") {
auto color = static_cast<Uint8>(safeStoi(val, 0));
room_data_.item_color1 = color;
@@ -1353,7 +1343,7 @@ auto MapEditor::setRoomProperty(const std::string& property, const std::string&
return toLower(property) + ": " + connection;
}
return "Unknown property: " + property + " (use: bgcolor, itemcolor1, itemcolor2, conveyor, tileset, up, down, left, right)";
return "Unknown property: " + property + " (use: itemcolor1, itemcolor2, conveyor, tileset, up, down, left, right)";
}
// Crea una nueva habitación
@@ -1405,7 +1395,6 @@ auto MapEditor::createNewRoom(const std::string& direction) -> std::string { //
// Crear Room::Data por defecto con conexión recíproca
Room::Data new_room;
new_room.number = std::string(name_buf).substr(0, std::string(name_buf).find('.'));
new_room.bg_color = 0;
new_room.tile_set_file = "standard.gif";
new_room.item_color1 = 11;
new_room.item_color2 = 12;
@@ -1439,7 +1428,6 @@ auto MapEditor::createNewRoom(const std::string& direction) -> std::string { //
file << "room:\n";
file << " name_en: \"NO_NAME\"\n";
file << " name_ca: \"NO_NAME\"\n";
file << " bgColor: black\n";
file << " tileSetFile: standard.gif\n";
file << "\n";
file << " connections:\n";
@@ -1698,7 +1686,7 @@ void MapEditor::renderGrid() const {
auto game_surface = Screen::get()->getRendererSurface();
if (!game_surface) { return; }
const Uint8 COLOR = pickGridColor(room_data_.bg_color, game_surface);
const Uint8 COLOR = pickGridColor(0, game_surface);
// Líneas verticales (cada 8 pixels)
for (int x = Tile::SIZE; x < PlayArea::WIDTH; x += Tile::SIZE) {

View File

@@ -43,7 +43,7 @@ auto RoomSaver::buildYAML(const fkyaml::node& original_yaml, const Room::Data& r
// --- Sección room ---
out << "room:\n";
out << " bgColor: " << static_cast<int>(room_data.bg_color) << "\n";
// bgColor ya no se escribe en el YAML
out << " tileSetFile: " << room_data.tile_set_file << "\n";
// Conexiones