mirror of
https://github.com/Blaststar/Questie-Octo-Vanilla.git
synced 2026-10-21 04:40:49 +00:00
Various fixes and added professions/class trainers
This commit is contained in:
+38
-7
@@ -14,13 +14,39 @@ local function NextRandom(seed)
|
||||
return seed,value
|
||||
end
|
||||
|
||||
-- HSV->RGB (h in [0,360), s/v in [0,1]). Lua 5.0: math.mod is fmod and works on
|
||||
-- floats, math.abs/math.floor are available.
|
||||
local function HSVToRGB(h,s,v)
|
||||
local c=v*s
|
||||
local hp=h/60
|
||||
local x=c*(1-math.abs(math.mod(hp,2)-1))
|
||||
local r,g,b=0,0,0
|
||||
if hp<1 then r,g,b=c,x,0
|
||||
elseif hp<2 then r,g,b=x,c,0
|
||||
elseif hp<3 then r,g,b=0,c,x
|
||||
elseif hp<4 then r,g,b=0,x,c
|
||||
elseif hp<5 then r,g,b=x,0,c
|
||||
else r,g,b=c,0,x end
|
||||
local m=v-c
|
||||
return r+m,g+m,b+m
|
||||
end
|
||||
|
||||
-- Full-wheel vivid colors. The previous scheme mapped each RGB channel into
|
||||
-- [0.45,0.95], which clustered every roll near a light desaturated gray: little
|
||||
-- variety and near-identical neighbours. Drawing a hue across the entire color
|
||||
-- wheel with high saturation and brightness gives a far larger, more separable
|
||||
-- gamut so overlapping quests/objectives are easy to tell apart, and re-rolling
|
||||
-- (Full Node click) jumps to a clearly different color.
|
||||
local function SeedColor(seed)
|
||||
seed=tonumber(seed) or 0
|
||||
local r,g,b
|
||||
seed,r=NextRandom(seed)
|
||||
seed,g=NextRandom(seed)
|
||||
seed,b=NextRandom(seed)
|
||||
return 0.45+r/2,0.45+g/2,0.45+b/2
|
||||
local h,s,v
|
||||
seed,h=NextRandom(seed)
|
||||
seed,s=NextRandom(seed)
|
||||
seed,v=NextRandom(seed)
|
||||
local hue=h*360
|
||||
local sat=0.82+s*0.18 -- 0.82 .. 1.00: strongly saturated
|
||||
local val=0.85+v*0.15 -- 0.85 .. 1.00: bright/readable
|
||||
return HSVToRGB(hue,sat,val)
|
||||
end
|
||||
|
||||
V.colorRolls=V.colorRolls or {}
|
||||
@@ -133,6 +159,12 @@ function V:ApplyPin(pin,node,isMinimap,alpha)
|
||||
end
|
||||
end
|
||||
|
||||
-- Fixed light blue-white used for the hover-highlight glow. The highlight only
|
||||
-- appears while every other objective is faded, so it never needs to be color
|
||||
-- coded per quest; a neutral tint reads clearly against the vivid node colors
|
||||
-- rather than blending into them.
|
||||
local HIGHLIGHT_GLOW_R,HIGHLIGHT_GLOW_G,HIGHLIGHT_GLOW_B=0.50,0.70,1.0
|
||||
|
||||
-- Tracker-hover highlight: brighten a pin and force its glow on so the hovered
|
||||
-- quest's objectives stand out, then restore the normal glow state on release.
|
||||
function V:SetHighlight(pin,on)
|
||||
@@ -140,8 +172,7 @@ function V:SetHighlight(pin,on)
|
||||
if on then
|
||||
pin.texture:SetVertexColor(pin.iconR or 1,pin.iconG or 1,pin.iconB or 1,1)
|
||||
if pin.glowTexture then
|
||||
local gr,gg,gb=self:GetQuestColor(pin.questID)
|
||||
pin.glowTexture:SetVertexColor(gr,gg,gb,1)
|
||||
pin.glowTexture:SetVertexColor(HIGHLIGHT_GLOW_R,HIGHLIGHT_GLOW_G,HIGHLIGHT_GLOW_B,1)
|
||||
self:ResizeGlow(pin)
|
||||
pin.glowTexture:Show()
|
||||
pin.glowForced=true
|
||||
|
||||
Reference in New Issue
Block a user