@@ -2247,7 +2247,28 @@ void AreaEditor::process_gui_panel_info() {
2247
2247
ImGui::Spacer ();
2248
2248
if (saveable_tree_node (" info" , " Thumbnail" )) {
2249
2249
2250
+ // Remove thumbnail button.
2251
+ unsigned char rem_thumb_opacity =
2252
+ !game.cur_area_data ->thumbnail ? 50 : 255 ;
2253
+ if (
2254
+ ImGui::ImageButton (
2255
+ " remThumbButton" , editor_icons[EDITOR_ICON_REMOVE],
2256
+ Point (ImGui::GetTextLineHeight ()), Point (), Point (1 .0f ),
2257
+ COLOR_EMPTY, map_alpha (rem_thumb_opacity)
2258
+ ) &&
2259
+ game.cur_area_data ->thumbnail
2260
+ ) {
2261
+ register_change (" area thumbnail removal" );
2262
+ remove_thumbnail ();
2263
+ thumbnail_needs_saving = true ;
2264
+ thumbnail_backup_needs_saving = true ;
2265
+ }
2266
+ set_tooltip (
2267
+ " Remove the current thumbnail, if any."
2268
+ );
2269
+
2250
2270
// Thumbnail browse button.
2271
+ ImGui::SameLine ();
2251
2272
if (ImGui::Button (" Browse..." )) {
2252
2273
vector<string> f =
2253
2274
prompt_file_dialog (
@@ -2274,18 +2295,7 @@ void AreaEditor::process_gui_panel_info() {
2274
2295
" a file on your disk. When you save the area, the thumbnail\n "
2275
2296
" gets saved into thumbnail.png in the area's folder, \n "
2276
2297
" but the original file you selected with the\n "
2277
- " Browse... button will be left untouched."
2278
- );
2279
-
2280
- // Thumbnail remove button.
2281
- ImGui::SameLine ();
2282
- if (ImGui::Button (" Remove thumbnail" )) {
2283
- remove_thumbnail ();
2284
- thumbnail_needs_saving = true ;
2285
- thumbnail_backup_needs_saving = true ;
2286
- }
2287
- set_tooltip (
2288
- " Removes the current thumbnail, if any."
2298
+ " 'Browse...' button will be left untouched."
2289
2299
);
2290
2300
2291
2301
// Current thumbnail text.
@@ -2314,7 +2324,27 @@ void AreaEditor::process_gui_panel_info() {
2314
2324
ImGui::Spacer ();
2315
2325
if (saveable_tree_node (" info" , " Background" )) {
2316
2326
2317
- // Choose background image button.
2327
+ // Remove background texture button.
2328
+ unsigned char rem_bg_opacity =
2329
+ game.cur_area_data ->bg_bmp_name .empty () ? 50 : 255 ;
2330
+ if (
2331
+ ImGui::ImageButton (
2332
+ " remBgButton" , editor_icons[EDITOR_ICON_REMOVE],
2333
+ Point (ImGui::GetTextLineHeight ()), Point (), Point (1 .0f ),
2334
+ COLOR_EMPTY, map_alpha (rem_bg_opacity)
2335
+ ) &&
2336
+ !game.cur_area_data ->bg_bmp_name .empty ()
2337
+ ) {
2338
+ register_change (" area background removal" );
2339
+ game.cur_area_data ->bg_bmp_name .clear ();
2340
+ set_status (" Removed the background image successfully." );
2341
+ }
2342
+ set_tooltip (
2343
+ " Remove the background image for the area."
2344
+ );
2345
+
2346
+ // Choose background texture button.
2347
+ ImGui::SameLine ();
2318
2348
if (ImGui::Button (" Choose image..." )) {
2319
2349
open_bitmap_dialog (
2320
2350
[this ] (const string &bmp) {
@@ -5386,9 +5416,25 @@ void AreaEditor::process_gui_panel_tools() {
5386
5416
// Reference image node.
5387
5417
if (saveable_tree_node (" tools" , " Reference image" )) {
5388
5418
5389
- string old_ref_file_name = reference_file_path;
5419
+ // Remove reference image button.
5420
+ unsigned char rem_ref_opacity = reference_file_path.empty () ? 50 : 255 ;
5421
+ if (
5422
+ ImGui::ImageButton (
5423
+ " remRefButton" , editor_icons[EDITOR_ICON_REMOVE],
5424
+ Point (ImGui::GetTextLineHeight ()), Point (), Point (1 .0f ),
5425
+ COLOR_EMPTY, map_alpha (rem_ref_opacity)
5426
+ )
5427
+ ) {
5428
+ reference_file_path.clear ();
5429
+ update_reference ();
5430
+ }
5431
+ set_tooltip (
5432
+ " Remove the reference image.\n "
5433
+ " This does not delete the file on your disk."
5434
+ );
5390
5435
5391
5436
// Browse for a reference image button.
5437
+ ImGui::SameLine ();
5392
5438
if (ImGui::Button (" Browse..." )) {
5393
5439
vector<string> f =
5394
5440
prompt_file_dialog (
0 commit comments