mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-01-15 23:04:31 -05:00
Pets can now be renamed multiple times
https://github.com/SWG-Source/qa-testing/issues/26
This commit is contained in:
@@ -749,10 +749,6 @@ public class beast extends script.base_script
|
||||
sendDirtyObjectMenuNotification(self);
|
||||
beast_lib.setBCDBeastName(beast_lib.getBeastBCD(self), beastName);
|
||||
beast_lib.setBeastName(self, beastName);
|
||||
if (hasObjVar(beast_lib.getBeastBCD(self), beast_lib.OBJVAR_OLD_PET_IDENTIFIER))
|
||||
{
|
||||
setObjVar(beast_lib.getBeastBCD(self), beast_lib.OBJVAR_OLD_PET_RENAMED, 1);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int handleGroupInvite(obj_id self, dictionary params) throws InterruptedException
|
||||
|
||||
@@ -46,7 +46,6 @@ public class beast_lib extends script.base_script
|
||||
public static final String OBJVAR_BEAST_PARENT = "beast.parent_creature_template";
|
||||
public static final String OBJVAR_BEAST_INCUBATION_BONUSES = "beast.incubation_bonuses";
|
||||
public static final String OBJVAR_OLD_PET_IDENTIFIER = "beast.converted_pet";
|
||||
public static final String OBJVAR_OLD_PET_RENAMED = "beast.old_pet_renamed";
|
||||
public static final String OBJVAR_OLD_PET_REHUED = "beast.old_pet_rehued";
|
||||
public static final String OBJVAR_BEAST_HUE = "beast.hue";
|
||||
public static final String OBJVAR_BEAST_HUE2 = "beast.hue2";
|
||||
|
||||
@@ -13,7 +13,7 @@ public class beast_display extends script.base_script
|
||||
}
|
||||
public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException
|
||||
{
|
||||
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED) && getOwner(self) == player)
|
||||
if (getOwner(self) == player)
|
||||
{
|
||||
mi.addRootMenu(menu_info_types.SERVER_MENU3, new string_id("beast", "name_beast"));
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class beast_display extends script.base_script
|
||||
public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException
|
||||
{
|
||||
sendDirtyObjectMenuNotification(self);
|
||||
if (item == menu_info_types.SERVER_MENU3 && !hasObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED) && getOwner(self) == player)
|
||||
if (item == menu_info_types.SERVER_MENU3 && getOwner(self) == player)
|
||||
{
|
||||
sui.inputbox(self, player, "@beast:name_d", sui.OK_CANCEL, "@beast:name_t", sui.INPUT_NORMAL, null, "handleSetBeastName", null);
|
||||
}
|
||||
@@ -152,7 +152,6 @@ public class beast_display extends script.base_script
|
||||
}
|
||||
sendDirtyObjectMenuNotification(self);
|
||||
setObjVar(self, "beast.beastName", beastName);
|
||||
setObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED, 1);
|
||||
setObjVar(self, incubator.DNA_PARENT_NAME, beastName);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
@@ -22,12 +22,10 @@ public class decoration_item extends script.base_script
|
||||
int management_root = mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_CONVERT_PET_ITEM_TO_DNA);
|
||||
}
|
||||
}
|
||||
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_REHUED) && getOwner(self) == player)
|
||||
{
|
||||
mi.addRootMenu(menu_info_types.SERVER_MENU2, PCOLOR);
|
||||
}
|
||||
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED) && getOwner(self) == player)
|
||||
{
|
||||
if (getOwner(self) == player){
|
||||
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_REHUED)){
|
||||
mi.addRootMenu(menu_info_types.SERVER_MENU2, PCOLOR);
|
||||
}
|
||||
mi.addRootMenu(menu_info_types.SERVER_MENU3, new string_id("beast", "name_beast"));
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
@@ -43,17 +41,15 @@ public class decoration_item extends script.base_script
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
}
|
||||
if (item == menu_info_types.SERVER_MENU2 && getOwner(self) == player)
|
||||
{
|
||||
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_REHUED))
|
||||
{
|
||||
sui.colorize(self, player, self, hue.INDEX_1, "handlePrimaryColorize");
|
||||
if (getOwner(self) == player) {
|
||||
if (item == menu_info_types.SERVER_MENU2) {
|
||||
if (!hasObjVar(self, beast_lib.OBJVAR_OLD_PET_REHUED)){
|
||||
sui.colorize(self, player, self, hue.INDEX_1, "handlePrimaryColorize");
|
||||
}
|
||||
} else if (item == menu_info_types.SERVER_MENU3) {
|
||||
sui.inputbox(self, player, "@beast:name_d", sui.OK_CANCEL, "@beast:name_t", sui.INPUT_NORMAL, null, "handleSetBeastName", null);
|
||||
}
|
||||
}
|
||||
if (item == menu_info_types.SERVER_MENU3 && !hasObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED) && getOwner(self) == player)
|
||||
{
|
||||
sui.inputbox(self, player, "@beast:name_d", sui.OK_CANCEL, "@beast:name_t", sui.INPUT_NORMAL, null, "handleSetBeastName", null);
|
||||
}
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
public int OnInitialize(obj_id self) throws InterruptedException
|
||||
@@ -146,7 +142,6 @@ public class decoration_item extends script.base_script
|
||||
}
|
||||
sendDirtyObjectMenuNotification(self);
|
||||
setName(self, beastName);
|
||||
setObjVar(self, beast_lib.OBJVAR_OLD_PET_RENAMED, 1);
|
||||
setObjVar(self, incubator.DNA_PARENT_NAME, beastName);
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user