Skip to content

Commit 2191b8f

Browse files
authored
Updated 3.7.4
Edit My Avatar 3D Form Functions - There are numerous new functions, hovers, click events, and loading conditions that have been added to the wtw_hud_login.js file to support the new Edit My Avatar 3D Form. Added Save Avatar Scaling Function - We added a function called saveAvatarScaling to the 3D-Avatars plugin to save the scaling values for the local user avatar. We also added a handler case for saveavatarscaling to call this function. Added Scaling to 3D Form for Edit Avatar - You can now edit the scaling of the local User Avatars. When you open the User Menu (from the bottom browse menu, profile), you can select Edit My Avatar. This opens a new 3D Form for editing your avatar, Select the Size button on the left, then adjust the scale on the right. Click Save to keep the settings. Added 3D Form for Edit Avatar Colors - You can now edit the colors of the local User Avatars. When you open the User Menu (from the bottom browse menu, profile), you can select Edit My Avatar. This opens a new 3D Form for editing your avatar, Select an avatar part on the right then edit the colors. Click Save to keep the settings. Removed Save Avatar Color Handler Call - We removed the function for saveAvatarColor from avatars.php handler. This same handler call is available in the wtw-avatars plugin, /core/handlers/wtwavatars-saveavatar.php. Removed Save Avatar Color - We removed the function for saveAvatarColor from class_wtwavatars.php. This same function is available in the wtw-avatars plugin. Added Cancel to User Menu - We added a cancel button to the User Menu so that you can close it. This included renaming some buttons, resizing the log off button, and adding the new cancel button with animation. The animation also required setting changes in the HUD JavaScript file. Global Avatar Update missing Parameter - In the 3D Internet plugin, downloadUserAvatarVersionResponse function, the zrequest variable was not set, therefore not passing the right parameters. It has now been set to the correct values. Corrected link to Edit Community - When browsing a 3D Community Scene, the link on the bottom was not showing a link to edit the community when there are no 3D Buildings in the scene. This update to the wtw_core.js file sets the edit community link.
1 parent d34a655 commit 2191b8f

5 files changed

Lines changed: 82 additions & 3 deletions

File tree

content/plugins/wtw-3dinternet/scripts/class_main.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,21 @@ WTW_3DINTERNET.prototype.downloadUserAvatarVersionResponse = function(zobj, zglo
14681468
/* download and update user avatar by version - process after local response */
14691469
try {
14701470
if (zglobaluseravatarid != '') {
1471+
var zrequest = {
1472+
'webid': zwebid,
1473+
'serverinstanceid': dGet('wtw_serverinstanceid').value,
1474+
'domainurl': wtw_domainurl,
1475+
'globaluserid': btoa(dGet('wtw_tglobaluserid').value),
1476+
'globaluseravatarid': zglobaluseravatarid,
1477+
'useravatarid': zuseravatarid,
1478+
'userid': dGet('wtw_tuserid').value,
1479+
'instanceid': dGet('wtw_tinstanceid').value,
1480+
'updatewebid': zupdatewebid,
1481+
'versionid': zversionid,
1482+
'version': zversion,
1483+
'webtype': zwebtype,
1484+
'function':'downloadupdateuseravatar'
1485+
};
14711486
WTW.postAsyncJSON('https://3dnet.walktheweb.com/connect/globalsaveavatar.php', zrequest,
14721487
function(zresponse) {
14731488
zresponse = JSON.parse(zresponse);

content/plugins/wtw-avatars/functions/class_functions.php

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,67 @@ public function saveAvatarColor($zuseravatarid, $zinstanceid, $zavatarpart, $zdi
180180
return $zfoundavatarpartid;
181181
}
182182

183+
public function saveAvatarScaling($zuseravatarid, $zinstanceid, $zscalingx, $zscalingy, $zscalingz) {
184+
/* save the user avatar scaling */
185+
global $wtwplugins;
186+
$zresponse = array(
187+
'serror'=>'',
188+
'useravatarid'=>$zuseravatarid
189+
);
190+
try {
191+
if ($wtwplugins->hasValue($zuseravatarid)) {
192+
$zfounduseravatarid = '';
193+
$zresults = $wtwplugins->query("
194+
select *
195+
from ".wtw_tableprefix."useravatars
196+
where useravatarid='".$zuseravatarid."'
197+
and userid='".$wtwplugins->userid."';");
198+
foreach ($zresults as $zrow) {
199+
$zfounduseravatarid = $zrow["useravatarid"];
200+
}
201+
if ($wtwplugins->hasValue($zfounduseravatarid)) {
202+
if (!is_numeric($zscalingx)) {
203+
$zscalingx = 1;
204+
}
205+
if (!is_numeric($zscalingy)) {
206+
$zscalingy = 1;
207+
}
208+
if (!is_numeric($zscalingz)) {
209+
$zscalingz = 1;
210+
}
211+
$wtwplugins->query("
212+
update ".wtw_tableprefix."useravatars
213+
set scalingx=".$zscalingx.",
214+
scalingy=".$zscalingy.",
215+
scalingz=".$zscalingz.",
216+
updatedate=now(),
217+
updateuserid='".$wtwplugins->userid."'
218+
where useravatarid='".$zfounduseravatarid."'
219+
and createuserid='".$wtwplugins->userid."'
220+
limit 1;
221+
");
222+
} else {
223+
$zresponse = array(
224+
'serror'=>'Avatar ID not found',
225+
'useravatarid'=>$zuseravatarid
226+
);
227+
}
228+
} else {
229+
$zresponse = array(
230+
'serror'=>'Requires An Avatar ID',
231+
'useravatarid'=>$zuseravatarid
232+
);
233+
}
234+
} catch (Exception $e) {
235+
$wtwplugins->serror("plugins:wtw-avatars:functions-class_functions.php-saveAvatarScaling=".$e->getMessage());
236+
$zresponse = array(
237+
'serror'=>$e->getMessage(),
238+
'useravatarid'=>$zuseravatarid
239+
);
240+
}
241+
return $zresponse;
242+
}
243+
183244
public function saveAvatarAnimation($zuseravatarid, $zinstanceid, $zavataranimationid, $zanimationevent) {
184245
global $wtwplugins;
185246
$zfounduseravataranimationid = '';

content/plugins/wtw-avatars/functions/class_plugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public function __construct() {
1919
}
2020
}
2121

22-
public $version = "1.0.4";
22+
public $version = "1.0.5";
2323
public $dbversion = "1.0.1";
24-
public $versiondate = "2023-9-5";
24+
public $versiondate = "2023-11-29";
2525

2626
public function __call ($method, $arguments) {
2727
if (isset($this->$method)) {

content/plugins/wtw-avatars/handlers/wtwavatars-saveavatar.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
'serror'=> ''
5454
);
5555
break;
56+
case "saveavatarscaling":
57+
$zresponse = $wtwavatars_functions->saveAvatarScaling($zuseravatarid, $zinstanceid, $zscalingx, $zscalingy, $zscalingz);
58+
break;
5659
case "saveavatarcolor":
5760
$zavatarpartid = $wtwavatars_functions->saveAvatarColor($zuseravatarid, $zinstanceid, $zavatarpart, $zdiffusecolor, $zspecularcolor, $zemissivecolor, $zambientcolor);
5861
$zresponse = array(

content/plugins/wtw-avatars/wtw-avatars.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# title = WalkTheWeb Avatars Plugin
44
# description = WalkTheWeb Avatar Creator and Editor
55
# author = Aaron Dishno Ed.D.
6-
# version = 1.0.4
6+
# version = 1.0.5
77
# releasedate = 9/5/2023
88

99
/* change the information above for your plugin */

0 commit comments

Comments
 (0)