Пример #1
0
void NameGenerator::GenerateName(csString &namebuffer,int length_low,int length_high)
{
    unsigned int length;
    PhonicEntry *lastphonic=NULL;
    namebuffer.Clear();

    length=randomgen->Get((length_high-length_low))+length_low;

    // Pick a beginning
    lastphonic=GetRandomBeginner();
    namebuffer.Append(lastphonic->phonic);

    // Add phonics to the middle while within length
    while (namebuffer.Length() < length)
    {
        if (lastphonic->flags & PHONIC_POSTJOINER)
            lastphonic=GetRandomNonPreJoiner();
        else
            lastphonic=GetRandomPreJoiner();
        namebuffer.Append(lastphonic->phonic);
    }

    // Pick an ending
    lastphonic=GetRandomEnder(!(lastphonic->flags & PHONIC_POSTJOINER));
    namebuffer.Append(lastphonic->phonic);

    namebuffer.Downcase();
}
Пример #2
0
static int StringToId (csString s)
{
  s.Downcase ();
  if (s == "new") return wxID_NEW;
  if (s == "copy") return wxID_COPY;
  if (s == "quit") return wxID_EXIT;
  if (s == "open") return wxID_OPEN;
  if (s == "save") return wxID_SAVE;
  if (s == "saveas") return wxID_SAVEAS;
  if (s == "paste") return wxID_PASTE;
  if (s == "delete") return wxID_DELETE;
  if (s == "preview") return wxID_PREVIEW;
  if (s == "find") return wxID_FIND;
  if (s == "help") return wxID_HELP_INDEX;
  if (s == "about") return wxID_ABOUT;
  return wxID_ANY;
}
Пример #3
0
bool pawsControlWindow::HandleWindowName(csString widgetStr)
{
    csString widget;
    widgetStr.Downcase();
    if(widgetStr == "options" )
        widget = "ConfigWindow";
    else if(widgetStr == "stats" || widgetStr =="skills")
        widget = "SkillWindow";
    else if(widgetStr == "spell book" || widgetStr == "spells")
        widget = "SpellBookWindow";
    else if(widgetStr == "inventory" || widgetStr == "inv")
        widget = "InventoryWindow";
    else if(widgetStr == "help")
        widget = "HelpWindow";
    else if(widgetStr == "buddy")
        widget = "BuddyWindow";
    else if(widgetStr == "info")
        widget = "InfoWindow";
    else if(widgetStr == "petition" || widgetStr == "petitions")
        widget = "PetitionWindow";
    else if(widgetStr == "quest")
        widget = "QuestNotebook";
    else if(widgetStr == "gm")
        widget = "GmGUI";
    else if(widgetStr == "shortcut")
        widget = "ShortcutWindow";
    else if(widgetStr == "group")
        widget = "GroupWindow";
    else if(widgetStr == "guild")
        widget = "GuildWindow";
    else if(widgetStr == "glyph")
        widget = "GlyphWindow";
    else if(widgetStr == "sketch")
        widget = "SketchWindow";
    else if(widgetStr == "merchant")
        widget = "MerchantWindow";
    else if(widgetStr == "loot")
        widget = "LootWindow";
    else if(widgetStr == "detail")
        widget = "DetailWindow";
    else if(widgetStr == "exchange")
        widget = "ExchangeWindow";
    else if(widgetStr == "write")
        widget = "WritingWindow";
    else if(widgetStr == "read")
        widget = "BookReadingWindow";
    else if(widgetStr == "questreward")
        widget = "QuestRewardWindow";
    else if(widgetStr == "craft")
        widget = "CraftWindow";
    else if(widgetStr == "ignore")
        widget = "IgnoreWindow";
    else if(widgetStr == "bag" || widgetStr == "smallinventory")
        widget = "SmallInventoryWindow";
    else if(widgetStr == "talk" || widgetStr == "chat" || widgetStr == "communications")
        widget = "ChatWindow";
    else if(widgetStr == "activemagic")
        widget = "ActiveMagicWindow";
    else if(widgetStr == "managepetitions")
        widget = "PetitionGMWindow";
    else if(widgetStr == "quit")
    {
        HandleQuit();
        return true;
    }
    else if(widgetStr == "buy")
    {
        psengine->GetCmdHandler()->Execute("/buy");
        return true;
    }
    if(widget)
        HandleWindow(widget);
    else return false;
    return true;
}