Author Topic: New Player List with Icons and status (unslove)-need help!!!  (Read 4585 times)


What exactly isn't working...?

What exactly isn't working...?
The icon does not showed up on the player list.

You can't use <bitmap:> in a guiTextListCtrl. It will just show up as the text you entered. You'll have to create guiBitmapCtrl's for the icons and parent them to the list.

You can't use <bitmap:> in a guiTextListCtrl. It will just show up as the text you entered. You'll have to create guiBitmapCtrl's for the icons and parent them to the list.
Can you give me an example? Please?

This is not done, this is an example.

[code ]if(isObject(NPL_Window))
{
   $NPL_Window = NPL_Window.getObject(0);
   new GuiBitmapCtrl(TrustList_Image) {
      profile = "GuiDefaultProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "0 0";
      extent = "64 64";
      minExtent = "8 2";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      bitmap = "IMAGEHERE";
      wrap = "0";
      lockAspectRatio = "0";
      alignLeft = "0";
      alignTop = "0";
      overflowImage = "0";
      keepCached = "0";
      mColor = "255 255 255 255";
      mMultiply = "0";
   };
   $NPL_Window.add(TrustList_Image);
}[/ code]
This is adding an image to the Player List or any GUI for that matter

Noticed you already had something like that
« Last Edit: August 16, 2014, 01:13:34 PM by Ampersand »

This is not done, this is an example.

[code ]if(isObject(NPL_Window))
{
   $NPL_Window = NPL_Window.getObject(0);
   new GuiBitmapCtrl(TrustList_Image) {
      profile = "GuiDefaultProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "0 0";
      extent = "64 64";
      minExtent = "8 2";
      enabled = "1";
      visible = "1";
      clipToParent = "1";
      bitmap = "IMAGEHERE";
      wrap = "0";
      lockAspectRatio = "0";
      alignLeft = "0";
      alignTop = "0";
      overflowImage = "0";
      keepCached = "0";
      mColor = "255 255 255 255";
      mMultiply = "0";
   };
   $NPL_Window.add(TrustList_Image);
}[/ code]
This is adding an image to the Player List or any GUI for that matter

Noticed you already had something like that

why strike line? That for a button. I am going asking someone will able help on this.


Can you give me an example? Please?
Code: [Select]
$example = new GuiMLTextCtrl() {
   profile = "w/e";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "w/e";
   extent = "246 13";
   minExtent = "8 2";
   enabled = "1";
   visible = "1";
   clipToParent = "1";
   lineSpacing = "2";
   allowColorChars = "0";
   maxChars = "-1";
   text = "blank";
   maxBitmapHeight = "-1";
   selectable = "1";
   autoResize = "1";
};
NPL_Window.add($Example);
if client admin
   $example.bitmap="blah";
blah blah blah

Or something like that maybe?

Code: [Select]
$example = new GuiMLTextCtrl() {
   profile = "w/e";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "w/e";
   extent = "246 13";
   minExtent = "8 2";
   enabled = "1";
   visible = "1";
   clipToParent = "1";
   lineSpacing = "2";
   allowColorChars = "0";
   maxChars = "-1";
   text = "blank";
   maxBitmapHeight = "-1";
   selectable = "1";
   autoResize = "1";
};
NPL_Window.add($Example);
if client admin
   $example.bitmap="blah";
blah blah blah

Or something like that maybe?
yes. It better for use a client script.

yes. It better for use a client script.
I was giving an example of how you can use a GuiMLTextCtrl as iirc they should be able to handle <bitmap:> properly as I know they can handle links.

I was giving an example of how you can use a GuiMLTextCtrl as iirc they should be able to handle <bitmap:> properly as I know they can handle links.
Umm, If you want to write the script, I will make sure you get credit for this. I will tweak some the lines.

(Please note these people didn't have any admin rights or w/e)

Joined the largest server, spent two minutes toying (mainly to find the name of the gui) and using GuiMlTextCtrl's was able to add bitmaps right over where the A/S/- appear. This could be refined even further to center under the admin section as well as removing/covering up the - so writing a script to do this using NewPlayerListGui::update(%this,%cl,%name,%blid,%a,%b,%c) shouldn't be hard at all. Please note I have no clue what %a,%b,%c are for, but I'm assuming that one of them is for admin.

(Please note these people didn't have any admin rights or w/e)

Joined the largest server, spent two minutes toying (mainly to find the name of the gui) and using GuiMlTextCtrl's was able to add bitmaps right over where the A/S/- appear. This could be refined even further to center under the admin section as well as removing/covering up the - so writing a script to do this using NewPlayerListGui::update(%this,%cl,%name,%blid,%a,%b,%c) shouldn't be hard at all. Please note I have no clue what %a,%b,%c are for, but I'm assuming that one of them is for admin.


Awesome! check out at my thread:
http://forum.blockland.us/index.php?topic=264795.0

the icons delete as players leave, as they're supposed to. But getting them to move into place after someone leaves isn't working. Also there's no code for moving the icons if the player list sorting is changed, as I have no idea how to pull that part off as I can't even move them when someone leaves the game

Client.cs
Code: [Select]

package NotAnActualPackage
{
function gameConnection::onConnectionAccepted(%t)
{
schedule(0,0,swol_saveServerName());
return parent::onConnectionAccepted(%t);
}
function swol_saveServerName()
{
$Swol::ServerName = $ServerInfo::Name;
$Swol::ServerHostName = swol_getHostName();
}
function swol_getHostName()
{
%s = $Swol::ServerName;
if(%s $= "")
%s = $ServerInfo::Name;
%a = strPos(%s,"'s");
%b = strPos(%s,"s'");
if(%a >= %b)
%c = %a;
else
%c = %b;
if(%c == -1)
return "";
%n = getSubStr(%s,0,%c);
return %n;
}
function NewPlayerListGui::update(%this,%cl,%name,%blid,%a,%b,%c)
{
$qq=NPL_List.RowCount();
parent::update(%this,%cl,%name,%blid,%a,%b,%c);
// echo(%name);
// echo(%a SPC "-" SPC %b SPC "-" SPC %c);
}
function NPL_List::addRow(%this,%i,%t)
{
if(getField(%t,0) $= "S" && getField(%t,1) $= $Swol::ServerHostName)
{
%t = "H" @ getSubStr(%t,1,strLen(%t)-1);
%j = "<bitmap:add-ons/Script_Statuses/Icon_HostShield.png>";
}
else if(getField(%t,0) $= "S" && getField(%t,1) !$= $Swol::ServerHostName)
{
// %t = " " @ getSubStr(%t,1,strLen(%t)-1);
%j = "<bitmap:add-ons/Script_Statuses/Icon_SuperAdminShield.png>";
}
else if(getField(%t,0) $= "A")
{
// %t = " " @ getSubStr(%t,1,strLen(%t)-1);
%j = "<bitmap:add-ons/Script_Statuses/Icon_AdminShield.png>";
}
else
{
// %t = " " @ getSubStr(%t,1,strLen(%t)-1);
%j = "<bitmap:add-ons/Script_Statuses/Icon_PlayerShield.png>";
}
if($testfornow)
{
if(isObject($q[$qq]))
{
$q[$qq].delete();
}
//%i=NPL_List.getRowID();
//$testfornow=false;
$q[%i]=new GuiMLTextCtrl()
{
profile = "GuiMLTextCtrl";
horizSizing = "right";
vertSizing = "bottom";
position = "20" SPC 20*$qq;
extent = "16 16";
minExtent = "8 2";
enabled = "1";
visible = "1";
clipToParent = "1";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = %j;
maxBitmapHeight = "-1";
selectable = "0";
autoResize = "0";
};
// %a=NPL_List.getRowID($q,NPL_List);
// $q_[$qq]=$qq;
// warn(%i);
NPL_Scroll.add($q[%i]);
$qq++;
}
parent::addRow(%this,%i,%t);
}
function NPL_list::removeRow(%this,%a)
{
parent::removeRow(%this,%a);
// warn(%a);
$q[%a].delete();
}
function NPL_list::removeRowByID(%this,%a)
{
parent::removeRowByID(%this,%a);
// warn(%a);
//NPL_List::ResetIcons();
$q[%a].delete();
}
function NPL_List::ResetIcons(%this)
{
if($qq<=0)
return;
for(%i=0;%i<$qq;%i++)
{
$q[%i].delete();
}
NewPlayerListGui::update();
}
};
activatePackage(NotAnActualPackage);
$testfornow=true;
$qq=-1;

function NPL_AddButtons()
{
%a = new GuiBitmapButtonCtrl(Legend_Icons) {
profile = "BlockButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "380 33";
extent = "100 19";
minExtent = "8 2";
enabled = "1";
visible = "1";
clipToParent = "1";
command = "";
text = "Legend Icons";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "base/client/ui/button1";
lockAspectRatio = "0";
alignLeft = "0";
alignTop = "0";
overflowImage = "0";
mKeepCached = "0";
mColor = "255 255 255 255";
};
%b = new GuiBitmapCtrl() {
profile = "GuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "52 33";
extent = "100 19";
minExtent = "8 2";
enabled = "1";
visible = "1";
clipToParent = "1";
command = "";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "base/data/shapes/white";
lockAspectRatio = "0";
alignLeft = "0";
alignTop = "0";
overflowImage = "0";
mKeepCached = "0";
mColor = "200 200 200 255";
};
%c = new GuiBitmapButtonCtrl(Status) {
profile = "BlockButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "56 33";
extent = "50 19";
minExtent = "8 2";
enabled = "1";
visible = "1";
clipToParent = "1";
command = "";
text = "Status";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "base/client/ui/button1";
lockAspectRatio = "0";
alignLeft = "0";
alignTop = "0";
overflowImage = "0";
mKeepCached = "0";
mColor = "255 255 255 255";
};
%d = new GuiBitmapButtonCtrl() {
profile = "BlockButtonProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "110 33";
extent = "68 19";
minExtent = "8 2";
enabled = "1";
visible = "1";
clipToParent = "1";
command = "NewPlayerListGui.sortList(1);";
text = "Name";
groupNum = "-1";
buttonType = "PushButton";
bitmap = "base/client/ui/button1";
lockAspectRatio = "0";
alignLeft = "0";
alignTop = "0";
overflowImage = "0";
mKeepCached = "0";
mColor = "255 255 255 255";
};
NPL_Window.add(%a);
NPL_Window.add(%b);
NPL_Window.add(%c);
NPL_Window.add(%d);
}
NPL_AddButtons();