Interface

DeusDoEgito

Единомышленник
Пользователь
Сообщения
8
Розыгрыши
0
Репутация
-1
Реакции
0
Баллы
173
При продаже нескольких товаров используйте запятые. 100000 = 100,000

1774404190329.webp
 
я хз о чем автор, но этого явно не хватает лучу. Который ток вчера сделал пост, о том как они во всех мелочах делают хорошо. за год могли уже добавить запятые при вводе цен на товары. и баги открытия диалоговых окон с нпц 2 года исправить не могут. особенно смешно, когда вместо окна открывается багнувшийся его html код.
 
я хз о чем автор, но этого явно не хватает лучу. Который ток вчера сделал пост, о том как они во всех мелочах делают хорошо. за год могли уже добавить запятые при вводе цен на товары. и баги открытия диалоговых окон с нпц 2 года исправить не могут. особенно смешно, когда вместо окна открывается багнувшийся его html код.
пипл и так хавает
 
При продаже нескольких товаров используйте запятые. 100000 = 100,000

Посмотреть вложение 94579
Ну тебе надо дирзай всего то надо сделать переводчик из запятых в ровное число для базы который любой школьник чит энгином заставит переводить так как ему надо...
 
Запрещено публиковать исходный код без BB-кода — CODE
Ну тебе надо дирзай всего то надо сделать переводчик из запятых в ровное число для базы который любой школьник чит энгином заставит переводить так как ему надо...
class MultiSellWnd extends UICommonAPI;

const MULTISELLWND_DIALOG_OK = 1122;

struct NeededItem
{
var int ID;
var string Name;
var int Count;
var string IconName;
var int Enchant;
var int CrystalType;
var int ItemType;
var int RefineryOp1;
var int RefineryOp2;
};

struct ItemList
{
var int MultiSellType;
var int NeededItemNum;
var Array<ItemInfo> ItemInfoList;
var Array<NeededItem> NeededItemList;
};

var Array<ItemList> m_itemLIst;
var int m_shopID;
var int pre_itemList;

function OnLoad()
{
RegisterEvent( EV_MultiSellShopID );
RegisterEvent( EV_MultiSellItemList );
RegisterEvent( EV_MultiSellNeededItemList );
RegisterEvent( EV_MultiSellItemListEnd );
RegisterEvent( EV_DialogOK );
pre_itemList = -1;
}

function OnEvent( int Event_ID, string param )
{
switch ( Event_ID )
{
case EV_MultiSellShopID:
HandleShopID( param );
break;
case EV_MultiSellItemList:
HandleItemList( param );
break;
case EV_MultiSellNeededItemList:
HandleNeededItemList( param );
break;
case EV_MultiSellItemListEnd:
HandleItemListEnd( param );
break;
case EV_DialogOK:
HandleDialogOK();
break;
default:
break;
};
}

function OnShow()
{
class'UIAPI_EDITBOX'.static.Clear("MultiSellWnd.ItemCountEdit");
}

function OnHide()
{
}

function OnClickButton( string ControlName )
{
switch ( ControlName )
{
case "OKButton":
HandleOKButton();
break;
case "CancelButton":
Clear();
HideWindow("MultiSellWnd");
break;
}
}

function OnClickItem( string strID, int index ) // ItemWindow
{
local int i;
local string param;

class'UIAPI_MULTISELLITEMINFO'.static.Clear("MultiSellWnd.ItemInfo");
class'UIAPI_MULTISELLNEEDEDITEM'.static.Clear("MultiSellWnd.NeededItem");
if ( strID == "ItemList" )
{
if ( index >= 0 && index < m_itemList.Length )
{
for ( i = 0;i < m_itemList[index].NeededItemList.Length;++i )
{
param = "";
ParamAdd( param, "Name", m_itemList[index].NeededItemList.Name );
ParamAdd( param, "ID", string(m_itemList[index].NeededItemList.ID ));
ParamAdd( param, "Num", string(m_itemList[index].NeededItemList.Count ));
ParamAdd( param, "Icon", m_itemList[index].NeededItemList.IconName );
ParamAdd( param, "Enchant", string(m_itemList[index].NeededItemList.Enchant) );
ParamAdd( param, "CrystalType", string(m_itemList[index].NeededItemList.CrystalType) );
ParamAdd( param, "ItemType", string(m_itemList[index].NeededItemList.ItemType) );
class'UIAPI_MULTISELLNEEDEDITEM'.static.AddData("MultiSellWnd.NeededItem", param);
}
for ( i = 0;i < m_itemList[index].NeededItemNum;++i )
class'UIAPI_MULTISELLITEMINFO'.static.SetItemInfo("MultiSellWnd.ItemInfo", i, m_itemList[index].ItemInfoList );

class'UIAPI_EDITBOX'.static.Clear("MultiSellWnd.ItemCountEdit");
if ( m_itemList[index].MultiSellType == 0 )
{
class'UIAPI_EDITBOX'.static.SetString("MultiSellWnd.ItemCountEdit", "1");
class'UIAPI_WINDOW'.static.DisableWindow("MultiSellWnd.ItemCountEdit");
}
else if ( m_itemList[index].MultiSellType == 1 )
{
class'UIAPI_EDITBOX'.static.SetString("MultiSellWnd.ItemCountEdit", "1");
class'UIAPI_WINDOW'.static.EnableWindow("MultiSellWnd.ItemCountEdit");
}
if ( pre_itemList != index )
{
if ( DialogIsMine() )
DialogHide();
}
}
}
}

function HandleShopID( string param )
{
Clear();
ParseInt( param, "shopID", m_shopID );
}

function Clear()
{
m_itemList.Length = 0;
class'UIAPI_MULTISELLITEMINFO'.static.Clear("MultiSellWnd.ItemInfo");
class'UIAPI_MULTISELLNEEDEDITEM'.static.Clear("MultiSellWnd.NeededItem");
class'UIAPI_ITEMWINDOW'.static.Clear("MultiSellWnd.ItemList");
}

function HandleItemList( string param )
{
local ItemInfo info;
local int index, type, i, classID;
local bool bMatchFound;

ParseInt( param, "classID", classID );
class'UIDATA_ITEM'.static.GetItemInfo( classID, info );

info.ClassID = classID;
ParseInt( param, "index", index );
ParseInt( param, "type", type );
ParseInt( param, "ID", info.Reserved );
ParseInt( param, "slotBitType", info.SlotBitType );
ParseInt( param, "itemType", info.ItemType );
ParseInt( param, "itemCount", info.ItemNum );
ParseInt( param, "OutputRefineryOp1", info.RefineryOp1 );
ParseInt( param, "OutputRefineryOp2", info.RefineryOp2 );
// 100% Durability
if ( 0 < info.Durability )
info.CurrentDurability = info.Durability;
if ( index == 0 )
{
i = m_itemList.Length;
m_itemList.Length = i + 1;
m_itemList.MultiSellType = type;
m_itemList.NeededItemNum = 1;
m_itemList.ItemInfoList.Length = index + 1;
m_itemList.ItemInfoList[index] = info;
}
else if ( index > 0 )
{
bMatchFound = False;
// Find matching item with ID
for ( i = m_itemList.Length - 1; i >= 0 ;--i )
{
if ( m_itemList.ItemInfoList[0].Reserved == info.Reserved
&& m_itemList.ItemInfoList[0].RefineryOp1 == info.RefineryOp1
&& m_itemList.ItemInfoList[0].RefineryOp2 == info.RefineryOp2 )
{
bMatchFound = True;
break;
}
}
if ( bMatchFound )
{
if ( m_itemList.ItemInfoList.Length <= index )
m_itemList.ItemInfoList.Length = index + 1;

m_itemList.MultiSellType = type;
m_itemList.ItemInfoList[index] = info;
++m_ItemList.NeededItemNum;
}
}
}

function HandleNeededItemList( string param )
{
local NeededItem item;
local int i, ID, index, RefineryOp1, RefineryOp2 ;

ParseInt( param, "ID", ID );
ParseInt( param, "refineryOp1", RefineryOp1 );
ParseInt( param, "refineryOp2", RefineryOp2 );
ParseInt( param, "ClassID", item.ID );
ParseInt( param, "count", item.Count );
ParseInt( param, "enchant", item.Enchant );
ParseInt( param, "inputRefineryOp1", item.RefineryOp1 );
ParseInt( param, "inputRefineryOp2", item.RefineryOp2 );
if ( item.ID == -100 )
{
item.Name = GetSystemString(1277);
item.IconName = "icon.etc_i.etc_pccafe_point_i00";
item.Enchant = 0;
item.ItemType = -1;
item.ID = 0;
}
else if ( item.ID == -200 )
{
item.Name = GetSystemString(1311);
item.IconName = "icon.etc_i.etc_bloodpledge_point_i00";
item.Enchant = 0;
item.ItemType = -1;
item.ID = 0;
}
else
{
item.Name = class'UIDATA_ITEM'.static.GetItemName( item.ID );
item.IconName = class'UIDATA_ITEM'.static.GetItemTextureName( item.ID );
}
// Add Item Info
for ( i = m_itemList.Length - 1; i >= 0 ;--i )
{
if ( m_itemList[i].ItemInfoList[0].Reserved == ID && m_itemList[i].ItemInfoList[0].RefineryOp1 == RefineryOp1 && m_itemList[i].ItemInfoList[0].RefineryOp2 == RefineryOp2 ) // match found
{
index = m_itemList[i].NeededItemList.Length;
m_itemList[i].NeededItemList.Length = index + 1;
item.ItemType = class'UIDATA_ITEM'.static.GetItemDataType( item.ID );
item.CrystalType = class'UIDATA_ITEM'.static.GetItemCrystalType( item.ID );
m_itemList[i].NeededItemList[index] = item;
break;
}
}
}

function HandleItemListEnd( string param )
{
local WindowHandle m_inventoryWnd;

m_inventoryWnd = GetHandle( "InventoryWnd" );

if ( m_inventoryWnd.IsShowWindow() )
m_inventoryWnd.HideWindow();
ShowWindow("MultiSellWnd");
class'UIAPI_WINDOW'.static.SetFocus("MultiSellWnd");
ShowItemList();
}

function ShowItemList()
{
local ItemInfo info;
local int i;

for ( i = 0;i < m_itemList.Length;++i )
{
info = m_itemList[i].ItemInfoList[0];
class'UIAPI_ITEMWINDOW'.static.AddItem( "MultiSellWnd.ItemList", info );
}
}

function HandleOKButton()
{
local int selectedIndex, itemNum;

selectedIndex = class'UIAPI_ITEMWINDOW'.static.GetSelectedNum("MultiSellWnd.ItemList");
itemNum = int(class'UIAPI_EDITBOX'.static.GetString("MultiSellWnd.ItemCountEdit"));
if ( selectedIndex >= 0 )
{
DialogSetReservedInt( selectedIndex );
DialogSetReservedInt2( itemNum );
DialogSetID( MULTISELLWND_DIALOG_OK );
DialogShow(DIALOG_Warning, GetSystemMessage(1383));
pre_itemList = selectedIndex;
}
}

function HandleDialogOK()
{
local string param;
local int SelectedIndex;

if ( DialogIsMine() )
{
SelectedIndex = DialogGetReservedInt();
ParamAdd( param, "ShopID", string(m_shopID) );
ParamAdd( param, "ItemID", string( m_itemList[SelectedIndex].ItemInfoList[0].Reserved ) );
ParamAdd( param, "RefineryOp1", string( m_itemList[SelectedIndex].ItemInfoList[0].RefineryOp1 ) );
ParamAdd( param, "RefineryOp2", string( m_itemList[SelectedIndex].ItemInfoList[0].RefineryOp2 ) );
ParamAdd( param, "ItemCount", string(DialogGetReservedInt2()) );
RequestMultiSellChoose( param );
}
}

defaultproperties
{
} как?
[/i][/i][/i][/i][/i][/i][/i]
 
class MultiSellWnd extends UICommonAPI;

const MULTISELLWND_DIALOG_OK = 1122;

struct NeededItem
{
var int ID;
var string Name;
var int Count;
var string IconName;
var int Enchant;
var int CrystalType;
var int ItemType;
var int RefineryOp1;
var int RefineryOp2;
};

struct ItemList
{
var int MultiSellType;
var int NeededItemNum;
var Array<ItemInfo> ItemInfoList;
var Array<NeededItem> NeededItemList;
};

var Array<ItemList> m_itemLIst;
var int m_shopID;
var int pre_itemList;

function OnLoad()
{
RegisterEvent( EV_MultiSellShopID );
RegisterEvent( EV_MultiSellItemList );
RegisterEvent( EV_MultiSellNeededItemList );
RegisterEvent( EV_MultiSellItemListEnd );
RegisterEvent( EV_DialogOK );
pre_itemList = -1;
}

function OnEvent( int Event_ID, string param )
{
switch ( Event_ID )
{
case EV_MultiSellShopID:
HandleShopID( param );
break;
case EV_MultiSellItemList:
HandleItemList( param );
break;
case EV_MultiSellNeededItemList:
HandleNeededItemList( param );
break;
case EV_MultiSellItemListEnd:
HandleItemListEnd( param );
break;
case EV_DialogOK:
HandleDialogOK();
break;
default:
break;
};
}

function OnShow()
{
class'UIAPI_EDITBOX'.static.Clear("MultiSellWnd.ItemCountEdit");
}

function OnHide()
{
}

function OnClickButton( string ControlName )
{
switch ( ControlName )
{
case "OKButton":
HandleOKButton();
break;
case "CancelButton":
Clear();
HideWindow("MultiSellWnd");
break;
}
}

function OnClickItem( string strID, int index ) // ItemWindow
{
local int i;
local string param;

class'UIAPI_MULTISELLITEMINFO'.static.Clear("MultiSellWnd.ItemInfo");
class'UIAPI_MULTISELLNEEDEDITEM'.static.Clear("MultiSellWnd.NeededItem");
if ( strID == "ItemList" )
{
if ( index >= 0 && index < m_itemList.Length )
{
for ( i = 0;i < m_itemList[index].NeededItemList.Length;++i )
{
param = "";
ParamAdd( param, "Name", m_itemList[index].NeededItemList.Name );
ParamAdd( param, "ID", string(m_itemList[index].NeededItemList.ID ));
ParamAdd( param, "Num", string(m_itemList[index].NeededItemList.Count ));
ParamAdd( param, "Icon", m_itemList[index].NeededItemList.IconName );
ParamAdd( param, "Enchant", string(m_itemList[index].NeededItemList.Enchant) );
ParamAdd( param, "CrystalType", string(m_itemList[index].NeededItemList.CrystalType) );
ParamAdd( param, "ItemType", string(m_itemList[index].NeededItemList.ItemType) );
class'UIAPI_MULTISELLNEEDEDITEM'.static.AddData("MultiSellWnd.NeededItem", param);
}
for ( i = 0;i < m_itemList[index].NeededItemNum;++i )
class'UIAPI_MULTISELLITEMINFO'.static.SetItemInfo("MultiSellWnd.ItemInfo", i, m_itemList[index].ItemInfoList );

class'UIAPI_EDITBOX'.static.Clear("MultiSellWnd.ItemCountEdit");
if ( m_itemList[index].MultiSellType == 0 )
{
class'UIAPI_EDITBOX'.static.SetString("MultiSellWnd.ItemCountEdit", "1");
class'UIAPI_WINDOW'.static.DisableWindow("MultiSellWnd.ItemCountEdit");
}
else if ( m_itemList[index].MultiSellType == 1 )
{
class'UIAPI_EDITBOX'.static.SetString("MultiSellWnd.ItemCountEdit", "1");
class'UIAPI_WINDOW'.static.EnableWindow("MultiSellWnd.ItemCountEdit");
}
if ( pre_itemList != index )
{
if ( DialogIsMine() )
DialogHide();
}
}
}
}

function HandleShopID( string param )
{
Clear();
ParseInt( param, "shopID", m_shopID );
}

function Clear()
{
m_itemList.Length = 0;
class'UIAPI_MULTISELLITEMINFO'.static.Clear("MultiSellWnd.ItemInfo");
class'UIAPI_MULTISELLNEEDEDITEM'.static.Clear("MultiSellWnd.NeededItem");
class'UIAPI_ITEMWINDOW'.static.Clear("MultiSellWnd.ItemList");
}

function HandleItemList( string param )
{
local ItemInfo info;
local int index, type, i, classID;
local bool bMatchFound;

ParseInt( param, "classID", classID );
class'UIDATA_ITEM'.static.GetItemInfo( classID, info );

info.ClassID = classID;
ParseInt( param, "index", index );
ParseInt( param, "type", type );
ParseInt( param, "ID", info.Reserved );
ParseInt( param, "slotBitType", info.SlotBitType );
ParseInt( param, "itemType", info.ItemType );
ParseInt( param, "itemCount", info.ItemNum );
ParseInt( param, "OutputRefineryOp1", info.RefineryOp1 );
ParseInt( param, "OutputRefineryOp2", info.RefineryOp2 );
// 100% Durability
if ( 0 < info.Durability )
info.CurrentDurability = info.Durability;
if ( index == 0 )
{
i = m_itemList.Length;
m_itemList.Length = i + 1;
m_itemList.MultiSellType = type;
m_itemList.NeededItemNum = 1;
m_itemList.ItemInfoList.Length = index + 1;
m_itemList.ItemInfoList[index] = info;
}
else if ( index > 0 )
{
bMatchFound = False;
// Find matching item with ID
for ( i = m_itemList.Length - 1; i >= 0 ;--i )
{
if ( m_itemList.ItemInfoList[0].Reserved == info.Reserved
&& m_itemList.ItemInfoList[0].RefineryOp1 == info.RefineryOp1
&& m_itemList.ItemInfoList[0].RefineryOp2 == info.RefineryOp2 )
{
bMatchFound = True;
break;
}
}
if ( bMatchFound )
{
if ( m_itemList.ItemInfoList.Length <= index )
m_itemList.ItemInfoList.Length = index + 1;

m_itemList.MultiSellType = type;
m_itemList.ItemInfoList[index] = info;
++m_ItemList[I].NeededItemNum;
}
}
}

function HandleNeededItemList( string param )
{
local NeededItem item;
local int i, ID, index, RefineryOp1, RefineryOp2 ;

ParseInt( param, "ID", ID );
ParseInt( param, "refineryOp1", RefineryOp1 );
ParseInt( param, "refineryOp2", RefineryOp2 );
ParseInt( param, "ClassID", item.ID );
ParseInt( param, "count", item.Count );
ParseInt( param, "enchant", item.Enchant );
ParseInt( param, "inputRefineryOp1", item.RefineryOp1 );
ParseInt( param, "inputRefineryOp2", item.RefineryOp2 );
if ( item.ID == -100 )
{
item.Name = GetSystemString(1277);
item.IconName = "icon.etc_i.etc_pccafe_point_i00";
item.Enchant = 0;
item.ItemType = -1;
item.ID = 0;
}
else if ( item.ID == -200 )
{
item.Name = GetSystemString(1311);
item.IconName = "icon.etc_i.etc_bloodpledge_point_i00";
item.Enchant = 0;
item.ItemType = -1;
item.ID = 0;
}
else
{
item.Name = class'UIDATA_ITEM'.static.GetItemName( item.ID );
item.IconName = class'UIDATA_ITEM'.static.GetItemTextureName( item.ID );
}
// Add Item Info
for ( i = m_itemList.Length - 1; i >= 0 ;--i )
{
if ( m_itemList[I].ItemInfoList[0].Reserved == ID && m_itemList[I].ItemInfoList[0].RefineryOp1 == RefineryOp1 && m_itemList[I].ItemInfoList[0].RefineryOp2 == RefineryOp2 ) // match found
{
index = m_itemList[I].NeededItemList.Length;
m_itemList[I].NeededItemList.Length = index + 1;
item.ItemType = class'UIDATA_ITEM'.static.GetItemDataType( item.ID );
item.CrystalType = class'UIDATA_ITEM'.static.GetItemCrystalType( item.ID );
m_itemList[I].NeededItemList[index] = item;
break;
}
}
}

function HandleItemListEnd( string param )
{
local WindowHandle m_inventoryWnd;

m_inventoryWnd = GetHandle( "InventoryWnd" );

if ( m_inventoryWnd.IsShowWindow() )
m_inventoryWnd.HideWindow();
ShowWindow("MultiSellWnd");
class'UIAPI_WINDOW'.static.SetFocus("MultiSellWnd");
ShowItemList();
}

function ShowItemList()
{
local ItemInfo info;
local int i;

for ( i = 0;i < m_itemList.Length;++i )
{
info = m_itemList[I].ItemInfoList[0];
class'UIAPI_ITEMWINDOW'.static.AddItem( "MultiSellWnd.ItemList", info );
}
}

function HandleOKButton()
{
local int selectedIndex, itemNum;

selectedIndex = class'UIAPI_ITEMWINDOW'.static.GetSelectedNum("MultiSellWnd.ItemList");
itemNum = int(class'UIAPI_EDITBOX'.static.GetString("MultiSellWnd.ItemCountEdit"));
if ( selectedIndex >= 0 )
{
DialogSetReservedInt( selectedIndex );
DialogSetReservedInt2( itemNum );
DialogSetID( MULTISELLWND_DIALOG_OK );
DialogShow(DIALOG_Warning, GetSystemMessage(1383));
pre_itemList = selectedIndex;
}
}

function HandleDialogOK()
{
local string param;
local int SelectedIndex;

if ( DialogIsMine() )
{
SelectedIndex = DialogGetReservedInt();
ParamAdd( param, "ShopID", string(m_shopID) );
ParamAdd( param, "ItemID", string( m_itemList[SelectedIndex].ItemInfoList[0].Reserved ) );
ParamAdd( param, "RefineryOp1", string( m_itemList[SelectedIndex].ItemInfoList[0].RefineryOp1 ) );
ParamAdd( param, "RefineryOp2", string( m_itemList[SelectedIndex].ItemInfoList[0].RefineryOp2 ) );
ParamAdd( param, "ItemCount", string(DialogGetReservedInt2()) );
RequestMultiSellChoose( param );
}
}

defaultproperties
{
} как?
[/I][/I][/I][/I][/I][/I][/I][/I]
Если тебе надо чисто отображение попробуй добавить.
C++:
function string FormatNumber(int Amount)
{
    local string S, Out;
    local int i;

    S = string(Amount);
    Out = "";
  
    for (i = 0; i < Len(S); i++)
    {
        if (i > 0 && (Len(S) - i) % 3 == 0)
            Out $= ","; //если хочешь поменяй на пробел.
        Out $= Mid(S, i, 1);
    }
    return Out;
}
И в OnClickItem замени
C++:
// Было:
ParamAdd( param, "Num", string(m_itemList[index].NeededItemList[i].Count ));

// Стало:
ParamAdd( param, "Num", FormatNumber(m_itemList[index].NeededItemList[i].Count) );
 
Последнее редактирование:
Лог ошибок должен быть представлен в виде текста, а не скринами. Если лог большой то прикрепите его вложением к своему сообщению
C++:
function string FormatNumber(int n)
{
    local string sCount, sResult, sChar, sComma;
    local int i, nLen;

    sCount = string(n);
    nLen = Len(sCount);
    sResult = "";
    sComma = ",";

    for (i = 0; i < nLen; i++)
    {
        sChar = Mid(sCount, i, 1);
        
        sResult = sResult $ sChar;
        if (i < (nLen - 1))
        {
            if (((nLen - 1 - i) % 3) == 0)
            {
                sResult = sResult $ sComma;
            }
        }
    }
    return sResult;
}

Попробуй так.
 
Запрещено публиковать исходный код без BB-кода — CODE
Всё осталось по-прежнему 15.
Сообщение объединено:
class ShopWnd extends UICommonAPI;

const DIALOG_TOP_TO_BOTTOM = 111;
const DIALOG_BOTTOM_TO_TOP = 222;
const DIALOG_PREVIEW = 333;

enum ShopType // 지금 열고 있는 창이 판패창인지 구매창인지 나타낸다
{
ShopNone, // Invalid type
ShopBuy,
ShopSell,
ShopPreview,
};

var String m_WindowName; // 상속에 사용하려고 윈도우 이름 추가 - lancelot 2006. 11. 27.

var ShopType m_shopType;
var int m_merchantID;
var int m_npcID; // only for shoppreveiw
var INT64 m_currentPrice; // 구매/판매 목록에 올려놓은 아이템의 가격을 합산한 것

function OnLoad()
{
registerEvent( EV_ShopOpenWindow );
registerEvent( EV_ShopAddItem );
registerEvent( EV_DialogOK );

}

function Clear()
{
m_shopType = ShopNone;
m_merchantID = -1;
m_npcID = -1;
m_currentPrice = Int2Int64(0);

class'UIAPI_ITEMWINDOW'.static.Clear(m_WindowName$".TopList");
class'UIAPI_ITEMWINDOW'.static.Clear(m_WindowName$".BottomList");

class'UIAPI_TEXTBOX'.static.SetText(m_WindowName$".PriceText", "0");
class'UIAPI_TEXTBOX'.static.SetTooltipString(m_WindowName$".PriceText", "");

class'UIAPI_TEXTBOX'.static.SetText(m_WindowName$".AdenaText", "0");
class'UIAPI_TEXTBOX'.static.SetTooltipString(m_WindowName$".AdenaText", "");

class'UIAPI_INVENWEIGHT'.static.ZeroWeight(m_WindowName$".InvenWeight");
}

function OnEvent(int Event_ID,string param)
{
switch( Event_ID )
{
case EV_ShopOpenWindow:
HandleOpenWindow(param);
break;
case EV_ShopAddItem:
HandleAddItem(param);
break;
case EV_DialogOK:
HandleDialogOK();
break;
default:
break;
}
}

function OnClickButton( string ControlName )
{
local int index;
if( ControlName == "UpButton" )
{
index = class'UIAPI_ITEMWINDOW'.static.GetSelectedNum( m_WindowName$".BottomList" );
MoveItemBottomToTop( index, false );
}
else if( ControlName == "DownButton" )
{
index = class'UIAPI_ITEMWINDOW'.static.GetSelectedNum( m_WindowName$".TopList" );
MoveItemTopToBottom( index, false );
}
else if( ControlName == "OKButton" )
{
HandleOKButton();
}
else if( ControlName == "CancelButton" )
{
Clear();
HideWindow(m_WindowName);
}
}

function OnDBClickItem( string ControlName, int index )
{
if(ControlName == "TopList")
{
MoveItemTopToBottom( index, false );
}
else if(ControlName == "BottomList")
{
MoveItemBottomToTop( index, false );
}

}

function OnDropItem( string strID, ItemInfo info, int x, int y)
{
local int index;
//debug("OnDropItem strID " $ strID $ ", src=" $ info.DragSrcName);
if( strID == "TopList" && info.DragSrcName == "BottomList" )
{
index = class'UIAPI_ITEMWINDOW'.static.FindItemWithClassID( m_WindowName$".BottomList", info.ClassID );
if( index >= 0 )
MoveItemBottomToTop( index, info.AllItemCount > 0 );
}
else if( strID == "BottomList" && info.DragSrcName == "TopList" )
{
index = class'UIAPI_ITEMWINDOW'.static.FindItemWithClassID( m_WindowName$".TopList", info.ClassID );
if( index >= 0 )
MoveItemTopToBottom( index, info.AllItemCount > 0 );
}
}

function MoveItemTopToBottom( int index, bool bAllItem )
{
local int bottomIndex;
local ItemInfo info, bottomInfo;
if( class'UIAPI_ITEMWINDOW'.static.GetItem(m_WindowName$".TopList", index, info) )
{
// 1일경우 수량을 입력하는 다이얼로그는 출력하지 않는다.
// debug("info.ConsumeType:"$info.ConsumeType$", 갯수:"$info.ItemNum);
if( !bAllItem && IsStackableItem( info.ConsumeType ) && (info.ItemNum!=1) ) // stackable?
{
DialogSetID( DIALOG_TOP_TO_BOTTOM );
DialogSetReservedInt( info.ClassID );
DialogSetDefaultOK();
if( m_shopType == ShopSell )
DialogSetParamInt( info.ItemNum );
else
DialogSetParamInt(-1);

DialogSetDefaultOK();
DialogShow( DIALOG_NumberPad, MakeFullSystemMsg( GetSystemMessage(72), info.Name, "" ) );
}
else
{
info.bShowCount = false;

if( m_shopType == ShopSell )
{
bottomIndex = class'UIAPI_ITEMWINDOW'.static.FindItemWithClassID( m_WindowName$".BottomList", info.ClassID );
if( bottomIndex >= 0 && IsStackableItem( info.ConsumeType ) )
{
class'UIAPI_ITEMWINDOW'.static.GetItem( m_WindowName$".BottomList", bottomIndex, bottomInfo );
bottomInfo.ItemNum += info.ItemNum;
class'UIAPI_ITEMWINDOW'.static.SetItem( m_WindowName$".BottomList", bottomIndex, bottomInfo);
}
else
{
class'UIAPI_ITEMWINDOW'.static.AddItem( m_WindowName$".BottomList", info );
}
class'UIAPI_ITEMWINDOW'.static.DeleteItem( m_WindowName$".TopList", index ); // 물건을 팔 경우 자신의 인벤토리 목록에서 아이템을 제거
}
else if( m_shopType == ShopBuy ) // 무게 바에 추가되는 무게만큼 더해 준다.
{
info.ItemNum = 1; // 상점 구매의 경우 ItemNum이 세팅 되어 있지 않은 경우가 있기 때문에 일부러 1로 해 줘야한다.
class'UIAPI_ITEMWINDOW'.static.AddItem( m_WindowName$".BottomList", info );
class'UIAPI_INVENWEIGHT'.static.AddWeight( m_WindowName$".InvenWeight", info.Weight * info.ItemNum );
}
else if( m_shopType == ShopPreview) //미리보기
{
bottomIndex = class'UIAPI_ITEMWINDOW'.static.FindItemWithClassID( m_WindowName$".BottomList", info.ClassID );
info.ItemNum = 1;
class'UIAPI_ITEMWINDOW'.static.AddItem( m_WindowName$".BottomList", info );
}
AddPrice(Int64Mul(info.Price, info.ItemNum));

}
}
}

function MoveItemBottomToTop( int index, bool bAllItem )
{
local ItemInfo info, info2;
local int bottomIndex;
if( class'UIAPI_ITEMWINDOW'.static.GetItem(m_WindowName$".BottomList", index, info) )
{
if( !bAllItem && IsStackableItem( info.ConsumeType ) ) // stackable?
{
DialogSetID( DIALOG_BOTTOM_TO_TOP );
DialogSetDefaultOK();
DialogSetReservedInt( info.ClassID );
DialogSetParamInt( info.ItemNum );
DialogSetDefaultOK();
DialogShow( DIALOG_NumberPad, MakeFullSystemMsg( GetSystemMessage(72), info.Name, "" ) );
}
else
{
class'UIAPI_ITEMWINDOW'.static.DeleteItem( m_WindowName$".BottomList", index );
if( m_shopType == ShopSell )
{
bottomIndex = class'UIAPI_ITEMWINDOW'.static.FindItemWithServerID( m_WindowName$".TopList", info.ServerID );
if( bottomIndex == -1 )
{
class'UIAPI_ITEMWINDOW'.static.AddItem( m_WindowName$".TopList", info ); // 물건을 판매하는 경우 다시 자신의 인벤토리 목록으로
}
else
{
class'UIAPI_ITEMWINDOW'.static.GetItem(m_WindowName$".TopList", bottomIndex, info2);
info2.ItemNum += info.ItemNum;
class'UIAPI_ITEMWINDOW'.static.SetItem(m_WindowName$".TopList", bottomIndex, info2);
}
}
else if( m_shopType == ShopBuy ) // 무게 바에 추가되는 무게만큼 빼 준다.
{
class'UIAPI_INVENWEIGHT'.static.ReduceWeight( m_WindowName$".InvenWeight", info.Weight * info.ItemNum );
}
AddPrice(Int64Mul(-info.Price, info.ItemNum));
}
}
}

function HandleDialogOK()
{
local int id, num, classID, index, topIndex;
local ItemInfo info, topInfo;
local string param;

if( DialogIsMine() )
{
id = DialogGetID();
num = int( DialogGetString() );
classID = DialogGetReservedInt();
if( id == DIALOG_TOP_TO_BOTTOM && num > 0 )
{
topIndex = class'UIAPI_ITEMWINDOW'.static.FindItemWithClassID( m_WindowName$".TopList", classID );
if( topIndex >= 0 )
{
class'UIAPI_ITEMWINDOW'.static.GetItem( m_WindowName$".TopList", topIndex, topInfo );
if( m_shopType == ShopSell )
num = Min(num, topInfo.ItemNum); // 다이얼로그에서 엉뚱한 숫자 입력하는 것 방지.
index = class'UIAPI_ITEMWINDOW'.static.FindItemWithClassID( m_WindowName$".BottomList", classID );
if( index >= 0 )
{
class'UIAPI_ITEMWINDOW'.static.GetItem( m_WindowName$".BottomList", index, info );
info.ItemNum += num;
class'UIAPI_ITEMWINDOW'.static.SetItem( m_WindowName$".BottomList", index, info );
AddPrice( Int64Mul(num, info.Price) );
}
else
{
info = topInfo;
info.ItemNum = num;
info.bShowCount = false;
class'UIAPI_ITEMWINDOW'.static.AddItem( m_WindowName$".BottomList", info );
AddPrice( Int64Mul(num, info.Price) );
}

if( m_shopType == ShopSell ) // 판매일 경우 자신의 인벤토리 목록의 개수를 조정해 준다(구매일 경우 상인이 가진 아이템 숫자는 의미가 없음)
{
topInfo.ItemNum -= num;
if( topInfo.ItemNum <= 0 )
class'UIAPI_ITEMWINDOW'.static.DeleteItem( m_WindowName$".TopList", topIndex );
else
class'UIAPI_ITEMWINDOW'.static.SetItem( m_WindowName$".TopList", topIndex, topInfo );
}
else if( m_shopType == ShopBuy ) // 무게 바에 추가되는 무게만큼 더해 준다.
{
class'UIAPI_INVENWEIGHT'.static.AddWeight( m_WindowName$".InvenWeight", info.Weight * num );
}
}
}
else if( id == DIALOG_BOTTOM_TO_TOP && num > 0 )
{
index = class'UIAPI_ITEMWINDOW'.static.FindItemWithClassID( m_WindowName$".BottomList", classID );
if( index >= 0 )
{
class'UIAPI_ITEMWINDOW'.static.GetItem( m_WindowName$".BottomList", index, info );
info.ItemNum -= num;
if( info.ItemNum > 0 )
class'UIAPI_ITEMWINDOW'.static.SetItem( m_WindowName$".BottomList", index, info );
else
class'UIAPI_ITEMWINDOW'.static.DeleteItem( m_WindowName$".BottomList", index );

if( m_shopType == ShopSell )
{
topIndex = class'UIAPI_ITEMWINDOW'.static.FindItemWithClassID( m_WindowName$".TopList", classID );
if( topIndex >=0 && IsStackableItem( info.ConsumeType ) )
{
class'UIAPI_ITEMWINDOW'.static.GetItem( m_WindowName$".TopList", topIndex, topInfo );
topInfo.ItemNum += num;
class'UIAPI_ITEMWINDOW'.static.SetItem( m_WindowName$".TopList", topIndex, topInfo );
}
else
{
info.ItemNum = num;
class'UIAPI_ITEMWINDOW'.static.AddItem( m_WindowName$".TopList", info );
}
}
else if( m_shopType == ShopBuy ) // 무게 바에 추가되는 무게만큼 빼 준다.
{
class'UIAPI_INVENWEIGHT'.static.ReduceWeight( m_WindowName$".InvenWeight", info.Weight * num );
}

AddPrice( Int64Mul(-num, info.Price) );
}
}
else if( id == DIALOG_PREVIEW )
{
num = class'UIAPI_ITEMWINDOW'.static.GetItemNum( m_WindowName$".BottomList" );

if( num > 0 )
{
// pack every item in BottomList
ParamAdd( param, "merchant", string(m_merchantID) );
ParamAdd( param, "npc", string(m_npcID) );
ParamAdd( param, "num", string(num) );
for( index=0 ; index < num; ++index )
{
class'UIAPI_ITEMWINDOW'.static.GetItem( m_WindowName$".BottomList", index, info);
ParamAdd( param, "classID" $ index, string(info.ClassID) );
}

RequestPreviewItem( param );
}
}
}
}

function HandleOpenWindow( string param )
{
local string type;
local int adena;
local string adenaString;

local WindowHandle m_inventoryWnd; // 인벤토리 핸들 선언.

m_inventoryWnd = GetHandle( "InventoryWnd" ); //인벤토리의 윈도우 핸들을 얻어온다.

Clear();

ParseString( param, "type", type );
ParseInt( param, "merchant", m_merchantID );
ParseInt( param, "adena", adena );

if( type == "buy" )
m_shopType = ShopBuy;
else if( type == "sell" )
m_shopType = ShopSell;
else if( type == "preview" )
m_shopType = ShopPreview;
else
m_shopType = ShopNone;

adenaString = MakeCostString( string(adena) );
class'UIAPI_TEXTBOX'.static.SetText(m_WindowName$".AdenaText", adenaString);
class'UIAPI_TEXTBOX'.static.SetTooltipString(m_WindowName$".AdenaText", ConvertNumToText(string(adena)) );

if( m_inventoryWnd.IsShowWindow() ) //인벤토리 창이 열려있으면 닫아준다.
{
m_inventoryWnd.HideWindow();
}
ShowWindow( m_WindowName );
class'UIAPI_WINDOW'.static.SetFocus(m_WindowName);

if( type == "buy" )
{
class'UIAPI_WINDOW'.static.SetTooltipType( m_WindowName$".TopList", "InventoryPrice1HideEnchantStackable" );
class'UIAPI_WINDOW'.static.SetTooltipType( m_WindowName$".BottomList", "InventoryPrice1" );

class'UIAPI_WINDOW'.static.SetWindowTitle(m_WindowName, 136);

class'UIAPI_TEXTBOX'.static.SetText( m_WindowName$".TopText", GetSystemString(137) );
class'UIAPI_TEXTBOX'.static.SetText( m_WindowName$".BottomText", GetSystemString(139) );
class'UIAPI_TEXTBOX'.static.SetText( m_WindowName$".PriceConstText", GetSystemString(142) );
}
else if( type == "sell" )
{
class'UIAPI_WINDOW'.static.SetTooltipType( m_WindowName$".TopList", "InventoryPrice2" );
class'UIAPI_WINDOW'.static.SetTooltipType( m_WindowName$".BottomList", "InventoryPrice2" );

class'UIAPI_WINDOW'.static.SetWindowTitle(m_WindowName, 136);

class'UIAPI_TEXTBOX'.static.SetText( m_WindowName$".TopText", GetSystemString(138) );
class'UIAPI_TEXTBOX'.static.SetText( m_WindowName$".BottomText", GetSystemString(137) );
class'UIAPI_TEXTBOX'.static.SetText( m_WindowName$".PriceConstText", GetSystemString(143) );
}
else if( type == "preview" )
{
ParseInt( param, "npc", m_npcID );

class'UIAPI_WINDOW'.static.SetTooltipType( m_WindowName$".TopList", "InventoryPrice1HideEnchantStackable" );
class'UIAPI_WINDOW'.static.SetTooltipType( m_WindowName$".BottomList", "InventoryPrice1" );

class'UIAPI_WINDOW'.static.SetWindowTitle(m_WindowName, 847);

class'UIAPI_TEXTBOX'.static.SetText( m_WindowName$".TopText", GetSystemString(811) );
class'UIAPI_TEXTBOX'.static.SetText( m_WindowName$".BottomText", GetSystemString(812) );
class'UIAPI_TEXTBOX'.static.SetText( m_WindowName$".PriceConstText", GetSystemString(813) );
}
}

function HandleAddItem( string param )
{
local ItemInfo info;

ParamToItemInfo( param, info );
if( m_shopType == ShopBuy && info.ItemNum > 0 )
info.bShowCount = true;

class'UIAPI_ITEMWINDOW'.static.AddItem( m_WindowName$".TopList", info );
}

function AddPrice( INT64 price )
{
local string adena;
m_currentPrice = Int64Add( m_currentprice, price );

if(m_currentPrice.nLeft <0 || m_currentPrice.nRight <0) //기본적으로 음수가 될 일이 없기때문에, 음수가 되면 걍 0을 뿌려줍니다.
{
m_currentPrice = Int2Int64(0);
}

adena = MakeCostStringInt64( m_currentPrice );
class'UIAPI_TEXTBOX'.static.SetText(m_WindowName$".PriceText", adena);
class'UIAPI_TEXTBOX'.static.SetTooltipString(m_WindowName$".PriceText", ConvertNumToText( Int64ToString(m_currentPrice)));
}

function HandleOKButton()
{
local string param;
local int topCount, bottomCount, topIndex, bottomIndex;
local ItemInfo topInfo, bottomInfo;
local int limitedItemCount;

bottomCount = class'UIAPI_ITEMWINDOW'.static.GetItemNum( m_WindowName$".BottomList" );
// debug("ShopWnd m_shopType:" $ m_shopType $ ", bottomCount:" $ bottomCount);
if( m_shopType == ShopBuy )
{
// limited item check
topCount = class'UIAPI_ITEMWINDOW'.static.GetItemNum( m_WindowName$".TopList" );
for( topIndex=0 ; topIndex < topCount ; ++topIndex )
{
class'UIAPI_ITEMWINDOW'.static.GetItem( m_WindowName$".TopList", topIndex, topInfo );
if( topInfo.ItemNum > 0 ) // this item can be purchased only by limited number
{
limitedItemCount = 0;
// search in BottomList for same classID
bottomCount = class'UIAPI_ITEMWINDOW'.static.GetItemNum( m_WindowName$".BottomList" );
for( bottomIndex=0; bottomIndex < bottomCount ; ++bottomIndex ) // match found, then check whether the number exceeds limited number
{
class'UIAPI_ITEMWINDOW'.static.GetItem( m_WindowName$".BottomList", bottomIndex, bottomInfo );
if( bottomInfo.ClassID == topInfo.ClassID )
limitedItemCount += bottomInfo.ItemNum;
}

//debug("limited Item count " $ limitedItemCount );
if( limitedItemCount > topInfo.ItemNum )
{
// warning dialog
DialogShow( DIALOG_WARNING, GetSystemMessage(1338) );
return;
}
}
}
// pack every item in BottomList
ParamAdd( param, "merchant", string(m_merchantID) );
ParamAdd( param, "num", string(bottomCount) );
for( bottomIndex=0 ; bottomIndex < bottomCount; ++bottomIndex )
{
class'UIAPI_ITEMWINDOW'.static.GetItem( m_WindowName$".BottomList", bottomIndex, bottomInfo );
ParamAdd( param, "classID" $ bottomIndex, string(bottomInfo.ClassID) );
ParamAdd( Param, "count" $ bottomIndex, string(bottomInfo.ItemNum) );
}
RequestBuyItem( param );
}
else if( m_shopType == ShopSell )
{
// pack every item in BottomList
ParamAdd( param, "merchant", string(m_merchantID) );
ParamAdd( param, "num", string(bottomCount) );
for( bottomIndex=0 ; bottomIndex < bottomCount; ++bottomIndex )
{
class'UIAPI_ITEMWINDOW'.static.GetItem( m_WindowName$".BottomList", bottomIndex, bottomInfo );
ParamAdd( param, "serverID" $ bottomIndex, string(bottomInfo.ServerID) );
ParamAdd( param, "classID" $ bottomIndex, string(bottomInfo.ClassID) );
ParamAdd( Param, "count" $ bottomIndex, string(bottomInfo.ItemNum) );
}
RequestSellItem( param );
}
else if( m_shopType == ShopPreview )
{
if( bottomCount > 0 )
{
DialogSetID( DIALOG_PREVIEW );
DialogShow( DIALOG_Warning, GetSystemMessage(1157) );
}
}

HideWindow(m_WindowName);
}

defaultproperties
{
m_WindowName="ShopWnd"
}
ShopWnd у него есть
 

Garo

Баллов: -1
Пряч код под в теги и под спойлер читать невозможною
Что будет представлять собой DLL-файл?
Сообщение объединено:
Знаете ли вы какой-нибудь удобный русский интерфейс + компилятор?
 
Последнее редактирование:
Что будет представлять собой DLL-файл?
Сообщение объединено:
Знаете ли вы какой-нибудь удобный русский интерфейс + компилятор?

Если для интерлюда
 
Что будет представлять собой DLL-файл?
Сообщение объединено:
Знаете ли вы какой-нибудь удобный русский интерфейс + компилятор?
Насколько я помню, в xdat можно выбрать нужные настройки отображения с запятой без и тп.
Попробуй выбрать NUMBER или то что тебе нужно из списка.

1774759021334.webp
 
Насколько я помню, в xdat можно выбрать нужные настройки отображения с запятой без и тп.
Попробуй выбрать NUMBER или то что тебе нужно из списка.

Посмотреть вложение 94634
Да ему скорее всего нужно что бы ценники за товары были с запятой, ну то есть обернуть условный price в MakeCostString(price)
 
Назад
Сверху Снизу