Skip to content

Commit 4f075fe

Browse files
committed
Clockwork 0.94.51 Beta
* 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
1 parent f554db0 commit 4f075fe

File tree

10 files changed

+154
-47
lines changed

10 files changed

+154
-47
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@ Changelog
22
---------
33
The following changes have been made for each official Clockwork build.
44

5+
0.94.51
6+
-------
7+
8+
* Fixes problem with some menus overlapping next buttons for lower resolutions in char creation
9+
* *Contributed by NightAngel.*
10+
11+
0.94.5
12+
-------
13+
14+
* Fixed animations not saving for salesmen
15+
* Added sounds for phrases and whether or not a phrase will display the salesman's name
16+
* Added phrase for when a player starts trading with a salesman
17+
* *Contributed by NightAngel.*
18+
19+
0.94.42
20+
-------
21+
22+
* Fixed a small problem with voice library being overwritten by HL2 RP.
23+
* *Contributed by NightAngel.*
24+
525
0.94.41
626
-------
727

Clockwork/garrysmod/gamemodes/clockwork/clockwork.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"settings"
66
{
77
}
8-
"version" "0.94.41"
8+
"version" "0.94.51"
99
"author" "Cloud Sixteen"
1010
"description" "A roleplaying framework developed by Cloud Sixteen for the people."
1111
"workshopid" "474315121"

Clockwork/garrysmod/gamemodes/clockwork/framework/derma/cl_character.lua

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ end;
287287
function PANEL:OpenPanel(vguiName, childData, Callback)
288288
if (!Clockwork.theme:Call("PreCharacterMenuOpenPanel", self, vguiName, childData, Callback)) then
289289
local panel = Clockwork.character:GetActivePanel();
290+
291+
local y = ScrH() * 0.275;
292+
293+
if (ScrH() < 768) then
294+
y = ScrH() * 0.11;
295+
end;
290296

291297
if (panel) then
292298
panel:FadeOut(0.5, function()
@@ -296,7 +302,10 @@ function PANEL:OpenPanel(vguiName, childData, Callback)
296302
Clockwork.character.activePanel:SetAlpha(0);
297303
Clockwork.character.activePanel:FadeIn(0.5);
298304
Clockwork.character.activePanel:MakePopup();
299-
Clockwork.character.activePanel:SetPos(ScrW() * 0.2, ScrH() * 0.275);
305+
306+
307+
308+
Clockwork.character.activePanel:SetPos(ScrW() * 0.2, y);
300309

301310
if (Callback) then
302311
Callback(Clockwork.character.activePanel);
@@ -315,7 +324,7 @@ function PANEL:OpenPanel(vguiName, childData, Callback)
315324
Clockwork.character.activePanel:SetAlpha(0);
316325
Clockwork.character.activePanel:FadeIn(0.5);
317326
Clockwork.character.activePanel:MakePopup();
318-
Clockwork.character.activePanel:SetPos(ScrW() * 0.2, ScrH() * 0.275);
327+
Clockwork.character.activePanel:SetPos(ScrW() * 0.2, y);
319328

320329
if (Callback) then
321330
Callback(Clockwork.character.activePanel);

Clockwork/garrysmod/gamemodes/clockwork/framework/libraries/sh_voices.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
http://cloudsixteen.com/license/clockwork.html
77
--]]
88

9-
Clockwork.voices = Clockwork.kernel:NewLibrary("Voices");
9+
Clockwork.voices = Clockwork.kernel:NewLibrary("CWVoices");
1010
Clockwork.voices.groups = {};
1111

1212
-- A function to add a voice group.

Clockwork/garrysmod/gamemodes/clockwork/framework/sh_boot.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ end;
2828

2929
Clockwork.ClockworkFolder = Clockwork.ClockworkFolder or GM.Folder;
3030
Clockwork.SchemaFolder = Clockwork.SchemaFolder or GM.Folder;
31-
Clockwork.KernelVersion = "0.94.41";
31+
Clockwork.KernelVersion = "0.94.51";
3232
Clockwork.KernelBuild = "beta"
3333
Clockwork.DeveloperVersion = true;
3434
Clockwork.Website = "http://kurozael.com";

Clockwork/garrysmod/gamemodes/clockwork/plugins/salesmen/plugin/cl_plugin.lua

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ Clockwork.datastream:Hook("SalesmenuRebuild", function(data)
3737
end;
3838
end);
3939

40+
Clockwork.datastream:Hook("SalesmanPlaySound", function(data)
41+
-- surface.PlaySound(data[1]);
42+
if (data[2] and data[2]:IsValid()) then
43+
data[2]:EmitSound(data[1]);
44+
end;
45+
end);
46+
4047
Clockwork.datastream:Hook("SalesmanAdd", function(data)
4148
if (Clockwork.salesman:IsSalesmanOpen()) then
4249
CloseDermaMenus();
@@ -62,7 +69,14 @@ Clockwork.datastream:Hook("SalesmanAdd", function(data)
6269
Clockwork.salesman.model = "models/humans/group01/male_0"..math.random(1, 9)..".mdl";
6370
Clockwork.salesman.items = {};
6471
Clockwork.salesman.cash = -1;
65-
Clockwork.salesman.text = {};
72+
Clockwork.salesman.text = {
73+
doneBusiness = {},
74+
cannotAfford = {},
75+
needMore = {},
76+
noStock = {},
77+
noSale = {},
78+
start = {}
79+
};
6680
Clockwork.salesman.buys = {};
6781
Clockwork.salesman.name = Clockwork.salesman.name;
6882

Clockwork/garrysmod/gamemodes/clockwork/plugins/salesmen/plugin/derma/cl_salesman.lua

Lines changed: 77 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -111,43 +111,61 @@ function PANEL:Init()
111111
self.responsesForm:SetPadding(4);
112112
self.responsesForm:SetName("Responses");
113113
self.settingsForm:AddItem(self.responsesForm);
114+
115+
self.startText = self.responsesForm:TextEntry("When the player starts trading.");
116+
self.startSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
117+
self.startHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.");
114118

115119
self.noSaleText = self.responsesForm:TextEntry("When the player cannot trade with them.");
120+
self.noSaleSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
121+
self.noSaleHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.");
122+
116123
self.noStockText = self.responsesForm:TextEntry("When the salesman does not have an item in stock.");
124+
self.noStockSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
125+
self.noStockHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.");
126+
117127
self.needMoreText = self.responsesForm:TextEntry("When the player cannot afford the item.");
128+
self.needMoreSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
129+
self.needMoreHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.");
130+
118131
self.cannotAffordText = self.responsesForm:TextEntry("When the salesman cannot afford the item.");
132+
self.cannotAffordSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
133+
self.cannotAffordHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.")
134+
119135
self.doneBusinessText = self.responsesForm:TextEntry("When the player is done doing trading.");
136+
self.doneBusinessSound = self.responsesForm:TextEntry("The sound to play for the above phrase.");
137+
self.doneBusinessHideName = self.responsesForm:CheckBox("Hide the salesman's name for the above phrase.")
120138

121-
if (!Clockwork.salesman.text.noSale) then
122-
self.noSaleText:SetValue("I cannot trade my inventory with you!");
123-
else
124-
self.noSaleText:SetValue(Clockwork.salesman.text.noSale);
125-
end;
126-
127-
if (!Clockwork.salesman.text.noStock) then
128-
self.noStockText:SetValue("I do not have that item in stock!");
129-
else
130-
self.noStockText:SetValue(Clockwork.salesman.text.noStock);
131-
end;
132-
133-
if (!Clockwork.salesman.text.needMore) then
134-
self.needMoreText:SetValue("You cannot afford to buy that from me!");
135-
else
136-
self.needMoreText:SetValue(Clockwork.salesman.text.needMore);
137-
end;
138-
139-
if (!Clockwork.salesman.text.cannotAfford) then
140-
self.cannotAffordText:SetValue("I cannot afford to buy that item from you!");
141-
else
142-
self.cannotAffordText:SetValue(Clockwork.salesman.text.cannotAfford);
143-
end;
144-
145-
if (!Clockwork.salesman.text.doneBusiness) then
146-
self.doneBusinessText:SetValue("Thanks for doing business, see you soon!");
147-
else
148-
self.doneBusinessText:SetValue(Clockwork.salesman.text.doneBusiness);
149-
end;
139+
self.startText:SetValue(Clockwork.salesman.text.start.text or "How can I help you today?");
140+
self.startSound:SetValue(Clockwork.salesman.text.start.sound or "");
141+
142+
self.startHideName:SetValue(Clockwork.salesman.text.start.bHideName == true);
143+
144+
self.noSaleText:SetValue(Clockwork.salesman.text.noSale.text or "I cannot trade my inventory with you!");
145+
self.noSaleSound:SetValue(Clockwork.salesman.text.noSale.sound or "");
146+
147+
self.noSaleHideName:SetValue(Clockwork.salesman.text.noSale.bHideName == true);
148+
149+
self.noStockText:SetValue(Clockwork.salesman.text.noStock.text or "I do not have that item in stock!");
150+
self.noStockSound:SetValue(Clockwork.salesman.text.noStock.sound or "");
151+
152+
self.noStockHideName:SetValue(Clockwork.salesman.text.noStock.bHideName == true);
150153

154+
self.needMoreText:SetValue(Clockwork.salesman.text.needMore.text or "You cannot afford to buy that from me!");
155+
self.needMoreSound:SetValue(Clockwork.salesman.text.needMore.sound or "");
156+
157+
self.needMoreHideName:SetValue(Clockwork.salesman.text.needMore.bHideName == true);
158+
159+
self.cannotAffordText:SetValue(Clockwork.salesman.text.cannotAfford.text or "I cannot afford to buy that item from you!");
160+
self.cannotAffordSound:SetValue(Clockwork.salesman.text.cannotAfford.sound or "");
161+
162+
self.cannotAffordHideName:SetValue(Clockwork.salesman.text.cannotAfford.bHideName == true);
163+
164+
self.doneBusinessText:SetValue(Clockwork.salesman.text.doneBusiness.text or "Thanks for doing business, see you soon!");
165+
self.doneBusinessSound:SetValue(Clockwork.salesman.text.doneBusiness.sound or "");
166+
167+
self.doneBusinessHideName:SetValue(Clockwork.salesman.text.doneBusiness.bHideName == true);
168+
151169
self.factionsForm = vgui.Create("DForm");
152170
self.factionsForm:SetPadding(4);
153171
self.factionsForm:SetName("Factions");
@@ -285,11 +303,36 @@ function PANEL:Think()
285303
self:SetSize(ScrW() * 0.5, ScrH() * 0.75);
286304
self:SetPos((ScrW() / 2) - (self:GetWide() / 2), (ScrH() / 2) - (self:GetTall() / 2));
287305

288-
Clockwork.salesman.text.doneBusiness = self.doneBusinessText:GetValue();
289-
Clockwork.salesman.text.cannotAfford = self.cannotAffordText:GetValue();
290-
Clockwork.salesman.text.needMore = self.needMoreText:GetValue();
291-
Clockwork.salesman.text.noStock = self.noStockText:GetValue();
292-
Clockwork.salesman.text.noSale = self.noSaleText:GetValue();
306+
Clockwork.salesman.text.doneBusiness = {
307+
text = self.doneBusinessText:GetValue(),
308+
bHideName = (self.doneBusinessHideName:GetChecked() == true),
309+
sound = self.doneBusinessSound:GetValue()
310+
};
311+
Clockwork.salesman.text.cannotAfford = {
312+
text = self.cannotAffordText:GetValue(),
313+
bHideName = (self.cannotAffordHideName:GetChecked() == true),
314+
sound = self.cannotAffordSound:GetValue()
315+
};
316+
Clockwork.salesman.text.needMore = {
317+
text = self.needMoreText:GetValue(),
318+
bHideName = (self.needMoreHideName:GetChecked() == true),
319+
sound = self.needMoreSound:GetValue()
320+
};
321+
Clockwork.salesman.text.noStock = {
322+
text = self.noStockText:GetValue(),
323+
bHideName = (self.noStockHideName:GetChecked() == true),
324+
sound = self.noStockSound:GetValue()
325+
};
326+
Clockwork.salesman.text.noSale = {
327+
text = self.noSaleText:GetValue(),
328+
bHideName = (self.noSaleHideName:GetChecked() == true),
329+
sound = self.noSaleSound:GetValue()
330+
};
331+
Clockwork.salesman.text.start = {
332+
text = self.startText:GetValue(),
333+
bHideName = (self.startHideName:GetChecked() == true),
334+
sound = self.startSound:GetValue()
335+
};
293336
Clockwork.salesman.showChatBubble = (self.showChatBubble:GetChecked() == true);
294337
Clockwork.salesman.buyInShipments = (self.buyInShipments:GetChecked() == true);
295338
Clockwork.salesman.physDesc = self.physDesc:GetValue();

Clockwork/garrysmod/gamemodes/clockwork/plugins/salesmen/plugin/entities/entities/cw_salesman/init.lua

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,17 @@ end;
3333

3434
-- A function to talk to a player.
3535
function ENT:TalkToPlayer(player, text, default)
36-
Clockwork.player:Notify(player, self:GetNetworkedString("Name").." says \""..(text or default).."\"");
36+
local sayString = text.text or default;
37+
38+
if (text.bHideName != true) then
39+
sayString = self:GetNetworkedString("Name").." says \""..sayString.."\"";
40+
end;
41+
42+
Clockwork.player:Notify(player, sayString);
43+
44+
if (text.sound and text.sound != "") then
45+
Clockwork.datastream:Start(player, "SalesmanPlaySound", {text.sound, self});
46+
end;
3747
end;
3848

3949
-- Called to setup the animation.

Clockwork/garrysmod/gamemodes/clockwork/plugins/salesmen/plugin/sv_hooks.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function cwSalesmen:PlayerCanUseSalesman(player, entity)
3535
end;
3636

3737
if (bDisallowed) then
38-
entity:TalkToPlayer(player, entity.cwTextTab.noSale or "I cannot trade my inventory with you!");
38+
entity:TalkToPlayer(player, entity.cwTextTab.noSale, "I cannot trade my inventory with you!");
3939
return false;
4040
end;
4141
end;
@@ -56,4 +56,6 @@ function cwSalesmen:PlayerUseSalesman(player, entity)
5656
buys = entity.cwBuyTab,
5757
name = entity:GetNetworkedString("Name")
5858
});
59+
60+
entity:TalkToPlayer(player, entity.cwTextTab.start, "How can I help you today?");
5961
end;

Clockwork/garrysmod/gamemodes/clockwork/plugins/salesmen/plugin/sv_plugin.lua

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Clockwork.datastream:Hook("SalesmanDone", function(player, data)
1010
if (IsValid(data) and data:GetClass() == "cw_salesman") then
11-
data:TalkToPlayer(player, data.cwTextTab.doneBusiness or "Thanks for doing business, see you soon!");
11+
data:TalkToPlayer(player, data.cwTextTab.doneBusiness, "Thanks for doing business, see you soon!");
1212
end;
1313
end);
1414

@@ -20,7 +20,7 @@ Clockwork.datastream:Hook("Salesmenu", function(player, data)
2020

2121
if (data.tradeType == "Sells" and !itemTable("isBaseItem") and data.entity.cwSellTab[data.uniqueID]) then
2222
if (data.entity.cwStock[itemUniqueID] == 0) then
23-
data.entity:TalkToPlayer(player, data.entity.cwTextTab.noStock or "I do not have that item in stock!");
23+
data.entity:TalkToPlayer(player, data.entity.cwTextTab.noStock, "I do not have that item in stock!");
2424

2525
return;
2626
end;
@@ -74,7 +74,12 @@ Clockwork.datastream:Hook("Salesmenu", function(player, data)
7474
end;
7575
else
7676
local cashRequired = (cost * amount) - player:GetCash();
77-
data.entity:TalkToPlayer(player, data.entity.cwTextTab.needMore or "You need another "..Clockwork.kernel:FormatCash(cashRequired, nil, true).."!");
77+
78+
data.entity:TalkToPlayer(
79+
player,
80+
data.entity.cwTextTab.needMore,
81+
"You need another "..Clockwork.kernel:FormatCash(cashRequired, nil, true).."!"
82+
);
7883
end;
7984
elseif (data.tradeType == "Buys" and !itemTable("isBaseItem") and data.entity.cwBuyTab[itemUniqueID]) then
8085
local itemTable = player:FindItemByID(data.uniqueID, data.itemID);
@@ -100,7 +105,7 @@ Clockwork.datastream:Hook("Salesmenu", function(player, data)
100105
Clockwork.player:Notify(player, "You have sold 1 "..itemTable("name").." to "..data.entity:GetNetworkedString("Name")..".");
101106
end;
102107
else
103-
data.entity:TalkToPlayer(player, data.entity.cwTextTab.cannotAfford or "I cannot afford to buy that item from you!");
108+
data.entity:TalkToPlayer(player, data.entity.cwTextTab.cannotAfford, "I cannot afford to buy that item from you!");
104109
end;
105110

106111
Clockwork.datastream:Start(player, "SalesmenuRebuild", data.entity.cwCash);
@@ -190,6 +195,8 @@ Clockwork.datastream:Hook("SalesmanAdd", function(player, data)
190195
salesman.cwFactions = data.factions;
191196
salesman.cwPriceScale = data.priceScale;
192197
salesman.cwBuyInShipments = data.buyInShipments;
198+
salesman.cwAnimation = player.cwSalesmanAnim;
199+
193200
salesman:SetupSalesman(data.name, data.physDesc, player.cwSalesmanAnim, data.showChatBubble);
194201

195202
Clockwork.entity:MakeSafe(salesman, true, true);
@@ -225,9 +232,11 @@ function cwSalesmen:LoadSalesmen()
225232
salesman.cwTextTab = v.textTab;
226233
salesman.cwPriceScale = v.priceScale;
227234
salesman.cwBuyInShipments = v.buyInShipments;
235+
salesman.cwAnimation = v.animation;
236+
228237
salesman:SetupSalesman(v.name, v.physDesc, v.animation, v.showChatBubble);
238+
229239
Clockwork.entity:MakeSafe(salesman, true, true);
230-
231240
self.salesmen[k] = salesman;
232241
end;
233242
end;

0 commit comments

Comments
 (0)