Skip to content

Commit

Permalink
Updated 3.7.4
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
adishno committed Nov 30, 2023
1 parent d34a655 commit 2191b8f
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 3 deletions.
15 changes: 15 additions & 0 deletions content/plugins/wtw-3dinternet/scripts/class_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,21 @@ WTW_3DINTERNET.prototype.downloadUserAvatarVersionResponse = function(zobj, zglo
/* download and update user avatar by version - process after local response */
try {
if (zglobaluseravatarid != '') {
var zrequest = {
'webid': zwebid,
'serverinstanceid': dGet('wtw_serverinstanceid').value,
'domainurl': wtw_domainurl,
'globaluserid': btoa(dGet('wtw_tglobaluserid').value),
'globaluseravatarid': zglobaluseravatarid,
'useravatarid': zuseravatarid,
'userid': dGet('wtw_tuserid').value,
'instanceid': dGet('wtw_tinstanceid').value,
'updatewebid': zupdatewebid,
'versionid': zversionid,
'version': zversion,
'webtype': zwebtype,
'function':'downloadupdateuseravatar'
};
WTW.postAsyncJSON('https://3dnet.walktheweb.com/connect/globalsaveavatar.php', zrequest,
function(zresponse) {
zresponse = JSON.parse(zresponse);
Expand Down
61 changes: 61 additions & 0 deletions content/plugins/wtw-avatars/functions/class_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,67 @@ public function saveAvatarColor($zuseravatarid, $zinstanceid, $zavatarpart, $zdi
return $zfoundavatarpartid;
}

public function saveAvatarScaling($zuseravatarid, $zinstanceid, $zscalingx, $zscalingy, $zscalingz) {
/* save the user avatar scaling */
global $wtwplugins;
$zresponse = array(
'serror'=>'',
'useravatarid'=>$zuseravatarid
);
try {
if ($wtwplugins->hasValue($zuseravatarid)) {
$zfounduseravatarid = '';
$zresults = $wtwplugins->query("
select *
from ".wtw_tableprefix."useravatars
where useravatarid='".$zuseravatarid."'
and userid='".$wtwplugins->userid."';");
foreach ($zresults as $zrow) {
$zfounduseravatarid = $zrow["useravatarid"];
}
if ($wtwplugins->hasValue($zfounduseravatarid)) {
if (!is_numeric($zscalingx)) {
$zscalingx = 1;
}
if (!is_numeric($zscalingy)) {
$zscalingy = 1;
}
if (!is_numeric($zscalingz)) {
$zscalingz = 1;
}
$wtwplugins->query("
update ".wtw_tableprefix."useravatars
set scalingx=".$zscalingx.",
scalingy=".$zscalingy.",
scalingz=".$zscalingz.",
updatedate=now(),
updateuserid='".$wtwplugins->userid."'
where useravatarid='".$zfounduseravatarid."'
and createuserid='".$wtwplugins->userid."'
limit 1;
");
} else {
$zresponse = array(
'serror'=>'Avatar ID not found',
'useravatarid'=>$zuseravatarid
);
}
} else {
$zresponse = array(
'serror'=>'Requires An Avatar ID',
'useravatarid'=>$zuseravatarid
);
}
} catch (Exception $e) {
$wtwplugins->serror("plugins:wtw-avatars:functions-class_functions.php-saveAvatarScaling=".$e->getMessage());
$zresponse = array(
'serror'=>$e->getMessage(),
'useravatarid'=>$zuseravatarid
);
}
return $zresponse;
}

public function saveAvatarAnimation($zuseravatarid, $zinstanceid, $zavataranimationid, $zanimationevent) {
global $wtwplugins;
$zfounduseravataranimationid = '';
Expand Down
4 changes: 2 additions & 2 deletions content/plugins/wtw-avatars/functions/class_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public function __construct() {
}
}

public $version = "1.0.4";
public $version = "1.0.5";
public $dbversion = "1.0.1";
public $versiondate = "2023-9-5";
public $versiondate = "2023-11-29";

public function __call ($method, $arguments) {
if (isset($this->$method)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
'serror'=> ''
);
break;
case "saveavatarscaling":
$zresponse = $wtwavatars_functions->saveAvatarScaling($zuseravatarid, $zinstanceid, $zscalingx, $zscalingy, $zscalingz);
break;
case "saveavatarcolor":
$zavatarpartid = $wtwavatars_functions->saveAvatarColor($zuseravatarid, $zinstanceid, $zavatarpart, $zdiffusecolor, $zspecularcolor, $zemissivecolor, $zambientcolor);
$zresponse = array(
Expand Down
2 changes: 1 addition & 1 deletion content/plugins/wtw-avatars/wtw-avatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# title = WalkTheWeb Avatars Plugin
# description = WalkTheWeb Avatar Creator and Editor
# author = Aaron Dishno Ed.D.
# version = 1.0.4
# version = 1.0.5
# releasedate = 9/5/2023

/* change the information above for your plugin */
Expand Down

0 comments on commit 2191b8f

Please sign in to comment.