Skip to content

Commit

Permalink
Clockwork 0.96.2 Beta
Browse files Browse the repository at this point in the history
* Fixed doors not displaying 3D2D info properly.
* Removed theme library debug prints when switching a theme.
* Made the GetDoorEntities function serverside only.
* Gave the PreDrawWeaponList hook the ability to stop drawing the weapon
list if it returns true.
* Fixed items removing on think (I.E. removing instantly when dropped).
* Fixed IsMapEntity using entIndex, changed to using the entity itself
to check for.
* Fixed fists not playing the knocking noise when the secondary fire is
used on a door.
* *Contributed by NightAngel.*
  • Loading branch information
Skiastra committed Apr 5, 2016
1 parent 04460ee commit 8171643
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 76 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,19 @@ Changelog
---------
The following changes have been made for each official Clockwork build.

0.96.2
-------

* Fixed doors not displaying 3D2D info properly.
* Removed theme library debug prints when switching a theme.
* Made the GetDoorEntities function serverside only.
* Gave the PreDrawWeaponList hook the ability to stop drawing the weapon list if it returns true.
* Fixed items removing on think (I.E. removing instantly when dropped).
* Fixed IsMapEntity using entIndex, changed to using the entity itself to check for.
* Fixed fists not playing the knocking noise when the secondary fire is used on a door.
* *Contributed by NightAngel.*


0.96.1
-------

Expand Down
Expand Up @@ -2797,12 +2797,10 @@ function Clockwork:PostDrawTranslucentRenderables(bDrawingDepth, bDrawingSkybox)
if (!cwKernel:IsChoosingCharacter()) then
cam.Start3D(eyePos, eyeAngles);
local entities = cwEntity:GetDoorEntities();
local entities = ents.FindInSphere(eyePos, 256);
for k, v in pairs(entities) do
local pos = v:GetPos();
if (IsValid(v) and pos:Distance(eyePos) <= 256) then
if (IsValid(v) and cwEntity:IsDoor(v)) then
cwKernel:DrawDoorText(v, eyePos, eyeAngles, doorFont, colorInfo, colorWhite);
end;
end;
Expand Down
Expand Up @@ -116,9 +116,9 @@ function ENT:Think()
if (type(nextThink) == "number") then
return self:NextThink(CurTime() + nextThink);
end;
else
self:Remove();
end;
else
self:Remove();
end;
self:NextThink(CurTime() + 1);
Expand Down
Expand Up @@ -365,8 +365,6 @@ end;
function Clockwork.theme:LoadTheme(themeTable, isBase)
local baseName = themeTable.base;
print(themeTable.name, baseName);
if (baseName) then
local base = self:FindByID(baseName);
Expand Down
Expand Up @@ -65,6 +65,15 @@ if (CLIENT) then
return attachment.Pos, attachment.Ang;
end;
else
--[[
@codebase Server
@details A function to get all door entities which are stored from server start.
@return Table A list of all door entities.
--]]
function Clockwork.entity:GetDoorEntities()
return self.DoorEntities or {};
end;
end;
--[[
Expand Down Expand Up @@ -136,15 +145,6 @@ function Clockwork.entity:GetDoorPartners(entity)
return doorPartners;
end;
--[[
@codebase Shared
@details A function to get all door entities which are stored from server start.
@return Table A list of all door entities.
--]]
function Clockwork.entity:GetDoorEntities()
return self.DoorEntities or {};
end;
--[[
@codebase Shared
@details A function to check if an entity is in a specified box area.
Expand Down Expand Up @@ -1323,9 +1323,9 @@ if (SERVER) then
local entIndex = entity:EntIndex();
if (isMapEntity) then
Clockwork.Entities[entIndex] = true;
Clockwork.Entities[entity] = true;
else
Clockwork.Entities[entIndex] = false;
Clockwork.Entities[entity] = false;
end;
end;
Expand Down
4 changes: 2 additions & 2 deletions Clockwork/garrysmod/gamemodes/clockwork/framework/sh_boot.lua
Expand Up @@ -28,8 +28,8 @@ end;
Clockwork.ClockworkFolder = Clockwork.ClockworkFolder or GM.Folder;
Clockwork.SchemaFolder = Clockwork.SchemaFolder or GM.Folder;
Clockwork.KernelVersion = "0.96.1";
Clockwork.KernelBuild = "alpha"
Clockwork.KernelVersion = "0.96.2";
Clockwork.KernelBuild = "beta"
Clockwork.DeveloperVersion = true;
Clockwork.Website = "http://kurozael.com";
Clockwork.Author = "kurozael";
Expand Down
Expand Up @@ -112,8 +112,21 @@ function cwPickupObjects:KeyPress(player, key)
local entity = trace.Entity;
local bCanPickup = nil;
if (Clockwork.plugin:Call("CanHandsPickupEntity", player, entity, trace)) then
self:ForcePickup(player, entity, trace);
if (IsValid(entity) and trace.HitPos:Distance(player:GetShootPos()) <= 96
and !entity:IsPlayer() and !entity:IsNPC()) then
if (Clockwork.plugin:Call("CanHandsPickupEntity", player, entity, trace)) then
bCanPickup = true;
end;
local bIsDoor = Clockwork.entity:IsDoor(entity);
if (bCanPickup and !bIsDoor and !player:InVehicle()) then
self:ForcePickup(player, entity, trace);
elseif (bIsDoor) then
local hands = player:GetActiveWeapon();
hands:SecondaryAttack();
end;
end;
end;
elseif (key == IN_ATTACK) then
Expand All @@ -126,14 +139,11 @@ end;
-- Called when a player attempts to pickup an object.
function cwPickupObjects:CanHandsPickupEntity(player, entity, trace)
if (IsValid(entity) and trace.HitPos:Distance(player:GetShootPos()) <= 96
and !entity:IsPlayer() and !entity:IsNPC()) then
if (IsValid(entity:GetPhysicsObject()) and entity:GetSolid() == SOLID_VPHYSICS) then
if (entity:GetClass() == "prop_ragdoll" or entity:GetPhysicsObject():GetMass() <= 100) then
if (entity:GetPhysicsObject():IsMoveable() and !IsValid(entity.cwHoldingGrab)) then
if (!Clockwork.entity:IsDoor(entity) and !player:InVehicle() and !entity.noHandsPickup) then
return true;
end;
if (IsValid(entity:GetPhysicsObject()) and entity:GetSolid() == SOLID_VPHYSICS) then
if (entity:GetClass() == "prop_ragdoll" or entity:GetPhysicsObject():GetMass() <= 100) then
if (entity:GetPhysicsObject():IsMoveable() and !IsValid(entity.cwHoldingGrab)) then
if (!entity.noHandsPickup) then
return true;
end;
end;
end;
Expand Down
Expand Up @@ -95,67 +95,67 @@ function cwWeaponSelect:HUDPaintImportant()
end;
end;
Clockwork.plugin:Call("PreDrawWeaponList", x, y, weaponLimit, self.displayAlpha);
if (!Clockwork.plugin:Call("PreDrawWeaponList", x, y, weaponLimit, self.displayAlpha, beforeWeapons, currentWeapon, afterWeapons, newWeapons)) then
if (#beforeWeapons > 1) then
for k, v in pairs(beforeWeapons) do
local weaponAlpha = math.min((255 / weaponLimit) * k, self.displayAlpha);
y = Clockwork.kernel:DrawInfo(
string.upper(self:GetWeaponPrintName(v)), x, y, colorWhite, weaponAlpha, true,
function(x, y, width, height)
Clockwork.plugin:Call("DrawWeaponList", x, y, width, height, weaponAlpha, "before");
if (#beforeWeapons > 1) then
for k, v in pairs(beforeWeapons) do
local weaponAlpha = math.min((255 / weaponLimit) * k, self.displayAlpha);
return x, y;
end
) + 3;
end;
end;
if (IsValid(currentWeapon)) then
local currentWeaponName = string.upper(self:GetWeaponPrintName(currentWeapon));
local weaponInfoY = y;
local weaponInfoX = x + 196;
y = Clockwork.kernel:DrawInfo(
string.upper(self:GetWeaponPrintName(v)), x, y, colorWhite, weaponAlpha, true,
currentWeaponName, x, y, informationColor, self.displayAlpha, true,
function(x, y, width, height)
Clockwork.plugin:Call("DrawWeaponList", x, y, width, height, weaponAlpha, "before");
Clockwork.plugin:Call("DrawWeaponList", x, y, width, height, self.displayAlpha, "current");
return x, y;
end
) + 3;
Clockwork.kernel:OverrideMainFont(false);
self:DrawWeaponInformation(
Clockwork.item:GetByWeapon(currentWeapon), currentWeapon, weaponInfoX, weaponInfoY, self.displayAlpha
);
if (#newWeapons == 1) then
y = Clockwork.kernel:DrawInfo(
"There are no other weapons.", x, y, colorWhite, self.displayAlpha, true,
function(x, y, width, height)
Clockwork.plugin:Call("DrawWeaponList", x, y, width, height, self.displayAlpha, "current");
return x, y;
end
) + 3;
end;
Clockwork.kernel:OverrideMainFont(Clockwork.option:GetFont("menu_text_tiny"));
end;
end;
if (IsValid(currentWeapon)) then
local currentWeaponName = string.upper(self:GetWeaponPrintName(currentWeapon));
local weaponInfoY = y;
local weaponInfoX = x + 196;
y = Clockwork.kernel:DrawInfo(
currentWeaponName, x, y, informationColor, self.displayAlpha, true,
function(x, y, width, height)
Clockwork.plugin:Call("DrawWeaponList", x, y, width, height, self.displayAlpha, "current");
return x, y;
end
) + 3;
Clockwork.kernel:OverrideMainFont(false);
self:DrawWeaponInformation(
Clockwork.item:GetByWeapon(currentWeapon), currentWeapon, weaponInfoX, weaponInfoY, self.displayAlpha
);
if (#newWeapons == 1) then
if (#newWeapons > 1) then
for k, v in pairs(afterWeapons) do
local weaponAlpha = math.min(255 - ((255 / weaponLimit) * k), self.displayAlpha);
y = Clockwork.kernel:DrawInfo(
"There are no other weapons.", x, y, colorWhite, self.displayAlpha, true,
string.upper(self:GetWeaponPrintName(v)), x, y, colorWhite, weaponAlpha, true,
function(x, y, width, height)
Clockwork.plugin:Call("DrawWeaponList", x, y, width, height, self.displayAlpha, "current");
Clockwork.plugin:Call("DrawWeaponList", x, y, width, height, weaponAlpha, "after");
return x, y;
end
) + 3;
end;
Clockwork.kernel:OverrideMainFont(Clockwork.option:GetFont("menu_text_tiny"));
end;
if (#newWeapons > 1) then
for k, v in pairs(afterWeapons) do
local weaponAlpha = math.min(255 - ((255 / weaponLimit) * k), self.displayAlpha);
y = Clockwork.kernel:DrawInfo(
string.upper(self:GetWeaponPrintName(v)), x, y, colorWhite, weaponAlpha, true,
function(x, y, width, height)
Clockwork.plugin:Call("DrawWeaponList", x, y, width, height, weaponAlpha, "after");
return x, y;
end
) + 3;
end;
end;
Expand Down

0 comments on commit 8171643

Please sign in to comment.