[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46170] trunk/blender/source/blender/ editors/interface/interface.c: Logic brick connection highlighting on mouseover.
Matthew Smith
mjdietel at gmail.com
Tue May 1 23:02:05 CEST 2012
Revision: 46170
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46170
Author: mokazon
Date: 2012-05-01 21:02:04 +0000 (Tue, 01 May 2012)
Log Message:
-----------
Logic brick connection highlighting on mouseover. Merged from candy branch. I hope it works - my first commit to trunk ^_^
Modified Paths:
--------------
trunk/blender/source/blender/editors/interface/interface.c
Property Changed:
----------------
trunk/blender/source/blender/editors/interface/interface.c
Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c 2012-05-01 20:57:39 UTC (rev 46169)
+++ trunk/blender/source/blender/editors/interface/interface.c 2012-05-01 21:02:04 UTC (rev 46170)
@@ -498,7 +498,7 @@
return prec;
}
-static void ui_draw_linkline(uiLinkLine *line)
+static void ui_draw_linkline(uiLinkLine *line, int hilightActiveLines)
{
rcti rect;
@@ -509,8 +509,10 @@
rect.xmax = (line->to->x1 + line->to->x2) / 2.0f;
rect.ymax = (line->to->y1 + line->to->y2) / 2.0f;
- if (line->flag & UI_SELECT)
- glColor3ub(100, 100, 100);
+ if(line->flag & UI_SELECT)
+ glColor3ub(100,100,100);
+ else if(hilightActiveLines && ((line->from->flag & UI_ACTIVE) || (line->to->flag & UI_ACTIVE)))
+ UI_ThemeColor(TH_TEXT_HI);
else
glColor3ub(0, 0, 0);
@@ -521,18 +523,38 @@
{
uiBut *but;
uiLinkLine *line;
-
- but = block->buttons.first;
- while (but) {
- if (but->type == LINK && but->link) {
- line = but->link->lines.first;
- while (line) {
- ui_draw_linkline(line);
- line = line->next;
+
+ // Draw the inactive lines (lines with neither button being hovered over).
+ // As we go, remember if we see any active or selected lines.
+ int foundselectline = 0;
+ int foundactiveline = 0;
+ for (but=block->buttons.first; but; but=but->next) {
+ if(but->type==LINK && but->link) {
+ for (line=but->link->lines.first; line; line=line->next) {
+ if (!(line->from->flag & UI_ACTIVE) && !(line->to->flag & UI_ACTIVE))
+ ui_draw_linkline(line, 0);
+ else
+ foundactiveline = 1;
+
+ if ((line->from->flag & UI_SELECT) || (line->to->flag & UI_SELECT))
+ foundselectline = 1;
}
}
but = but->next;
}
+
+ // Draw any active lines (lines with either button being hovered over).
+ // Do this last so they appear on top of inactive lines.
+ if (foundactiveline) {
+ for (but=block->buttons.first; but; but=but->next) {
+ if(but->type==LINK && but->link) {
+ for (line=but->link->lines.first; line; line=line->next) {
+ if ((line->from->flag & UI_ACTIVE) || (line->to->flag & UI_ACTIVE))
+ ui_draw_linkline(line, !foundselectline);
+ }
+ }
+ }
+ }
}
/* ************** BLOCK ENDING FUNCTION ************* */
Property changes on: trunk/blender/source/blender/editors/interface/interface.c
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato/source/blender/editors/interface/interface.c:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037
More information about the Bf-blender-cvs
mailing list