added support for left, middle or right mouse button for CE change events
[rocksndiamonds.git] / src / screens.c
index dbac21b31e47d8625abb9f940bf84b7d12139bdc..0ce46341598a59e72cd1e3ee354286111bc9836d 100644 (file)
 // other screen text constants
 #define STR_CHOOSE_TREE_EDIT           "Edit"
 #define MENU_CHOOSE_TREE_FONT(x)       (FONT_TEXT_1 + (x))
+#define MENU_CHOOSE_TREE_COLOR(ti, a)  TREE_COLOR(ti, a)
 
 // for input setup functions
 #define SETUPINPUT_SCREEN_POS_START    0
@@ -1738,6 +1739,16 @@ void DrawMainMenu(void)
   SetMouseCursor(CURSOR_DEFAULT);
 
   OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2);
+
+#if defined(PLATFORM_EMSCRIPTEN)
+  EM_ASM
+  (
+    FS.syncfs(function(err)
+    {
+      assert(!err);
+    });
+  );
+#endif
 }
 
 static void gotoTopLevelDir(void)
@@ -4408,9 +4419,8 @@ static void drawChooseTreeText(int y, boolean active, TreeInfo *ti)
   int entry_pos = first_entry + y;
   TreeInfo *node_first = getTreeInfoFirstGroupEntry(ti);
   TreeInfo *node = getTreeInfoFromPos(node_first, entry_pos);
-  int node_color = (node->color == FC_YELLOW ? FC_GREEN : node->color);
-  int color = (active ? FC_YELLOW : node_color);
-  int font_nr = MENU_CHOOSE_TREE_FONT(color);
+  int font_color = MENU_CHOOSE_TREE_COLOR(node, active);
+  int font_nr = MENU_CHOOSE_TREE_FONT(font_color);
   int font_xoffset = getFontBitmapInfo(font_nr)->draw_xoffset;
   int xpos = MENU_SCREEN_START_XPOS;
   int ypos = MENU_SCREEN_START_YPOS + y;