Skip to content

Commit

Permalink
Clockwork 0.94.4 Beta
Browse files Browse the repository at this point in the history
* Added 'PostCommandUsed' hook called after a command succeeds in
running.
* *Contributed by NightAngel.*
* Added 'StaticAreaAdd' and 'StaticAreaRemove' commands for adding
static entities in a certain radius around you.
* *Contributed by NightAngel.*
* Added two new functions in the player library, CanPromote and
CanDemote (focussed on rank promotions/demotions).
* *Contributed by Vortix.*
* Added two new commands, RankPromote and RankDemote.
* *Contributed by Vortix.*
* GetLowestRank and GetHighestRank functions now return rank table as
well as name.
* *Contributed by Vortix.*
* SetFactionRank now checks if the rank is valid and, if it is, sets the
player's rank to the provided rank and provides the new rank's model,
class and weapons.
* *Contributed by Vortix.*
* Fixed sorting for tab menu items that don't have icons.
* *Contributed by kurozael.*
* Fixed issue with players being unable to make another character
without having to rejoin.
* *Contributed by NightAngel.*
* Added theme hooks 'PreCharacterFadeOutNavigation',
'PreCharacterFadeInNavigation', 'PreCharacterFadeOutTitle' and
'PreCharacterFadeInTitle'.
* *Contributed by NightAngel.*
* Shifted PreCharacterMenuPaint to include everything inside the paint
function.
* *Contributed by NightAngel.*
* Fixed errors that occured from the display typing plugin with utf8 len
function.
* *Contributed by NightAngel.*
* Added whitelist/blacklist system for classes that can be staticed
* *Contributed by NightAngel.*
* Added EditStaticWhitelist and EditStaticBlacklist hooks to modify what
can and cannot be staticed
* *Contributed by NightAngel.*
* Added 'target_id_delay' config to modify the delay for when a target
ID appears on a player's screen.
* *Contributed by kurozael.*
* Added config options for intro background and logo.
('intro_background_url', 'intro_logo_url')
* *Contributed by kurozael.*
* Added work in progress translate command along with
'translate_api_key' config option.
* *Contributed by Vortix.*
  • Loading branch information
Skiastra committed Nov 21, 2015
1 parent 38577db commit bdaa177
Show file tree
Hide file tree
Showing 22 changed files with 573 additions and 112 deletions.
53 changes: 41 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@ Changelog
---------
The following changes have been made for each official Clockwork build.

0.94.4
-------

* Added 'PostCommandUsed' hook called after a command succeeds in running.
* *Contributed by NightAngel.*
* Added 'StaticAreaAdd' and 'StaticAreaRemove' commands for adding static entities in a certain radius around you.
* *Contributed by NightAngel.*
* Added two new functions in the player library, CanPromote and CanDemote (focussed on rank promotions/demotions).
* *Contributed by Vortix.*
* Added two new commands, RankPromote and RankDemote.
* *Contributed by Vortix.*
* GetLowestRank and GetHighestRank functions now return rank table as well as name.
* *Contributed by Vortix.*
* SetFactionRank now checks if the rank is valid and, if it is, sets the player's rank to the provided rank and provides the new rank's model, class and weapons.
* *Contributed by Vortix.*
* Fixed sorting for tab menu items that don't have icons.
* *Contributed by kurozael.*
* Fixed issue with players being unable to make another character without having to rejoin.
* *Contributed by NightAngel.*
* Added theme hooks 'PreCharacterFadeOutNavigation', 'PreCharacterFadeInNavigation', 'PreCharacterFadeOutTitle' and 'PreCharacterFadeInTitle'.
* *Contributed by NightAngel.*
* Shifted PreCharacterMenuPaint to include everything inside the paint function.
* *Contributed by NightAngel.*
* Fixed errors that occured from the display typing plugin with utf8 len function.
* *Contributed by NightAngel.*
* Added whitelist/blacklist system for classes that can be staticed
* *Contributed by NightAngel.*
* Added EditStaticWhitelist and EditStaticBlacklist hooks to modify what can and cannot be staticed
* *Contributed by NightAngel.*
* Added 'target_id_delay' config to modify the delay for when a target ID appears on a player's screen.
* *Contributed by kurozael.*
* Added config options for intro background and logo. ('intro_background_url', 'intro_logo_url')
* *Contributed by kurozael.*
* Added work in progress translate command along with 'translate_api_key' config option.
* *Contributed by Vortix.*

0.94.17
-------

Expand All @@ -18,20 +54,13 @@ The following changes have been made for each official Clockwork build.
* Added checks to chatbox that solve len bug from utf8 commit.
* *Contributed by NightAngel.*

0.94.13
-------

* Added bitflag library.
* *Contributed by duck.*
* Linked utf-8 library with GMod utf-8 module.
* *Contributed by Kefta.*

0.94.1
-------

* Added plugin call for drawing salesman targetID.
* *Contributed by NightAngel.*
* Added custom ammo type saving based on ammo items, as well as AdjustAmmoTypes(ammoTable) hook for adding/removing ammo types to save.
* Added custom ammo type saving and AdjustAmmoTypes hook.
* *Contributed by NightAngel.*
* Shifted faction/rank derived stat setting from PostPlayerSpawn to PlayerSpawn.
* *Contributed by NightAngel.*

0.94
Expand Down Expand Up @@ -121,7 +150,7 @@ The following changes have been made for each official Clockwork build.
* *Contributed by kurozael.*
* Added system to add icons to menu items in the TAB menu.
* *Contributed by kurozael.*

0.93
-------

Expand Down Expand Up @@ -277,4 +306,4 @@ player object.
* Loading and unloading of plugins is now fully functional.
* A player's targetname is now set to their faction (for use with mapping.)
* Added size multiplier options to the chatbox to allow different sized messages. Whispering and yelling uses this feature.
* Added the Clockwork.fonts library for ease in creation and grabbing of different sized fonts that use the same settings.
* Added the Clockwork.fonts library for ease in creation and grabbing of different sized fonts that use the same settings.
2 changes: 1 addition & 1 deletion Clockwork/garrysmod/gamemodes/clockwork/clockwork.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"settings"
{
}
"version" "0.94.17"
"version" "0.94.4"
"author" "Cloud Sixteen"
"description" "A roleplaying framework developed by Cloud Sixteen for the people."
"workshopid" "474315121"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,7 @@ function Clockwork:HUDDrawTargetID()
if (IsValid(trace.Entity) and !trace.Entity:IsEffectActive(EF_NODRAW)) then
if (!self.TargetIDData or self.TargetIDData.entity != trace.Entity) then
self.TargetIDData = {
showTime = curTime + 0.5,
showTime = curTime + Clockwork.config:Get("target_id_delay"):Get(),
entity = trace.Entity
};
end;
Expand Down Expand Up @@ -3565,4 +3565,4 @@ function playerMeta:GetChatIcon()
end;
playerMeta.GetName = playerMeta.Name;
playerMeta.Nick = playerMeta.Name;
playerMeta.Nick = playerMeta.Name;
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
--[[
© 2015 CloudSixteen.com do not share, re-distribute or modify
without permission of its author (kurozael@gmail.com).
Clockwork was created by Conna Wiles (also known as kurozael.)
http://cloudsixteen.com/license/clockwork.html
--]]
local COMMAND = Clockwork.command:New("RankDemote");
COMMAND.tip = "Demote someone to the next rank down.";
COMMAND.text = "<string Name> [boolean Force]";
COMMAND.arguments = 1;
COMMAND.optionalArguments = 1;
-- Called when the command has been run.
function COMMAND:OnRun(player, arguments)
local target = Clockwork.player:FindByID(arguments[1]);
local force = tobool(arguments[2]);
if (force) then
if (player:IsAdmin()) then
local lowestRank, rankTable = Clockwork.faction:GetLowestRank(target:GetFaction());
local targetRank, targetRankTable = Clockwork.player:GetFactionRank(target);
if (istable(rankTable) and targetRankTable.position and targetRankTable.position != rankTable.position) then
local rank, rankTable = target:GetFactionRank();
Clockwork.player:SetFactionRank(target, Clockwork.faction:GetLowerRank(target:GetFaction(), rankTable));
Clockwork.player:NotifyAll(player:Name().." has force-demoted "..target:Name().." to rank "..target:GetFactionRank());
else
Clockwork.player:Notify(player, "You cannot demote this player!")
end;
else
Clockwork.player:Notify(player, "You must be an admin or superadmin to force demote!");
end;
else
if (player:GetFaction() == target:GetFaction()) then
if (Clockwork.player:CanDemote(player, target)) then
local rank, rankTable = target:GetFactionRank();
Clockwork.player:SetFactionRank(target, Clockwork.faction:GetHigherRank(target:GetFaction(), rankTable));
Clockwork.player:NotifyAll(player:Name().." has demoted "..target:Name().." to rank "..target:GetFactionRank());
else
Clockwork.player:Notify(player, "You do not have permission to demote this player.");
end;
else
Clockwork.player:Notify(player, "You can only demote someone within your own faction!");
end;
end;
end;
COMMAND:Register();
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
--[[
© 2015 CloudSixteen.com do not share, re-distribute or modify
without permission of its author (kurozael@gmail.com).
Clockwork was created by Conna Wiles (also known as kurozael.)
http://cloudsixteen.com/license/clockwork.html
--]]
local COMMAND = Clockwork.command:New("RankPromote");
COMMAND.tip = "Promote someone to the next rank up.";
COMMAND.text = "<string Name> [boolean Force]";
COMMAND.arguments = 1;
COMMAND.optionalArguments = 1;
-- Called when the command has been run.
function COMMAND:OnRun(player, arguments)
local target = Clockwork.player:FindByID(arguments[1]);
local force = tobool(arguments[2]);
if (force) then
if (player:IsAdmin()) then
local highestRank, rankTable = Clockwork.faction:GetHighestRank(target:GetFaction());
local targetRank, targetRankTable = Clockwork.player:GetFactionRank(target);
if (istable(rankTable) and targetRankTable.position and targetRankTable.position != rankTable.position) then
local rank, rankTable = target:GetFactionRank();
Clockwork.player:SetFactionRank(target, Clockwork.faction:GetHigherRank(target:GetFaction(), rankTable));
Clockwork.player:NotifyAll(player:Name().." has force-promoted "..target:Name().." to rank "..target:GetFactionRank());
else
Clockwork.player:Notify(player, "You cannot promote this player!")
end;
else
Clockwork.player:Notify(player, "You must be an admin or superadmin to force promote!");
end;
else
if (player:GetFaction() == target:GetFaction()) then
if (Clockwork.player:CanPromote(player, target)) then
local rank, rankTable = target:GetFactionRank();
Clockwork.player:SetFactionRank(target, Clockwork.faction:GetHigherRank(target:GetFaction(), rankTable));
Clockwork.player:NotifyAll(player:Name().." has promoted "..target:Name().." to rank "..target:GetFactionRank());
else
Clockwork.player:Notify(player, "You do not have permission to promote this player.");
end;
else
Clockwork.player:Notify(player, "You can only promote someone within your own faction!");
end;
end;
end;
COMMAND:Register();
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
--[[
© 2015 CloudSixteen.com do not share, re-distribute or modify
without permission of its author (kurozael@gmail.com).
Clockwork was created by Conna Wiles (also known as kurozael.)
http://cloudsixteen.com/license/clockwork.html
--]]
local COMMAND = Clockwork.command:New("Translate");
COMMAND.tip = "Translate given text to the specified language and print it in chat.";
COMMAND.text = "<string Source> <string Language> <string Text>";
COMMAND.arguments = 3;
-- Called when the command has been run.
function COMMAND:OnRun(player, arguments)
if (Clockwork.config:Get("translate_api_key"):Get() != "") then
http.Fetch("https://www.googleapis.com/language/translate/v2/languages?key="..Clockwork.config:Get("translate_api_key"):Get().."&target=en",
function(body, length, headers, code)
body = Clockwork.json:Decode(body);
if (body["data"]) then
local languages = {};
local source = "";
local target = "";
for i = 1, #body["data"]["languages"] do
languages[string.lower(body["data"]["languages"][i].name)] = string.lower(body["data"]["languages"][i].language);
if (string.lower(body["data"]["languages"][i].name) == string.lower(arguments[1]) or string.lower(body["data"]["languages"][i].language) == string.lower(arguments[1])) then
source = string.lower(body["data"]["languages"][i].language);
end;
if (string.lower(body["data"]["languages"][i].name) == string.lower(arguments[2]) or string.lower(body["data"]["languages"][i].language) == string.lower(arguments[2])) then
target = string.lower(body["data"]["languages"][i].language);
end;
end;
if (source != "") then
if (target != "") then
http.Fetch("https://www.googleapis.com/language/translate/v2?key="..Clockwork.config:Get("translate_api_key"):Get().."&source="..source.."&target="..v.."&q="..arguments[3],
function(body, length, headers, code)
body = Clockwork.json:Decode(body);
if (body["data"]) then
Clockwork.chatBox:AddInRadius(player, "ic", body["data"]["translations"][1].translatedText, player:GetPos(), Clockwork.config:Get("talk_radius"):Get());
elseif (body["error"]) then
local errorsString = body["error"]["errors"][1].reason;
for i = 2, #body["error"]["errors"] do
errorsString = ", "..body["error"]["errors"][i].reason;
end;
Clockwork.player:Notify(player, "Error(s): "..errorsString);
end;
end,
function(error)
Clockwork.player:Notify(player, "Error: "..error);
end
);
else
Clockwork.player:Notify(player, "Invalid target language.");
end;
else
Clockwork.player:Notify(player, "Invalid source language.");
end;
elseif (body["error"]) then
local errorsString = body["error"]["errors"][1].reason;
for i = 2, #body["error"]["errors"] do
errorsString = ", "..body["error"]["errors"][i].reason;
end;
Clockwork.player:Notify(player, "Error(s): "..errorsString);
end;
end,
function(error)
Clockwork.player:Notify(player, "Error: "..error);
end
);
else
Clockwork.player:Notify(player, "There must be a Google Translate API key set for the value of the translate_api_key config to use this feature.");
end;
end;
--COMMAND:Register();
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Clockwork.config:AddToSystem("Cash space", "cash_space", "The amount of space ca
Clockwork.config:AddToSystem("Head damage scale", "scale_head_dmg", "The amount to scale head damage by.");
Clockwork.config:AddToSystem("Block inventory binds", "block_inv_binds", "Whether or not inventory binds should be blocked for players.");
Clockwork.config:AddToSystem("Limb damage scale", "scale_limb_dmg", "The amount to scale limb damage by.");
Clockwork.config:AddToSystem("Target ID delay", "target_id_delay", "The delay before the Target ID is displayed when looking at an entity.");
Clockwork.config:AddToSystem("Headbob enabled", "enable_headbob", "Whether or not to enable headbob.");
Clockwork.config:AddToSystem("Chat command prefix", "command_prefix", "The prefix that is used for chat commands.");
Clockwork.config:AddToSystem("Crouch walk speed", "crouched_speed", "The speed that characters walk at when crouched.", 0, 1024);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
local Clockwork = Clockwork;
Clockwork.config:ShareKey("use_opens_entity_menus");
Clockwork.config:ShareKey("target_id_delay");
Clockwork.config:ShareKey("additional_characters");
Clockwork.config:ShareKey("raised_weapon_system");
Clockwork.config:ShareKey("use_own_group_system");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local Clockwork = Clockwork;
--[[
Never edit this file! All config editing should be done
either through the .cfg files provides or through the
either through the .cfg files provided or through the
in-game config editing systems.
--]]
Expand Down Expand Up @@ -77,6 +77,7 @@ Clockwork.config:Add("cash_weight", 0.001, true);
Clockwork.config:Add("cash_space", 0.001, true);
Clockwork.config:Add("scale_head_dmg", 3);
Clockwork.config:Add("block_inv_binds", true, true);
Clockwork.config:Add("target_id_delay", 0.5, true);
Clockwork.config:Add("scale_limb_dmg", 0.5);
Clockwork.config:Add("enable_headbob", true, true);
Clockwork.config:Add("command_prefix", "/", true);
Expand Down Expand Up @@ -108,4 +109,5 @@ Clockwork.config:Add("enable_looc_icons", true, true, true);
Clockwork.config:Add("show_business", true, true);
Clockwork.config:Add("chat_multiplier", true, true, true);
Clockwork.config:Add("steam_api_key", "");
Clockwork.config:Add("enable_map_props_physgrab", false);
Clockwork.config:Add("enable_map_props_physgrab", false);
Clockwork.config:Add("translate_api_key", "");

0 comments on commit bdaa177

Please sign in to comment.