Custom Query (928 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (22 - 24 of 928)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Ticket Resolution Summary Owner Reporter
#1110 fixed Wierd chili issues with colorbars beherith
Description

I needed some colorbars, so I decided to try chili.

I didnt like the small slivers of colorbar that chili renders, and they are hard to click too, so I tried changing the rendering function of Colorbars:DrawControl().

The issue:

No matter what I change in the Colorbars:DrawControl(), it doesnt have ANY effect. If i intentionally put a syntax error in it, it crashes chili.

Here is the changed Colorbars:DrawControl():

--//=============================================================================

--- Colorbars module

--- Colorbar fields.
-- Inherits from Control.
-- @see control.Control
-- @table Colorbars
-- @tparam {r,g,b,a} color color table, (default {1,1,1,1})
-- @tparam {func1,func2,...} OnChange listener functions for color changes, (default {})
Colorbars = Control:Inherit{
  classname = "colorbars",
  color     = {1,1,1,1},

  defaultWidth = 100,
  defaultHeight = 20,

  OnChange = {},
}

local this = Colorbars
local inherited = this.inherited

--//=============================================================================

--- Sets the new color
-- @tparam {r,g,b,a} c color table 
function Colorbars:SetColor(c)
Spring.Echo("function Colorbars:SetColor()")
  self.value = c
  self:CallListeners(self.OnChange,c)
  self:Invalidate()
end

--//=============================================================================

local GL_LINE_LOOP = GL.LINE_LOOP
local GL_LINES = GL.LINES
local glPushMatrix = gl.PushMatrix
local glPopMatrix  = gl.PopMatrix
local glTranslate  = gl.Translate
local glVertex   = gl.Vertex
local glRect     = gl.Rect
local glColor    = gl.Color
local glBeginEnd = gl.BeginEnd

function Colorbars:DrawControl()
	Spring.Echo("function Colorbars:DrawControl()")
  local barswidth  = self.width - (self.height + 4)

  local color = self.color
  local step = self.height/7

  --bars
  local rX1,rY1,rX2,rY2 = 0,0*step,color[1]*barswidth,0.5*step
  local gX1,gY1,gX2,gY2 = 10,2*step,color[2]*barswidth,4*step
  local bX1,bY1,bX2,bY2 = 0,4*step,color[3]*barswidth,5*step
  local aX1,aY1,aX2,aY2 = 0,6*step,(color[4] or 1)*barswidth,7*step

  glColor(1,0,1,1)
  glRect(rX1,rY1,rX2,rY2)

  glColor(0,1,0,1)
  glRect(gX1,gY1,gX2,gY2)

  glColor(0,0,1,1)
  glRect(bX1,bY1,bX2,bY2)

  glColor(1,1,0,1)
  -- glRect(aX1,aY1,aX2,aY2)

  -- glColor(self.color)
  --glColor(0,1,0,1)
  glRect(barswidth + 2,self.height,self.width - 2,0)

  gl.BeginEnd(GL.TRIANGLE_STRIP, theme.DrawBorder_, barswidth + 2,0,self.width - barswidth - 4,self.height, 1, self.borderColor, self.borderColor2)
end

--//=============================================================================

function Colorbars:HitTest()
  return self
end

function Colorbars:MouseDown(x,y)
  local step = self.height/7
  local yp = y/step
  local r  = yp%2
  local barswidth = self.width - (self.height + 4)

  if (x<=barswidth)and(r<=1) then
    local barIdx = (yp-r)/2 + 1
    local newvalue = x/barswidth
    if (newvalue>1) then newvalue=1 elseif (newvalue<0) then newvalue=0 end
    self.color[barIdx] = newvalue
    self:SetColor(self.color)
    return self
  end
end

function Colorbars:MouseMove(x,y,dx,dy,button)
  if (button==1) then
    return self:MouseDown(x,y)
  end
end

--//=============================================================================

#1109 fixed make sinfo text scale with view size Bluestone Bluestone
#1108 cantreproduce Extra model shading state sometimes displays wrong after button mashing Floris
Description

see start: https://www.youtube.com/watch?v=-YlTy_phx4g

model has no extra model shading applied while menu has checkbox checked. It will get enabled after unchecking->checking

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Batch Modify
Note: See TracBatchModify for help on using batch modify.
Note: See TracQuery for help on using queries.