This reverts commit 179cb50557.
This commit is contained in:
parent
179cb50557
commit
c2ecc76457
588 changed files with 16260 additions and 10926 deletions
|
|
@ -24,10 +24,10 @@ namespace Server.Menus
|
|||
{
|
||||
public interface IMenu
|
||||
{
|
||||
Serial Serial{ get; }
|
||||
int Serial{ get; }
|
||||
int EntryLength{ get; }
|
||||
void SendTo(NetState state);
|
||||
void OnCancel(NetState state);
|
||||
void OnResponse(NetState state, int index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Menus
|
||||
namespace Server.Menus.ItemLists
|
||||
{
|
||||
public class ItemListEntry
|
||||
{
|
||||
|
|
@ -40,7 +40,8 @@ namespace Server.Menus
|
|||
|
||||
public class ItemListMenu : IMenu
|
||||
{
|
||||
private static Serial m_NextSerial;
|
||||
private static int m_NextSerial;
|
||||
private int m_Serial;
|
||||
|
||||
public ItemListMenu(string question, ItemListEntry[] entries)
|
||||
{
|
||||
|
|
@ -49,18 +50,18 @@ namespace Server.Menus
|
|||
|
||||
do
|
||||
{
|
||||
Serial = m_NextSerial++;
|
||||
Serial &= 0x7FFFFFFF;
|
||||
} while (Serial == 0);
|
||||
m_Serial = m_NextSerial++;
|
||||
m_Serial &= 0x7FFFFFFF;
|
||||
} while (m_Serial == 0);
|
||||
|
||||
Serial |= 0x80000000;
|
||||
m_Serial = (int)((uint)m_Serial | 0x80000000);
|
||||
}
|
||||
|
||||
public string Question{ get; }
|
||||
|
||||
public ItemListEntry[] Entries{ get; set; }
|
||||
|
||||
public Serial Serial { get; private set; }
|
||||
int IMenu.Serial => m_Serial;
|
||||
|
||||
int IMenu.EntryLength => Entries.Length;
|
||||
|
||||
|
|
@ -75,7 +76,7 @@ namespace Server.Menus
|
|||
public void SendTo(NetState state)
|
||||
{
|
||||
state.AddMenu(this);
|
||||
Packets.SendDisplayItemListMenu(state, this);
|
||||
state.Send(new DisplayItemListMenu(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,11 +20,12 @@
|
|||
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Menus
|
||||
namespace Server.Menus.Questions
|
||||
{
|
||||
public class QuestionMenu : IMenu
|
||||
{
|
||||
private static Serial m_NextSerial;
|
||||
private static int m_NextSerial;
|
||||
private int m_Serial;
|
||||
|
||||
public QuestionMenu(string question, string[] answers)
|
||||
{
|
||||
|
|
@ -33,16 +34,16 @@ namespace Server.Menus
|
|||
|
||||
do
|
||||
{
|
||||
Serial = ++m_NextSerial;
|
||||
Serial &= 0x7FFFFFFF;
|
||||
} while (Serial == 0);
|
||||
m_Serial = ++m_NextSerial;
|
||||
m_Serial &= 0x7FFFFFFF;
|
||||
} while (m_Serial == 0);
|
||||
}
|
||||
|
||||
public string Question{ get; set; }
|
||||
|
||||
public string[] Answers{ get; }
|
||||
|
||||
public Serial Serial { get; private set; }
|
||||
int IMenu.Serial => m_Serial;
|
||||
|
||||
int IMenu.EntryLength => Answers.Length;
|
||||
|
||||
|
|
@ -57,7 +58,7 @@ namespace Server.Menus
|
|||
public void SendTo(NetState state)
|
||||
{
|
||||
state.AddMenu(this);
|
||||
Packets.SendDisplayQuestionMenu(state, this);
|
||||
state.Send(new DisplayQuestionMenu(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue