running: tweaks
[neverball] / ball / st_level.c
index 8e70c78..8050752 100644 (file)
 
 static int level_enter(void)
 {
-    int id, jd, kd, ld;
-    const char *ln;
-    int b;
-    const float *textcol1, *textcol2;
+    int id, jd, kd;
 
     if ((id = gui_vstack(0)))
     {
         if ((jd = gui_hstack(id)))
         {
-            ln = level_repr (curr_level());
-            b  = level_bonus(curr_level());
-
-            textcol1 = b ? gui_wht : 0;
-            textcol2 = b ? gui_grn : 0;
-
             gui_filler(jd);
 
             if ((kd = gui_vstack(jd)))
             {
-                gui_label(kd, set_name(curr_set()), GUI_SML, GUI_ALL,
-                          gui_wht, gui_wht);
-
-                gui_space(kd);
-
-                if ((ld = gui_hstack(kd)))
-                {
-                    if (b == 0)
-                    {
-                        gui_label(ld, ln,          GUI_LRG, GUI_NE,
-                                  textcol1, textcol2);
-                        gui_label(ld, _("Level "), GUI_LRG, GUI_NW,
-                                  textcol1, textcol2);
-                    }
-                    else
-                    {
-                        gui_label(ld, ln,                GUI_MED, GUI_NE,
-                                  textcol1, textcol2);
-                        gui_label(ld, _("Bonus Level "), GUI_MED, GUI_NW,
-                                  textcol1, textcol2);
-                    }
-                }
-
-                gui_label(kd, mode_to_str(curr_mode(), 1), GUI_SML, GUI_BOT,
-                          gui_wht, gui_wht);
-
+                const char *ln = level_name (curr_level());
+                int b          = level_bonus(curr_level());
+
+                char setattr[MAXSTR], lvlattr[MAXSTR];
+
+                if (b)
+                    sprintf(lvlattr, _("Bonus Level %s"), ln);
+                else
+                    sprintf(lvlattr, _("Level %s"), ln);
+
+                if (curr_mode() == MODE_CHALLENGE)
+                    sprintf(setattr, "%s: %s", set_name(curr_set()),
+                            mode_to_str(MODE_CHALLENGE, 1));
+                else
+                    sprintf(setattr, "%s", set_name(curr_set()));
+
+                gui_label(kd, lvlattr, b ? GUI_MED : GUI_LRG, GUI_TOP,
+                          b ? gui_wht : 0, b ? gui_grn : 0);
+                gui_label(kd, setattr, GUI_SML,               GUI_BOT,
+                          gui_wht,         gui_wht);
             }
             gui_filler(jd);
         }