Сортировка предметов инвентаря Interlude

Ну ок, а если мечи и дагерьі какие-то, они тоже перемешаются, пики с кастетами и вот єто все, что может иметь схожие параметрьі.
 

идеальная сортировка не нужна, нужна интуитивно-понятная для клиента. а это имхо из нескольких вариантов тестами выбирается.
 
А чем дефолтная не устраивает? Я понимаю, если там 1000 итемов бы была, так там 250 лимит обычно. Шлите на сервак байпасс с запросом на сортировку, пусть сортирует и шлет обновленный итем лист. Явно будет быстрее, чем клиент задрачивать. Отдельный микросервис запустить, который будет запросы эти обрабатывать сортировать)
 

Aristo

Доступа нет на к серверу и хроники интерлюд там нет сортировки(
 
Хз, вот посмотри как там сделано)

class InventoryWnd extends UICommonAPI;

const DIALOG_USE_RECIPE = 1111;
const DIALOG_POPUP = 2222;
const DIALOG_DROPITEM = 3333;
const DIALOG_DROPITEM_ASKCOUNT = 4444;
const DIALOG_DROPITEM_ALL = 5555;
const DIALOG_DESTROYITEM = 6666;
const DIALOG_DESTROYITEM_ALL = 7777;
const DIALOG_DESTROYITEM_ASKCOUNT = 8888;
const DIALOG_CRYSTALLIZE = 9999;
const DIALOG_DROPITEM_PETASKCOUNT = 10000;

const EQUIPITEM_Underwear = 0;
const EQUIPITEM_Head = 1;
const EQUIPITEM_Hair = 2;
const EQUIPITEM_Hair2 = 3;
const EQUIPITEM_Neck = 4;
const EQUIPITEM_RHand = 5;
const EQUIPITEM_Chest = 6;
const EQUIPITEM_LHand = 7;
const EQUIPITEM_REar = 8;
const EQUIPITEM_LEar = 9;
const EQUIPITEM_Gloves = 10;
const EQUIPITEM_Legs = 11;
const EQUIPITEM_Feet = 12;
const EQUIPITEM_RFinger = 13;
const EQUIPITEM_LFinger = 14;
const EQUIPITEM_Max = 15;

var String m_WindowName;
var ItemWindowHandle m_invenItem;
var ItemWindowHandle m_questItem;
var ItemWindowHandle m_equipItem[EQUIPITEM_Max];
var ItemWindowHandle m_hHennaItemWindow;
var TextBoxHandle m_hAdenaTextBox;

var array<int> m_itemOrder;
var Vector m_clickLocation;

var Array<ItemInfo> m_EarItemList;
var Array<ItemInfo> m_FingerItemLIst;

function OnLoad () {
RegisterEvent(EV_InventoryClear);
RegisterEvent(EV_InventoryOpenWindow);
RegisterEvent(EV_InventoryHideWindow);
RegisterEvent(EV_InventoryAddItem);
RegisterEvent(EV_InventoryUpdateItem);
RegisterEvent(EV_InventoryItemListEnd);
RegisterEvent(EV_InventoryAddHennaInfo);
RegisterEvent(EV_InventoryToggleWindow);
RegisterEvent(EV_UpdateHennaInfo);
RegisterEvent(EV_UpdateUserInfo);
RegisterEvent(EV_DialogOK);
RegisterEvent(EV_LanguageChanged);
InitHandle();
}

function InitHandle () {
m_invenItem = ItemWindowHandle(GetHandle(m_WindowName $ ".InventoryItem"));
m_questItem = ItemWindowHandle(GetHandle(m_WindowName $ ".QuestItem"));
m_hAdenaTextBox = TextBoxHandle(GetHandle(m_WindowName $ ".AdenaText"));
m_equipItem[EQUIPITEM_Underwear] = ItemWindowHandle(GetHandle("EquipItem_Underwear"));
m_equipItem[EQUIPITEM_Head] = ItemWindowHandle(GetHandle("EquipItem_Head"));
m_equipItem[EQUIPITEM_Hair] = ItemWindowHandle(GetHandle("EquipItem_Hair"));
m_equipItem[EQUIPITEM_Hair2] = ItemWindowHandle(GetHandle("EquipItem_Hair2"));
m_equipItem[EQUIPITEM_Neck] = ItemWindowHandle(GetHandle("EquipItem_Neck"));
m_equipItem[EQUIPITEM_RHand] = ItemWindowHandle(GetHandle("EquipItem_RHand"));
m_equipItem[EQUIPITEM_Chest] = ItemWindowHandle(GetHandle("EquipItem_Chest"));
m_equipItem[EQUIPITEM_LHand] = ItemWindowHandle(GetHandle("EquipItem_LHand"));
m_equipItem[EQUIPITEM_REar] = ItemWindowHandle(GetHandle("EquipItem_REar"));
m_equipItem[EQUIPITEM_LEar] = ItemWindowHandle(GetHandle("EquipItem_LEar"));
m_equipItem[EQUIPITEM_Gloves] = ItemWindowHandle(GetHandle("EquipItem_Gloves"));
m_equipItem[EQUIPITEM_Legs] = ItemWindowHandle(GetHandle("EquipItem_Legs"));
m_equipItem[EQUIPITEM_Feet] = ItemWindowHandle(GetHandle("EquipItem_Feet"));
m_equipItem[EQUIPITEM_RFinger] = ItemWindowHandle(GetHandle("EquipItem_RFinger"));
m_equipItem[EQUIPITEM_LFinger] = ItemWindowHandle(GetHandle("EquipItem_LFinger"));
m_equipItem[EQUIPITEM_LHand].SetDisableTex("L2UI.InventoryWnd.Icon_dualcap");
m_equipItem[EQUIPITEM_Head].SetDisableTex("L2UI.InventoryWnd.Icon_dualcap");
m_equipItem[EQUIPITEM_Gloves].SetDisableTex("L2UI.InventoryWnd.Icon_dualcap");
m_equipItem[EQUIPITEM_Legs].SetDisableTex("L2UI.InventoryWnd.Icon_dualcap");
m_equipItem[EQUIPITEM_Feet].SetDisableTex("L2UI.InventoryWnd.Icon_dualcap");
m_equipItem[EQUIPITEM_Hair2].SetDisableTex("L2UI.InventoryWnd.Icon_dualcap");
m_hHennaItemWindow = ItemWindowHandle(GetHandle("HennaItem"));
}

function OnEvent (int Event_ID, string param) {

if(GetWndStatus() == 0)
{
switch (Event_ID) {
case EV_InventoryClear:
HandleClear();
break;
case EV_InventoryOpenWindow:
HandleOpenWindow();
break;
case EV_InventoryHideWindow:
HandleHideWindow();
break;
case EV_InventoryAddItem:
HandleAddItem(param);
break;
case EV_InventoryUpdateItem:
HandleUpdateItem(param);
break;
case EV_InventoryItemListEnd:
HandleItemListEnd();
break;
case EV_InventoryAddHennaInfo:
HandleAddHennaInfo(param);
break;
case EV_UpdateHennaInfo:
HandleUpdateHennaInfo(param);
break;
case EV_InventoryToggleWindow:
HandleToggleWindow();
break;
case EV_DialogOK:
HandleDialogOK();
break;
case EV_UpdateUserInfo:
HandleUpdateUserInfo();
break;
case EV_LanguageChanged:
HandleLanguageChanged();
break;
default:
break;
}
}
}

function HandleLanguageChanged () {
RequestItemList();
}

function OnShow () {

if ( class'UIDATA_PLAYER'.static.HasCrystallizeAbility() ) {
ShowWindow(m_WindowName $ ".CrystallizeButton");
} else {
HideWindow(m_WindowName $ ".CrystallizeButton");
}
SetAdenaText();
SetItemCount();
UpdateHennaInfo();

if(GetWndStatus() == 1 || GetWndStatus() == 2)
{
HideWindow("InventoryWnd");
ShowWindow("NewInventoryWnd");
}
}

function OnHide () {
SaveItemOrder();
}

function OnDBClickItemWithHandle (ItemWindowHandle a_hItemWindow, int Index) {
UseItem(a_hItemWindow,Index);
}

function OnRClickItemWithHandle (ItemWindowHandle a_hItemWindow, int Index) {
UseItem(a_hItemWindow,Index);
}

function OnSelectItemWithHandle (ItemWindowHandle a_hItemWindow, int a_Index) {
local int i;
local ItemInfo Info;
local string ItemName;
local string AdditionalName;
local ChatWnd script;

script = ChatWnd(GetScript("ChatWnd"));
if ( IsKeyDown(IK_Shift) ) {
a_hItemWindow.GetSelectedItem(Info);
ItemName = " ";
if ( Info.Enchanted > 0 ) {
ItemName = ItemName $ "+" $ string(Info.Enchanted) $ " ";
}
ItemName = ItemName $ class'UIDATA_ITEM'.static.GetRefineryItemName(Info.Name,Info.RefineryOp1,Info.RefineryOp2);
AdditionalName = class'UIDATA_ITEM'.static.GetItemAdditionalName(Info.ClassID);
if ( Len(AdditionalName) != 0 ) {
ItemName = ItemName $ " - " $ AdditionalName;
}
if ( Info.ItemNum > 1 ) {
ItemName = ItemName $ " (" $ MakeCostString(string(Info.ItemNum)) $ ")";
}
script.ChatEditBox.SetString(script.ChatEditBox.GetString() $ ItemName);
class'UIAPI_WINDOW'.static.SetFocus("ChatWnd");
}

if ( a_hItemWindow == m_invenItem ) {
return;
}
if ( a_hItemWindow == m_questItem ) {
return;
}
for (i = 0; i < EQUIPITEM_Max; ++i) {
if ( a_hItemWindow != m_equipItem ) {
m_equipItem.ClearSelect();
}
}
}

function OnDropItem (string strTarget, ItemInfo Info, int X, int Y) {
local int toIndex;
local int fromIndex;

if ( !(Info.DragSrcName == "InventoryItem") || (Info.DragSrcName == "QuestItem") || (-1 != InStr(Info.DragSrcName,"EquipItem")) || (Info.DragSrcName == "PetInvenWnd") ) {
return;
}
if ( strTarget == "InventoryItem" ) {
if ( Info.DragSrcName == "InventoryItem" ) {
toIndex = m_invenItem.GetIndexAt(X,Y,1,1);
if ( toIndex >= 0 ) {
fromIndex = m_invenItem.FindItemWithServerID(Info.ServerID);
if ( toIndex != fromIndex ) {
while ( fromIndex < toIndex ) {
m_invenItem.SwapItems(fromIndex,fromIndex + 1);
++fromIndex;
}
while ( toIndex < fromIndex ) {
m_invenItem.SwapItems(fromIndex,fromIndex - 1);
--fromIndex;
}
}
} else {
fromIndex = m_invenItem.GetItemNum();
while ( toIndex < fromIndex - 1 ) {
m_invenItem.SwapItems(toIndex,toIndex + 1);
++toIndex;
};
}
} else if ( -1 != InStr(Info.DragSrcName,"EquipItem") ) {
RequestUnequipItem(Info.ServerID,Info.SlotBitType);
} else if ( Info.DragSrcName == "PetInvenWnd" ) {
if ( IsStackableItem(Info.ConsumeType) && (Info.ItemNum > 1) ) {
if ( Info.AllItemCount > 0 ) {
if ( CheckItemLimit(Info.ClassID,Info.AllItemCount) ) {
class'PetAPI'.static.RequestGetItemFromPet(Info.ServerID,Info.AllItemCount,false);
}
} else {
DialogSetID(DIALOG_DROPITEM_PETASKCOUNT);
DialogSetReservedInt(Info.ServerID);
DialogSetParamInt(Info.ItemNum);
DialogShow(DIALOG_NumberPad,MakeFullSystemMsg(GetSystemMessage(72),Info.Name));
}
} else {
class'PetAPI'.static.RequestGetItemFromPet(Info.ServerID,1,false);
}
}
} else if ( strTarget == "QuestItem" ) {
if ( Info.DragSrcName == "QuestItem" ) {
toIndex = m_questItem.GetIndexAt(X,Y,1,1);
if ( toIndex >= 0 ) {
fromIndex = m_questItem.FindItemWithServerID(Info.ServerID);
if ( toIndex != fromIndex ) {
while ( fromIndex < toIndex ) {
m_questItem.SwapItems(fromIndex,fromIndex + 1);
++fromIndex;
}
while ( toIndex < fromIndex ) {
m_questItem.SwapItems(fromIndex,fromIndex - 1);
--fromIndex;
}
}
} else {
fromIndex = m_invenItem.GetItemNum();
while ( toIndex < fromIndex - 1 ) {
m_invenItem.SwapItems(toIndex,toIndex + 1);
++toIndex;
};
}
}
} else if ( -1 != InStr(strTarget,"EquipItem") ) {
if ( Info.DragSrcName == "PetInvenWnd" ) {
class'PetAPI'.static.RequestGetItemFromPet(Info.ServerID,1,true);
} else if ( -1 != InStr(Info.DragSrcName,"EquipItem") ) {
} else if ( EItemType(Info.ItemType) != ITEM_ETCITEM ) {
RequestUseItem(Info.ServerID);
}
} else if ( strTarget == "TrashButton" ) {
if ( IsStackableItem(Info.ConsumeType) && (Info.ItemNum > 1) ) {
if ( Info.AllItemCount > 0 ) {
DialogSetID(DIALOG_DESTROYITEM_ALL);
DialogSetReservedInt(Info.ServerID);
DialogSetReservedInt2(Info.AllItemCount);
DialogShow(DIALOG_Warning,MakeFullSystemMsg(GetSystemMessage(74),Info.Name,""));
} else {
DialogSetID(DIALOG_DESTROYITEM_ASKCOUNT);
DialogSetReservedInt(Info.ServerID);
DialogSetParamInt(Info.ItemNum);
DialogShow(DIALOG_NumberPad,MakeFullSystemMsg(GetSystemMessage(73),Info.Name));
}
} else {
DialogSetID(DIALOG_DESTROYITEM);
DialogSetReservedInt(Info.ServerID);
DialogShow(DIALOG_Warning,MakeFullSystemMsg(GetSystemMessage(74),Info.Name));
}
} else if ( strTarget == "CrystallizeButton" ) {
if ( (Info.DragSrcName == "InventoryItem") || (-1 != InStr(Info.DragSrcName,"EquipItem")) ) {
if ( class'UIDATA_PLAYER'.static.HasCrystallizeAbility() && class'UIDATA_ITEM'.static.IsCrystallizable(Info.ClassID) ) {
DialogSetID(DIALOG_CRYSTALLIZE);
DialogSetReservedInt(Info.ServerID);
DialogShow(DIALOG_Warning,MakeFullSystemMsg(GetSystemMessage(336),Info.Name));
}
}
}
}

function OnDropItemSource (string strTarget, ItemInfo Info) {
if ( strTarget == "Console" ) {
if ( (Info.DragSrcName == "InventoryItem") || (Info.DragSrcName == "QuestItem") || (-1 != InStr(Info.DragSrcName,"EquipItem")) ) {
m_clickLocation = GetClickLocation();
if ( IsStackableItem(Info.ConsumeType) && (Info.ItemNum > 1) ) {
if ( Info.AllItemCount > 0 ) {
DialogHide();
DialogSetID(DIALOG_DROPITEM_ALL);
DialogSetReservedInt(Info.ServerID);
DialogSetReservedInt2(Info.AllItemCount);
DialogShow(DIALOG_Warning,MakeFullSystemMsg(GetSystemMessage(1833),Info.Name,""));
} else {
DialogHide();
DialogSetID(DIALOG_DROPITEM_ASKCOUNT);
DialogSetReservedInt(Info.ServerID);
DialogSetParamInt(Info.ItemNum);
DialogShow(DIALOG_NumberPad,MakeFullSystemMsg(GetSystemMessage(71),Info.Name,""));
}
} else {
DialogHide();
DialogSetID(DIALOG_DROPITEM);
DialogSetReservedInt(Info.ServerID);
DialogShow(DIALOG_Warning,MakeFullSystemMsg(GetSystemMessage(400),Info.Name,""));
}
}
}
}

function bool IsEquipItem (out ItemInfo info) {
return info.bEquipped;
}

function bool IsQuestItem (out ItemInfo info) {
return EItemtype(info.ItemType) == ITEM_QUESTITEM;
}

function HandleClear () {
EquipItemClear();
m_invenItem.Clear();
m_questItem.Clear();
m_EarItemList.Length = 0;
m_FingerItemLIst.Length = 0;
}

function int EquipItemGetItemNum () {
local int i;
local int ItemNum;

for( i = 0; i < EQUIPITEM_Max; ++i ) {
if ( m_equipItem.IsEnableWindow() ) {
ItemNum = ItemNum + m_equipItem.GetItemNum();
}
}
return ItemNum;
}

function EquipItemClear () {
local int i;

for( i = 0; i < EQUIPITEM_Max; ++i ) {
m_equipItem.Clear();
}
}

function bool EquipItemFind (int a_ServerID) {
local int i;
local int Index;

for( i = 0; i < EQUIPITEM_Max; ++i ) {
Index = m_equipItem.FindItemWithServerID(a_ServerID);
if ( -1 != Index ) {
return true;
}
}
return false;
}

function EquipItemDelete (int a_ServerID) {
local int i;
local int Index;
local ItemInfo TheItemInfo;

for ( i = 0; i < EQUIPITEM_Max; ++i ) {
Index = m_equipItem.FindItemWithServerID(a_ServerID);
if ( -1 != Index ) {
m_equipItem.Clear();
if ( i == EQUIPITEM_LHand ) {
if ( m_equipItem[EQUIPITEM_RHand].GetItem(0,TheItemInfo) ) {
if ( TheItemInfo.SlotBitType == 16384 ) {
m_equipItem[EQUIPITEM_LHand].Clear();
m_equipItem[EQUIPITEM_LHand].AddItem(TheItemInfo);
m_equipItem[EQUIPITEM_LHand].DisableWindow();
}
}
}
}
}
}

function EarItemUpdate () {
local int i;
local int LEarIndex;
local int REarIndex;

LEarIndex = -1;
REarIndex = -1;
for( i = 0; i < m_EarItemList.Length; ++i ) {
switch (IsLOrREar(m_EarItemList.ServerID)) {
case -1:
LEarIndex = i;
break;
case 0:
m_EarItemList.Remove (i,1);
break;
case 1:
REarIndex = i;
break;
}
}
if ( -1 != LEarIndex ) {
m_equipItem[EQUIPITEM_LEar].Clear();
m_equipItem[EQUIPITEM_LEar].AddItem(m_EarItemList[LEarIndex]);
}
if ( -1 != REarIndex ) {
m_equipItem[EQUIPITEM_REar].Clear();
m_equipItem[EQUIPITEM_REar].AddItem(m_EarItemList[REarIndex]);
}
}

function FingerItemUpdate () {
local int i;
local int LFingerIndex;
local int RFingerIndex;

LFingerIndex = -1;
RFingerIndex = -1;

for (i = 0; i < m_FingerItemLIst.Length; ++i) {
switch (IsLOrRFinger(m_FingerItemLIst.ServerID)) {
case -1:
LFingerIndex = i;
break;
case 0:
m_FingerItemLIst.Remove (i,1);
break;
case 1:
RFingerIndex = i;
break;
}
}
if ( -1 != LFingerIndex ) {
m_equipItem[14].Clear();
m_equipItem[14].AddItem(m_FingerItemLIst[LFingerIndex]);
}
if ( -1 != RFingerIndex ) {
m_equipItem[13].Clear();
m_equipItem[13].AddItem(m_FingerItemLIst[RFingerIndex]);
}
}

function EquipItemUpdate (ItemInfo a_Info) {
local ItemWindowHandle hItemWnd;
local ItemInfo TheItemInfo;
local bool ClearLHand;
local ItemInfo RHand;
local ItemInfo LHand;
local ItemInfo Legs;
local ItemInfo Gloves;
local ItemInfo Feet;
local ItemInfo Hair2;
local int i;

switch (a_Info.SlotBitType) {
case 1:
hItemWnd = m_equipItem[0];
break;
case 2:
case 4:
case 6:
for (i = 0; i < m_EarItemList.Length; ++i) {
if ( m_EarItemList.ServerID == a_Info.ServerID ) {
break;
}
}
if ( i == m_EarItemList.Length ) {
m_EarItemList.Length = m_EarItemList.Length + 1;
m_EarItemList[m_EarItemList.Length - 1] = a_Info;
}
hItemWnd = None;
EarItemUpdate();
break;
case 8:
hItemWnd = m_equipItem[4];
break;
case 16:
case 32:
case 48:
for (i = 0; i < m_FingerItemLIst.Length; ++i) {
if ( m_FingerItemLIst.ServerID == a_Info.ServerID ) {
break;
}
}
if ( i == m_FingerItemLIst.Length ) {
m_FingerItemLIst.Length = m_FingerItemLIst.Length + 1;
m_FingerItemLIst[m_FingerItemLIst.Length - 1] = a_Info;
}
hItemWnd = None;
FingerItemUpdate();
break;
case 64:
hItemWnd = m_equipItem[1];
hItemWnd.EnableWindow();
break;
case 128:
hItemWnd = m_equipItem[5];
break;
case 256:
hItemWnd = m_equipItem[7];
hItemWnd.EnableWindow();
break;
case 512:
hItemWnd = m_equipItem[10];
hItemWnd.EnableWindow();
break;
case 1024:
hItemWnd = m_equipItem[6];
break;
case 2048:
hItemWnd = m_equipItem[11];
hItemWnd.EnableWindow();
break;
case 4096:
hItemWnd = m_equipItem[12];
hItemWnd.EnableWindow();
break;
case 8192:
hItemWnd = m_equipItem[0];
break;
case 16384:
hItemWnd = m_equipItem[5];
ClearLHand = true;
if ( IsBowOrFishingRod(a_Info) ) {
if ( m_equipItem[7].GetItem(0,TheItemInfo) ) {
if ( IsArrow(TheItemInfo) ) {
ClearLHand = false;
}
}
}
if ( ClearLHand ) {
if ( Len(a_Info.IconNameEx1) != 0 ) {
RHand = a_Info;
LHand = a_Info;
RHand.IconIndex = 1;
LHand.IconIndex = 2;
m_equipItem[5].Clear();
m_equipItem[5].AddItem(RHand);
m_equipItem[7].Clear();
m_equipItem[7].AddItem(LHand);
m_equipItem[7].DisableWindow();
hItemWnd = None;
} else {
m_equipItem[7].Clear();
m_equipItem[7].AddItem(a_Info);
m_equipItem[7].DisableWindow();
}
}
break;
case 32768:
hItemWnd = m_equipItem[6];
Legs = a_Info;
Legs.IconName = a_Info.IconNameEx2;
m_equipItem[11].Clear();
m_equipItem[11].AddItem(Legs);
m_equipItem[11].DisableWindow();
break;
case 65536:
hItemWnd = m_equipItem[2];
break;
case 131072:
hItemWnd = m_equipItem[6];
Hair2 = a_Info;
Gloves = a_Info;
Legs = a_Info;
Feet = a_Info;
Hair2.IconName = a_Info.IconNameEx1;
Gloves.IconName = a_Info.IconNameEx2;
Legs.IconName = a_Info.IconNameEx3;
Feet.IconName = a_Info.IconNameEx4;
m_equipItem[1].Clear();
m_equipItem[1].AddItem(Hair2);
m_equipItem[1].DisableWindow();
m_equipItem[10].Clear();
m_equipItem[10].AddItem(Gloves);
m_equipItem[10].DisableWindow();
m_equipItem[11].Clear();
m_equipItem[11].AddItem(Legs);
m_equipItem[11].DisableWindow();
m_equipItem[12].Clear();
m_equipItem[12].AddItem(Feet);
m_equipItem[12].DisableWindow();
break;
case 262144:
hItemWnd = m_equipItem[3];
hItemWnd.EnableWindow();
break;
case 524288:
hItemWnd = m_equipItem[2];
m_equipItem[3].Clear();
m_equipItem[3].AddItem(a_Info);
m_equipItem[3].DisableWindow();
break;
default:
}
if ( None != hItemWnd ) {
hItemWnd.Clear();
hItemWnd.AddItem(a_Info);
}
}

function HandleOpenWindow () {
LoadItemOrder();
ShowWindow(m_WindowName);
class'UIAPI_WINDOW'.static.SetFocus(m_WindowName);
}

function HandleHideWindow () {
HideWindow(m_WindowName);
}

function HandleAddItem (string param) {
local ItemInfo Info;
local int ID;

ParamToItemInfo(param,Info);
ID = Info.ClassID;
if ( Info.RefineryOp1 > 0 ) {
Info.ForeTexture = "L2UI_CH2.augmented";
}
if ( (Info.Enchanted > 0) && (Info.Enchanted <= 50) )
{
if ( Info.RefineryOp1 > 0 )
{
Info.ForeTexture = "L2UI_CH2.augmented_and_enchanted_" $ string(Info.Enchanted);
} else {
Info.ForeTexture = "L2UI_CH2.enchanted_" $ string(Info.Enchanted);
}
} else {
if ( Info.Enchanted > 50 )
{
if ( Info.RefineryOp1 > 0 )
{
Info.ForeTexture = "L2UI_CH2.augmented_and_enchanted_plus";
} else {
Info.ForeTexture = "L2UI_CH2.enchanted_plus";
}
}
}
if ( IsEquipItem(Info) ) {
EquipItemUpdate(Info);
} else if ( IsQuestItem(Info) ) {
m_questItem.AddItem(Info);
} else {
m_invenItem.AddItem(Info);
}
}

function HandleUpdateItem (string param) {
local string Type;
local ItemInfo Info;
local int Index;

ParseString(param,"type",Type);
ParamToItemInfo(param,Info);
if ( Info.RefineryOp1 > 0 ) {
Info.ForeTexture = "L2UI_CH2.augmented";
}
if ( (Info.Enchanted > 0) && (Info.Enchanted <= 50) )
{
if ( Info.RefineryOp1 > 0 )
{
Info.ForeTexture = "L2UI_CH2.augmented_and_enchanted_" $ string(Info.Enchanted);
} else {
Info.ForeTexture = "L2UI_CH2.enchanted_" $ string(Info.Enchanted);
}
} else {
if ( Info.Enchanted > 50 )
{
if ( Info.RefineryOp1 > 0 )
{
Info.ForeTexture = "L2UI_CH2.augmented_and_enchanted_plus";
} else {
Info.ForeTexture = "L2UI_CH2.enchanted_plus";
}
}
}
if ( Type == "add" ) {
if ( IsEquipItem(Info) ) {
EquipItemUpdate(Info);
} else if ( IsQuestItem(Info) ) {
m_questItem.AddItem(Info);
Index = m_questItem.GetItemNum() - 1;
if ( Index > 0 ) {
m_questItem.SwapItems(Index - 1,Index);
--Index;
}
} else {
m_invenItem.AddItem(Info);
Index = m_invenItem.GetItemNum() - 1;
if ( Index > 0 ) {
m_invenItem.SwapItems(Index - 1,Index);
--Index;
}
}
} else if ( Type == "update" ) {
if ( IsEquipItem(Info) ) {
if ( EquipItemFind(Info.ServerID) ) {
EquipItemUpdate(Info);
} else {
Index = m_invenItem.FindItemWithServerID(Info.ServerID);
if ( Index != -1 ) {
m_invenItem.DeleteItem(Index);
}
EquipItemUpdate(Info);
}
} else if ( IsQuestItem(Info) ) {
Index = m_questItem.FindItemWithServerID(Info.ServerID);
if ( Index != -1 ) {
m_questItem.SetItem(Index,Info);
} else {
EquipItemDelete(Info.ServerID);
m_questItem.AddItem(Info);
}
} else {
Index = m_invenItem.FindItemWithServerID(Info.ServerID);
if ( Index != -1 ) {
m_invenItem.SetItem(Index,Info);
} else {
EquipItemDelete(Info.ServerID);
m_invenItem.AddItem(Info);
Index = m_invenItem.GetItemNum() - 1;
if ( Index > 0 ) {
m_invenItem.SwapItems(Index - 1,Index);
--Index;
}
}
}
} else if ( Type == "delete" ) {
if ( IsEquipItem(Info) ) {
EquipItemDelete(Info.ServerID);
} else if ( IsQuestItem(Info) ) {
Index = m_questItem.FindItemWithServerID(Info.ServerID);
m_questItem.DeleteItem(Index);
} else {
Index = m_invenItem.FindItemWithServerID(Info.ServerID);
m_invenItem.DeleteItem(Index);
}
}
SetAdenaText();
SetItemCount();
}

function HandleItemListEnd () {
SetAdenaText();
SetItemCount();
OrderItem();
}

function HandleAddHennaInfo (string param) {
UpdateHennaInfo();
}

function HandleUpdateHennaInfo (string param) {
UpdateHennaInfo();
}

function UpdateHennaInfo () {
local int i;
local int HennaInfoCount;
local int HennaID;
local int IsActive;
local ItemInfo HennaItemInfo;
local UserInfo PlayerInfo;
local int ClassStep;

if ( GetPlayerInfo(PlayerInfo) ) {
ClassStep = GetClassStep(PlayerInfo.nSubClass);
switch (ClassStep) {
case 1:
case 2:
case 3:
m_hHennaItemWindow.SetRow(ClassStep);
break;
default:
m_hHennaItemWindow.SetRow(0);
break;
}
}

m_hHennaItemWindow.Clear();
HennaInfoCount = class'HennaAPI'.static.GetHennaInfoCount();
if ( HennaInfoCount > ClassStep ) {
HennaInfoCount = ClassStep;
}

for (i = 0; i < HennaInfoCount; ++i) {
if ( class'HennaAPI'.static.GetHennaInfo(i,HennaID,IsActive) ) {
if( !class'UIDATA_HENNA'.static.GetItemName( HennaID, HennaItemInfo.Name ) ) {
break;
}
if( !class'UIDATA_HENNA'.static.GetDescription( HennaID, HennaItemInfo.Description ) ) {
break;
}
if( !class'UIDATA_HENNA'.static.GetIconTex( HennaID, HennaItemInfo.IconName ) ) {
break;
}

if ( 0 == IsActive ) {
HennaItemInfo.bDisabled = true;
} else {
HennaItemInfo.bDisabled = false;
}
m_hHennaItemWindow.AddItem(HennaItemInfo);
}
}
}

function SetAdenaText () {
local string adenaString;

adenaString = MakeCostString(string(GetAdena()));
m_hAdenaTextBox.SetText(adenaString);
m_hAdenaTextBox.SetTooltipString(ConvertNumToText(string(GetAdena())));
}

function UseItem (ItemWindowHandle a_hItemWindow, int Index) {
local ItemInfo Info;

if ( a_hItemWindow.GetItem(Index,Info) ) {
if ( Info.bRecipe ) {
DialogSetReservedInt(Info.ServerID);
DialogSetID(DIALOG_USE_RECIPE);
DialogShow(DIALOG_Warning,GetSystemMessage(798));
} else if ( Info.PopMsgNum > 0 ) {
DialogSetID(DIALOG_POPUP);
DialogSetReservedInt(Info.ServerID);
DialogShow(DIALOG_Warning,GetSystemMessage(Info.PopMsgNum));
} else {
RequestUseItem(Info.ServerID);
}
}
}

function SaveItemOrder () {
local ItemInfo Info;
local int i;

m_itemOrder.Length = m_invenItem.GetItemNum();
for (i = 0; i < m_itemOrder.Length; ++i) {
m_invenItem.GetItem(i,Info);
m_itemOrder = Info.ClassID;
}
SaveInventoryOrder(m_itemOrder);
}

function LoadItemOrder () {
LoadInventoryOrder(m_itemOrder);
}

function OrderItem () {
local int newItemIndex;
local int ItemNum;
local int itemIndex;
local int orderIndex;
local ItemInfo Info;
local bool matched;

newItemIndex = 0;
ItemNum = m_invenItem.GetItemNum();

for (itemIndex = 0; itemIndex < ItemNum; ++itemIndex) {
m_invenItem.GetItem(itemIndex,Info);
matched = false;

for (orderIndex = 0; orderIndex < m_itemOrder.Length; ++orderIndex) {
if ( Info.ClassID == m_itemOrder[orderIndex] ) {
matched = true;
break;
}
}
if (!matched) {
m_invenItem.SwapItems(itemIndex,newItemIndex);
++newItemIndex;
}
}

for (orderIndex = 0; orderIndex < m_itemOrder.Length; ++orderIndex) {
for (itemIndex = 0; itemIndex < ItemNum; ++itemIndex) {
m_invenItem.GetItem(itemIndex,Info);
if ( Info.ClassID == m_itemOrder[orderIndex] ) {
m_invenItem.SwapItems(itemIndex,newItemIndex);
++newItemIndex;
break;
}
}
}
}

function int GetMyInventoryLimit () {
return class'UIDATA_PLAYER'.static.GetInventoryLimit();
}

function SetItemCount () {
local int limit;
local int Count;
local TextBoxHandle Handle;

Count = m_invenItem.GetItemNum() + m_questItem.GetItemNum() + EquipItemGetItemNum();
limit = GetMyInventoryLimit();
Handle = TextBoxHandle(GetHandle(m_WindowName $ ".ItemCount"));
Handle.SetText("(" $ string(Count) $ "/" $ string(limit) $ ")");
}

function HandleDialogOK () {
local int Id;
local int Reserved;
local int reserved2;
local int Number;

if ( DialogIsMine() ) {
Id = DialogGetID();
Reserved = DialogGetReservedInt();
reserved2 = DialogGetReservedInt2();
Number = int(DialogGetString());
if ( (Id == DIALOG_USE_RECIPE) || (Id == DIALOG_POPUP) ) {
RequestUseItem(Reserved);
} else if ( Id == DIALOG_DROPITEM ) {
RequestDropItem(Reserved,1,m_clickLocation);
} else if ( Id == DIALOG_DROPITEM_ASKCOUNT ) {
if ( Number == 0 ) {
Number = 1;
}
RequestDropItem(Reserved,Number,m_clickLocation);
} else if ( Id == DIALOG_DROPITEM_ALL ) {
RequestDropItem(Reserved,reserved2,m_clickLocation);
} else if ( Id == DIALOG_DESTROYITEM ) {
RequestDestroyItem(Reserved,1);
PlayConsoleSound(IFST_TRASH_BASKET);
} else if ( Id == DIALOG_DESTROYITEM_ASKCOUNT ) {
RequestDestroyItem(Reserved,Number);
PlayConsoleSound(IFST_TRASH_BASKET);
} else if ( Id == DIALOG_DESTROYITEM_ALL ) {
RequestDestroyItem(Reserved,reserved2);
PlayConsoleSound(IFST_TRASH_BASKET);
} else if ( Id == DIALOG_CRYSTALLIZE ) {
RequestCrystallizeItem(Reserved,1);
PlayConsoleSound(IFST_TRASH_BASKET);
} else if ( Id == DIALOG_DROPITEM_PETASKCOUNT ) {
class'PetAPI'.static.RequestGetItemFromPet(Reserved,Number,false);
}
}
}

function HandleUpdateUserInfo () {
if ( m_hOwnerWnd.IsShowWindow() ) {
EarItemUpdate();
FingerItemUpdate();
}
}

function HandleToggleWindow () {
if ( m_hOwnerWnd.IsShowWindow() ) {
m_hOwnerWnd.HideWindow();
PlayConsoleSound(IFST_INVENWND_CLOSE);
} else if ( IsShowInventoryWndUponEvent() ) {
RequestItemList();
m_hOwnerWnd.ShowWindow();
PlayConsoleSound(IFST_INVENWND_OPEN);
}
}

function bool IsShowInventoryWndUponEvent () {
local WindowHandle m_warehouseWnd;
local WindowHandle m_privateShopWnd;
local WindowHandle m_tradeWnd;
local WindowHandle m_shopWnd;
local WindowHandle m_multiSellWnd;
local WindowHandle m_deliverWnd;
local PrivateShopWnd m_scriptPrivateShopWnd;

m_warehouseWnd = GetHandle("WarehouseWnd");
m_privateShopWnd = GetHandle("PrivateShopWnd");
m_tradeWnd = GetHandle("TradeWnd");
m_shopWnd = GetHandle("ShopWnd");
m_multiSellWnd = GetHandle("MultiSellWnd");
m_deliverWnd = GetHandle("DeliverWnd");
m_scriptPrivateShopWnd = PrivateShopWnd(GetScript("PrivateShopWnd"));
if ( m_warehouseWnd.IsShowWindow() ) {
return false;
}
if ( m_warehouseWnd.IsShowWindow() ) {
return false;
}
if ( m_tradeWnd.IsShowWindow() ) {
return false;
}
if ( m_shopWnd.IsShowWindow() ) {
return false;
}
if ( m_multiSellWnd.IsShowWindow() ) {
return false;
}
if ( m_deliverWnd.IsShowWindow() ) {
return false;
}
if ( m_privateShopWnd.IsShowWindow() && (m_scriptPrivateShopWnd.m_type == 2) ) {
return false;
}
return true;
}

function int IsLOrREar (int a_ServerID) {
local int LEar;
local int REar;
local int LFinger;
local int RFinger;

GetAccessoryServerID(LEar,REar,LFinger,RFinger);
if ( a_ServerID == LEar ) {
return -1;
} else if ( a_ServerID == REar ) {
return 1;
} else {
return 0;
}
}

function int IsLOrRFinger (int a_ServerID) {
local int LEar;
local int REar;
local int LFinger;
local int RFinger;

GetAccessoryServerID(LEar,REar,LFinger,RFinger);
if ( a_ServerID == LFinger ) {
return -1;
} else if ( a_ServerID == RFinger ) {
return 1;
} else {
return 0;
}
}

function bool IsBowOrFishingRod (ItemInfo a_Info) {
if ( (6 == a_Info.WeaponType) || (10 == a_Info.WeaponType) ) {
return true;
}
return false;
}

function bool IsArrow (ItemInfo a_Info) {
return a_Info.bArrow;
}

function OnClickButton (string strID) {
switch (strID) {
case "SortBtn":
SortItem(m_invenItem);
break;
case "Base1Btn":
btnInfoAug();
break;
default:
}
}

function btnInfoAug ()
{
if ( IsShowWindow("RefineryInfoWnd_1") )
{
Class'UIAPI_LISTCTRL'.static.DeleteAllItem("RefineryInfoWnd.RefineryInfoWnd_2.AugmentList2");
Class'UIAPI_WINDOW'.static.HideWindow("RefineryInfoWnd.RefineryInfoWnd_2");
Class'UIAPI_WINDOW'.static.HideWindow("RefineryInfoWnd.RefineryInfoWnd_1");
PlayConsoleSound(IFST_WINDOW_CLOSE);
} else {
Class'UIAPI_WINDOW'.static.HideWindow("RefineryInfoWnd.RefineryInfoWnd_2");
ShowWindowWithFocus("RefineryInfoWnd.RefineryInfoWnd_1");
PlayConsoleSound(IFST_WINDOW_OPEN);
}
}


function SortItem (ItemWindowHandle ItemWnd) {
local int i;
local int j;
local int invenLimit;
local ItemInfo item;
local EItemType eItemType;
local int numAsset;
local int numWeapon;
local int numArmor;
local int numAccessary;
local int numEtcItem;
local int numBlessEnchantAm;
local int numBlessEnchantWp;
local int numEnchantAm;
local int numEnchantWp;
local int numPotion;
local int numElixir;
local int numArrow;
local int numRecipe;
local int numMaterial;
local int nextSlot;
local int testInt;
local array<ItemInfo> AssetList;
local array<ItemInfo> WeaponList;
local array<ItemInfo> ArmorList;
local array<ItemInfo> AccesaryList;
local array<ItemInfo> EtcItemList;
local array<ItemInfo> BlessEnchantAmList;
local array<ItemInfo> BlessEnchantWpList;
local array<ItemInfo> EnchantAmList;
local array<ItemInfo> EnchantWpList;
local array<ItemInfo> PotionList;
local array<ItemInfo> ElixirList;
local array<ItemInfo> ArrowList;
local array<ItemInfo> RecipeList;
local array<ItemInfo> MaterialList;
local ItemInfo temp;

Debug("Sorting Inven Item");
numAsset = 0;
numWeapon = 0;
numArmor = 0;
numAccessary = 0;
numPotion = 0;
numEtcItem = 0;
numBlessEnchantAm = 0;
numBlessEnchantWp = 0;
numEnchantAm = 0;
numEnchantWp = 0;
numElixir = 0;
numArrow = 0;
numRecipe = 0;
numMaterial = 0;
nextSlot = 0;
invenLimit = m_invenItem.GetItemNum();
for (i = 0; i < invenLimit; ++i) {
m_invenItem.GetItem(i,item);
eItemType = EItemType(item.ItemType);
switch (eItemType) {
case ITEM_ASSET:
AssetList[numAsset] = item;
numAsset = numAsset + 1;
break;
case ITEM_WEAPON:
WeaponList[numWeapon] = item;
numWeapon = numWeapon + 1;
break;
case ITEM_ARMOR:
ArmorList[numArmor] = item;
numArmor = numArmor + 1;
break;
case ITEM_ACCESSARY:
AccesaryList[numAccessary] = item;
numAccessary = numAccessary + 1;
break;
case ITEM_ETCITEM:
testInt = item.ItemSubType;
switch (EEtcItemType(item.ItemSubType)) {
case ITEME_BLESS_ENCHT_AM:
BlessEnchantAmList[numBlessEnchantAm] = item;
numBlessEnchantAm = numBlessEnchantAm + 1;
break;
case ITEME_BLESS_ENCHT_WP:
BlessEnchantWpList[numBlessEnchantWp] = item;
numBlessEnchantWp = numBlessEnchantWp + 1;
break;
case ITEME_ENCHT_AM:
EnchantAmList[numEnchantAm] = item;
numEnchantAm = numEnchantAm + 1;
break;
case ITEME_ENCHT_WP:
EnchantWpList[numEnchantWp] = item;
numEnchantWp = numEnchantWp + 1;
break;
case ITEME_POTION:
PotionList[numPotion] = item;
numPotion = numPotion + 1;
break;
case ITEME_ELIXIR:
ElixirList[numElixir] = item;
numElixir = numElixir + 1;
break;
case ITEME_ARROW:
ArrowList[numArrow] = item;
numArrow = numArrow + 1;
break;
case ITEME_RECIPE:
RecipeList[numRecipe] = item;
numRecipe = numRecipe + 1;
break;
case ITEME_MATERIAL:
MaterialList[numMaterial] = item;
numMaterial = numMaterial + 1;
break;
default:
EtcItemList[numEtcItem] = item;
numEtcItem = numEtcItem + 1;
break;
}
break;
default:
Debug("huh???");
EtcItemList[numEtcItem] = item;
numEtcItem = numEtcItem + 1;
break;
}
}

for (i = 0; i < numAsset; ++i) {
for (j = 0; j < numAsset - i; ++j) {
if ( j < numAsset - 1 ) {
if ( AssetList[j].Weight < AssetList[j + 1].Weight ) {
temp = AssetList[j];
AssetList[j] = AssetList[j + 1];
AssetList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numWeapon; ++i) {
for (j = 0; j < numWeapon - i; ++j) {
if ( j < numWeapon - 1 ) {
if ( WeaponList[j].Weight < WeaponList[j + 1].Weight ) {
temp = WeaponList[j];
WeaponList[j] = WeaponList[j + 1];
WeaponList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numArmor; ++i) {
for (j = 0; j < numArmor - i; ++j) {
if ( j < numArmor - 1 ) {
if ( ArmorList[j].Weight < ArmorList[j + 1].Weight ) {
temp = ArmorList[j];
ArmorList[j] = ArmorList[j + 1];
ArmorList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numAccessary; ++i) {
for (j = 0; j < numAccessary - i; ++j) {
if ( j < numAccessary - 1 ) {
if ( AccesaryList[j].Weight < AccesaryList[j + 1].Weight ) {
temp = AccesaryList[j];
AccesaryList[j] = AccesaryList[j + 1];
AccesaryList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numBlessEnchantAm; ++i) {
for (j = 0; j < numBlessEnchantAm - i; ++j) {
if ( j < numBlessEnchantAm - 1 ) {
if ( BlessEnchantAmList[j].Weight < BlessEnchantAmList[j + 1].Weight ) {
temp = BlessEnchantAmList[j];
BlessEnchantAmList[j] = BlessEnchantAmList[j + 1];
BlessEnchantAmList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numBlessEnchantWp; ++i) {
for (j = 0; j < numBlessEnchantWp - i; ++j) {
if ( j < numBlessEnchantWp - 1 ) {
if ( BlessEnchantWpList[j].Weight < BlessEnchantWpList[j + 1].Weight ) {
temp = BlessEnchantWpList[j];
BlessEnchantWpList[j] = BlessEnchantWpList[j + 1];
BlessEnchantWpList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numEnchantAm; ++i) {
for (j = 0; j < numEnchantAm - i; ++j) {
if (j < numEnchantAm - 1) {
if (EnchantAmList[j].Weight < EnchantAmList[j + 1].Weight) {
temp = EnchantAmList[j];
EnchantAmList[j] = EnchantAmList[j + 1];
EnchantAmList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numEnchantWp; ++i) {
for (j = 0; j < numEnchantWp - i; ++j) {
if (j < numEnchantWp - 1) {
if (EnchantWpList[j].Weight < EnchantWpList[j + 1].Weight) {
temp = EnchantWpList[j];
EnchantWpList[j] = EnchantWpList[j + 1];
EnchantWpList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numPotion; ++i) {
for (j = 0; j < numPotion - i; ++j) {
if ( j < numPotion - 1 ) {
if ( PotionList[j].Weight < PotionList[j + 1].Weight ) {
temp = PotionList[j];
PotionList[j] = PotionList[j + 1];
PotionList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numElixir; ++i) {
for (j = 0; j < numElixir - i; ++j) {
if ( j < numElixir - 1 ) {
if ( ElixirList[j].Weight < ElixirList[j + 1].Weight ) {
temp = ElixirList[j];
ElixirList[j] = ElixirList[j + 1];
ElixirList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numArrow; ++i) {
for (j = 0; j < numArrow - i; ++j) {
if ( j < numArrow - 1 ) {
if ( ArrowList[j].Weight < ArrowList[j + 1].Weight ) {
temp = ArrowList[j];
ArrowList[j] = ArrowList[j + 1];
ArrowList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numRecipe; ++i) {
for (j = 0; j < numRecipe - i; ++j) {
if ( j < numRecipe - 1 ) {
if ( RecipeList[j].Weight < RecipeList[j + 1].Weight ) {
temp = RecipeList[j];
RecipeList[j] = RecipeList[j + 1];
RecipeList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numMaterial; ++i) {
for (j = 0; j < numMaterial - i; ++j) {
if ( j < numMaterial - 1 ) {
if ( MaterialList[j].Weight < MaterialList[j + 1].Weight ) {
temp = MaterialList[j];
MaterialList[j] = MaterialList[j + 1];
MaterialList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numEtcItem; ++i) {
for (j = 0; j < numEtcItem - i; ++j) {
if ( j < numEtcItem - 1 ) {
if ( EtcItemList[j].Weight < EtcItemList[j + 1].Weight ) {
temp = EtcItemList[j];
EtcItemList[j] = EtcItemList[j + 1];
EtcItemList[j + 1] = temp;
}
}
}
}

for (i = 0; i < numAsset; ++i) {
m_invenItem.SetItem(nextSlot + i,AssetList);
}
nextSlot = nextSlot + numAsset;

for (i = 0; i < numWeapon; ++i) {
ItemWnd.SetItem(nextSlot + i, WeaponList);
}
nextSlot = nextSlot + numWeapon;

for (i = 0; i < numArmor; ++i) {
ItemWnd.SetItem(nextSlot + i, ArmorList);
}
nextSlot = nextSlot + numArmor;

for (i = 0; i < numAccessary; ++i) {
ItemWnd.SetItem(nextSlot + i, AccesaryList);
}
nextSlot = nextSlot + numAccessary;

for (i = 0; i < numBlessEnchantAm; ++i) {
m_invenItem.SetItem(nextSlot + i,BlessEnchantAmList);
}
nextSlot = nextSlot + numBlessEnchantAm;

for (i = 0; i < numBlessEnchantWp; ++i) {
m_invenItem.SetItem(nextSlot + i,BlessEnchantWpList);
}
nextSlot = nextSlot + numBlessEnchantWp;

for (i = 0; i < numEnchantAm; ++i) {
m_invenItem.SetItem(nextSlot + i,EnchantAmList);
}
nextSlot = nextSlot + numEnchantAm;

for (i = 0; i < numEnchantWp; ++i) {
m_invenItem.SetItem(nextSlot + i,EnchantWpList);
}

for (i = 0; i < numRecipe; ++i) {
m_invenItem.SetItem(nextSlot + i,RecipeList);
}
nextSlot = nextSlot + numRecipe;

for (i = 0; i < numMaterial; ++i) {
m_invenItem.SetItem(nextSlot + i,MaterialList);
}
nextSlot = nextSlot + numMaterial;
nextSlot = nextSlot + numEnchantWp;

for (i = 0; i < numPotion; ++i) {
m_invenItem.SetItem(nextSlot + i,PotionList);
}
nextSlot = nextSlot + numPotion;

for (i = 0; i < numElixir; ++i) {
m_invenItem.SetItem(nextSlot + i,ElixirList);
}
nextSlot = nextSlot + numElixir;

for (i = 0; i < numArrow; ++i) {
m_invenItem.SetItem(nextSlot + i,ArrowList);
}
nextSlot = nextSlot + numArrow;

for (i = 0; i < numEtcItem; ++i) {
m_invenItem.SetItem(nextSlot + i,EtcItemList);
}
nextSlot = nextSlot + numEtcItem;
m_itemOrder.Length = nextSlot;
SaveItemOrder();
}

defaultproperties
{
m_WindowName="InventoryWnd"
}

 
Да тоже по весу if ( AssetList[j].Weight < AssetList[j + 1].Weight )
 
Да тоже по весу if ( AssetList[j].Weight < AssetList[j + 1].Weight )

может тогда в настройках поменять веса айтемов? или надо ВСЕ КАК НА ОФФЕ! костыль конечно, но можно его интересно реализовать, переосмыслив шизу корейцев о весе айтемов

ЗЫ код под кодовый спойлер убирай, а то ругаться будут