Skip to content

Commit

Permalink
Clockwork 0.94.51 Beta
Browse files Browse the repository at this point in the history
* Fixed a small problem with voice library being overwritten by HL2 RP.
* Fixed animations not saving for salesmen
* Added sounds for phrases and whether or not a phrase will display the
salesman's name
* Added phrase for when a player starts trading with a salesman
* Fixes problem with some menus overlapping next buttons for lower
resolutions in char creation
  • Loading branch information
Skiastra committed Dec 2, 2015
1 parent f554db0 commit 4f075fe
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 47 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@ Changelog
---------
The following changes have been made for each official Clockwork build.

0.94.51
-------

* Fixes problem with some menus overlapping next buttons for lower resolutions in char creation
* *Contributed by NightAngel.*

0.94.5
-------

* Fixed animations not saving for salesmen
* Added sounds for phrases and whether or not a phrase will display the salesman's name
* Added phrase for when a player starts trading with a salesman
* *Contributed by NightAngel.*

0.94.42
-------

* Fixed a small problem with voice library being overwritten by HL2 RP.
* *Contributed by NightAngel.*

0.94.41
-------

Expand Down
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.41"
"version" "0.94.51"
"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 @@ -287,6 +287,12 @@ end;
function PANEL:OpenPanel(vguiName, childData, Callback)
if (!Clockwork.theme:Call("PreCharacterMenuOpenPanel", self, vguiName, childData, Callback)) then
local panel = Clockwork.character:GetActivePanel();
local y = ScrH() * 0.275;
if (ScrH() < 768) then
y = ScrH() * 0.11;
end;
if (panel) then
panel:FadeOut(0.5, function()
Expand All @@ -296,7 +302,10 @@ function PANEL:OpenPanel(vguiName, childData, Callback)
Clockwork.character.activePanel:SetAlpha(0);
Clockwork.character.activePanel:FadeIn(0.5);
Clockwork.character.activePanel:MakePopup();
Clockwork.character.activePanel:SetPos(ScrW() * 0.2, ScrH() * 0.275);
Clockwork.character.activePanel:SetPos(ScrW() * 0.2, y);
if (Callback) then
Callback(Clockwork.character.activePanel);
Expand All @@ -315,7 +324,7 @@ function PANEL:OpenPanel(vguiName, childData, Callback)
Clockwork.character.activePanel:SetAlpha(0);
Clockwork.character.activePanel:FadeIn(0.5);
Clockwork.character.activePanel:MakePopup();
Clockwork.character.activePanel:SetPos(ScrW() * 0.2, ScrH() * 0.275);
Clockwork.character.activePanel:SetPos(ScrW() * 0.2, y);
if (Callback) then
Callback(Clockwork.character.activePanel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
http://cloudsixteen.com/license/clockwork.html
--]]
Clockwork.voices = Clockwork.kernel:NewLibrary("Voices");
Clockwork.voices = Clockwork.kernel:NewLibrary("CWVoices");
Clockwork.voices.groups = {};
-- A function to add a voice group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ end;
Clockwork.ClockworkFolder = Clockwork.ClockworkFolder or GM.Folder;
Clockwork.SchemaFolder = Clockwork.SchemaFolder or GM.Folder;
Clockwork.KernelVersion = "0.94.41";
Clockwork.KernelVersion = "0.94.51";
Clockwork.KernelBuild = "beta"
Clockwork.DeveloperVersion = true;
Clockwork.Website = "http://kurozael.com";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ Clockwork.datastream:Hook("SalesmenuRebuild", function(data)
end;
end);
Clockwork.datastream:Hook("SalesmanPlaySound", function(data)
-- surface.PlaySound(data[1]);
if (data[2] and data[2]:IsValid()) then
data[2]:EmitSound(data[1]);
end;
end);
Clockwork.datastream:Hook("SalesmanAdd", function(data)
if (Clockwork.salesman:IsSalesmanOpen()) then
CloseDermaMenus();
Expand All @@ -62,7 +69,14 @@ Clockwork.datastream:Hook("SalesmanAdd", function(data)
Clockwork.salesman.model = "models/humans/group01/male_0"..math.random(1, 9)..".mdl";
Clockwork.salesman.items = {};
Clockwork.salesman.cash = -1;
Clockwork.salesman.text = {};
Clockwork.salesman.text = {
doneBusiness = {},
cannotAfford = {},
needMore = {},
noStock = {},
noSale = {},
start = {}
};
Clockwork.salesman.buys = {};
Clockwork.salesman.name = Clockwork.salesman.name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,43 +111,61 @@ function PANEL:Init()
self.responsesForm:SetPadding(4);
self.responsesForm:SetName("Responses");
self.settingsForm:AddItem(self.responsesForm);
self.startText = self.responsesForm:TextEntry("When the player starts trading.");
self.startSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
self.startHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.");
self.noSaleText = self.responsesForm:TextEntry("When the player cannot trade with them.");
self.noSaleSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
self.noSaleHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.");
self.noStockText = self.responsesForm:TextEntry("When the salesman does not have an item in stock.");
self.noStockSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
self.noStockHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.");
self.needMoreText = self.responsesForm:TextEntry("When the player cannot afford the item.");
self.needMoreSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
self.needMoreHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.");
self.cannotAffordText = self.responsesForm:TextEntry("When the salesman cannot afford the item.");
self.cannotAffordSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
self.cannotAffordHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.")
self.doneBusinessText = self.responsesForm:TextEntry("When the player is done doing trading.");
self.doneBusinessSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
self.doneBusinessHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.")
if (!Clockwork.salesman.text.noSale) then
self.noSaleText:SetValue("I cannot trade my inventory with you!");
else
self.noSaleText:SetValue(Clockwork.salesman.text.noSale);
end;
if (!Clockwork.salesman.text.noStock) then
self.noStockText:SetValue("I do not have that item in stock!");
else
self.noStockText:SetValue(Clockwork.salesman.text.noStock);
end;
if (!Clockwork.salesman.text.needMore) then
self.needMoreText:SetValue("You cannot afford to buy that from me!");
else
self.needMoreText:SetValue(Clockwork.salesman.text.needMore);
end;
if (!Clockwork.salesman.text.cannotAfford) then
self.cannotAffordText:SetValue("I cannot afford to buy that item from you!");
else
self.cannotAffordText:SetValue(Clockwork.salesman.text.cannotAfford);
end;
if (!Clockwork.salesman.text.doneBusiness) then
self.doneBusinessText:SetValue("Thanks for doing business, see you soon!");
else
self.doneBusinessText:SetValue(Clockwork.salesman.text.doneBusiness);
end;
self.startText:SetValue(Clockwork.salesman.text.start.text or "How can I help you today?");
self.startSound:SetValue(Clockwork.salesman.text.start.sound or "");
self.startHideName:SetValue(Clockwork.salesman.text.start.bHideName == true);
self.noSaleText:SetValue(Clockwork.salesman.text.noSale.text or "I cannot trade my inventory with you!");
self.noSaleSound:SetValue(Clockwork.salesman.text.noSale.sound or "");
self.noSaleHideName:SetValue(Clockwork.salesman.text.noSale.bHideName == true);
self.noStockText:SetValue(Clockwork.salesman.text.noStock.text or "I do not have that item in stock!");
self.noStockSound:SetValue(Clockwork.salesman.text.noStock.sound or "");
self.noStockHideName:SetValue(Clockwork.salesman.text.noStock.bHideName == true);
self.needMoreText:SetValue(Clockwork.salesman.text.needMore.text or "You cannot afford to buy that from me!");
self.needMoreSound:SetValue(Clockwork.salesman.text.needMore.sound or "");
self.needMoreHideName:SetValue(Clockwork.salesman.text.needMore.bHideName == true);
self.cannotAffordText:SetValue(Clockwork.salesman.text.cannotAfford.text or "I cannot afford to buy that item from you!");
self.cannotAffordSound:SetValue(Clockwork.salesman.text.cannotAfford.sound or "");
self.cannotAffordHideName:SetValue(Clockwork.salesman.text.cannotAfford.bHideName == true);
self.doneBusinessText:SetValue(Clockwork.salesman.text.doneBusiness.text or "Thanks for doing business, see you soon!");
self.doneBusinessSound:SetValue(Clockwork.salesman.text.doneBusiness.sound or "");
self.doneBusinessHideName:SetValue(Clockwork.salesman.text.doneBusiness.bHideName == true);
self.factionsForm = vgui.Create("DForm");
self.factionsForm:SetPadding(4);
self.factionsForm:SetName("Factions");
Expand Down Expand Up @@ -285,11 +303,36 @@ function PANEL:Think()
self:SetSize(ScrW() * 0.5, ScrH() * 0.75);
self:SetPos((ScrW() / 2) - (self:GetWide() / 2), (ScrH() / 2) - (self:GetTall() / 2));
Clockwork.salesman.text.doneBusiness = self.doneBusinessText:GetValue();
Clockwork.salesman.text.cannotAfford = self.cannotAffordText:GetValue();
Clockwork.salesman.text.needMore = self.needMoreText:GetValue();
Clockwork.salesman.text.noStock = self.noStockText:GetValue();
Clockwork.salesman.text.noSale = self.noSaleText:GetValue();
Clockwork.salesman.text.doneBusiness = {
text = self.doneBusinessText:GetValue(),
bHideName = (self.doneBusinessHideName:GetChecked() == true),
sound = self.doneBusinessSound:GetValue()
};
Clockwork.salesman.text.cannotAfford = {
text = self.cannotAffordText:GetValue(),
bHideName = (self.cannotAffordHideName:GetChecked() == true),
sound = self.cannotAffordSound:GetValue()
};
Clockwork.salesman.text.needMore = {
text = self.needMoreText:GetValue(),
bHideName = (self.needMoreHideName:GetChecked() == true),
sound = self.needMoreSound:GetValue()
};
Clockwork.salesman.text.noStock = {
text = self.noStockText:GetValue(),
bHideName = (self.noStockHideName:GetChecked() == true),
sound = self.noStockSound:GetValue()
};
Clockwork.salesman.text.noSale = {
text = self.noSaleText:GetValue(),
bHideName = (self.noSaleHideName:GetChecked() == true),
sound = self.noSaleSound:GetValue()
};
Clockwork.salesman.text.start = {
text = self.startText:GetValue(),
bHideName = (self.startHideName:GetChecked() == true),
sound = self.startSound:GetValue()
};
Clockwork.salesman.showChatBubble = (self.showChatBubble:GetChecked() == true);
Clockwork.salesman.buyInShipments = (self.buyInShipments:GetChecked() == true);
Clockwork.salesman.physDesc = self.physDesc:GetValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,17 @@ end;
-- A function to talk to a player.
function ENT:TalkToPlayer(player, text, default)
Clockwork.player:Notify(player, self:GetNetworkedString("Name").." says \""..(text or default).."\"");
local sayString = text.text or default;
if (text.bHideName != true) then
sayString = self:GetNetworkedString("Name").." says \""..sayString.."\"";
end;
Clockwork.player:Notify(player, sayString);
if (text.sound and text.sound != "") then
Clockwork.datastream:Start(player, "SalesmanPlaySound", {text.sound, self});
end;
end;
-- Called to setup the animation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function cwSalesmen:PlayerCanUseSalesman(player, entity)
end;
if (bDisallowed) then
entity:TalkToPlayer(player, entity.cwTextTab.noSale or "I cannot trade my inventory with you!");
entity:TalkToPlayer(player, entity.cwTextTab.noSale, "I cannot trade my inventory with you!");
return false;
end;
end;
Expand All @@ -56,4 +56,6 @@ function cwSalesmen:PlayerUseSalesman(player, entity)
buys = entity.cwBuyTab,
name = entity:GetNetworkedString("Name")
});
entity:TalkToPlayer(player, entity.cwTextTab.start, "How can I help you today?");
end;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Clockwork.datastream:Hook("SalesmanDone", function(player, data)
if (IsValid(data) and data:GetClass() == "cw_salesman") then
data:TalkToPlayer(player, data.cwTextTab.doneBusiness or "Thanks for doing business, see you soon!");
data:TalkToPlayer(player, data.cwTextTab.doneBusiness, "Thanks for doing business, see you soon!");
end;
end);
Expand All @@ -20,7 +20,7 @@ Clockwork.datastream:Hook("Salesmenu", function(player, data)
if (data.tradeType == "Sells" and !itemTable("isBaseItem") and data.entity.cwSellTab[data.uniqueID]) then
if (data.entity.cwStock[itemUniqueID] == 0) then
data.entity:TalkToPlayer(player, data.entity.cwTextTab.noStock or "I do not have that item in stock!");
data.entity:TalkToPlayer(player, data.entity.cwTextTab.noStock, "I do not have that item in stock!");
return;
end;
Expand Down Expand Up @@ -74,7 +74,12 @@ Clockwork.datastream:Hook("Salesmenu", function(player, data)
end;
else
local cashRequired = (cost * amount) - player:GetCash();
data.entity:TalkToPlayer(player, data.entity.cwTextTab.needMore or "You need another "..Clockwork.kernel:FormatCash(cashRequired, nil, true).."!");
data.entity:TalkToPlayer(
player,
data.entity.cwTextTab.needMore,
"You need another "..Clockwork.kernel:FormatCash(cashRequired, nil, true).."!"
);
end;
elseif (data.tradeType == "Buys" and !itemTable("isBaseItem") and data.entity.cwBuyTab[itemUniqueID]) then
local itemTable = player:FindItemByID(data.uniqueID, data.itemID);
Expand All @@ -100,7 +105,7 @@ Clockwork.datastream:Hook("Salesmenu", function(player, data)
Clockwork.player:Notify(player, "You have sold 1 "..itemTable("name").." to "..data.entity:GetNetworkedString("Name")..".");
end;
else
data.entity:TalkToPlayer(player, data.entity.cwTextTab.cannotAfford or "I cannot afford to buy that item from you!");
data.entity:TalkToPlayer(player, data.entity.cwTextTab.cannotAfford, "I cannot afford to buy that item from you!");
end;
Clockwork.datastream:Start(player, "SalesmenuRebuild", data.entity.cwCash);
Expand Down Expand Up @@ -190,6 +195,8 @@ Clockwork.datastream:Hook("SalesmanAdd", function(player, data)
salesman.cwFactions = data.factions;
salesman.cwPriceScale = data.priceScale;
salesman.cwBuyInShipments = data.buyInShipments;
salesman.cwAnimation = player.cwSalesmanAnim;
salesman:SetupSalesman(data.name, data.physDesc, player.cwSalesmanAnim, data.showChatBubble);
Clockwork.entity:MakeSafe(salesman, true, true);
Expand Down Expand Up @@ -225,9 +232,11 @@ function cwSalesmen:LoadSalesmen()
salesman.cwTextTab = v.textTab;
salesman.cwPriceScale = v.priceScale;
salesman.cwBuyInShipments = v.buyInShipments;
salesman.cwAnimation = v.animation;
salesman:SetupSalesman(v.name, v.physDesc, v.animation, v.showChatBubble);
Clockwork.entity:MakeSafe(salesman, true, true);
self.salesmen[k] = salesman;
end;
end;
Expand Down

0 comments on commit 4f075fe

Please sign in to comment.