mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
86 lines
1.8 KiB
Plaintext
86 lines
1.8 KiB
Plaintext
|
|
include library.utils;
|
|
|
|
const string_id MNU_SET_COLOR = new string_id("sui","set_color");
|
|
|
|
trigger OnObjectMenuRequest(obj_id player, menu_info mi)
|
|
{
|
|
int mnuSetColor = mi.addRootMenu(menu_info_types.SERVER_MENU1, MNU_SET_COLOR);
|
|
|
|
for ( int i = 0; i < utils.WAYPOINT_COLORS.length; i++ )
|
|
mi.addSubMenu(mnuSetColor, menu_info_types.SERVER_MENU1 + i + 1, new string_id("sui", utils.WAYPOINT_COLORS[i]));
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnObjectMenuSelect(obj_id player, int item)
|
|
{
|
|
int max = menu_info_types.SERVER_MENU1 + utils.WAYPOINT_COLORS.length + 1;
|
|
|
|
if ( item > menu_info_types.SERVER_MENU1 && item < max ) //waypoint color selection!!
|
|
{
|
|
int idx = item - menu_info_types.SERVER_MENU1 - 1;
|
|
setWaypointColor(self, utils.WAYPOINT_COLORS[idx]);
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnDestroy()
|
|
{
|
|
clearClientPath(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnAboutToBeTransferred(obj_id destContainer, obj_id transferer)
|
|
{
|
|
clearClientPath(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
void clearClientPath(obj_id self)
|
|
{
|
|
if ( hasObjVar(self, "hasClientPath") )
|
|
{
|
|
obj_id target = getObjIdObjVar(self, "hasClientPath");
|
|
if ( isIdValid(target) )
|
|
{
|
|
destroyClientPath(target);
|
|
}
|
|
}
|
|
}
|
|
|
|
messageHandler OnSetWaypointActive()
|
|
{
|
|
boolean isActive = params.getBoolean("isActive");
|
|
obj_id waypoint = params.getObjId("waypoint");
|
|
if(waypoint != null)
|
|
{
|
|
_setWaypointActiveNative(waypoint, isActive);
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler OnSetWaypointRegion()
|
|
{
|
|
obj_id w = params.getObjId("waypoint");
|
|
region r = params.getRegion("region");
|
|
if(w != null)
|
|
{
|
|
if(r != null)
|
|
{
|
|
}
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler OnSetWaypoinVisible()
|
|
{
|
|
boolean isVisible = params.getBoolean("isVisible");
|
|
obj_id waypoint = params.getObjId("waypoint");
|
|
if(waypoint != null)
|
|
{
|
|
}
|
|
return SCRIPT_CONTINUE;
|
|
}
|