diff --git a/Bindings.xml b/Bindings.xml
new file mode 100644
index 00000000..d364dcfe
--- /dev/null
+++ b/Bindings.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+ ChatFrame_OpenChat("/o");
+
+
+ ChatFrame_OpenChat("/g");
+
+
+ ChatFrame_OpenChat("/p");
+
+
+ ChatFrame_OpenChat("/raid");
+
+
+ ChatFrame_OpenChat("/rw");
+
+
+ ChatFrame_OpenChat("/bg");
+
+
+ ChatFrame_OpenChat("/say");
+
+
+ ChatFrame_OpenChat("/yell");
+
+
+ ChatFrame_OpenChat("/w");
+
+
+ ChatFrame_OpenChat("/1");
+
+
+ ChatFrame_OpenChat("/2");
+
+
+ ChatFrame_OpenChat("/3");
+
+
+ ChatFrame_OpenChat("/4");
+
+
+ ChatFrame_OpenChat("/5");
+
+
+ ChatFrame_OpenChat("/6");
+
+
+ ChatFrame_OpenChat("/7");
+
+
+ ChatFrame_OpenChat("/8");
+
+
+ ChatFrame_OpenChat("/9");
+
+
+ ChatFrame_OpenChat("/10");
+
+
+ ChatFrame_OpenChat("/gr");
+
+
+
+ Prat.Addon:GetModule("TellTarget"):SendTellToTarget(SELECTED_CHAT_FRAME, "");
+
+
+
+ Prat.Addon:GetModule("CopyChat"):CopyChat();
+
+
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 00000000..10926e87
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,675 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
+
diff --git a/Prat-3.0.toc b/Prat-3.0.toc
new file mode 100644
index 00000000..b64a0f1d
--- /dev/null
+++ b/Prat-3.0.toc
@@ -0,0 +1,44 @@
+## Interface: 30000
+
+## Title: Prat |cff8080ff3.0|r |cffff8080Alpha Version|r
+## Notes: A framework for chat frame modules. ALPHA Version - Still in development.
+## Title-zhCN: Prat |cff8080ff3.0|r
+## Notes-zhCN: 整合的聊天增强助手
+## Notes-zhTW: 整合的聊天視窗模組。
+## Notes-frFR: Framework pour des modules concernant les fen\195\170tres de discussion
+## Notes-esES: Un entorno para modulos de chat.
+## Notes-deDE: Ein Grundaddon für Chatfenstermodule.
+## Notes-koKR: 대화창에 대한 다양한 기능을 제공하는 애드온입니다.
+## Version: 3.0 (Alpha Version) $Revision: 82160 $
+## Author: Prat Development Team
+## eMail: sylvanaar@mindspring.com,fin@instinct.org
+## URL: http://www.wowace.com/wiki/Prat
+
+## X-Category: Chat/Communication
+## X-Website: http://www.wowace.com/wiki/Prat
+## X-AceForum: 14824
+## X-Credits: Sylvanaar, Fin, Curney, Krtek, Industrial, Ammo, Cirk, Yrys (ChatLink), Leuchtturm, AnduinLothar, Satrina, 昏睡墨鱼&月色狼影
+
+## X-RelSite-WoWI: 10783
+## X-RelSite-Curse:
+
+## X-License: GPLv3
+
+## RequiredDeps: Ace3
+## OptionalDeps: LibSink-2.0, LibBabble-Class-3.0, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibDataBroker-1.1
+## X-Embeds: LibSink-2.0, LibBabble-Class-3.0, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibDataBroker-1.1
+
+
+## SavedVariables: Prat3DB, Prat3FuDB
+## SavedVariablesPerCharacter: Prat3PerCharDB
+
+libraries\includes.xml
+
+addon\includes.xml
+
+services\includes.xml
+
+modules\includes.xml
+
+
+
diff --git a/addon/addon.lua b/addon/addon.lua
new file mode 100644
index 00000000..8daed465
--- /dev/null
+++ b/addon/addon.lua
@@ -0,0 +1,536 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat modification
+-- and a collection of modules which utilize the framework
+--
+-- Copyright (C) 2006-2008 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: Prat 3.0 (addon.lua)
+Revision: $Revision: 82149 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+ Fin (fin@instinct.org)
+ Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+ and others (see invidual modules)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: The main addon source module
+]]
+
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+
+
+local _G = _G
+local LibStub = LibStub
+local tonumber = tonumber
+local tostring = tostring
+local pairs = pairs
+local ipairs = ipairs
+local type = type
+local select = select
+local Prat = Prat
+local setmetatable = setmetatable
+local strfind = strfind
+local IsSecureCmd = IsSecureCmd
+
+-- Isolate the environment
+setfenv(1, Prat)
+
+--[[ END STANDARD HEADER ]]--
+
+-- Thanks CKKnight!
+WOTLK = select(4, _G.GetBuildInfo()) >= 30000
+
+
+-- Debug
+--PrintMainChunkUse=true
+
+--ChunkSizes = {}
+
+_G.DisableAddOn("Prat")
+
+Prat.Prat3 = true
+
+local function debug(...) end
+
+Localizations = GetLocalizer({})
+local L = Localizations
+
+Frames = {
+ ["ChatFrame1"]=_G.ChatFrame1, ["ChatFrame2"]=_G.ChatFrame2, ["ChatFrame3"]=_G.ChatFrame3,
+ ["ChatFrame4"]=_G.ChatFrame4, ["ChatFrame5"]=_G.ChatFrame5, ["ChatFrame6"]=_G.ChatFrame6, ["ChatFrame7"]=_G.ChatFrame7
+}
+HookedFrames = {
+ ["ChatFrame1"]=_G.ChatFrame1, ["ChatFrame3"]=_G.ChatFrame3,
+ ["ChatFrame4"]=_G.ChatFrame4, ["ChatFrame5"]=_G.ChatFrame5, ["ChatFrame6"]=_G.ChatFrame6, ["ChatFrame7"]=_G.ChatFrame7
+}
+
+ExternalFrames = {
+}
+
+
+local builtinSounds = {
+ ["Bell"] = "Interface\\AddOns\\Prat-3.0\\sounds\\Bell.mp3",
+ ["Chime"] = "Interface\\AddOns\\Prat-3.0\\Sounds\\Chime.mp3",
+ ["Heart"] = "Interface\\AddOns\\Prat-3.0\\Sounds\\Heart.wav",
+ ["IM"] = "Interface\\AddOns\\Prat-3.0\\Sounds\\IM.mp3",
+ ["Info"] = "Interface\\AddOns\\Prat-3.0\\Sounds\\Info.mp3",
+ ["Kachink"] = "Interface\\AddOns\\Prat-3.0\\Sounds\\Kachink.wav",
+ ["popup"] = "Interface\\AddOns\\Prat-3.0\\Sounds\\Link.wav",
+ ["Text1"] = "Interface\\AddOns\\Prat-3.0\\Sounds\\Text1.wav",
+ ["Text2"] = "Interface\\AddOns\\Prat-3.0\\Sounds\\Text2.wav",
+ ["Xylo"] = "Interface\\AddOns\\Prat-3.0\\Sounds\\Xylo.mp3",
+}
+
+
+-- Symbolic names for all the events which Prat uses
+Events = {
+ MODULE_ENABLED = "Prat_ModuleCreated",
+ DISABLED = "Prat_Disabled",
+ ENABLING = "Prat_Starting",
+ ENABLED = "Prat_Ready",
+ STARTUP = "Prat_Initialized",
+ DEBUG_UPDATE = "Prat_DebugModeChanged",
+ PRE_OUTBOUND = "Prat_PreOutboundChat",
+ OUTBOUND = "Prat_OutboundChat",
+ PRE_ADDMESSAGE = "Prat_PreAddMessage",
+ POST_ADDMESSAGE = "Prat_PostAddMessage",
+ FRAME_MESSAGE = "Prat_FrameMessage",
+ SECTIONS_UPDATED = "Prat_ChatSectionsUpdated",
+}
+
+EnableTasks = {}
+
+local addon = LibStub("AceAddon-3.0"):NewAddon("Prat", "AceConsole-3.0", "AceTimer-3.0", "AceHook-3.0")
+Addon = addon
+
+local callbacks
+
+--[[ 1 = no load, 2 = disabled, 3 = enabled (this is temporary, a better format will be forthcoming]]
+-- What I need to do is return the module's own value if the option isn't 1
+local defaults = {
+ profile = {
+ modules = {
+ ["*"] = 3
+ }
+ }
+}
+local dbg,SOUND
+function addon:OnInitialize()
+
+-- Print("Pre-Init Memory Use: "..MemoryUse())
+
+ if _G.IsAddOnLoaded("Prat") == 1 then
+ Print(("Prat 2.0 was detected, and disabled. Please %s your UI."):format(GetReloadUILink()))
+ end
+
+ Prat.db = LibStub("AceDB-3.0"):New("Prat3DB", defaults, "Default")
+
+ callbacks = LibStub("CallbackHandler-1.0"):New(Prat, "RegisterChatEvent", "UnregisterChatEvent", "UnregisterAllChatEvents")
+
+ Options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(Prat.db)
+ Options.args.profiles.order = tonumber(-1)
+
+ Media = LibStub("LibSharedMedia-3.0")
+ SOUND = Media.MediaType.SOUND
+
+ for k,v in pairs(builtinSounds) do
+ Media:Register(SOUND, k, v)
+ end
+
+ AddonName = self.baseName
+
+ builtinSounds = nil
+
+ Prat.db.RegisterCallback(self, "OnProfileChanged", "UpdateProfile")
+ Prat.db.RegisterCallback(self, "OnProfileCopied", "UpdateProfile")
+ Prat.db.RegisterCallback(self, "OnProfileReset", "UpdateProfile")
+
+-- _G.collectgarbage('collect')
+-- Print("Pre-Module-Load Memory Use: "..MemoryUse())
+
+ LoadModules()
+
+-- _G.collectgarbage('collect')
+-- Print("Post-Module-Load Memory Use: "..MemoryUse())
+
+ self.OnInitalize = nil
+end
+
+function addon:OnEnable()
+ for i,v in ipairs(EnableTasks) do
+ v(self)
+ end
+ EnableTasks = nil
+
+ RegisterLinkType( { linkid="rldui", linkfunc=function(...) _G.ReloadUI() return false end }, "Prat")
+
+ self:ScheduleTimer("PostEnable", 0)
+
+-- Print("OnEnable Memory Use: "..MemoryUse())
+end
+
+
+function addon:UpdateProfile()
+ self:ScheduleTimer("UpdateProfileDelayed", 0)
+end
+
+function addon:UpdateProfileDelayed()
+ for k, v in self:IterateModules() do
+ if v:IsEnabled() then
+ v:Disable()
+ v:Enable()
+ end
+ end
+end
+
+function GetReloadUILink(Requestor)
+ return BuildLink("rldui", Requestor or "Prat", "Reload", "ffa0a0")
+end
+
+local module = {}
+
+function addon:PostEnable()
+ local revision = tonumber(("$Revision: 82149 $"):sub(12, -3))
+ local VERSION_STRING = "Prat |cff8080ff3.0|r |cffff8080Alpha Version|r (|cff8080ff"..revision.."|r)"
+
+ Print(VERSION_STRING)
+
+ -- 2.4 Changes
+-- self:RegisterEvent("CVAR_UPDATE")
+
+ -- Inbound Hooking
+ self:RawHook("ChatFrame_MessageEventHandler", true)
+
+ -- Outbound hooking
+ self:SecureHook("ChatEdit_ParseText")
+
+ -- Display Hooking
+ for _,v in pairs(HookedFrames) do
+ self:RawHook(v, "AddMessage", true)
+ end
+
+ -- ItemRef Hooking
+ self:RawHook("SetItemRef", true)
+
+-- -- This event fires after Prat's hooks are installed
+-- -- Prat's core wont operate until after this event
+ callbacks:Fire(Events.SECTIONS_UPDATED)
+ callbacks:Fire(Events.ENABLED)
+
+-- if ChunkSizes then
+-- local last = 0
+-- for i, v in ipairs(ChunkSizes) do
+-- self:Print("Chunk #"..tostring(i)..":"..("|cff80ffff%.0f|r KB"):format(v-last))
+-- last = v
+-- end
+-- self:Print("Total Size: "..("|cff80ffff%.0f|r KB"):format(ChunkSizes[#ChunkSizes]))
+-- ChunkSizes = nil
+-- end
+
+ if Modules then
+ local total, loaded, enabled = 0,0,0
+ for k, v in pairs(Modules) do
+ total = total + 1
+ if v ~= "EXISTS" then
+ loaded = loaded + 1
+ end
+ if v == "ENABLED" then
+ enabled = enabled + 1
+ end
+ end
+
+ self:Print(("Module Count: |cff80ffff%d|r total |cff80ffff%d|r loaded, |cff80ffff%d|r enabled"):format(total, loaded, enabled))
+ end
+
+ if MemoryUse then
+ self:Print("Memory Use: "..MemoryUse())
+ end
+end
+
+function addon:SetItemRef(...)
+ return SetItemRefHook(self.hooks.SetItemRef, ...)
+end
+
+
+function addon:ChatEdit_ParseText(editBox, send)
+ local command = editBox:GetText()
+
+-- this is what blizzard does
+ local cmd = command:match("^(#%s*[Ss][Hh][Oo][Ww]:*)%s[^%s]") or
+ command:match("^(#%s*[Ss][Hh][Oo][Ww][Tt][Oo][Oo][Ll][Tt][Ii][Pp]:*)%s[^%s]") or
+ command:match("^(/[^%s]+)");
+
+-- Hack from blizzard's code
+ if ( cmd and strfind(cmd, "^#") ) then
+ -- This is a hack, but the "USE" code below handles bags and slots
+ cmd = SLASH_USE1;
+ end
+
+ if cmd and IsSecureCmd(cmd) then
+ -- DBG_PATTERN("The command is secure.", cmd)
+ return
+ end
+
+ local m = Prat.SplitMessageOut
+ CurrentMsg = m
+
+
+ m.MESSAGE = command
+
+ m.CTYPE = editBox:GetAttribute("chatType")
+ m.TARGET = editBox:GetAttribute("tellTarget")
+ m.CHANNEL = editBox:GetAttribute("channelTarget")
+ m.LANGUAGE = editBox.language
+ m.SEND = send
+
+ if send ~= 1 then
+ return
+ end
+
+-- DUMP_SPLIT("Pre_Process", m)
+ self:ProcessUserEnteredChat(m)
+
+ --PrintLiteral(m)
+-- DUMP_SPLIT("Post_Process", m)
+
+ editBox:SetAttribute("chatType", m.CTYPE)
+ editBox:SetAttribute("tellTarget", m.TARGET)
+ editBox:SetAttribute("channelTarget", m.CHANNEL)
+
+
+ editBox:SetText(m.MESSAGE)
+
+ CurrentMsg = nil
+end
+
+
+function addon:ProcessUserEnteredChat(m)
+ if (m.MESSAGE:len() <= 0) then
+ return
+ end
+
+ callbacks:Fire(Events.PRE_OUTBOUND, m)
+
+ -- Remove all the pattern matches ahead of time
+ m.MESSAGE = MatchPatterns(m.MESSAGE, "OUTBOUND")
+
+ callbacks:Fire(Events.OUTBOUND, m)
+
+ -- Pattern Matches Put Back IN
+ m.MESSAGE = ReplaceMatches(m.MESSAGE, "OUTBOUND")
+end
+
+
+function addon:ChatFrame_MessageEventHandler(this, event, ...)
+--function addon:ChatFrame_MessageEventHandler(event, ...)
+ local PRE_ADDMESSAGE = "Prat_PreAddMessage"
+ local POST_ADDMESSAGE = "Prat_PostAddMessage"
+ local FRAME_MESSAGE = "Prat_FrameMessage"
+
+ local event = WOTLK and event or _G.event
+ local this = WOTLK and this or
+ _G.this
+ local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12 = WOTLK and ... or
+ _G.arg1, _G.arg2, _G.arg3, _G.arg4, _G.arg5, _G.arg6, _G.arg7, _G.arg8, _G.arg9, _G.arg10, _G.arg11, _G.arg12
+
+ if not HookedFrames[this:GetName()] then
+ return
+ end
+
+ local message, info
+ local process = EventIsProcessed(event)
+
+ local CMEResult
+
+ if type(arg1) == "string" and (arg1):find("\r") then -- Stupid exploit. Protect our users.
+ arg1 = arg1:gsub("\r", " ")
+ end
+
+ -- Create a message table. This table contains the chat message in a non-concatenated form
+ -- so that it can be modified easily without lots of complex gsub's
+ message, info = SplitChatMessage(this, event, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12)
+
+ -- Handle Default-UI filtering: Since the default UI now provides filtering functions
+ -- similar to the way Prat's pattern registry works, we need to be sure not to call the
+ -- filtering functions twice by calling back into the hook chain - otherwise you could
+ -- have side effects of the handler functions being called more than once for a given event.
+ -- I don't see any way around this.
+ if type(message) == "boolean" and message == true then
+ return true
+ end
+
+ if not info then
+ if WOTLK then
+ return self.hooks["ChatFrame_MessageEventHandler"](this, event, ...)
+ else
+ return self.hooks["ChatFrame_MessageEventHandler"](event, ...)
+ end
+ else
+ local m = SplitMessage
+ CurrentMsg = m
+
+ -- Prat_FrameMessage is fired for every message going to the
+ -- chatframe which is displayable (has a chat infotype)
+ -- It may not be displayed, in which case no Pre/Post Addmessage
+ -- events will fire
+ -- Any addons which hook things will operate following this event
+ -- but before Prat_PreAddMessage, OUTPUT will contain the chat line
+ -- it may be modified by other addons.
+ --
+ -- Right now, prat will discard the chat line for chat types that
+ -- it is handling
+ --
+ m.OUTPUT = nil
+
+ m.DONOTPROCESS = nil
+
+-- DUMP_OUTPUT_EX(this, "Prat_FrameMessage", nil, nil, m.CAPTUREOUTPUT, m.OUTPUT)
+
+ callbacks:Fire(FRAME_MESSAGE, message, this, event)
+
+ -- A return value of true means that the message was processed
+ -- normally this would result in the OnEvent returning
+ -- for that chatframe
+ m.CAPTUREOUTPUT = this
+ if WOTLK then
+ CMEResult = self.hooks["ChatFrame_MessageEventHandler"](this, event, ...)
+ else
+ CMEResult = self.hooks["ChatFrame_MessageEventHandler"](event, ...)
+ end
+
+ m.CAPTUREOUTPUT = false
+
+-- DBG_OUTPUT("CMEResult", CMEResult)
+ if type(m.OUTPUT) == "string" and not m.DONOTPROCESS then
+ local r,g,b,id = self.INFO.r, self.INFO.g, self.INFO.b, self.INFO.id
+
+ -- Remove all the pattern matches ahead of time
+ m.MESSAGE = MatchPatterns(m.MESSAGE)
+
+-- --[[DUMP_OUTPUT]]debug("Prat_PreAddMessage", m)
+ callbacks:Fire(PRE_ADDMESSAGE, message, this, event, BuildChatText(message), r,g,b,id )
+
+-- if self:IsDebugging() then
+-- DUMP_PATTERN(self.MatchTable)
+--
+-- for k,v in pairs(m) do
+-- if v == "" then m[k] = nil end
+-- end
+--
+-- DUMP_RESULT_EX(this, "SplitMessage", self.SplitMessageIdx, m)
+--
+-- self:ValidateMessageTable(m)
+-- end
+
+
+ -- Pattern Matches Put Back IN
+ m.MESSAGE = ReplaceMatches(m.MESSAGE)
+
+ if process then
+ -- We are about to send the message
+ m.OUTPUT = BuildChatText(message) -- Combine all the chat sections
+
+ -- If process is set we have a split table
+ -- If not then we have 1 string for the whole chatline
+-- DUMP_OUTPUT("AddMessage - build", m)
+ else
+ if type(m.OUTPUT) == "string" then
+ -- Now we have the chatstring that the client was planning to output
+ -- For now just do it. (Tack on POST too)
+ m.OUTPUT = (m.PRE or "")..m.OUTPUT..(m.POST or "")
+
+ -- DUMP_OUTPUT("AddMessage - pass", m)
+ end
+ end
+
+ -- Allow for message blocking during the patern match phase
+ if not m.DONOTPROCESS then
+ this:AddMessage(m.OUTPUT, r,g,b,id);
+ end
+
+ -- We have called addmessage by now, or we have skipped it
+ -- regardless, we call postaddmessage. This was changed to allow
+ -- for more flexibility in the customfilters module, speficially
+ -- it allows for replacements to occur in blocked messages
+ -- DUMP_OUTPUT("Prat_PostAddMessage", m)
+
+ callbacks:Fire(POST_ADDMESSAGE, m, this, event, m.OUTPUT, r,g,b,id)
+
+ end
+
+ m.CAPTUREOUTPUT = nil
+ m.OUTPUT = nil
+ m.INFO = nil
+
+ CurrentMessage = nil
+ end
+
+ return CMEResult
+end
+
+
+addon.INFO = {r = 1.0, g = 1.0, b = 1.0, id = 0 }
+
+function addon:AddMessage(frame, text, r, g, b, id, ...)
+ local s = SplitMessage
+ if s.OUTPUT == nil and s.CAPTUREOUTPUT == frame --[[ and Prat.dumping == false]] then
+ self.INFO.r, self.INFO.g, self.INFO.b, self.INFO.id = r, g, b, id
+ s.OUTPUT = text
+ s.INFO = self.INFO
+ else
+ self.hooks[frame].AddMessage(frame, text, r, g, b, id, ...)
+ end
+end
+
+local wowsounds = {
+ ["TellMessage"] = "TellMessage",
+}
+
+function PlaySound(self, sound)
+ if not sound then return end
+
+ if wowsounds[sound] then
+ _G.PlaySound(wowsounds[sound])
+ else
+ local play
+ if play == nil then
+ play = Media:Fetch(SOUND, sound)
+ end
+ if play == nil then return end
+
+ _G.PlaySoundFile(play)
+ end
+end
+
+
+
+function RegisterChatCommand(cmd, func)
+ addon:RegisterChatCommand(cmd, func)
+end
\ No newline at end of file
diff --git a/addon/includes.xml b/addon/includes.xml
new file mode 100644
index 00000000..28e64588
--- /dev/null
+++ b/addon/includes.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
diff --git a/addon/locales.lua b/addon/locales.lua
new file mode 100644
index 00000000..7c55861a
--- /dev/null
+++ b/addon/locales.lua
@@ -0,0 +1,59 @@
+--[[
+Name: Prat 3.0 (locales.lua)
+Revision: $Revision: 79217 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Implements the chat string sectioning service
+]]
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local setmetatable = setmetatable
+local tostring = tostring
+local type = type
+local pairs = pairs
+local GetLocale = GetLocale
+local SVC_NAMESPACE = SVC_NAMESPACE
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+--==============
+-- Locale
+--==============
+
+function AddLocale(L, name, loc)
+ if GetLocale() == name then
+ for k, v in pairs(loc) do
+ if v == true then
+ L[k] = k
+ else
+ L[k] = v
+ end
+ end
+ end
+end
+
+local loc_mt = {
+ __index = function(t, k)
+ _G.error("Locale key " .. tostring(k) .. " is not provided.")
+ end
+ }
+
+function GetLocalizer(self, locs)
+ if self ~= SVC_NAMESPACE then
+ locs = self
+ end
+
+ locs.AddLocale = AddLocale
+ return setmetatable(locs, loc_mt)
+end
+
diff --git a/addon/modules.lua b/addon/modules.lua
new file mode 100644
index 00000000..401fe2df
--- /dev/null
+++ b/addon/modules.lua
@@ -0,0 +1,341 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2008 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: Prat 3.0 (modules.lua)
+Revision: $Revision: 82088 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: The implementation of the module framework
+]]
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local LibStub = LibStub
+local tonumber = tonumber
+local tostring = tostring
+local pairs, ipairs = pairs, ipairs
+local type = type
+local Prat = Prat
+local pcall = pcall
+local setmetatable = setmetatable
+local tinsert = tinsert
+-- Isolate the environment
+setfenv(1, Prat)
+
+--[[ END STANDARD HEADER ]]--
+
+Addon.defaultModuleState = true
+
+--[[
+
+Module system flow:
+
+1) Module code loaded by the client
+2) Module first asks if it should be INSTALLED
+3) If no, the module code returns before creating the module
+4) If yes, the module is given the name it should register with
+5) The module code creates a new module calling NewModule
+6) Once the module has been created, we recieve OnModuleCreated, we want to
+ remember that this module is installed, so we save that info
+7) The module will have its on initalize called after Prat's.
+8) If the module is disabled it will stop at this point
+9) If the module is enabled, it will call its OnEnable
+
+That give us the states: EXISTS, INSTALLED, INITIALIZED, ENABLED,
+ DISABLED
+
+
+]]
+
+local function NOP() end
+
+do
+ Modules = {}
+ function RequestModuleName(self, name) -- <== EXISTS
+ if type(name) ~= "string" then
+ name = tostring(self)
+ end
+
+ CreateModuleControlOption(name)
+
+ -- Duh, this still requires separate loader due to the saved variable
+ if Prat.db and Prat.db.profile.modules[name] == 1 then
+ Modules[name] = "EXISTS"
+ end
+
+ if not Modules[name] then
+ Modules[name] = "EXISTS"
+ return name
+ end
+ end
+end
+
+do
+ local module_defaults = {}
+ function SetModuleDefaults(self, module, defaults)
+ module_defaults[type(module) == "table" and module.name or module] = defaults
+ end
+
+ local module_init = {}
+ function SetModuleInit(self, module, init)
+ module_init[type(module) == "table" and module.name or module or "null"] = init
+ end
+ local function GetModuleInit(module)
+ return module_init[type(module) == "table" and module.name or module or "null"]
+ end
+
+ local sectionlist = {
+ --display
+ ["ChannelColorMemory"] = "display",
+ ["ChannelSticky"] = "display",
+ ["ChatFrames"] = "display",
+ ["Fading"] = "display",
+ ["History"] = "display",
+ ["Frames"] = "display",
+ ["Editbox"] = "display",
+ ["Paragraph"] = "display",
+ ["Scroll"] = "display",
+ ["Clear"] = "display",
+ ["Font"] = "display",
+ ["Tabs"] = "display",
+ --formatting
+ ["ChannelNames"] = "formatting",
+ ["PlayerNames"] = "formatting",
+ ["ServerNames"] = "formatting",
+ ["Substitutions"] = "formatting",
+ ["Timestamps"] = "formatting",
+ ["UrlCopy"] = "formatting",
+ --extras
+ ["AddonMsgs"] = "extras",
+ ["EventNames"] = "extras",
+ ["PopupMessage"] = "extras",
+ ["Sounds"] = "extras",
+ }
+ setmetatable(sectionlist, {__index = function(t,k,v)
+ return "extras"
+ end})
+
+ local function onInit(self) -- ==> INSTALLED -> INITIALIZED
+ local defaults, opts, init
+ defaults, module_defaults[self.name] = module_defaults[self.name] or {}
+ self.db = Prat.db:RegisterNamespace(self.name, defaults)
+
+ init = GetModuleInit(self)
+ if init then
+ init(self)
+ SetModuleInit(self, self, nil)
+ end
+ opts = GetModuleOptions(self.name)
+ if opts then
+ opts.handler = self
+ opts.disabled = "IsDisabled"
+ Options.args[sectionlist[opts.name]].args[opts.name], opts = opts
+ SetModuleOptions(self, self.name, nil)
+ end
+
+ self:SetEnabledState(self.db.profile.on)
+
+ Modules[self.name] = "INITALIZED"
+ end
+
+
+ local function onEnable(self) -- ==> INITIALIZED/DISABLED -> ENABLED
+ local pats = GetModulePatterns(self)
+ if pats then
+ for _,v in ipairs(pats) do
+ RegisterPattern(v, self.name)
+ end
+ end
+
+ self:OnModuleEnable()
+ Modules[self.name] = "ENABLED"
+ end
+ local function onDisable(self) -- ==>INITIALIZED/ENABLED -> DISABLED
+ UnregisterAllPatterns(self.name)
+ self:OnModuleDisable()
+ Modules[self.name] = "DISABLED"
+ end
+
+
+ local function setValue(self, info, b)
+ self.db.profile[info[#info]] = b
+ self:OnValueChanged(info, b)
+ end
+ local function getValue(self, info)
+ return self.db.profile[info[#info]]
+ end
+
+ local function getSubValue(self, info, val)
+ return self.db.profile[info[#info]][val]
+ end
+ local function setSubValue(self, info, val, b)
+ self.db.profile[info[#info]][val] = b
+ self:OnSubValueChanged(info, val, b)
+ end
+
+ local defclr = { r=1, b=1, g=1, a=1 }
+ local function getColorValue(self, info)
+ local c = self.db.profile[info[#info]] or defclr
+ return c.r, c.g, c.b, c.a
+ end
+ local function setColorValue(self, info, r,g,b,a)
+ local c = self.db.profile[info[#info]] or defclr
+ c.r, c.g, c.b, c.a = r,g,b,a
+ self:OnColorValueChanged(info, r,g,b,a)
+ end
+
+ local function isDisabled(self)
+ return not self:IsEnabled()
+ end
+
+ local prototype = {
+ OnEnable = onEnable,
+ OnDisable = onDisable,
+ OnInitialize = onInit,
+ OnModuleEnable = NOP,
+ OnModuleDisable = NOP,
+ OnModuleInit = NOP,
+ OnValueChanged = NOP,
+ OnSubValueChanged = NOP,
+ OnColorValueChanged = NOP,
+ GetValue = getValue,
+ SetValue = setValue,
+ GetSubValue = getSubValue,
+ SetSubValue = setSubValue,
+ GetColorValue = getColorValue,
+ SetColorValue = setColorValue,
+ IsDisabled = isDisabled,
+
+ -- Standard fields
+ L = {},
+ section = "extras",
+ }
+
+ function NewModule(self, name, ...) -- <== INSTALLED (Ace3 does the <== INITIALIZED)
+ return Addon:NewModule(name, prototype, ...)
+ end
+
+-- local locs, section
+-- function NewModuleEx(self, name, locs, section, ...) -- <== INSTALLED (Ace3 does the <== INITIALIZED)
+-- return Addon:NewModule(name, prototype, ...)
+-- end
+
+ function Addon:OnModuleCreated(module) -- EXISTS -> INSTALLED
+ _G[module.moduleName:lower()] = module -- Remove before release
+-- module.L, module.section, locs, section = locs, section
+ Modules[module.name], Modules[module.moduleName] = "INSTALLED"
+ end
+end
+
+
+--[[
+
+For module options, i want to use the single closure style executed from the main chunk of the module,
+such as:
+
+SetModuleOptionTable(name, function() return { ... } )
+
+This way the options can be GC'd by from the modules, before the decision is made as
+to whether we will actually load the module. they will go into a table here, and either
+free'd, given back to the module for it to execute, or possible executed on this end.
+
+In any case there will only be 1 copy of the closure, and if executed it will create its data
+and then it can be freed leaving no code behind. Prat 2.0 used alot of memory solely because of
+its options tables, this tries to avoid that.
+
+]]
+
+do
+ local module_options = {}
+ function SetModuleOptions(self, module, options)
+ module_options[type(module) == "table" and module.name or module or "null"] = options
+ end
+
+ function GetModuleOptions(module)
+ return module_options[type(module) == "table" and module.name or module or "null"]
+ end
+end
+
+do
+ local module_patterns = {}
+ function SetModulePatterns(self, module, patterns)
+ module_patterns[type(module) == "table" and module.name or module or "null"] = patterns
+ end
+
+ function GetModulePatterns(module)
+ return module_patterns[type(module) == "table" and module.name or module or "null"]
+ end
+end
+
+do
+ local modules_toload = {}
+ local extensions_toload = {}
+ function AddModuleToLoad(self, module_closure)
+ tinsert(modules_toload, module_closure)
+ end
+
+ function AddModuleExtension(self, extension_closure)
+ tinsert(extensions_toload, extension_closure)
+ end
+
+ local function loadNow(self, mod)
+ local success, ret = pcall(mod)
+ if not success then
+ _G.geterrorhandler()(ret)
+ end
+ end
+
+ function LoadModules()
+ for i=1,#modules_toload,1 do
+ local success, ret = pcall(modules_toload[i])
+ if not success then
+ _G.geterrorhandler()(ret)
+ end
+ modules_toload[i] = nil
+ end
+ modules_toload = nil
+
+ for i=1,#extensions_toload,1 do
+ local success, ret = pcall(extensions_toload[i])
+ if not success then
+ _G.geterrorhandler()(ret)
+ end
+ extensions_toload[i] = nil
+ end
+ extensions_toload = nil
+
+ LoadModules = nil
+ AddModuleToLoad = loadNow
+ AddModuleExtension = loadNow
+ end
+end
+
diff --git a/addon/namespace.lua b/addon/namespace.lua
new file mode 100644
index 00000000..b9663185
--- /dev/null
+++ b/addon/namespace.lua
@@ -0,0 +1,15 @@
+--[[
+Name: Prat 3.0 (namespace.lua)
+Revision: $Revision: 79586 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Defines the addon namespace(s)
+]]
+
+Prat = {}
+
+SVC_NAMESPACE = Prat
\ No newline at end of file
diff --git a/addon/options.lua b/addon/options.lua
new file mode 100644
index 00000000..74defbbe
--- /dev/null
+++ b/addon/options.lua
@@ -0,0 +1,236 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2008 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: Prat 3.0 (options.lua)
+Revision: $Revision: 80963 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: The implementation of addon-wide options
+]]
+
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local LibStub = LibStub
+local tonumber = tonumber
+local tostring = tostring
+local pairs = pairs
+local type = type
+local Prat = Prat
+local setmetatable = setmetatable
+local tinsert = tinsert
+
+-- Isolate the environment
+setfenv(1, Prat)
+
+--[[ END STANDARD HEADER ]]--
+
+--local L = Prat.Localizations
+--
+--L:AddLocale("enUS", {
+-- ["ChatFrame %d"] = true
+--})
+
+local AceConfig = LibStub("AceConfig-3.0")
+--local AceConfigDialog = LibStub("AceConfigDialog-3.0")
+--local AceConfigCmd = LibStub("AceConfigCmd-3.0")
+
+local moduleControlArgs = {}
+
+Options = {
+ type = "group",
+ childGroups = "tab",
+ get = "GetValue",
+ set = "SetValue",
+ args = {
+ display = {
+ type = "group",name = "Display Settings",
+ desc = "Chat Frame Control and Look",
+ hidden = function(info) end,
+ get = "GetValue",
+ set = "SetValue",
+ args = {},
+ order = 1,
+ },
+ formatting = {
+ type = "group",name = "Chat Formatting",
+ desc = "Change the way the lines look and feel",
+ hidden = function(info) end,
+ get = "GetValue",
+ set = "SetValue",
+ args = {},
+ order = 2,
+ },
+ extras = {
+ type = "group",name = "Extra Stuff",
+ desc = "Msc. Modules",
+ hidden = function(info) end,
+ get = "GetValue",
+ set = "SetValue",
+ args = {},
+ order = 3,
+ },
+ modulecontrol = {
+ type = "group",
+ name = "Module Control",
+ desc = "Control the loading and enabling of Prat's modules.",
+ get = "GetValue",
+ set = "SetValue",
+ args = moduleControlArgs,
+ order = 4,
+ }
+ }
+}
+
+--[[ WitchHunt: [Ammo] ]]--
+tinsert(EnableTasks, function(self)
+
+ local acreg = LibStub("AceConfigRegistry-3.0")
+ acreg:RegisterOptionsTable("Prat", Options)
+ acreg:RegisterOptionsTable("Prat: "..Options.args.display.name, Options.args.display)
+ acreg:RegisterOptionsTable("Prat: "..Options.args.formatting.name, Options.args.formatting)
+ acreg:RegisterOptionsTable("Prat: "..Options.args.extras.name, Options.args.extras)
+ acreg:RegisterOptionsTable("Prat: "..Options.args.modulecontrol.name, Options.args.modulecontrol)
+ acreg:RegisterOptionsTable("Prat: "..Options.args.profiles.name, Options.args.profiles)
+
+ local acdia = LibStub("AceConfigDialog-3.0")
+ acdia:AddToBlizOptions("Prat", "Prat")
+ acdia:AddToBlizOptions("Prat: "..Options.args.display.name, Options.args.display.name, "Prat")
+ acdia:AddToBlizOptions("Prat: "..Options.args.formatting.name, Options.args.formatting.name, "Prat")
+ acdia:AddToBlizOptions("Prat: "..Options.args.extras.name, Options.args.extras.name, "Prat")
+ acdia:AddToBlizOptions("Prat: "..Options.args.modulecontrol.name, Options.args.modulecontrol.name, "Prat")
+ acdia:AddToBlizOptions("Prat: "..Options.args.profiles.name, Options.args.profiles.name, "Prat")
+
+ self:RegisterChatCommand("prat", function() acdia:Open("Prat") end)
+end)
+
+
+do
+ local function getModuleFromShortName(shortname)
+ for k, v in Addon:IterateModules() do
+ if v.moduleName == shortname then
+ return v
+ end
+ end
+ end
+
+ local lastReloadMessage = 0
+ local function PrintReloadMessage()
+ local tm = _G.GetTime()
+ if tm - lastReloadMessage > 60 then
+ Prat.Print(("This option change may not take full effect until you %s your UI."):format(GetReloadUILink()))
+ lastReloadMessage = tm
+ end
+ end
+
+ local function setValue(info, b)
+ local old = Prat.db.profile.modules[info[#info]]
+ Prat.db.profile.modules[info[#info]] = b
+
+ if old == 1 or b ==1 then
+ PrintReloadMessage()
+ end
+
+ local m = getModuleFromShortName(info[#info])
+ if not m then return end
+
+ if b == 2 then
+ m.db.profile.on = false
+ m:Disable()
+ elseif b == 3 then
+ m.db.profile.on = true
+ m:Enable()
+ end
+ end
+
+ local function getValue(info)
+ local v,m
+ v = Prat.db.profile.modules[info[#info]]
+
+ if v ~= 1 then
+ m = getModuleFromShortName(info[#info])
+ if m then
+ v = m.db.profile.on and 3 or 2
+ end
+ end
+
+ return v
+ end
+
+
+ do
+ local moduleControlOption = {
+ name = function(info) return info[#info] end,
+ desc = "Control the load behavior for this module.",
+ type = "select",
+ style = "radio",
+ values = { "|cffA0A0A0Don't Load|r", "|cffff8080Disabled|r", "|cff80ff80Enabled|r" },
+ get = getValue,
+ set = setValue
+ }
+
+ function CreateModuleControlOption(name)
+ moduleControlArgs[name] = moduleControlOption
+ end
+ end
+end
+
+FrameList = {}
+HookedFrameList = {}
+
+
+tinsert(EnableTasks, function(self)
+ self:SecureHook("FCF_SetWindowName",
+ function()
+ for k,v in pairs(HookedFrames) do
+ if (v.isDocked == 1) or v:IsShown() then
+ HookedFrameList[k] = (v.name)
+ else
+ HookedFrameList[k] = nil
+ end
+ end
+ for k,v in pairs(Frames) do
+ if (v.isDocked == 1) or v:IsShown() then
+ FrameList[k] = (v.name)
+ else
+ FrameList[k] = nil
+ end
+ end
+ LibStub("AceConfigRegistry-3.0"):NotifyChange("Prat")
+ end)
+ local name = _G.GetChatWindowInfo(1)
+ _G.FCF_SetWindowName(_G.ChatFrame1, name, 1)
+end)
+
+
+
+
diff --git a/debug/chunkprofiler.lua b/debug/chunkprofiler.lua
new file mode 100644
index 00000000..827b0bc8
--- /dev/null
+++ b/debug/chunkprofiler.lua
@@ -0,0 +1,25 @@
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local SVC_NAMESPACE = SVC_NAMESPACE
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+if ChunkSizes then
+CNTR = CNTR or 1
+ local function MemoryUse(name)
+ _G.UpdateAddOnMemoryUsage()
+ return _G.GetAddOnMemoryUsage(name)
+ end
+
+ local location = _G.debugstack():match("ns\\(.-)\\")
+
+ ChunkSizes[CNTR] = MemoryUse(location) or "?"
+CNTR = CNTR + 1
+end
+
diff --git a/debug/includes.xml b/debug/includes.xml
new file mode 100644
index 00000000..d6bd01b3
--- /dev/null
+++ b/debug/includes.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
diff --git a/debug/memory.lua b/debug/memory.lua
new file mode 100644
index 00000000..992452a3
--- /dev/null
+++ b/debug/memory.lua
@@ -0,0 +1,34 @@
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local SVC_NAMESPACE = SVC_NAMESPACE
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+
+function GetMemoryUse(name)
+ _G.UpdateAddOnMemoryUsage()
+ local mem = _G.GetAddOnMemoryUsage(name)
+ local text2
+ if mem > 1024 then
+ text2 = ("|cff80ffff%.2f|r MB"):format(mem / 1024)
+ else
+ text2 = ("|cff80ffff%.0f|r KB"):format(mem)
+ end
+
+ return text2
+end
+
+local location = _G.debugstack():match("ns\\(.-)\\")
+
+function MemoryUse()
+ return GetMemoryUse(location)
+end
+
+
+
diff --git a/debug/printliteral.lua b/debug/printliteral.lua
new file mode 100644
index 00000000..21e932ad
--- /dev/null
+++ b/debug/printliteral.lua
@@ -0,0 +1,50 @@
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local LibStub = LibStub
+local tostring = tostring
+local select = select
+local type = type
+
+local SVC_NAMESPACE = SVC_NAMESPACE
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+
+--[[ from AceConsole-3.0 ]]--
+function Print(...)
+ local text = ""
+ local first = 1
+
+ local frame = select(first, ...)
+ if frame == SVC_NAMESPACE then
+ first = first + 1
+ frame = select(first, ...)
+ end
+
+ if not ( type(frame) == "table" and frame.AddMessage ) then -- Is first argument something with an .AddMessage member?
+ frame=nil
+ else
+ first = first + 1
+ end
+
+ for i=first, select("#", ...) do
+ text = text .. tostring( select( i, ...) ) .." "
+ end
+ (frame or _G.DEFAULT_CHAT_FRAME):AddMessage( text )
+end
+
+
+-- TODO - this is debug really
+function PrintLiteral(...)
+ if SVC_NAMESPACE == ... then
+ LibStub("AceConsole-2.0"):PrintLiteral(select(2, ...))
+ else
+ LibStub("AceConsole-2.0"):PrintLiteral(...)
+ end
+end
\ No newline at end of file
diff --git a/frames/popup.xml b/frames/popup.xml
new file mode 100644
index 00000000..b91c854d
--- /dev/null
+++ b/frames/popup.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frames/pratcc.xml b/frames/pratcc.xml
new file mode 100644
index 00000000..c029ff06
--- /dev/null
+++ b/frames/pratcc.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if (button == "LeftButton") then
+ self:StartMoving()
+ end
+
+
+ self:StopMovingOrSizing()
+
+
+
+
diff --git a/icon.tga b/icon.tga
new file mode 100644
index 00000000..8c0c0ebd
Binary files /dev/null and b/icon.tga differ
diff --git a/libraries/LibDataBroker-1.1/LibDataBroker-1.1.lua b/libraries/LibDataBroker-1.1/LibDataBroker-1.1.lua
new file mode 100644
index 00000000..364602ea
--- /dev/null
+++ b/libraries/LibDataBroker-1.1/LibDataBroker-1.1.lua
@@ -0,0 +1,66 @@
+
+assert(LibStub, "LibDataBroker-1.1 requires LibStub")
+assert(LibStub:GetLibrary("CallbackHandler-1.0", true), "LibDataBroker-1.1 requires CallbackHandler-1.0")
+
+local lib, oldminor = LibStub:NewLibrary("LibDataBroker-1.1", 3)
+if not lib then return end
+oldminor = oldminor or 0
+
+
+lib.callbacks = lib.callbacks or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib)
+lib.attributestorage, lib.namestorage, lib.proxystorage = lib.attributestorage or {}, lib.namestorage or {}, lib.proxystorage or {}
+local attributestorage, namestorage, callbacks = lib.attributestorage, lib.namestorage, lib.callbacks
+
+if oldminor < 2 then
+ lib.domt = {
+ __metatable = "access denied",
+ __index = function(self, key) return attributestorage[self] and attributestorage[self][key] end,
+ }
+end
+
+if oldminor < 3 then
+ lib.domt.__newindex = function(self, key, value)
+ if not attributestorage[self] then attributestorage[self] = {} end
+ if attributestorage[self][key] == value then return end
+ attributestorage[self][key] = value
+ local name = namestorage[self]
+ if not name then return end
+ callbacks:Fire("LibDataBroker_AttributeChanged", name, key, value, self)
+ callbacks:Fire("LibDataBroker_AttributeChanged_"..name, name, key, value, self)
+ callbacks:Fire("LibDataBroker_AttributeChanged_"..name.."_"..key, name, key, value, self)
+ callbacks:Fire("LibDataBroker_AttributeChanged__"..key, name, key, value, self)
+ end
+end
+
+if oldminor < 2 then
+ function lib:NewDataObject(name, dataobj)
+ if self.proxystorage[name] then return end
+
+ if dataobj then
+ assert(type(dataobj) == "table", "Invalid dataobj, must be nil or a table")
+ self.attributestorage[dataobj] = {}
+ for i,v in pairs(dataobj) do
+ self.attributestorage[dataobj][i] = v
+ dataobj[i] = nil
+ end
+ end
+ dataobj = setmetatable(dataobj or {}, self.domt)
+ self.proxystorage[name], self.namestorage[dataobj] = dataobj, name
+ self.callbacks:Fire("LibDataBroker_DataObjectCreated", name, dataobj)
+ return dataobj
+ end
+end
+
+if oldminor < 1 then
+ function lib:DataObjectIterator()
+ return pairs(self.proxystorage)
+ end
+
+ function lib:GetDataObjectByName(dataobjectname)
+ return self.proxystorage[dataobjectname]
+ end
+
+ function lib:GetNameByDataObject(dataobject)
+ return self.namestorage[dataobject]
+ end
+end
diff --git a/libraries/includes.xml b/libraries/includes.xml
new file mode 100644
index 00000000..189fb4b4
--- /dev/null
+++ b/libraries/includes.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/AddonMessages.lua b/modules/AddonMessages.lua
new file mode 100644
index 00000000..4393e335
--- /dev/null
+++ b/modules/AddonMessages.lua
@@ -0,0 +1,175 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: PratAddonMsgs
+Revision: $Revision: 80330 $
+Author(s): Sylvanaar (sylvanaar@mindspring.com)
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#AddonMsgs
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that toggles showing hidden addon messages on and off (default=off).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("AddonMsgs")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+-- define localized strings
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["AddonMsgs"] = true,
+ ["Addon message options."] = true,
+ ["show_name"] = "Show Addon Messages",
+ ["show_desc"] = "Toggle showing hidden addon messages in each chat window.",
+ ["show_perframename"] = "ChatFrame%d AddonMsgsShow",
+ ["show_perframedesc"] = "Toggle showing hidden addon messages on and off.",
+} )
+
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["AddonMsgs"] = "Addon Nachrichten",
+-- ["Addon message options."] = "Chatfenster Addon Nachrichten Optionen.",
+-- ["show_name"] = "Zeige Addon Nachrichten",
+-- ["show_desc"] = "Schaltet das Anzeigen von verborgenen Addon Nachrichten an und aus f\195\188r jedes Fenster.",
+-- ["show_perframename"] = "%s Addon Nachricht Anzeigen",
+-- ["show_perframedesc"] = "Schaltet das Anzeigen von verborgenen Addon Nachrichten ein und aus f\195\188r %s .",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["AddonMsgs"] = "Messages des Addons",
+-- ["Addon message options."] = "Options des messages d'addon.",
+-- ["show_name"] = "Afficher les messages des addons",
+-- ["show_desc"] = "Active/d\195\169sactive les messages des addons pour chaque fen\195\170tre.",
+-- ["show_perframename"] = "%s : Afficher les messages des addons",
+-- ["show_perframedesc"] = "Active/d\195\169sactive les messages des addons dans la fen\195\170tre %s .",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["AddonMsgs"] = "Mensajes de Accesorio",
+-- ["Addon message options."] = "Opciones de Mensajes de Accesorio",
+-- ["show_name"] = "Mostrar",
+-- ["show_desc"] = "Determina si se muestran los mensajes ocultos de accesorio para cada ventana.",
+-- ["show_perframename"] = "Mostrar Mensajes en %s ",
+-- ["show_perframedesc"] = "Determina si se muestran los mensajes de accesorio para la ventana de %s ."
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["AddonMsgs"] = "애드온 메세지",
+-- ["Addon message options."] = "애드온 메세지 설정입니다.",
+-- ["show_name"] = "애드온 메세지 표시",
+-- ["show_desc"] = "각각의 대화창에 숨겨진 애드온 메세지를 표시합니다.",
+-- ["show_perframename"] = "대화창%d 애드온 메세지 표시",
+-- ["show_perframedesc"] = "숨겨진 애드온 메세지를 표시합니다.",
+--} end)
+
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["AddonMsgs"] = "插件訊息",
+-- ["Addon message options."] = "插件訊息選項。",
+-- ["show_name"] = "顯示插件訊息",
+-- ["show_desc"] = "切換是否在各個聊天視窗顯示插件訊息。",
+-- ["show_perframename"] = "聊天視窗%d顯示插件訊息",
+-- ["show_perframedesc"] = "切換是否顯示插件訊息。"
+--} end)
+--
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["AddonMsgs"] = "插件信息",
+-- ["Addon message options."] = "插件信息设置",
+-- ["show_name"] = "显示插件信息",
+-- ["show_desc"] = "选择是否在每个窗口显示插件信息",
+-- ["show_perframename"] = "在窗口%s显示插件信息",
+-- ["show_perframedesc"] = "选择是否在聊天窗口%s显示隐藏的插件信息."
+-- } end)
+
+
+
+local mod = Prat:NewModule(PRAT_MODULE, "AceEvent-3.0")
+
+Prat:SetModuleDefaults(mod.name, {
+ profile = {
+ on = false,
+ show = {},
+ }
+} )
+
+Prat:SetModuleOptions(mod.name, {
+ name = L["AddonMsgs"],
+ desc = L["Addon message options."],
+ type = "group",
+ args = {
+ show = {
+ name = L["show_name"],
+ desc = L["show_desc"],
+ type = "multiselect",
+ values = Prat.HookedFrameList,
+ get = "GetSubValue",
+ set = "SetSubValue"
+ }
+ }
+ }
+)
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+function mod:OnModuleEnable()
+ self:RegisterEvent("CHAT_MSG_ADDON")
+end
+function mod:OnModuleDisable()
+ self:UnregisterEvent("CHAT_MSG_ADDON")
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+local CLR = Prat.CLR
+
+-- add a splash of color to text
+local function c1(text) return CLR:Colorize("ffff40", text) end
+local function c2(text) return CLR:Colorize("a0a0a0", text) end
+local function c3(text) return CLR:Colorize("40ff40", text) end
+local function c4(text) return CLR:Colorize("4040ff", text) end
+
+-- show hidden addon channel messages
+function mod:CHAT_MSG_ADDON(arg1, arg2, arg3, arg4)
+ for k,v in pairs(Prat.HookedFrames) do
+ if self.db.profile.show[k] then
+ v:AddMessage("["..c1(arg1).."]["..c2(arg2).."]["..c3(arg3).."]["..c4(arg4).."]")
+ end
+ end
+end
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Alias.lua b/modules/Alias.lua
new file mode 100644
index 00000000..89461c0c
--- /dev/null
+++ b/modules/Alias.lua
@@ -0,0 +1,692 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+--[[
+Name: module
+Revision: $Revision: $
+Author(s): Fin (fin@instinct.org)
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Alias
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Adds the command /alias, which can be used to alias slash commands in a similar way to the Unix alias command (default=off).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("Alias")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["module_name"] = "Alias",
+ ["module_desc"] = "Adds the command /alias, which can be used to alias slash commands in a similar way to the Unix alias command.",
+ ["add"] = true,
+ ["add an alias"] = true,
+ ['[ ] - alias to be executed as , or return the value of the currently defined alias for if has not been assigned a value. eg: "/alias /examplehello /say hello there" - typing "/examplehello" will now cause your character to say "hello there"; "/alias examplehello" - \s "/examplehello is aliased to /say hello there" (cmd aliases: /addalias)'] = true,
+ ["unalias"] = true,
+ ["remove an alias"] = true,
+ [' - remove the alias (cmd aliases: /delalias, /remalias)'] = true,
+ ["listaliases"] = true,
+ ["list all aliases"] = true,
+ ['findaliases'] = true,
+ ['find aliases matching a given search term'] = true,
+ [' - finds all aliases matching (cmd aliases: /findalias)'] = true,
+ ['verbose'] = true,
+ ['Display extra information in the chat frame when commands are dealiased'] = true,
+ ['inline'] = true,
+ ['Expand aliases as you are typing'] = true,
+ ["Options for altering the behaviour of Alias"] = true,
+ ['Options'] = true,
+ ['noclobber'] = true,
+ ["Don't overwrite existing aliases when using /addalias"] = true,
+ [' - list all aliases; supply to search for matching aliases (cmd aliases: /listallaliases)'] = true,
+ ["%s() called with nil argument!"] = true,
+ ["%s() called with blank string!"] = true,
+ ['refusing to alias "/%s" to anything in the interests of Not Buggering Everything Up'] = true,
+ ['noclobber set - skipping new alias: /%s already expands to /%s'] = true,
+ ['overwriting existing alias "/%s" (was aliased to "/%s")'] = true,
+ ["/%s aliased to: /%s"] = true,
+ ['alias "/%s" does not exist'] = true,
+ ['deleting alias "/%s" (previously aliased as "/%s")'] = true,
+ ['tried to show value for alias "%s" but undefined in module.Aliases!'] = true,
+ ['/%s aliased to "/%s"'] = true,
+ ["No aliases have been defined"] = true,
+ ['There is no alias current defined for "%s"'] = true,
+ ['infinite loop detected for alias /%s - ignoring'] = true,
+ ['dealiasing command /%s to /%s'] = true,
+ ['matching aliases found: %d'] = true,
+ ['total aliases: %d'] = true,
+ ["warnUser() called with nil argument!"] = true,
+ ["warnUser() called with zero length string!"] = true,
+})
+
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Alias"] = "Alias",
+-- ["Adds the command /alias, which can be used to alias slash commands in a similar way to the Unix alias command."] = "A\195\177ade el comando /alias, que puede ser usado para crear alias de comandos de un modo similar al comando alias de Unix.",
+-- ["add"] = "add",
+-- ["add an alias"] = "A\195\177ade un alias",
+-- ['[ ] - alias to be executed as , or return the value of the currently defined alias for if has not been assigned a value. eg: "/alias /examplehello /say hello there" - typing "/examplehello" will now cause your character to say "hello there"; "/alias examplehello" - prints "/examplehello is aliased to /say hello there" (cmd aliases: /addalias)'] = "[ ] - alias de que se ejecutar\195\161 como , o devuelve el valor del alias actualmente definido para si no tiene un valor asignado. Ej: '/alias /ejemplohola /decir Hola' - al escribir '/ejemplohola' tu personaje dir\195\161 'Hola'; '/alias ejemplohola' - muestra '/ejemplohola es el alias de /decir Hola' (cmd alias: /addalias)",
+-- ["unalias"] = "unalias",
+-- ["remove an alias"] = "Elimina un alias",
+-- [' - remove the alias (cmd aliases: /delalias, /remalias)'] = " - elimina el alias (cmd aliases: /delalias, /remalias)",
+-- ["listaliases"] = "listaliases",
+-- ["list all aliases"] = "Lista todos los alias",
+-- ['findaliases'] = "findaliases",
+-- ['find aliases matching a given search term'] = "encuentra alias que coincidan con el buscado",
+-- [' - finds all aliases matching (cmd aliases: /findalias)'] = " - encuentra todos los alias coincidentes (cmd aliases: /findalias)",
+-- ['verbose'] = "verbose",
+-- ['Display extra information in the chat frame when commands are dealiased'] = "Muestra informaci\195\179n extra en el marco del chat cuando los comandos son ejecutados",
+-- ['inline'] = "inline",
+-- ['Expand aliases as you are typing'] = "Expande los alias al escribirlos",
+-- ["Options for altering the behaviour of Alias"] = "Opciones para alterar los Alias",
+-- ['Options'] = "Opciones",
+-- ['noclobber'] = "noclobber",
+-- ["Don't overwrite existing aliases when using /addalias"] = "No sobreescribe alias existentes al usar /addalias",
+-- [' - list all aliases; supply to search for matching aliases (cmd aliases: /listallaliases)'] = ' - list all aliases; supply to search for matching aliases (cmd aliases: /listallaliases)',
+-- ["%s() called with nil argument!"] = "%s() called with nil argument!",
+-- ["%s() called with blank string!"] = "%s() called with blank string!",
+-- ['refusing to alias "/%s" to anything in the interests of Not Buggering Everything Up'] = 'refusing to alias "/%s" to anything in the interests of Not Buggering Everything Up',
+-- ['noclobber set - skipping new alias: /%s already expands to /%s'] = 'noclobber set - skipping new alias: /%s already expands to /%s',
+-- ['overwriting existing alias "/%s" (was aliased to "/%s")'] = 'overwriting existing alias "/%s" (was aliased to "/%s")',
+-- ["/%s aliased to: /%s"] = "/%s aliased to: /%s",
+-- ['alias "/%s" does not exist'] = 'alias "/%s" does not exist',
+-- ['deleting alias "/%s" (previously aliased as "/%s")'] = 'deleting alias "/%s" (previously aliased as "/%s")',
+-- ['tried to show value for alias "%s" but undefined in module.Aliases!'] = 'tried to show value for alias "%s" but undefined in module.Aliases!',
+-- ['/%s aliased to "/%s"'] = '/%s aliased to "/%s"',
+-- ["No aliases have been defined"] = "Ning\195\186n alias ha sido definido",
+-- ['There is no alias current defined for "%s"'] = 'No existen alias definidos para "%s"',
+-- ['infinite loop detected for alias /%s - ignoring'] = 'Ciclo infinito detectado para alias /%s - ignorando',
+-- ['dealiasing command /%s to /%s'] = 'Comando alias inverso /%s a /%s',
+-- ['matching aliases found: %d'] = "Alias coincidentes encontrados: %d",
+-- ['total aliases: %d'] = "Total alias: %d",
+-- ["warnUser() called with nil argument!"] = "warnUser() llamado con argumento nil!",
+-- ["warnUser() called with zero length string!"] = "warnUser() llamado con cadena de longitud cero!",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Alias"] = "Alias",
+-- ["Adds the command /alias, which can be used to alias slash commands in a similar way to the Unix alias command."] = "Fügt das Chatkommando /alias hinzu, das dazu benutzt werden kann selbst definierte Wörter für Chatkommandos zu verwenden. Ähnlich wie es das UNIX Alias Kommando tut.",
+-- ["add"] = "Hinzufügen",
+-- ["add an alias"] = "Füge ein Alias Kommando hinzu.",
+-- ['[ ] - alias to be executed as , or return the value of the currently defined alias for if has not been assigned a value. eg: "/alias /examplehello /say hello there" - typing "/examplehello" will now cause your character to say "hello there"; "/alias examplehello" - prints "/examplehello is aliased to /say hello there" (cmd aliases: /addalias)'] = "[ ] - Füge ein hinzu das das auslöst, oder dir anzeigt was für ein was für ein >ergebnisslashkommando> auslösen würde. zB: '/alias /beispielhallo /s hallo zusammen' - eintippen von '/beispielhallo' würde nun deinen Charakter dazu bringen 'hallo zusammen' zu sagen; '/alias beispielhallo' - schreibt im chat '/beispielhallo ist zugeornet zu /s hallo zusammen' (cmd aliases: /addalias)",
+-- ["unalias"] = "Entferne Alias",
+-- ["remove an alias"] = "Ein Alias Kommando entfernen.",
+-- [' - remove the alias (cmd aliases: /delalias, /remalias)'] = " - entferne den alias ",
+-- ["listaliases"] = "Liste Aliase",
+-- ["list all aliases"] = "Listet alle vorhanden Aliase auf.",
+-- ['findaliases'] = "Finde Aliase",
+-- ['find aliases matching a given search term'] = "Finde Aliase die dem gesuchten Wort entsprechen.",
+-- [' - finds all aliases matching (cmd aliases: /findalias)'] = "' - finde alle Aliase die entsprechen (cmd aliases: /findalias)",
+-- ['verbose'] = "Ausführlich",
+-- ['Display extra information in the chat frame when commands are dealiased'] = "Zeige eine zusätzliche Information im Chatfenster wenn Alias Kommandos entfernt werden.",
+-- ['inline'] = "Ausfüllen",
+-- ['Expand aliases as you are typing'] = "Vervollständige Aliase beim eintippen.",
+-- ["Options for altering the behaviour of Alias"] = "Optionem um das verhalten der Aliasen zu abzuändern.",
+-- ['Options'] = "Optionen",
+-- ['noclobber'] = "NichtÜberschreiben",
+-- ["Don't overwrite existing aliases when using /addalias"] = "Kein Überschreiben von existierenden Aliasen wenn /addalias benutzt wird.",
+-- [' - list all aliases; supply to search for matching aliases (cmd aliases: /listallaliases)'] = " - Liste alle Aliase; benutze um nach möglichen Aliasen zu suchen.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Alias"] = "指令別名",
+-- ["Adds the command /alias, which can be used to alias slash commands in a similar way to the Unix alias command."] = "增加指令 /alias,可用以作為一般指令的別名,就像在 Unix 系統中的指令別名。",
+-- ["add"] = "增加別名",
+-- ["add an alias"] = "增加一個指令別名。",
+-- ['[ ] - alias to be executed as , or return the value of the currently defined alias for if has not been assigned a value. eg: "/alias /examplehello /say hello there" - typing "/examplehello" will now cause your character to say "hello there"; "/alias examplehello" - prints "/examplehello is aliased to /say hello there" (cmd aliases: /addalias)'] = "<指令>[ <值>] - 將<指令>作為<值>的別名; 如果沒有指定<值>的話就傳回現定義為<指令>的別名。例: 「/alias /examplehello /say hello there」 - 現在鍵入「/examplehello」會使你的角色說: 「hello there」; 「/alias examplehello」 - 在聊天視窗顯示「/examplehello 是「/say hello there」的指令別名」 (別名: /addalias)",
+-- ["unalias"] = "移除別名",
+-- ["remove an alias"] = "移除一個指令別名。",
+-- [' - remove the alias (cmd aliases: /delalias, /remalias)'] = "<指令別名> - 移除一個指令別名<指令別名> (別名: /delalias,/remalias)",
+-- ["listaliases"] = "列出別名",
+-- ["list all aliases"] = "列出你現在所有指令別名。",
+-- ['findaliases'] = "搜尋別名",
+-- ['find aliases matching a given search term'] = "搜尋指令別名。",
+-- [' - finds all aliases matching (cmd aliases: /findalias)'] = "<關鍵字> - 搜尋符合<關鍵字>的指令別名 (別名: /findalias)",
+-- ['verbose'] = "額外資訊",
+-- ['Display extra information in the chat frame when commands are dealiased'] = "當執行指令別名時在聊天視窗顯示額外資訊。",
+-- ['inline'] = "即時變更",
+-- ['Expand aliases as you are typing'] = "在輸入框把指令別名變為實際指令。",
+-- ["Options for altering the behaviour of Alias"] = "指令別名的選項。",
+-- ['Options'] = "選項",
+-- ['noclobber'] = "不覆寫",
+-- ["Don't overwrite existing aliases when using /addalias"] = "當執行 /addalias 時不覆寫現有的指令別名。",
+-- [' - list all aliases; supply to search for matching aliases (cmd aliases: /listallaliases)'] = " - 列出所有指令別名; 提供<關鍵字>搜尋符合的指令別名 (別名: /listallaliases)",
+-- ["%s() called with nil argument!"] = "%s(): 沒有參數!",
+-- ["%s() called with blank string!"] = "%s(): 空白字串!",
+-- ['refusing to alias "/%s" to anything in the interests of Not Buggering Everything Up'] = "拒絕定義「/%s」",
+-- ['noclobber set - skipping new alias: /%s already expands to /%s'] = "已設定不覆寫現有的指令別名 - /%s 早已是 /%s 的指令別名",
+-- ['overwriting existing alias "/%s" (was aliased to "/%s")'] = "覆寫「/%s」 (先前是「/%s」的指令別名)",
+-- ["/%s aliased to: /%s"] = "/%s 是 /%s 的指令別名",
+-- ['alias "/%s" does not exist'] = "指令別名「/%s」不存在",
+-- ['deleting alias "/%s" (previously aliased as "/%s")'] = "移除「/%s」 (先前是「/%s」的指令別名)",
+-- ['tried to show value for alias "%s" but undefined in module.Aliases!'] = "「/%s」未定義!",
+-- ['/%s aliased to "/%s"'] = "/%s 是「/%s」的指令別名",
+-- ["No aliases have been defined"] = "沒有定義指令別名",
+-- ['There is no alias current defined for "%s"'] = "沒有「%s」指令別名",
+-- ['infinite loop detected for alias /%s - ignoring'] = "/%s: found無限迴路 - 忽略",
+-- ['dealiasing command /%s to /%s'] = "/%s => /%s",
+-- ['matching aliases found: %d'] = "找到符合的指令別名: %d",
+-- ['total aliases: %d'] = "指令別名總數: %d",
+-- ["warnUser() called with nil argument!"] = "warnUser(): 沒有參數!",
+-- ["warnUser() called with zero length string!"] = "warnUser(): 空白字串!",
+--} end)
+--
+--
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+----Chinese Translate Add by Ananhaid(NovaLOG)@CWDG (Line:185-216)
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Alias"] = "自定义指令",
+-- ["Adds the command /alias, which can be used to alias slash commands in a similar way to the Unix alias command."] = "增加指令 /alias ,可以作为一般指令的别名,就如在 Unix 系统中的自定义指令",
+-- ["add"] = "添加自定义",
+-- ["add an alias"] = "添加一条自定义指令",
+-- ['[ ] - alias to be executed as , or return the value of the currently defined alias for if has not been assigned a value. eg: "/alias /examplehello /say hello there" - typing "/examplehello" will now cause your character to say "hello there"; "/alias examplehello" - prints "/examplehello is aliased to /say hello there" (cmd aliases: /addalias)'] = "<指令>[ <值>] - 将自定义<指令>成为可执行<值>;如果你没用指定该<值>的话,系统就会反馈给你当前自定义<指令>的值。例如:/alias /examplehello /say hello there - 输入/examplehello,你的角色会立即/say Hello there输出到聊天框中。从上面例子可以看出/examplehello已经成为/say hello there的一个自定义指令。让你聊天更加快捷方便。",
+-- ["unalias"] = "移除自定义指令",
+-- ["remove an alias"] = "移除一条自定义指令",
+-- ["listaliases"] = "列出自定义指令",
+-- ["list all aliases"] = "列出你当前所有自定义指令",
+-- ['findaliases'] = "搜索自定义指令",
+-- ['find aliases matching a given search term'] = "搜索自定义指令。",
+-- [' - finds all aliases matching (cmd aliases: /findalias)'] = "<关键字> - 搜索符合<关键字>的自定义指令 (命令行: /findalias)",
+-- ['verbose'] = "额外信息",
+-- ['Display extra information in the chat frame when commands are dealiased'] = "当执行自定义指令时在聊天窗口显示额外信息。",
+-- ['inline'] = "即时更新",
+-- ['Expand aliases as you are typing'] = "在输入框把自定义指令变为实际指令。",
+-- ["Options for altering the behaviour of Alias"] = "自定义指令选项。",
+-- ['Options'] = "选项",
+-- ['noclobber'] = "不覆盖",
+-- ["Don't overwrite existing aliases when using /addalias"] = "当执行 /addalias 时不覆盖现有的自定义指令。",
+-- [' - list all aliases; supply to search for matching aliases (cmd aliases: /listallaliases)'] = " - 列出所有自定义指令; 提供<关键字>搜索符合的自定义指令 (別名: /listallaliases)",
+-- ["%s() called with nil argument!"] = "%s(): 沒有参数!",
+-- ["%s() called with blank string!"] = "%s(): 空白字符!",
+-- ['refusing to alias "/%s" to anything in the interests of Not Buggering Everything Up'] = "拒绝定义「/%s」",
+-- ['noclobber set - skipping new alias: /%s already expands to /%s'] = "已设定不覆盖现有的自定义指令 - /%s 早已是 /%s 的自定义指令",
+-- ['overwriting existing alias "/%s" (was aliased to "/%s")'] = "覆盖「/%s」 (先前是「/%s」的自定义指令)",
+-- ["/%s aliased to: /%s"] = "/%s 是 /%s 的自定义指令",
+-- ['alias "/%s" does not exist'] = "自定义指令「/%s」不存在",
+-- ['deleting alias "/%s" (previously aliased as "/%s")'] = "移除「/%s」 (先前是「/%s」的自定义指令)",
+-- ['tried to show value for alias "%s" but undefined in module.Aliases!'] = "「/%s」未定义!",
+-- ['/%s aliased to "/%s"'] = "/%s 是「/%s」的自定义指令",
+-- ["No aliases have been defined"] = "沒有定义自定义指令",
+-- ['There is no alias current defined for "%s"'] = "沒有「%s」自定义指令",
+-- ['infinite loop detected for alias /%s - ignoring'] = "/%s: 发现无限循环 - 忽略",
+-- ['dealiasing command /%s to /%s'] = "/%s => /%s",
+-- ['matching aliases found: %d'] = "找到符合的自定义指令: %d",
+-- ['total aliases: %d'] = "自定义指令总数: %d",
+-- ["warnUser() called with nil argument!"] = "warnUser(): 沒有参数!",
+-- ["warnUser() called with zero length string!"] = "warnUser(): 空白字符!",
+--} end)
+
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = false,
+ aliases = {},
+ verbose = false,
+ inline = true,
+ noclobber = false,
+
+ -- things we won't alias
+ wontalias = {
+ unalias = 1,
+ alias = 1,
+ prat = 1,
+ script = 1,
+ run = 1,
+ ace = 1,
+ ace2 = 1,
+ listaliases = 1,
+ quit = 1,
+ reload = 1,
+ rl = 1,
+ },
+ }
+} )
+
+
+
+
+-- any boolean options
+--module.toggleOptions = {
+-- on,
+-- verbose,
+-- inline,
+-- noclobber,
+-- }
+
+
+Prat:SetModuleOptions(module, {
+ name = L["module_name"],
+ desc = L["module_desc"],
+ type = "group",
+ args = {
+ add = {
+ type = "input",
+ name = L["add"],
+ desc = L["add an alias"],
+-- usage = L['[ ] - alias to be executed as , or return the value of the currently defined alias for if has not been assigned a value. eg: "/alias /examplehello /say hello there" - typing "/examplehello" will now cause your character to say "hello there"; "/alias examplehello" - prints "/examplehello is aliased to /say hello there" (cmd aliases: /addalias)'],
+
+ get = false,
+ set = function(info, argstr) return info.handler:setAlias(argstr) end,
+ order = 210,
+ },
+
+ del = {
+ name = L["unalias"],
+ desc = L["remove an alias"],
+ type = "select",
+-- usage = L[' - remove the alias (cmd aliases: /delalias, /remalias)'],
+ values = function(info) return info.handler.db.profile.aliases end,
+ set = function(info, aliastoremove) return info.handler:delAlias(aliastoremove) end,
+ order = 220,
+ disabled = function(info) return info.handler:NumAliases()==0 end
+ },
+
+ find = {
+ name = L["findaliases"],
+ desc = L["find aliases matching a given search term"],
+ type = 'input',
+ set = function(info, q) return info.handler:listAliases(q) end,
+ get = false,
+-- usage = L[' - finds all aliases matching (cmd aliases: /findalias)'],
+ order = 230,
+ },
+
+ list = {
+ name = L["listaliases"],
+ desc = L["list all aliases"],
+ type = 'execute',
+ func = function(info) info.handler:listAliases() end,
+-- usage = L[' - list all aliases; supply to search for matching aliases (cmd aliases: /listallaliases)'],
+ order = 240,
+ },
+
+
+ blankheader = {
+ name = "",
+ order = 499,
+ type = 'header',
+ },
+ --[[ OPTIONS ]]--
+ optionsheader = {
+ name = L["Options"],
+ desc = L["Options for altering the behaviour of Alias"],
+ type = 'header',
+ order = 500,
+ },
+
+
+ inline = {
+ name = L['inline'],
+ desc = L['Expand aliases as you are typing'],
+ type = 'toggle',
+ order = 510,
+ },
+
+ noclobber = {
+ name = L['noclobber'],
+ desc = L["Don't overwrite existing aliases when using /addalias"],
+ type = 'toggle',
+ order = 520,
+ },
+
+ verbose = {
+ name = L['verbose'],
+ desc = L['Display extra information in the chat frame when commands are dealiased'],
+ type = 'toggle',
+ order = 530,
+ },
+ }
+ }
+)
+
+local CLR = Prat.CLR
+
+local function clralias(text) return CLR:Colorize("64ff64", text:lower()) end
+local function clrexpansion(text) return CLR:Colorize("64ffff", text:lower()) end
+local function clrmodname(text) return CLR:Colorize("ff8080", text) end
+
+
+-- things to do when the module is enabled
+function module:OnModuleEnable()
+ self.Aliases = {}
+
+ table.sort(self.db.profile.aliases)
+
+ for k, v in pairs(self.db.profile.aliases) do
+ self.Aliases[k] = v
+ end
+
+ self.WontAlias = self.db.profile.wontalias
+ for naughtyalias, justtrue in pairs(self.WontAlias) do
+ self.WontAlias[string.lower(naughtyalias)] = 1
+ end
+
+ self:RawHook('ChatEdit_HandleChatType', true)
+
+-- Prat:RegisterChatCommand({ '/alias', '/addalias', }, self.moduleOptions.args.add, 'PRATALIAS')
+-- Prat:RegisterChatCommand({ '/unalias', '/delalias', '/remalias' }, self.moduleOptions.args.del, 'PRATUNALIAS')
+-- Prat:RegisterChatCommand({ '/listaliases', '/listallaliases' }, self.moduleOptions.args.list, 'PRATLISTALIASES')
+-- Prat:RegisterChatCommand({ '/findaliases', '/findalias' }, self.moduleOptions.args.find, 'PRATFINDALIASES')
+
+ Prat.RegisterChatCommand("alias", function(argstr) return self:setAlias(argstr) end)
+ Prat.RegisterChatCommand("unalias", function(argstr) return self:delAlias(argstr) end)
+ Prat.RegisterChatCommand("listaliases", function(argstr) return self:listAliases(argstr) end)
+end
+
+-- things to do when the module is disabled
+function module:OnModuleDisable()
+ -- unregister events
+-- Prat.UnregisterAllChatEvents(self)
+
+ self:UnhookAll()
+ self.Aliases = nil
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+function module:splitAliasArgs(str)
+ -- str should be "[=value| value]"
+ local name, value
+ local args = {
+ name = "",
+ value = "",
+ }
+
+ -- if it doesn't match, args is left with default blank strings for values
+ --for alias, command in str:find("(%w+)%s*=?%s*(.-)%s*$") do
+ for alias, command in str:gmatch("/?(%w+)%s*[%s=]%s*/?(.-)$") do
+ -- either matches both alias and command (may match command as a blank string)
+ args['name'] = string.lower(alias)
+ args['value'] = command or ""
+ -- util:print('name ' .. args['name'])
+ -- util:print('value ' .. args['value'])
+ end
+
+ return args
+end
+
+function module:checkArgStr(funcname, argstr)
+ if argstr == nil then
+ self:warnUser(string.format(L["%s() called with nil argument!"], funcname))
+ return false
+ end
+
+ if argstr == "" then
+ self:warnUser(string.format(L["%s() called with blank string!"], funcname))
+ return false
+ end
+
+ return true
+end
+
+function module:setAlias(argstr)
+ -- argstr should be "[ - check for alias called to display
+ if self.Aliases[name] then
+ -- alias found; show it :)
+ self:showAlias(name)
+ return true
+ else
+ -- no alias found called ; tell user
+ self:reportUndefinedAlias(name)
+ end
+ elseif self.WontAlias[string.lower(alias['name'])] then
+ -- user is defining an alias called , but it's potentially bad
+ self:warnUser(string.format(L['refusing to alias "/%s" to anything in the interests of Not Buggering Everything Up'], clralias(alias['name'])))
+ return false
+ elseif self.db.profile.noclobber and self.Aliases[string.lower(alias['name'])] then
+ self:warnUser(string.format(L['noclobber set - skipping new alias: /%s already expands to /%s'], clralias(alias['name']), clrexpansion(alias['value'])))
+ return false
+ else
+ -- it's not listed as bad, so create or update the aliases tables
+ -- called as /alias - define alias as
+ if self.Aliases[alias['name']] then
+ -- specified alias already exists, warn user and print old setting
+ self:warnUser(string.format(L['overwriting existing alias "/%s" (was aliased to "/%s")'], clralias(alias['name']), clrexpansion(self.Aliases[alias['name']])))
+ end
+
+ -- now (re?)define the alias to
+ self.Aliases[alias['name']] = alias['value']
+ self.db.profile.aliases[alias['name']] = alias['value']
+
+ table.sort(self.db.profile.aliases)
+ table.sort(self.Aliases)
+
+ LibStub("AceConfigRegistry-3.0"):NotifyChange("Prat")
+
+ self:warnUser(string.format(L["/%s aliased to: /%s"], clralias(alias['name']), clrexpansion(alias['value'])))
+ end
+end
+
+function module:delAlias(aliasname)
+ if not self:checkArgStr('delAlias', aliasname) then
+ return false
+ end
+
+ -- remove unecessary /s at the beginning of the alias name
+ aliasname = aliasname:gsub('^/*', '')
+
+ if not self.Aliases[aliasname] then
+ self:warnUser(string.format(L['alias "/%s" does not exist'], clralias(aliasname)))
+ return false
+ end
+
+ local oldalias = self.Aliases[aliasname]
+
+ self:warnUser(string.format(L['deleting alias "/%s" (previously aliased as "/%s")'], clralias(aliasname), clrexpansion(oldalias)))
+
+ self.Aliases[aliasname] = nil
+ self.db.profile.aliases[aliasname] = nil
+
+ LibStub("AceConfigRegistry-3.0"):NotifyChange("Prat")
+
+ return oldalias
+end
+
+function module:showAlias(aliasname)
+ if not self:checkArgStr('showAlias', aliasname) then
+ return false
+ end
+
+ -- check for undefined alias called aliasname
+ if not self.Aliases[aliasname] then
+ self:warnUser(string.format(L['tried to show value for alias "%s" but undefined in module.Aliases!'], clralias(aliasname)))
+ return false
+ end
+
+ -- everything OK; display value of alias "aliasname"
+ self:warnUser(string.format(L['/%s aliased to "/%s"'], clralias(aliasname), clrexpansion(self.Aliases[aliasname])))
+
+ return true
+end
+
+function module:listAliases(q)
+ if self.Aliases == {} then
+ self:warnUser(L["No aliases have been defined"])
+ return false
+ end
+
+ local msg
+ local count = 0
+
+ table.sort(self.Aliases)
+
+ for name, alias in pairs(self.Aliases) do
+ if not q or (name:match(q)) then
+ self:showAlias(name)
+ count = count + 1
+ end
+ end
+
+ if q then
+ msg = L['matching aliases found: %d']
+ else
+ msg = L['total aliases: %d']
+ end
+
+ self:tellUser(string.format(msg, count))
+end
+
+
+function module:reportUndefinedAlias(name)
+ return self:warnUser(string.format(L['There is no alias current defined for "%s"'], clralias(name)))
+end
+
+function module:tellUser(str)
+ return module:warnUser(str)
+end
+
+function module:NumAliases()
+ local n=0
+ for name, alias in pairs(self.Aliases) do
+ n=n+1
+ end
+ return n
+end
+
+function module:warnUser(str)
+ if str == nil then
+ str = L["warnUser() called with nil argument!"]
+ elseif not str then
+ str = L["warnUser() called with zero length string!"]
+ end
+
+ DEFAULT_CHAT_FRAME:AddMessage(string.format("%s: %s", clrmodname(self.moduleName), str))
+
+ return true
+end
+
+
+local fake = {}
+
+function module:ChatEdit_HandleChatType(editBox, msg, command, send, dealiased)
+ local command = command or ""
+ local alias = self.Aliases[string.lower(strsub(command, 2))]
+ local dealiased = dealiased or {}
+ local msg = msg or ""
+
+ if dealiased[command] then
+ -- skip commands we've already dealiased
+ self:warnUser(string.format(L['infinite loop detected for alias /%s - ignoring'], clralias(alias)))
+ elseif alias and alias ~= "" then
+ if (send == 1) and self.db.profile.verbose then
+ self:warnUser(string.format(L['dealiasing command /%s to /%s'], clralias(strsub(command, 2)), clrexpansion(alias)))
+ end
+
+ dealiased[command] = true
+ alias = Prat.ReplaceMatches(alias, 'OUTBOUND')
+
+ local newcmd = strmatch(alias, "^/*([^%s]+)") or ""
+ local premsg = strsub(alias, strlen(newcmd) + 2) or ""
+
+ if premsg ~= "" then
+ msg = premsg .. ' ' .. msg
+ end
+
+ command = '/' .. string.upper(newcmd)
+ text = string.lower(command)
+
+ if msg ~= "" then
+ fake.MESSAGE = msg
+
+ Prat.Addon:ProcessUserEnteredChat(fake)
+
+ msg = fake.MESSAGE
+ text = text .. ' ' .. msg
+ end
+
+ if (send == 1) then
+ editBox:SetText(text)
+ elseif (self.db.profile.inline) then
+ editBox:SetText(text .. ' ')
+ end
+
+ self:ChatEdit_HandleChatType(editBox, msg, command, send, dealiased)
+
+ return true
+ end
+
+ if send == 1 then
+ local text = editBox:GetText()
+ -- ripped off Blizzard's slash command bits here; just changed return value
+ if ( hash_SlashCmdList[command] ) then
+ hash_SlashCmdList[command](strtrim(msg));
+ editBox:AddHistoryLine(text);
+ ChatEdit_OnEscapePressed(editBox);
+
+ return true
+ end
+
+ for index, value in pairs(SlashCmdList) do
+ local i = 1;
+ local cmdString = getglobal("SLASH_"..index..i);
+ while ( cmdString ) do
+ cmdString = strupper(cmdString);
+ if ( cmdString == command ) then
+ hash_SlashCmdList[command] = value; -- add to hash
+ -- if the code in here changes - change the corresponding code above
+ value(strtrim(msg));
+
+ editBox:AddHistoryLine(text);
+ ChatEdit_OnEscapePressed(editBox);
+ return true
+ end
+ i = i + 1;
+ cmdString = getglobal("SLASH_"..index..i);
+ end
+ end
+ end
+
+ return self.hooks["ChatEdit_HandleChatType"](editBox, msg, command, send)
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/AltNames.lua b/modules/AltNames.lua
new file mode 100644
index 00000000..a0f3b9a0
--- /dev/null
+++ b/modules/AltNames.lua
@@ -0,0 +1,1388 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+--[[
+Name: AltNames
+Revision: $Revision $
+Author(s): Fin (fin@instinct.org)
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#AltNames
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Allows people's alt characters to be linked to their mains, which will then be displayed next to their names when found in chat messages (default=off).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("AltNames")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Start"] = true,
+ ["AltNames"] = true,
+ ["module_desc"] = "Allows people's alt characters to be linked to their mains, which can then be displayed next to their names when found in chat messages (default=off).",
+ ["quiet"] = "Be quiet",
+ ["quiet_name"] = true,
+ ["quiet_desc"] = "Whether to report to the chat frame or not.",
+ ["mainpos_name"] = "Main name position",
+ ["mainpos_desc"] = "Where to display a character's main name when on their alt.",
+ ["Main name position"] = true,
+ [" (eg, /altnames del Personyouthoughtwassomeonesaltbutreallyisnt)"] = true,
+ ["Where to display a character's main name when on their alt."] = true,
+ ["Left"] = true,
+ ["Right"] = true,
+ ["Disabled"] = true,
+ ["Find characters"] = true,
+ ["Search the list of linked characters for matching main or alt names."] = true,
+ [" (eg, /altnames find fin)"] = true,
+ ["Link alt"] = true,
+ ["Link someone's alt character with the name of their main."] = true,
+ ["link (eg, /altnames link Fin Finjathealtoffin)"] = true,
+ ["Delete alt"] = true,
+ ["Delete a character's link to another character as their main."] = true,
+ ["Be quiet"] = true,
+ ["Whether to report to the chat frame or not."] = true,
+ ["You have not yet linked any alts with their mains."] = true,
+ ["no matches found"] = true,
+ ["List all"] = true,
+ ["List all links between alts and their main names."] = true,
+ ["Imports data from LOKWhoIsWho, if present (drop your SavedVariables\LOKWhoIsWho.lua in the Prat directory to be able to use this)."] = true,
+ ["LOKWhoIsWho import"] = true,
+ ["Clear all"] = true,
+ ["Clear all links between alts and main names."] = true,
+ ["Colour"] = true,
+ ["The colour of an alt's main name that will be displayed"] = true,
+ ["Import from guild roster"] = true,
+ ['Imports alt names from the guild roster by checking for members with the rank "alt" or "alts", or guild / officer notes like "\'s alt"'] = true,
+ ['Import from Guild Greet database'] = true,
+ ['Imports alt names from a Guild Greet database, if present'] = true,
+ ['Use class colour (from the PlayerNames module)'] = true,
+ ["use class colour of main"] = true,
+ ["use class colour of alt"] = true,
+ ["don't use"] = true,
+ ["Display main names in the same colour as that of the main's class (taking the data from the PlayerNames module if it is enabled)"] = true,
+ ["Display main names in the same colour as that of the alt's class (taking the data from the PlayerNames module if it is enabled)"] = true,
+ ["Don't use data from the PlayerNames module at all"] = true,
+ ["Import options"] = true,
+ ["Various ways to import a main's alts from other addons"] = true,
+ ["Don't overwrite existing links"] = true,
+ ["Don't overwrite existing alt <-> main links when importing or adding new alts."] = true,
+ [".*[Aa]lts?$"] = true,
+ ["(.-)'s? [Aa]lt"] = true,
+ ["([^%s%p%d%c%z]+)'s alt"] = true,
+ ['ERROR: some function sent a blank message!'] = true,
+ ["Alts:"] = true,
+ ['Main:'] = true,
+ ["No main name supplied to link %s to"] = true,
+ ['alt name exists: %s -> %s; not overwriting as set in preferences'] = true,
+ ['warning: alt %s already linked to %s'] = true,
+ ["linked alt %s => %s"] = true,
+ ["character removed: %s"] = true,
+ ['no characters called "%s" found; nothing deleted'] = true,
+ ['%s total alts linked to mains'] = true,
+ ['no alts or mains found matching "%s"'] = true,
+ ["searched for: %s - total matches: %s"] = true,
+ ['LOKWhoIsWho lua file not found, sorry.'] = true,
+ ["LOKWhoIsWho data not found"] = true,
+ ["%s alts imported from LOKWhoIsWho"] = true,
+ ['No Guild Greet database found'] = true,
+ ['You are not in a guild'] = true,
+ ["guild member alts found and imported: %s"] = true,
+ ["Fix alts"] = true,
+ ["Fix corrupted entries in your list of alt names."] = true,
+ ["Class colour"] = true,
+ ["Use class colour (from the PlayerNames module)"] = true,
+ ['Show main in tooltip'] = true,
+ ["Display a player's main name in the tooltip"] = true,
+ ['Show alts in tooltip'] = true,
+ ["Display a player's alts in the tooltip"] = true,
+ ["Found alt: %s => main: %s"] = true,
+ ["alt"] = true,
+ ["main"] = true,
+ ["Alt"] = true,
+ ["Main"] = true,
+ ['no alts found for character '] = true,
+ ['List alts'] = true,
+ ['List alts for a given character'] = true,
+ [' (eg /altnames listalts Fin)'] = true,
+ ['%d alts found for %s: %s'] = true,
+ ['No arg string given to :addAlt()'] = true,
+
+})
+
+-- L[LIB.NEWLOCALE](L"deDE", function() return {
+-- } end)
+-- L[LIB.NEWLOCALE](L"frFR", function() return {
+-- } end)
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Start"] = "Iniciar",
+-- --["AltNames"] = "Nombres de Secundario",
+-- ["quiet"] = "silencioso",
+-- ["quiet_name"] = "silencioso_nombre",
+-- ["quiet_desc"] = "Determina si se informa en la ventana de chat o no.",
+-- ["mainpos_name"] = "Posición del nombre del principal",
+-- ["mainpos_desc"] = "Dónde mostrar el nombre del personaje principal cuando está con su secundario.",
+-- ["Allows people's alt characters to be linked to their mains, which can then be displayed next to their names when found in chat messages (default=off)."] = "Permite que los personajes secundarios (alts) de los jugadores sean enlazados a sus principales, para poder luego mostrarlos junto a sus nombres en sus mensajes en la ventana de chat (por defecto=desactivado).",
+-- ["Main name position"] = "Posición del nombre del principal",
+-- [" (eg, /altnames del Personyouthoughtwassomeonesaltbutreallyisnt)"] = " (ej: /altnames del Personaquecreistequeeraalguienquerealmentenoes)",
+-- ["Where to display a character's main name when on their alt."] = "Dónde mostrar el nombre de un personaje principal cuando está con su secundario.",
+-- ["Left"] = "Izquierda",
+-- ["Right"] = "Derecha",
+-- ["Disabled"] = "Desactivado",
+-- ["Find characters"] = "Buscar personajes",
+-- ["Search the list of linked characters for matching main or alt names."] = "Busca en la lista de personajes enlazados para encontrar personajes de principales o secundarios.",
+-- [" (eg, /altnames find fin)"] = " (ej: /altnames find Fin)",
+-- ["Link alt"] = "Enlazar secundario",
+-- ["Link someone's alt character with the name of their main."] = "Enlaza el personaje secundario de alguien con el nombre de su principal.",
+-- ["link (eg, /altnames link Fin Finjathealtoffin)"] = "link (ej: /altnames link Fin Finjathealtoffin)",
+-- ["Delete alt"] = "Borrar secundario",
+-- ["Delete a character's link to another character as their main."] = "Borra el enlace como principal de un personaje con otro",
+-- ["Be quiet"] = "Silencioso",
+-- ["Whether to report to the chat frame or not."] = "Determina si se informa en la ventana de chat o no.",
+-- ["You have not yet linked any alts with their mains."] = "Todavía no has enlazado ningún secundario con su principal",
+-- ["no matches found"] = "No se ha encontrado nada",
+-- ["List all"] = "Mostrar lista de todos",
+-- ["List all links between alts and their main names."] = "Muestra una lista de todos los enlaces entre los nombres de secundarios y sus principales.",
+-- ["Imports data from LOKWhoIsWho, if present (drop your SavedVariables\LOKWhoIsWho.lua in the Prat directory to be able to use this)."] = "Importa información de LOKWhoIsWho, si la hay (coloca el archivo SavedVariables\LOKWhoIsWho.lua en el directorio de Prat para poder usar esto)",
+-- ["LOKWhoIsWho import"] = "Importar LOKWhoIsWho",
+-- ["Clear all"] = "Borrar todo",
+-- ["Clear all links between alts and main names."] = "Borra todos los enlaces entre los nombres de secundarios y principales",
+-- ["Colour"] = "Color",
+-- ["The colour of an alt's main name that will be displayed"] = "El color del nombre del principal de un personaje secundario",
+--} end)
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Start"] = "시작",
+-- ["AltNames"] = "부캐이름",
+-- ["quiet"] = "정숙",
+---- ["quiet_name"] = "정숙",
+---- ["quiet_desc"] = "대화창에 결과를 표시할지 않을지를 선택합니다.",
+---- ["mainpos_name"] = "주캐릭터 이름 위치",
+---- ["mainpos_desc"] = "주캐릭터를 부캐릭터의 이름의 어느 위치에 표시할지를 선택합니다.",
+-- ["Allows people's alt characters to be linked to their mains, which can then be displayed next to their names when found in chat messages (default=off)."] = "대화창에서 부캐릭터의 이름 옆에 주캐릭터의 이름을 표시합니다 (기본=끔).",
+-- ["Main name position"] = "주캐릭터 이름 위치",
+-- [" (eg, /altnames del Personyouthoughtwassomeonesaltbutreallyisnt)"] = "<부캐릭터 이름> (예, /altnames del Personyouthoughtwassomeonesaltbutreallyisnt)",
+-- ["Where to display a character's main name when on their alt."] = "주캐릭터의 이름을 부캐릭터 이름 어느 쪽에 표시할지를 선택합니다",
+-- ["Left"] = "좌",
+-- ["Right"] = "우",
+-- ["Disabled"] = "사용 안함",
+-- ["Find characters"] = "캐릭터 검색",
+-- ["Search the list of linked characters for matching main or alt names."] = "주캐릭터나 부캐릭터의 이름중 검색어와 일치하는 연관 정보를 검색합니다",
+-- [" (eg, /altnames find fin)"] = "<검색어> (예, /altnames find fin)",
+-- ["Link alt"] = "부캐 연결",
+-- ["Link someone's alt character with the name of their main."] = "부캐릭터와 주캐릭터의 연결을 입력합니다",
+-- ["link (eg, /altnames link Fin Finjathealtoffin)"] = "link <부캐릭터 이름> <주캐릭터 이름> (예, /altnames link Fin Finjathealtoffin)",
+-- ["Delete alt"] = "부캐릭터 삭제",
+-- ["Delete a character's link to another character as their main."] = "주캐릭터에 연관되어 있는 부 캐릭터정보를 삭제합니다",
+-- ["Be quiet"] = "정숙모드",
+-- ["Whether to report to the chat frame or not."] = "대화창에 결과를 출력하거나 출력하지 않습니다.",
+-- ["You have not yet linked any alts with their mains."] = "주캐릭터와 부캐릭터의 연관 정보가 없습니다",
+-- ["no matches found"] = "일치하는 결과가 없습니다",
+-- ["List all"] = "목록 출력",
+-- ["List all links between alts and their main names."] = "모든 주캐릭터와 부캐릭터 연관 정보 목록을 출력합니다",
+-- ["Imports data from LOKWhoIsWho, if present (drop your SavedVariables\LOKWhoIsWho.lua in the Prat directory to be able to use this)."] = "LOKWhoIsWho 자료를 입력받습니다(당신의 SavedVariables\LOKWhoIsWho.lua 파일을 Prat 폴더에 넣어야 사용할 수 있습니다).",
+-- ["LOKWhoIsWho import"] = "LOKWhoIsWho 입력",
+-- ["Clear all"] = "초기화",
+-- ["Clear all links between alts and main names."] = "모든 주캐릭터와 부캐릭터 연관 정보를 초기화 합니다",
+-- ["Colour"] = "색상",
+-- ["The colour of an alt's main name that will be displayed"] = "부캐릭터의 주케릭터 이름의 색상을 표시합니다",
+-- ["Import from guild roster"] = "길드원 정보 입력",
+-- ['Imports alt names from the guild roster by checking for members with the rank "alt" or "alts", or guild / officer notes like "\'s alt"'] = '길드원 정보에서 길드 등급이 "부캐" 또는 "부케"인지 또는 쪽지나 길드관리자 쪽지에 "<이름> 부캐" 또는 "<이름> 부케"의 내용이 있는지를 확인해 입력합니다',
+-- ['Import from Guild Greet database'] = "Guild Greet 부캐릭터 정보 입력",
+-- ['Imports alt names from a Guild Greet database, if present'] = "Guild Greet의 부캐릭터 정보를 입력받습니다",
+-- ['Use class colour (from the PlayerNames module)'] = "직업 색상 사용(플레이어명 모듈 사용)",
+-- ["use class colour of main"] = "주캐릭터 직업 색상 사용",
+-- ["use class colour of alt"] = "부캐릭터 직업 색상 사용",
+-- ["don't use"] = "사용 안함",
+-- ["Display main names in the same colour as that of the main's class (taking the data from the PlayerNames module if it is enabled)"] = "주캐의 이름 색상을 ,주캐의 직업 색상으로 표시합니다(플레이어명 모듈에서 정보를 받아옵니다)",
+-- ["Display main names in the same colour as that of the alt's class (taking the data from the PlayerNames module if it is enabled)"] = "주캐의 이름 색상을 부캐의 직업 색상으로 표시합니다(플레이어명 모듈에서 정보를 받아옵니다)",
+-- ["Don't use data from the PlayerNames module at all"] = "플레이어명 모듈을 사용하지 않을 경우 사용할 수 없습니다",
+-- ["Import options"] = "외부 입력 설정",
+-- ["Various ways to import a main's alts from other addons"] = "주캐와 부캐 정보를 다양한 타 애드온으로 부터 외부 입력 받습니다",
+-- ["Don't overwrite existing links"] = "덮어쓰지 않음",
+-- ["Don't overwrite existing alt <-> main links when importing or adding new alts."] = "신규 부캐를 추가하거나 외부 자료 입력시 기존 부캐 <-> 주캐 정보를 덮어쓰지 않습니다",
+-- [".*[Aa]lts?$"] = ".*부[캐케릭]+$",
+-- ["([^%s%p%d%c%z]+)'s alt"] = "^([^%s]+) 부[캐케]+",
+-- ['ERROR: some function sent a blank message!'] = '오류: 몇몇 기능이 공백 문자열로 인한 문제가 발생했습니다!',
+-- ["Alts:"] = "부캐:",
+-- ['Main:'] = "본캐:",
+-- ["No main name supplied to link %s to"] = "%s|1와;과; 연결된 주캐릭터 이름이 없습니다",
+-- ['alt name exists: %s -> %s; not overwriting as set in preferences'] = '부캐릭터 정보 존재: %s -> %s; 설정에 의해 덮어쓰기가 금지되었습니다',
+-- ['warning: alt %s already linked to %s'] = '경고: "%s"|1은;는 이미 "%s"의 부캐릭터로 저장되어 있습니다',
+-- ["linked alt %s => %s"] = "부캐릭터 연결 %s => %s",
+-- ["character removed: %s"] = "캐릭터 정보 삭제: %s",
+-- ['no characters called "%s" found; nothing deleted'] = '"%s"|1은;는; 검색되지 않습니다; 삭제가 불가능합니다',
+-- ['%s total alts linked to mains'] = '총 %s개의 부캐릭터가 저장되어 있습니다',
+-- ['no alts or mains found matching "%s"'] = "%s|1와;과; 일치하는 부캐릭터나 주캐릭터가 존재하지 않습니다",
+-- ["searched for: %s - total matches: %s"] = "검색 결과: %s - 총 일치 결과: %s",
+-- ['LOKWhoIsWho lua file not found, sorry.'] = 'LOKWholsWho lua 파일을 찾을 수 없습니다.',
+-- ["LOKWhoIsWho data not found"] = "LOKWholsWho 자료를 찾을 수 없습니다",
+-- ["%s alts imported from LOKWhoIsWho"] = "%s개의 부캐릭터 정보가 LOKWholsWho로 부터 입력되었습니다",
+-- ['No Guild Greet database found'] = 'Guild Greet 자료를 찾을 수 없습니다',
+-- ['You are not in a guild'] = '길드에 속해 있지 않습니다',
+-- ["guild member alts found and imported: %s"] = "입력된 길드원 부캐릭터 정보: %s개",
+-- ["Fix alts"] = "부캐릭터 정보 수정",
+-- ["Fix corrupted entries in your list of alt names."] = "부캐릭터 목록 상의 오류를 수정합니다.",
+-- ["Class colour"] = "직업 색상",
+-- ["Use class colour (from the PlayerNames module)"] = "직업 색상을 사용합니다 (플레이어명 모듈이 필요합니다)",
+-- ['Show main in tooltip'] = "툴팁에 주캐릭터 표시",
+-- ["Display a player's main name in the tooltip"] = "부캐릭터의 툴팁에 주캐릭터를 표시합니다" ,
+-- ['Show alts in tooltip'] = "툴팁에 부캐릭터 표시",
+-- ["Display a player's alts in the tooltip"] = "주캐릭터의 툴팁에 부캐릭터를 표시합니다",
+-- ["Found alt: %s => main: %s"] = "부캐 검색 결과: %s => 주캐릭터: %s",
+-- ["alt"] = "부캐릭터",
+-- ["main"] = "주캐릭터",
+-- ["Alt"] = "부캐릭터",
+-- ["Main"] = "주캐릭터",
+-- ['no alts found for character '] = "부캐릭터 검색 결과가 없습니다: ",
+-- ['List alts'] = "부캐 목록",
+-- ['List alts for a given character'] = "입력된 캐릭터에 대한 부캐릭터의 목록을 표시합니다",
+-- [' (eg /altnames listalts Fin)'] = "<주캐릭터> (예 /altnames listalts Fin)",
+-- ['%d alts found for %s: %s'] = "%2$s에 대하여 %1$d개의 부캐릭터 검색: %3$s",
+--} end)
+--
+---- Help to translate,Thanks
+---- L[LIB.NEWLOCALE](L"zhCN", function() return {
+---- } end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Start"] = "開端",
+-- ["AltNames"] = "分身名字",
+---- no use anymore ["quiet"] = true,
+-- ["quiet_name"] = "安靜",
+-- ["quiet_desc"] = "是否在聊天視窗中回報。",
+-- ["mainpos_name"] = "本尊名字位置",
+-- ["mainpos_desc"] = "當其他人開分身時要在哪裡顯示本尊名字。",
+-- ["Allows people's alt characters to be linked to their mains, which can then be displayed next to their names when found in chat messages (default=off)."] = "允許分身角色與本尊連結,使得在聊天視窗出現時可顯示本尊名字在其名字旁邊 (預設: 關閉)。",
+-- ["Main name position"] = "本尊名字位置",
+-- [" (eg, /altnames del Personyouthoughtwassomeonesaltbutreallyisnt)"] = "<分身名字> (例: /altnames del Personyouthoughtwassomeonesaltbutreallyisnt)",
+-- ["Where to display a character's main name when on their alt."] = "當其他人開分身時要在哪裡顯示本尊名字。",
+-- ["Left"] = "左",
+-- ["Right"] = "右",
+---- no use anymore ["Disabled"] = true,
+-- ["Find characters"] = "尋找角色",
+-- ["Search the list of linked characters for matching main or alt names."] = "搜尋已連結角色清單的本尊或分身名字。",
+-- [" (eg, /altnames find fin)"] = "<搜尋關鍵> (例: /altnames find fin)",
+-- ["Link alt"] = "連結分身",
+-- ["Link someone's alt character with the name of their main."] = "將某人的分身名字與本尊連結起來。",
+-- ["link (eg, /altnames link Fin Finjathealtoffin)"] = "link <分身名字> <本尊名字> (例: /altnames link Fin Finjathealtoffin)",
+-- ["Delete alt"] = "刪除分身",
+-- ["Delete a character's link to another character as their main."] = "刪除某角色與其本尊名字的連結。",
+-- ["Be quiet"] = "安靜",
+-- ["Whether to report to the chat frame or not."] = "是否在聊天視窗中回報。",
+-- ["You have not yet linked any alts with their mains."] = "你還沒有將任何分身名字與它們的本尊連結起來。",
+---- no use anymore ["no matches found"] = true,
+-- ["List all"] = "列出清單",
+-- ["List all links between alts and their main names."] = "列出所有分身與他們的本尊名字。",
+-- ["Imports data from LOKWhoIsWho, if present (drop your SavedVariables\LOKWhoIsWho.lua in the Prat directory to be able to use this)."] = "如果有的話,從 LOKWhoIsWho 匯入資料 (將你的SavedVariables\LOKWhoIsWho.lua移到Prat目錄下才能使用本功能)。",
+-- ["LOKWhoIsWho import"] = "從 LOKWhoIsWho 匯入",
+-- ["Clear all"] = "全部清除",
+-- ["Clear all links between alts and main names."] = "清除所有分身與本尊名字間的連結。",
+-- ["Colour"] = "顏色",
+-- ["The colour of an alt's main name that will be displayed"] = "本尊名字顯示時的顏色",
+-- ["Import from guild roster"] = "從公會名冊中匯入",
+-- ['Imports alt names from the guild roster by checking for members with the rank "alt" or "alts", or guild / officer notes like "\'s alt"'] = "從公會名冊中根據階級/注釋匯入分身名字。",
+-- ['Import from Guild Greet database'] = "從 Guild Greet 資料庫中匯入",
+-- ['Imports alt names from a Guild Greet database, if present'] = "如果有的話,從 Guild Greet 資料庫中匯入資料。",
+-- ['Use class colour (from the PlayerNames module)'] = "使用職業顏色 (從玩家名字模組)",
+-- ["use class colour of main"] = "使用本尊的職業顏色",
+-- ["use class colour of alt"] = "使用分身的職業顏色",
+-- ["don't use"] = "不用",
+-- ["Display main names in the same colour as that of the main's class (taking the data from the PlayerNames module if it is enabled)"] = "使用本尊的職業顏色顯示本尊名字 (從玩家名字模組)",
+-- ["Display main names in the same colour as that of the alt's class (taking the data from the PlayerNames module if it is enabled)"] = "使用分身的職業顏色顯示本尊名字 (從玩家名字模組)",
+-- ["Don't use data from the PlayerNames module at all"] = "不用玩家名字模組的資料",
+-- ["Import options"] = "匯入選項",
+-- ["Various ways to import a main's alts from other addons"] = "從其他插件匯入本尊-分身連結的方法",
+-- ["Don't overwrite existing links"] = "不覆寫現有的連結",
+-- ["Don't overwrite existing alt <-> main links when importing or adding new alts."] = "當匯入或連結分身時不覆寫現有的本尊-分身連結。",
+-- [".*[Aa]lts?$"] = "分身",
+-- ["(.-)'s? [Aa]lt"] = "(.*)的分身",
+-- ["([^%s%p%d%c%z]+)'s alt"] = "(.*)的分身",
+-- ['ERROR: some function sent a blank message!'] = "錯誤: 空白的訊息!",
+-- ["Alts:"] = "分身:",
+-- ['Main:'] = "本尊:",
+-- ["No main name supplied to link %s to"] = "沒有提供本尊名字連結到%s",
+-- ['alt name exists: %s -> %s; not overwriting as set in preferences'] = "存在分身名字: %s -> %s; 不覆寫",
+-- ['warning: alt %s already linked to %s'] = "警告: %s早已連結到%s",
+-- ["linked alt %s => %s"] = "已連結%s => %s",
+-- ["character removed: %s"] = "角色已移除: %s",
+-- ['no characters called "%s" found; nothing deleted'] = "找不到「%s」; 沒有移除任何東西",
+-- ['%s total alts linked to mains'] = "連結到本尊的分身數目: %s",
+-- ['no alts or mains found matching "%s"'] = "找不到符合「%s」的本尊或分身",
+-- ["searched for: %s - total matches: %s"] = "尋找: %s - 找到: %s",
+-- ['LOKWhoIsWho lua file not found, sorry.'] = "找不到LOKWhoIsWho.lua。",
+-- ["LOKWhoIsWho data not found"] = "在 LOKWhoIsWho 找不到資料",
+-- ["%s alts imported from LOKWhoIsWho"] = "已從 LOKWhoIsWho 匯入%s分身",
+-- ['No Guild Greet database found'] = "找不到 Guild Greet 資料庫",
+-- ['You are not in a guild'] = "你不在任何公會裡",
+-- ["guild member alts found and imported: %s"] = "從公會名冊中匯入的分身: %s",
+-- ["Fix alts"] = "修復分身",
+-- ["Fix corrupted entries in your list of alt names."] = "修復分身名字。",
+-- ["Class colour"] = "職業顏色",
+---- duplicated entry ["Use class colour (from the PlayerNames module)"] = true,
+-- ['Show main in tooltip'] = "在提示訊息顯示本尊",
+-- ["Display a player's main name in the tooltip"] = "在提示訊息顯示本尊名字",
+-- ['Show alts in tooltip'] = "在提示訊息顯示分身",
+-- ["Display a player's alts in the tooltip"] = "在提示訊息顯示分身名字",
+-- ["Found alt: %s => main: %s"] = "找到分身: %s => 本尊: %s",
+---- no use anymore ["alt"] = true,
+---- no use anymore ["main"] = true,
+---- no use anymore ["Alt"] = true,
+---- no use anymore ["Main"] = true,
+-- ['no alts found for character '] = "找不到分身名字的角色: ",
+-- ['List alts'] = "列出分身",
+-- ['List alts for a given character'] = "列出角色的分身",
+-- [' (eg /altnames listalts Fin)'] = "<本尊> (例: /altnames listalts Fin)",
+-- ['%d alts found for %s: %s'] = "找到%d個分身,%s: %s",
+-- ['No arg string given to :addAlt()'] = "addAlt: 空白的參數!",
+--
+--} end)
+
+
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+module.Alts = {}
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = false,
+ quiet = false,
+ pncol = 'no',
+ altidx = {},
+ mainpos = 'RIGHT',
+ colour = {},
+
+ maincolour = '97ff4c', -- fairly light bright green
+ altcolour = 'ff6df2', -- fairly bright light purpley pinkish
+ noclobber = false,
+
+ tooltip_showmain = false,
+ tooltip_showalts = false,
+ },
+ realm = {
+ alts = {},
+ }
+} )
+
+
+
+-- any boolean options
+module.toggleOptions = {
+ quiet,
+ noclobber,
+ tooltip_showmain,
+ tooltip_showalts,
+ }
+
+Prat:SetModuleInit(module,
+ function(self)
+ if self.db.profile.alts then
+ local alts = self.db.profile.alts
+ self.db.profile.alts = nil
+ for k,v in pairs(alts) do
+ self.db.realm.alts[k] = self.db.realm.alts[k] or v
+ end
+ end
+
+ -- define a popup to get the main name
+ StaticPopupDialogs['MENUITEM_LINKALT'] = {
+ -- text = "Who would you like to set as the main character of %s?",
+ text = 'Mainname',
+ button1 = TEXT(ACCEPT),
+ button2 = TEXT(CANCEL),
+ hasEditBox = 1,
+ maxLetters = 24,
+ exclusive = 0,
+
+ OnAccept = function(altname)
+ local editBox = getglobal(this:GetParent():GetName().."EditBox");
+ local mainname = editBox:GetText()
+
+ altname = altname or 'xxx'
+
+ module:addAlt(string.format('%s %s', altname, mainname))
+ end,
+
+ OnShow = function()
+ getglobal(this:GetName().."EditBox"):SetFocus();
+ end,
+
+ OnHide = function()
+ if ( ChatFrameEditBox:IsShown() ) then
+ ChatFrameEditBox:SetFocus();
+ end
+ getglobal(this:GetName().."EditBox"):SetText("");
+ end,
+
+ EditBoxOnEnterPressed = function(altname)
+ local editBox = getglobal(this:GetParent():GetName().."EditBox");
+ local mainname = editBox:GetText()
+
+ altname = altname or 'xxx'
+
+ module:addAlt(string.format('%s %s', altname, mainname))
+
+ this:GetParent():Hide();
+ end,
+
+ EditBoxOnEscapePressed = function()
+ this:GetParent():Hide();
+ end,
+ timeout = 0,
+ whileDead = 1,
+ hideOnEscape = 1
+ }
+ return end)
+
+
+Prat:SetModuleOptions(module, {
+ name = L["AltNames"],
+ desc = L["module_desc"],
+ type = "group",
+ args = {
+-- find = {
+-- name = L["Find characters"],
+-- desc = L["Search the list of linked characters for matching main or alt names."],
+-- type = "text",
+-- usage = L[" (eg, /altnames find fin)"],
+-- order = 110,
+-- set = function(info, q) self:findChars(q) end,
+-- get = false,
+-- },
+--
+-- listalts = {
+-- name = L['List alts'],
+-- desc = L['List alts for a given character'],
+-- type = 'text',
+-- usage = L[' (eg /altnames listalts Fin)'],
+-- order = 115,
+-- set = function(info, m) self:listAlts(m) end,
+-- get = false,
+-- },
+--
+-- link = {
+-- name = L["Link alt"],
+-- desc = L["Link someone's alt character with the name of their main."],
+-- type = "text",
+-- order = 120,
+-- usage = L["link (eg, /altnames link Fin Finjathealtoffin)"],
+-- -- pass = true,
+-- -- set = function(argname, argstr) self:addAlt(argstr) end,
+-- set = function(info, argstr) self:addAlt(argstr) end,
+-- get = false,
+---- alias = { 'new', 'add' },
+-- },
+--
+-- del = {
+-- name = L["Delete alt"],
+-- desc = L["Delete a character's link to another character as their main."],
+-- type = "text",
+-- usage = L[" (eg, /altnames del Personyouthoughtwassomeonesaltbutreallyisnt)"],
+-- order = 130,
+-- set = function(info, altname) self:delAlt(altname) end,
+-- get = false,
+-- confirm = true,
+---- alias = { 'remove', 'unlink' },
+-- },
+
+ quiet = {
+ name = L["Be quiet"],
+ desc = L["Whether to report to the chat frame or not."],
+ type = "toggle",
+ order = 191, -- 19x = options
+
+ },
+
+ listall = {
+ name = L["List all"],
+ desc = L["List all links between alts and their main names."],
+ type = "execute",
+ func = "listAll",
+-- alias = { 'list', 'all' },
+ },
+
+ clearall = {
+ name = L["Clear all"],
+ desc = L["Clear all links between alts and main names."],
+ type = "execute",
+ func = "clearAllAlts",
+ confirm = true,
+ },
+
+ fixalts = {
+ name = L["Fix alts"],
+ desc = L["Fix corrupted entries in your list of alt names."],
+ type = "execute",
+ func = "fixAlts",
+ },
+
+ colour = {
+ name = L["Colour"],
+ get = function(info) return info.handler:getColour() end,
+ set = function(info, nr, ng, nb, na) info.handler.db.profile.colour = { r = nr, g = ng, b = nb, a = na } end,
+ desc = L["The colour of an alt's main name that will be displayed"],
+ type = "color",
+-- alias = 'color',
+ },
+
+ mainpos = {
+ name = L["Main name position"],
+ desc = L["Where to display a character's main name when on their alt."],
+ type = "select",
+ order = 100,
+ get = function(info) return info.handler.db.profile.mainpos end,
+ set = function(info, v) info.handler:setMainPos(v) end,
+ values = {
+ ["LEFT"] = L["Left"],
+ ["RIGHT"] = L["Right"],
+ ["START"] = L["Start"],
+ },
+ },
+
+ tooltip_showmain = {
+ name = L['Show main in tooltip'],
+ desc = L["Display a player's main name in the tooltip"],
+ type = 'toggle',
+ order = 150,
+ get = function(info) return info.handler.db.profile.tooltip_showmain end,
+ set = function(info)
+ info.handler.db.profile.tooltip_showmain = not info.handler.db.profile.tooltip_showmain
+ info.handler.altertooltip = info.handler.db.profile.tooltip_showalts or info.handler.db.profile.tooltip_showmain
+ end,
+
+ },
+
+ tooltip_showalts = {
+ name = L['Show alts in tooltip'],
+ desc = L["Display a player's alts in the tooltip"],
+ type = 'toggle',
+ order = 150,
+ get = function(info) return info.handler.db.profile.tooltip_showalts end,
+ set = function(info)
+ info.handler.db.profile.tooltip_showalts = not info.handler.db.profile.tooltip_showalts
+ info.handler.altertooltip = info.handler.db.profile.tooltip_showalts or info.handler.db.profile.tooltip_showmain
+ end,
+ },
+
+
+ noclobber = {
+ name = L["Don't overwrite existing links"],
+ desc = L["Don't overwrite existing alt <-> main links when importing or adding new alts."],
+ type = "toggle",
+ order = 192, -- 19x = options
+
+ },
+
+-- blankheader = {
+-- order = 499,
+-- type = 'header',
+-- },
+
+ --[[ IMPORT OPTIONS ]]--
+ importheader = {
+ name = L["Import options"],
+ desc = L["Various ways to import a main's alts from other addons"],
+ type = 'header',
+ order = 500,
+ },
+
+ -- imports: LOKWhoIsWho - SavedVariables
+ importfromlok = {
+ name = L["LOKWhoIsWho import"],
+ desc = L["Imports data from LOKWhoIsWho, if present (drop your SavedVariables\LOKWhoIsWho.lua in the Prat directory to be able to use this)."],
+ type = "execute",
+ func = "importFromLOK",
+ confirm = true,
+ order = 510,
+ },
+
+ -- imports: guild roster - officer notes, public notes, ranks
+ guildimport = {
+ name = L["Import from guild roster"],
+ desc = L['Imports alt names from the guild roster by checking for members with the rank "alt" or "alts", or guild / officer notes like "\'s alt"'],
+ type = "execute",
+ func = "importGuildAlts",
+ confirm = true,
+ order = 520,
+ },
+
+ -- imports: guild greet - SavedVariables
+ ggimport = {
+ name = L['Import from Guild Greet database'],
+ desc = L['Imports alt names from a Guild Greet database, if present'],
+ type = 'execute',
+ func = "importGGAlts",
+ confirm = true,
+ order = 530,
+ },
+ }
+ }
+)
+
+-- if Prat:IsModuleActive("PlayerNames") then
+-- self.moduleOptions['args']['pncol'] = {
+-- name = L["Class colour"],
+-- desc = L["Use class colour (from the PlayerNames module)"],
+-- type = "text",
+-- get = function() return self.db.profile.pncol end,
+-- set = function(v) self.db.profile.pncol = v end,
+-- order = 150,
+-- validate = {
+-- ['main'] = L["use class colour of main"],
+-- ['alt'] = L["use class colour of alt"],
+-- ['no'] = L["don't use"],
+-- },
+-- validateDesc = {
+-- ['main'] = L["Display main names in the same colour as that of the main's class (taking the data from the PlayerNames module if it is enabled)"],
+-- ['alt'] = L["Display main names in the same colour as that of the alt's class (taking the data from the PlayerNames module if it is enabled)"],
+-- ['no'] = L["Don't use data from the PlayerNames module at all"],
+-- },
+-- }
+-- end
+--)
+
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+function module:OnModuleEnable()
+ -- much code ripped off from the PlayerMenu code - thanks, and sorry!
+
+ -- things to do when the module is enabled
+ for altname, mainname in pairs(self.db.realm.alts) do
+ self.Alts[altname] = mainname
+ end
+
+ -- PlayerNames colour
+ local pncol = self.db.profile.pncol
+
+ if pncol == 'no' then
+ pncol = false
+ self.db.profile.pncol = false
+ end
+
+ self.db.profile.pncol = self.db.profile.pncol or false
+
+ -- for caching a main's list of alts
+ self.Altlists = {}
+
+ -- just register one area which can be used for anything
+ -- (and only actually has one use at the moment)
+ self.ALTNAMES = ""
+
+ -- set position that main names are displayed in chat messages
+ self:setMainPos(self.db.profile.mainpos)
+
+ -- register events
+ Prat.RegisterChatEvent(self, "Prat_PreAddMessage")
+
+ -- hook functions
+ self.altertooltip = self.db.profile.tooltip_showmain or self.db.profile.tooltip_showalts
+
+ if self.altertooltip then
+ self:SecureHookScript(GameTooltip, 'OnTooltipSetUnit')
+ self:SecureHookScript(GameTooltip, 'OnTooltipCleared')
+ end
+
+ -- hack 'n' slash
+ local slashcmds = {
+ '/altnames',
+ '/alts',
+ '/alt',
+ }
+
+ --Prat:RegisterChatCommand(slashcmds, self.moduleOptions, string.upper("AltNames"))
+
+ --self:SecureHook("UnitPopup_OnClick")
+ self:SecureHook("UnitPopup_ShowMenu")
+
+ -- add the bits to the context menus
+ UnitPopupButtons['LINK_ALT'] = { text = "Set Main", dist = 0, func = function() module:UnitPopup_LinkAltOnClick() end , arg1 = "", arg2 = ""}
+
+ tinsert(UnitPopupMenus['PARTY'], #UnitPopupMenus['PARTY']-1, 'LINK_ALT')
+ tinsert(UnitPopupMenus['FRIEND'], #UnitPopupMenus['FRIEND']-1, 'LINK_ALT')
+ tinsert(UnitPopupMenus['SELF'], #UnitPopupMenus['SELF']-1, 'LINK_ALT')
+ tinsert(UnitPopupMenus['PLAYER'], #UnitPopupMenus['PLAYER']-1, 'LINK_ALT')
+ -- tinsert(UnitPopupMenus['TARGET'], getn(UnitPopupMenus['TARGET'])-1, 'LINK_ALT')
+end
+
+
+function module:UnitPopup_ShowMenu(dropdownMenu, which, unit, name, userData, ...)
+ for i=1, UIDROPDOWNMENU_MAXBUTTONS do
+ button = getglobal("DropDownList"..UIDROPDOWNMENU_MENU_LEVEL.."Button"..i);
+
+ -- Patch our handler function back in
+ if button.value == "LINK_ALT" then
+ button.func = UnitPopupButtons["LINK_ALT"].func
+ end
+ end
+end
+
+function module:UnitPopup_LinkAltOnClick()
+ local dropdownFrame = getglobal(UIDROPDOWNMENU_INIT_MENU)
+
+ --if (button == 'LINK_ALT') then
+ local altname = dropdownFrame.name
+ local dialog = StaticPopup_Show('MENUITEM_LINKALT', altname)
+
+ if dialog then
+ local altname = dropdownFrame.name
+ dialog.data = altname
+ end
+ --end
+end
+
+
+
+-- things to do when the module is disabled
+function module:OnModuleDisable()
+ -- unregister events
+ Prat.UnregisterAllChatEvents(self)
+end
+
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+
+function module:print(msg, printanyway)
+ -- make sure we've got a message
+ if msg == nil then
+ printanyway = true
+ msg = L['ERROR: some function sent a blank message!']
+ end
+
+ local verbose = not self.db.profile.quiet
+
+ if verbose or printanyway then
+ msg = string.format('|cffffd100' .. L['AltNames'] .. ':|r %s', msg)
+ DEFAULT_CHAT_FRAME:AddMessage(msg)
+ end
+end
+
+--[[ colo*u*ring and formatting ]]--
+
+local clrname = function(name, colour)
+ return '|cff' .. (colour or 'ffffff') .. (name or "") .. '|r'
+end
+
+local clrmain = function(mainname, maincolour)
+ mainname = mainname or ""
+ maincolour = maincolour or module.db.profile.maincolour or '8080ff'
+
+ -- 1, 0.9, 0, 0.5, 0.5, 1
+
+ return clrname(mainname, maincolour)
+end
+
+local clralt = function(altname, altcolour)
+ altname = altname or ""
+ altcolour = altcolour or module.db.profile.altcolour or 'ff8080'
+
+ -- 1, 0.7, 0, 1, 0.5, 0.5
+
+ return clrname(altname, altcolour)
+end
+
+local clralts = function(alts, altcolour)
+ if not alts or (type(alts) ~= 'table') or (#alts == 0) then return false end
+
+ for mainname, altname in pairs(alts) do
+ alts[mainname] = clralt(altname)
+ end
+
+ return alts
+end
+
+function module:formatCharName(name)
+ -- format character names as having uppercase first letter followed by all lowercase
+
+ if name == nil then
+ return ""
+ end
+
+ name = name:gsub('[%%%[%]":|%s]', '')
+ name = name:gsub("'", '')
+
+ name = string.lower(name)
+ name = string.gsub(name, "^(%w)", string.upper, 1)
+
+ return name
+end
+
+--[[ alt <-> main link management ]]--
+
+function module:addAlt(argstr)
+ local mainname
+
+ local altname = ""
+ local args = {}
+
+ -- check we've been passed something
+ if (argstr == nil) or (argstr == "") then
+ self:print(L['No arg string given to :addAlt()'])
+ return false
+ end
+
+ -- extract the alt's name and the main name to link to
+ for k, v in argstr:gmatch('%s*(%S+)%s+(.+)') do
+ altname, mainname = k, v
+ end
+
+ -- check we've got a main name to link to
+ if altname and not mainname then
+ altname = argstr
+ self:print(string.format(L["No main name supplied to link %s to"], clralt(altname)), true)
+ return false
+ end
+
+ -- clean up character names
+ mainname = mainname:gsub('%s+$', '')
+ altname = self:formatCharName(altname)
+
+ -- check if alt has already been linked to a main
+ local oldmain = ""
+ local noclobber = self.db.profile.noclobber
+
+ if self.Alts[altname] then
+ oldmain = self.Alts[altname]
+
+ if oldmain == mainname then
+ self:print(string.format(L['warning: alt %s already linked to %s'], clralt(altname), clrmain(mainname)))
+ return false
+ end
+
+ if noclobber then
+ self:print(string.format(L['alt name exists: %s -> %s; not overwriting as set in preferences'], clralt(altname), clrmain(oldmain)))
+ return false
+ end
+
+ self:print(string.format(L['warning: alt %s already linked to %s'], clralt(altname), clrmain(oldmain)))
+ end
+
+ -- add alt to list of alts -> mains
+ self.Alts[altname] = mainname
+ self.db.realm.alts[altname] = mainname
+
+ -- make sure this character's list of alts is rebuilt next time it's needed
+ if self.Altlists[mainname] then self.Altlists[mainname] = nil end
+
+ self:print(string.format(L["linked alt %s => %s"], clralt(altname), clrmain(mainname)))
+end
+
+function module:delAlt(altname)
+ local suppliedaltname = altname
+
+ altname = self:formatCharName(altname)
+
+ if self.Alts[altname] then
+ self.Alts[altname] = nil
+ self.db.realm.alts[altname] = nil
+
+ self:print(string.format(L["character removed: %s"], clralt(suppliedaltname)))
+
+ -- make sure this character's list of alts is rebuilt next time it's needed
+ if self.Altlists[mainname] then self.Altlists[mainname] = nil end
+
+ return true
+ end
+
+ self:print(string.format(L['no characters called "%s" found; nothing deleted'], clralt(suppliedaltname)))
+end
+
+function module:listAll()
+ if not self.db.realm.alts and self.Alts then
+ self:print(L["You have not yet linked any alts with their mains."], true)
+ return false
+ end
+
+ local altcount = 0
+
+ for altname, mainname in pairs(self.Alts) do
+ altcount = altcount + 1
+ self:print(string.format("alt: %s => main: %s", clralt(altname), clrmain(mainname)))
+ end
+
+ self:print(string.format(L['%s total alts linked to mains'], altcount))
+end
+
+function module:findChars(q)
+ local numfound
+
+ local matchhighlight
+
+ if not self.Alts then
+ self:print(L["You have not yet linked any alts with their mains."], true)
+ return false
+ else
+ local matches = {}
+ local numfound = 0
+
+ for altname, mainname in pairs(self.Alts) do
+ local a = string.lower(altname)
+ local m = string.lower(mainname)
+ local pat = string.lower(q)
+
+ -- self:print(string.format("matching against: altname:'%s', mainname:'%s', pat:'%s'", a, m, pat))
+
+ if (a == pat) or (m == pat) or (a:find(pat)) or (m:find(pat)) then
+ matches[altname] = mainname
+ numfound = numfound + 1
+ end
+ end
+
+ if numfound == 0 then
+ self:print(string.format(L['no alts or mains found matching "%s"'], '|cffffb200' .. q .. '|r'), true)
+ else
+ for altname, mainname in pairs(matches) do
+ self:print(string.format(L["Found alt: %s => main: %s"], clralt(altname), clrmain(mainname)))
+ end
+
+ self:print(string.format(L["searched for: %s - total matches: %s"], q, numfound))
+ end
+
+ return numfound
+ end
+end
+
+
+function module:fixAlts()
+ local fixedalts = {}
+
+ for altname, mainname in pairs(self.db.realm.alts) do
+ altname = self:formatCharName(altname)
+ mainname = self:formatCharName(mainname)
+
+ fixedalts[altname] = mainname
+ end
+
+ self.Alts = fixedalts
+ self.db.realm.alts = fixedalts
+end
+
+
+function module:clearAllAlts()
+ self.Alts = {}
+ self.db.realm.alts = {}
+ self.Altlists = {}
+end
+
+
+local CLR = Prat.CLR
+
+function module:setMainPos(pos)
+ -- which item to go after, depending on our position
+ local msgitems = {
+ RIGHT = 'Pp',
+ LEFT = 'Ff',
+ START = nil,
+ }
+
+ pos = pos or 'RIGHT'
+
+ Prat:RegisterMessageItem('ALTNAMES', msgitems[pos])
+
+ if pos == 'RIGHT' then
+ self.padfmt = ' '..CLR:Colorize("ffffff", "(").."%s"..CLR:Colorize("ffffff", ")")
+ else
+ self.padfmt = CLR:Colorize("ffffff", "(").."%s"..CLR:Colorize("ffffff", ")")..' '
+ end
+
+ self.db.profile.mainpos = pos
+end
+
+function module:Prat_PreAddMessage(message, frame, event)
+ local hexcolour = CLR.NONE
+ local mainname = message.PLAYERLINK
+
+ if self.db.profile.on and self.Alts[mainname] then
+ local altname = self.Alts[mainname]
+ local padfmt = self.padfmt or ' (%s)'
+
+
+ if self.db.profile.colour then
+ if self.db.profile.pncol ~= 'no' then
+ local charname
+ local coltype = self.db.profile.pncol
+
+ if coltype == "alt" then
+ charname = mainname
+ elseif coltype == "main" then
+ charname = altname
+ else
+ charname = nil
+ self.db.profile.pncol = 'no'
+ end
+
+ if charname then
+ local class, level, subgroup = Prat_PlayerNames:GetData(charname)
+ if class then
+ hexcolour = Prat_PlayerNames:GetClassColor(class)
+ end
+ end
+ else
+ hexcolour = CLR:GetHexColor(self.db.profile.colour)
+ end
+
+ hexcolour = hexcolour or CLR:GetHexColor(self.db.profile.colour)
+ end
+
+ self.ALTNAMES = string.format(padfmt, CLR:Colorize(hexcolour, altname))
+
+ message.ALTNAMES = self.ALTNAMES
+ end
+end
+
+function module:getColour(r, g, b, a)
+ local col = self.db.profile.colour
+ if not col then return false end
+ return col.r, col.g, col.b, nil
+end
+
+function module:importFromLOK()
+ if not LOKWhoIsWho_Config then
+ self:print(L['LOKWhoIsWho lua file not found, sorry.'])
+ return false
+ end
+
+ local server = GetRealmName()
+ local lokalts = LOKWhoIsWho_Config[server]['players']
+
+ if lokalts == nil then
+ self:print(L["LOKWhoIsWho data not found"])
+ return false
+ end
+
+ local numimported = 0
+
+ for altname, mainname in pairs(lokalts) do
+ self:addAlt(string.format("%s %s", altname, mainname))
+ numimported = numimported + 1
+ end
+
+ self:print(string.format(L["%s alts imported from LOKWhoIsWho"], numimported))
+end
+
+function module:importGGAlts()
+ --[[
+ imports guilds from a Guild Greet database, if present
+ ]]
+ if not GLDG_Data then
+ self:print(L['No Guild Greet database found'])
+ return
+ end
+
+ local servername = GetRealmName()
+ local k, v
+
+ for k, v in pairs(GLDG_Data) do
+ if string.match(k, servername .. ' - %S+') then
+ local name, player
+
+ for name, player in pairs(v) do
+ -- not sure whether this would be useful:
+ -- if player['alt'] and player['alt'] ~= "" and not player['own'] then
+ if player['alt'] and player['alt'] ~= "" then
+ mainname = player['alt']
+ altname = name
+
+ self:addAlt(string.format('%s %s', altname, mainname))
+ end
+ end
+ end
+ end
+end
+
+function module:importGuildAlts(altrank)
+ if altrank == "" then altrank = nil end
+
+ local totalmembers
+
+ totalmembers = GetNumGuildMembers(true)
+
+ if totalmembers == 0 then
+ self:print(L['You are not in a guild'])
+ return
+ end
+
+
+ -- build a list of guild members to check guild notes against later
+ local guildMembers = {}
+
+ for x = 1, totalmembers do
+ local name, rank, rankIndex, level, class, zone, publicnote, officernote, online, status = GetGuildRosterInfo(x)
+ guildMembers[string.lower(name)] = name
+ end
+
+
+ -- loop through members and check stuff for later
+ local mainname
+ local altname
+ local numfound = 0
+
+ for x = 1, totalmembers do
+ altname = nil
+ mainname = nil
+
+ local name, rank, rankIndex, level, class, zone, publicnote, officernote, online, status = GetGuildRosterInfo(x)
+
+ -- yeah I know the vars should be pre-lc'ed and it's not as efficient as it could be below
+ -- ... feel free to clean it up
+
+ -- untested (is there a more convenient trim function available?):
+ --[[
+ officernote = gsub("^%s*", "", officernote)
+ publicnote = gsub("^%s*", "", publicnote)
+ ]]
+
+ officernote = (officernote):match(L["(.-)'s? [Aa]lt"]) or officernote
+ publicnote = (publicnote):match(L["(.-)'s? [Aa]lt"]) or publicnote
+
+ -- check for guild members with rank "alt" or "alts" or "officer alt"
+ if rank:match(L[".*[Aa]lts?$"]) or (altrank and rank == altrank) then
+ -- self:print(string.format('found mainname name for member %s', name))
+ mainname = publicnote
+ -- check whether guild note is an exact match of a member's name
+ elseif guildMembers[publicnote:lower()] then
+ mainname = publicnote
+ elseif guildMembers[officernote:lower()] then
+ mainname = officernote
+ elseif officernote:find(L["([^%s%p%d%c%z]+)'s alt"]) or publicnote:find(L["([^%s%p%d%c%z]+)'s alt"]) then
+ local TempName = officernote:match(L["([^%s%p%d%c%z]+)'s alt"]) or publicnote:match(L["([^%s%p%d%c%z]+)'s alt"])
+ if TempName and guildMembers[string.lower(TempName)] then
+ mainname = TempName
+ end
+ end
+
+ -- set alt name if we've found their main name
+ if mainname and mainname ~= "" then
+ numfound = numfound + 1
+ altname = name
+ self:addAlt(string.format('%s %s', altname, mainname))
+ end
+ end
+
+ self:print(string.format(L["guild member alts found and imported: %s"], numfound))
+end
+
+
+-- function for showing a list of alt names in the tooltip
+function module:getAlts(mainname)
+ -- self.Alts = self.db.profile.altnames
+
+ -- check valid mainname is being passed and that we actually have a list of alts
+ if not (mainname and self.Alts) then return false end
+
+ -- format the character name
+ mainname = self:formatCharName(mainname)
+
+ -- check mainname wasn't just made of invalid characters
+ if mainname == "" then return false end
+
+ -- check we've not already built the list of alts for this character
+ if self.Altlists[mainname] then return self.Altlists[mainname] end
+
+ local alts = {}
+ local allalts = self.Alts
+
+ -- loop through list of alts and build alts table for given mainname
+ for alt, tmpmainname in pairs(allalts) do
+ if mainname == tmpmainname then
+ table.insert(alts, alt)
+ end
+ end
+
+ -- check there we've actually found some alts
+ if #alts == 0 then return false end
+
+ -- cache this list of alts
+ self.Altlists[mainname] = alts
+
+ return alts
+end
+
+
+-- function for showing main names in the tooltip
+function module:getMain(altname)
+ -- self.Alts = self.db.profile.altnames
+
+ -- check for valid alt name being passed and that we actually have a list of alts
+ if not altname and self.Alts then return false end
+
+ -- format the character name
+ altname = self:formatCharName(altname)
+
+ -- check the alt name wasn't just made of invalid character
+ if altname == "" then return false end
+
+ -- check a main exists for the given alt name
+ if not self.Alts[altname] then return false end
+
+ return self.Alts[altname]
+end
+
+
+
+local function nicejoin(t, glue, gluebeforelast)
+ -- check we've got a table
+ if type(t) ~= 'table' then return false end
+
+ local list = {}
+ local index = 1
+
+ -- create a copy of the table with a numerical and no nested tables
+ for i, v in pairs(t) do
+ local vtype = type(v)
+ local item = v
+
+ if vtype ~= 'string' then
+ item = vtype
+ end
+
+ list[index] = item or vtype
+ index = index + 1
+ end
+
+ -- make sure we have some items to join
+ if #list == 0 then
+ return ""
+ end
+
+ -- trying to join one item = that item
+ if #list == 1 then
+ return list[1]
+ end
+
+ -- defaults with which we will want wo woin no that's not going to work
+ -- defaults
+ glue = glue or ', '
+ gluebeforelast = gluebeforelast or ', and '
+
+ -- pop the last value off
+ local last = table.remove(list) or "" -- shouldn't need the ' or ""'?
+
+ -- standard way of joining a list of items together
+ local str = table.concat(list, glue)
+
+ -- return the previous list, but add the last value nicely
+ return str .. gluebeforelast .. last
+end
+
+
+-- displays all alts for a given character as a list rather than seperate matches
+function module:listAlts(mainname)
+ if not mainname then return false end
+
+ mainname = self:formatCharName(mainname)
+
+ if mainname == "" then return false end
+
+ local alts
+
+ alts = self:getAlts(mainname)
+
+ if not alts or (#alts == 0) then
+ self:print(L['no alts found for character '] .. mainname)
+ return
+ else
+ self:print(string.format(L['%d alts found for %s: %s'], #alts, clrmain(mainname), nicejoin(clralts(alts))))
+ return #alts
+ end
+end
+
+
+-- hooked function to show mains and alts if set in preferences
+function module:OnTooltipSetUnit()
+ --[[
+ check:
+
+ . the user wants information about alts or mains on the tooltip
+ . there's a tooltip to alter
+ . we haven't already added anything to the tooltip
+
+ ]]
+ if self.altertooltip and GameTooltip and not self.showingtooltip then
+ -- create lines table for extra information that might be added
+ local lines = {}
+
+ -- check who / what the tooltip's being displayed for
+ local charname, unitid = GameTooltip:GetUnit()
+
+ -- check to see if it's a character
+ if UnitIsPlayer(unitid) then
+ local mainname, alts, tooltipaltered
+
+ -- check if the user wants the mainame name shown on alts' tooltips
+ if self.db.profile.tooltip_showmain then
+ local mainname = self:getMain(charname)
+
+ if mainname then
+ -- add the character's main name to the tooltip
+ GameTooltip:AddDoubleLine(L['Main:'] .. ' ', clrmain(mainname), 1, 0.9, 0, 0.5, 0.5, 1)
+ tooltipaltered = true
+ end
+ end
+
+ -- check if the user wants a list of alts shown on mains' tooltips
+ if self.db.profile.tooltip_showalts then
+ local alts = self:getAlts(charname) or self:getAlts(mainame)
+
+ if alts then
+ -- build the string listing alts
+ local altstr = nicejoin(alts)
+
+ -- add the list of alts to the tooltip
+ GameTooltip:AddDoubleLine(L['Alts:'] .. ' ', clralt(altstr), 1, 0.7, 0, 1, 0.5, 0.5)
+ tooltipaltered = true
+ end
+ end
+
+ if tooltipaltered then
+ GameTooltip:Show()
+ end
+
+ -- make sure we don't add another tooltip
+ self.showingtooltip = true
+ end
+ end
+end
+
+-- got to reset the flag so we know when to readd the lines
+function module:OnTooltipCleared()
+ self.showingtooltip = false
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Buttons.lua b/modules/Buttons.lua
new file mode 100644
index 00000000..2cdc5dc1
--- /dev/null
+++ b/modules/Buttons.lua
@@ -0,0 +1,279 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+--[[
+Name: module
+Revision: $Revision: r24999 $
+Author(s): Fin (fin@instinct.org)
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Clear
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Adds /clear (or /cls) and /clearall (or /clsall) commands for clearing chat frames (default=off).
+Dependencies: Prat
+Credits: Code taken almost entirely from Chatter by Antiarc
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("Buttons")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Buttons"] = true,
+ ["Chat window button options."] = true,
+ ["chatmenu_name"] = "Show Chat Menu",
+ ["chatmenu_desc"] = "Toggles chat menu on and off.",
+ ["Show Arrows"] = true,
+ ["Toggle showing chat arrows for each chat window."] = true,
+ ["Show Chat%d Arrows"] = true,
+ ["Toggles navigation arrows on and off."] = true,
+ ["scrollReminder_name"] = "Show ScrollDown Reminder",
+ ["scrollReminder_desc"] = "Show reminder button when not at the bottom of a chat window.",
+ ["Set Position"] = true,
+ ["Sets position of chat menu and arrows for all chat windows."] = true,
+ ["Default"] = true,
+ ["Right, Inside Frame"] = true,
+ ["Right, Outside Frame"] = true,
+ ["alpha_name"] = "Set Alpha",
+ ["alpha_desc"] = "Sets alpha of chat menu and arrows for all chat windows.",
+})
+
+
+
+
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = false,
+ scrollReminder = true,
+ showButtons = true
+ }
+} )
+
+Prat:SetModuleOptions(module.name, {
+ name = L["Buttons"],
+ desc = L["Chat window button options."],
+ type = "group",
+ args = {
+ showButtons = {
+ name = L["Show Arrows"],
+ desc = L["Toggle showing chat arrows for each chat window."],
+ type = "toggle",
+ order = 100
+ },
+ scrollReminder = {
+ name = L["scrollReminder_name"],
+ desc = L["scrollReminder_desc"],
+ type = "toggle",
+ order = 110
+ },
+ }
+ }
+)
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+local fmt = _G.string.format
+
+
+local function hide(self)
+ if not self.override then
+ self:Hide()
+ end
+ self.override = nil
+end
+
+function module:OnModuleEnable()
+ if not self.db.profile.showButtons then
+ self:HideButtons()
+ end
+
+ local v = self.db.profile.scrollReminder
+ if v then
+ module:EnableBottomButton()
+ elseif self.buttonsEnabled then
+ module:DisableBottomButton()
+ end
+
+ Prat.RegisterChatEvent(self, Prat.Events.POST_ADDMESSAGE)
+
+ --self:RawHook("FCF_SetButtonSide", true)
+end
+
+function module:OnModuleDisable()
+ self:DisableBottomButton()
+ self:ShowButtons()
+
+ Prat.UnregisterAllChatEvents(self)
+end
+
+function module:OnValueChanged(info, b)
+ if info[#info] == "showButtons" then
+ if not self.db.profile.showButtons then
+ self:HideButtons()
+ else
+ self:ShowButtons()
+ end
+ end
+end
+
+function module:HideButtons()
+ ChatFrameMenuButton:Hide()
+ local upButton, downButton, bottomButton
+
+ for name, frame in pairs(Prat.Frames) do
+ upButton = _G[name.."UpButton"]
+ upButton:SetScript("OnShow", hide)
+ upButton:Hide()
+ downButton = _G[name.."DownButton"]
+ downButton:SetScript("OnShow", hide)
+ downButton:Hide()
+ bottomButton = _G[name.."BottomButton"]
+ bottomButton:SetScript("OnShow", hide)
+ bottomButton:Hide()
+-- self:FCF_SetButtonSide(frame)
+ end
+end
+
+function module:ShowButtons()
+-- self:Unhook("FCF_SetButtonSide")
+ ChatFrameMenuButton:Show()
+ local upButton, downButton, bottomButton
+
+ for name, frame in pairs(Prat.Frames) do
+ upButton = _G[name.."UpButton"]
+ upButton:SetScript("OnShow", nil)
+ upButton:Show()
+ downButton = _G[name.."DownButton"]
+ downButton:SetScript("OnShow", nil)
+ downButton:Show()
+ bottomButton = _G[name.."BottomButton"]
+ bottomButton:SetScript("OnShow", nil)
+ bottomButton:Show()
+
+ frame.buttonSide = nil
+ bottomButton:ClearAllPoints()
+ bottomButton:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", -32, -4);
+ FCF_UpdateButtonSide(frame)
+ end
+end
+
+--[[ - - ------------------------------------------------
+ Core Functions
+--------------------------------------------- - ]]--
+
+function module:FCF_SetButtonSide(chatFrame, buttonSide)
+ local f = _G[chatFrame:GetName().."BottomButton"]
+ f:ClearAllPoints()
+ f:SetPoint("TOPRIGHT", chatFrame, "TOPRIGHT", 2, 2)
+end
+
+
+function module:EnableBottomButton()
+ if self.buttonsEnabled then return end
+ self.buttonsEnabled = true
+ for name, f in pairs(Prat.Frames) do
+ self:Hook(f, "ScrollUp", true)
+ self:Hook(f, "ScrollToTop", "ScrollUp", true)
+ self:Hook(f, "PageUp", "ScrollUp", true)
+
+ self:Hook(f, "ScrollDown", true)
+ self:Hook(f, "ScrollToBottom", "ScrollDownForce", true)
+ self:Hook(f, "PageDown", "ScrollDown", true)
+
+ if f:GetCurrentScroll() ~= 0 then
+ local button = _G[name .. "BottomButton"]
+ button.override = true
+ button:Show()
+ end
+ end
+end
+
+function module:DisableBottomButton()
+ if not self.buttonsEnabled then return end
+ self.buttonsEnabled = false
+ for i = 1, NUM_CHAT_WINDOWS do
+ local f = _G["ChatFrame" .. i]
+ if f then
+ self:Unhook(f, "ScrollUp")
+ self:Unhook(f, "ScrollToTop")
+ self:Unhook(f, "PageUp")
+ self:Unhook(f, "ScrollDown")
+ self:Unhook(f, "ScrollToBottom")
+ self:Unhook(f, "PageDown")
+
+ if f ~= COMBATLOG then
+ self:Unhook(f, "AddMessage")
+ end
+ local button = _G["ChatFrame" .. i .. "BottomButton"]
+ button:Hide()
+ end
+ end
+end
+
+function module:ScrollUp(frame)
+ local button = _G[frame:GetName() .. "BottomButton"]
+ button.override = true
+ button:Show()
+end
+
+function module:ScrollDown(frame)
+ if frame:GetCurrentScroll() == 0 then
+ local button = _G[frame:GetName() .. "BottomButton"]
+ button:Hide()
+ end
+end
+
+function module:ScrollDownForce(frame)
+ local button = _G[frame:GetName() .. "BottomButton"]
+ button:Hide()
+end
+
+--function module:AddMessage(frame, text, ...)
+function module:Prat_PostAddMessage(info, message, frame, event, text, r, g, b, id)
+ local button = _G[frame:GetName() .. "BottomButton"]
+ if frame:GetCurrentScroll() > 0 then
+ button.override = true
+ button:Show()
+ else
+ button:Hide()
+ end
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/ChannelColorMemory.lua b/modules/ChannelColorMemory.lua
new file mode 100644
index 00000000..d2132dde
--- /dev/null
+++ b/modules/ChannelColorMemory.lua
@@ -0,0 +1,169 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat modules
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- moduleify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: PratChannelColorMemory
+Revision: $Revision: 82095 $
+Author(s): Sylvanaar (sylvanaar@mindspring.com)
+Inspired by: ConsisTint By Karl Isenberg (AnduinLothar)
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Moduleules#ChannelColorMemory
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Moduleule for Prat that remembers the colors of channels by channel name (default=on).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("ChannelColorMemory")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["ChannelColorMemory"] = true,
+ ["Remembers the colors of each channel name."] = true,
+ ["(%w+)%s?(.*)"] = true,
+})
+
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["ChannelColorMemory"] = "Mémorisation des couleurs des canaux",
+-- ["Remembers the colors of each channel name."] = "M\195\169moriser les couleurs de chaque canal.",
+-- ["(%w+)%s?(.*)"] = "(%w+)%s?(.*)",
+--} end)
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["ChannelColorMemory"] = "频道颜色储存",
+-- ["Remembers the colors of each channel name."] = "还原频道名称的颜色设置",
+-- ["(%w+)%s?(.*)"] = "(.+)%s?(.*)",
+-- } end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["ChannelColorMemory"] = "채널색상기억",
+-- ["Remembers the colors of each channel name."] = "각 채널명의 색상을 기억합니다.",
+-- ["(%w+)%s?(.*)"] = "(.+)%s?(.*)",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["ChannelColorMemory"] = "頻道顏色記憶",
+-- ["Remembers the colors of each channel name."] = "記住每個頻道的顏色設定。",
+-- ["(%w+)%s?(.*)"] = "(.+)%s?(.*)",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["ChannelColorMemory"] = "Memoria de Color de Canal",
+-- ["Remembers the colors of each channel name."] = "Recuerda los colores de los canales por nombre de canal.",
+-- ["(%w+)%s?(.*)"] = "(%w+)%s?(.*)",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["ChannelColorMemory"] = "Kanal Farben Merken",
+-- ["Remembers the colors of each channel name."] = "Merkt sich die Farben von jedem Kanal Namen.",
+-- ["(%w+)%s?(.*)"] = "(%w+)%s?(.*)",
+--} end)
+
+local module = Prat:NewModule(PRAT_MODULE, "AceEvent-3.0")
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ colors = {},
+ }
+} )
+
+Prat:SetModuleOptions(module.name, {
+ name = L["ChannelColorMemory"],
+ desc = L["Remembers the colors of each channel name."],
+ type = "group",
+ args = {
+ info = {
+ name = "This module remembers what color you give to a channel with a particular name, so that if you rejoin the channel, no matter what number it is, it will always have the same color.",
+ type = "description",
+ }
+ }
+ }
+)
+
+--[[------------------------------------------------
+ Moduleule Event Functions
+------------------------------------------------]]--
+
+-- things to do when the moduleule is enabled
+function module:OnModuleEnable()
+ self:RegisterEvent("UPDATE_CHAT_COLOR")
+ self:RegisterEvent("CHAT_MSG_CHANNEL_NOTICE")
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+function module:UPDATE_CHAT_COLOR(evt, ChatType, cr,cg,cb)
+ if (ChatType) then
+ local number = ChatType:match("CHANNEL(%d+)")
+ if ( number ) then
+ local _, name = GetChannelName(number);
+ if ( name ) then
+ local name, zoneSuffix = name:match(L["(%w+)%s?(.*)"]);
+ local color = self.db.profile.colors[name];
+ if (not color) then
+ self.db.profile.colors[name] = {r=cr, g=cg, b=cb};
+ else
+ color.r=cr
+ color.g=cg
+ color.b=cb
+ end
+ end
+ end
+ end
+end
+
+function module:CHAT_MSG_CHANNEL_NOTICE(evt, NoticeType, Sender, Language, LongName, Target, Flags, Unknown, number, cname, unknown, counter)
+ if number == nil then
+ return
+ elseif (NoticeType == "YOU_JOINED") then
+ local color = self.db.profile.colors[cname];
+ if (color) then
+ ChangeChatColor("CHANNEL"..number, color.r, color.g, color.b);
+ else
+ color = ChatTypeInfo["CHANNEL"..number];
+ self.db.profile.colors[cname] = {r=color.r, g=color.g, b=color.b};
+ end
+ elseif (NoticeType == "YOU_LEFT") then
+ local color = self.db.profile.colors[cname];
+ if (color) then
+ ChangeChatColor("CHANNEL"..number, 1.0, 0.75, 0.75);
+ end
+ end
+end
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/ChannelNames.lua b/modules/ChannelNames.lua
new file mode 100644
index 00000000..adbb5cd5
--- /dev/null
+++ b/modules/ChannelNames.lua
@@ -0,0 +1,767 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratChannelNames
+Revision: $Revision: 80975 $
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+ Sylvanaar (sylvanaar@mindspring.com)
+Inspired by: idChat2_ChannelNames by Industrial
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#ChannelNames
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that options for replacing channel names with abbreviations.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("ChannelNames")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+-- define localized strings
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["ChannelNames"] = true,
+ ["Channel name abbreviation options."] = true,
+ ["Replace"] = true,
+ ["Toggle replacing this channel."] = true,
+ ["Blank"] = true,
+ ["Dont display the channel/chat type name"] = true,
+ ["Set"] = true,
+ ["Channel %d"] = true,
+ ["%s settings."] = true,
+ ["Use a custom replacement for the chat %s text."] = true,
+
+ ["channelnick_name"] = "Channel Abbreviations",
+ ["channelnick_desc"] = "Channel Abbreviations",
+
+ ["Add Channel Abbreviation"] = true,
+ ["addnick_desc"] = "Adds an abbreviated channel name. Prefix the name with '#' to include the channel number. (e.g. '#Trade').",
+ ["Remove Channel Abbreviation"] = true,
+ ["Removes an an abbreviated channel name."] = true,
+ ["Clear Channel Abbreviation"] = true,
+ ["Clears an abbreviated channel name."] = true,
+
+ ["otheropts_name"] = "Other Options",
+ ["otheropts_desc"] = "Additional channel formating options, and channel link controls.",
+
+ ["space_name"] = "Show Space",
+ ["space_desc"] = "Toggle adding space after channel replacement.",
+ ["colon_name"] = "Show Colon",
+ ["colon_desc"] = "Toggle adding colon after channel replacement.",
+
+ ["chanlink_name"] = "Create Channel Link",
+ ["chanlink_desc"] = "Make the channel a clickable link which opens chat to that channel.",
+
+ [""] = true,
+})
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["ChannelNames"] = "Kanal Name",
+-- ["Channel name abbreviation options."] = "Kanal Namen Abk\195\188rzungsoptionen.",
+-- ["Replace"] = "Ersetze",
+-- ["Toggle replacing this channel."] = "Schaltet das ersetzen dieses Kannals ein.",
+-- ["Blank"] = "Aus",
+-- ["Dont display the channel/chat type name"] = "Schaltet diesen Kanal aus.",
+-- ["Set"] = "Einstellen",
+-- ["Channel %d"] = "Kanal %d",
+-- ["%s settings."] = "%s Einstellungen.",
+-- ["Use a custom replacement for the chat %s text."] = "Benutze eigenen Namen f\195\188r den Chat %s Text.",
+-- ["space_name"] = "Zeige Leerstelle",
+-- ["space_desc"] = "Aktiviere eine zus\195\164tzliche Leerstelle nach dem eigenen Kanalnamen.",
+-- ["colon_name"] = "Zeige Doppelpunkt",
+-- ["colon_desc"] = "Aktiviere das hinzuf\195\188gen eines Doppelpunkts nach dem eigenen Kanalnamen.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["ChannelNames"] = "Nombres de Canal",
+-- ["Channel name abbreviation options."] = "Opciones de abreviaci\195\179n de los nombres de canal",
+-- ["Replace"] = "Reemplazar",
+-- ["Toggle replacing this channel."] = "Determina si se reemplaza este canal",
+-- ["Blank"] = "Desactivar",
+-- ["Dont display the channel/chat type name"] = "Desactivar este canal",
+-- ["Set"] = "Establecer",
+-- ["Channel %d"] = "Canal %d",
+-- ["%s settings."] = "Ajustes de %s",
+-- ["Use a custom replacement for the chat %s text."] = "Usa un recambio personalizado para el texto del chat %s",
+-- ["space_name"] = "Mostrar Espacio",
+-- ["space_desc"] = "Determina si se a\195\177ade un espacio despu\195\169s del recambio de canal.",
+-- ["colon_name"] = "Mostrar los Dos Puntos",
+-- ["colon_desc"] = "Determina si se a\195\177aden los dos puntos despu\195\169s del recambio de canal.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["ChannelNames"] = "채널명",
+-- ["Channel name abbreviation options."] = "채널명 생략 설정입니다.",
+-- ["Replace"] = "변경",
+-- ["Toggle replacing this channel."] = "해당 채널을 변경합니다.",
+-- ["Blank"] = "공백",
+-- ["Dont display the channel/chat type name"] = "채널명/대화 종류명을 표시하지 않습니다.",
+-- ["Set"] = "설정",
+-- ["Channel %d"] = "채널 %d",
+-- ["%s settings."] = "%s 설정입니다.",
+-- ["Use a custom replacement for the chat %s text."] = "%s 대화에 사용자 정의로 변경합니다.",
+--
+-- ["Add Channel Abbreviation"] = "채널 단축 추가",
+-- ["addnick_desc"] = "단축된 채널명을 추가합니다.",
+-- ["Remove Channel Abbreviation"] = "채널 단축 제거",
+-- ["Removes an an abbreviated channel name."] = "단축된 채널명을 제거합니다.",
+-- ["Clear Channel Abbreviation"] = "채널 단축 초기화",
+-- ["Clears an abbreviated channel name."] = "단축된 채널명을 초기화합니다.",
+--
+-- ["space_name"] = "간격 표시",
+-- ["space_desc"] = "채널 변경 후 간격을 추가합니다.",
+-- ["colon_name"] = "콜론 표시",
+-- ["colon_desc"] = "채널 변경 후 콜론을 추가합니다.",
+--
+-- ["chanlink_name"] = "채널 링크 생성",
+-- ["chanlink_desc"] = "해당 채널에 대화창을 여는 클릭 가능한 채널 링크를 생성합니다.",
+--
+-- [""] = "<문자열>",
+--} end)
+--
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--local PratCNlocal = GetLocale()
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["ChannelNames"] = "频道名称",
+-- ["Channel name abbreviation options."] = "频道名称缩写选项。",
+-- ["Replace"] = "替换",
+-- ["Toggle replacing this channel."] = "替换频道。",
+-- ["Blank"] = "关闭",
+-- ["Dont display the channel/chat type name"] = "关闭此频道。",
+-- ["Set"] = "设置",
+-- ["Channel %d"] = "频道 %d",
+-- ["%s settings."] = "%s 设置。",
+-- ["Use a custom replacement for the chat %s text."] = "自定义替换此聊天 %s 文本。",
+--
+-- ["Add Channel Abbreviation"] = "增加频道缩写",
+-- ["addnick_desc"] = "增加频道名称缩写。",
+-- ["Remove Channel Abbreviation"] = "移除频道缩写",
+-- ["Removes an an abbreviated channel name."] = "移除频道缩写名称。",
+-- ["Clear Channel Abbreviation"] = "清除频道缩写",
+-- ["Clears an abbreviated channel name."] = "清除频道缩写名称。",
+--
+-- ["space_name"] = "显示间隔",
+-- ["space_desc"] = "切换频道替换后增加间隔空间。",
+-- ["colon_name"] = "显示冒号",
+-- ["colon_desc"] = "切换频道替换后增加冒号。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["ChannelNames"] = "頻道名稱",
+-- ["Channel name abbreviation options."] = "頻道名稱縮寫選項。",
+-- ["Replace"] = "替換",
+-- ["Toggle replacing this channel."] = "替換頻道名稱。",
+-- ["Blank"] = "空白",
+-- ["Dont display the channel/chat type name"] = "不顯示頻道名稱。",
+---- no use anymore ["Set"] = true,
+-- ["Channel %d"] = "頻道%d",
+-- ["%s settings."] = "%s設定。",
+-- ["Use a custom replacement for the chat %s text."] = "自定義替換聊天頻道 (%s) 名稱。",
+--
+-- ["Add Channel Abbreviation"] = "增加頻道縮寫",
+-- ["addnick_desc"] = "增加頻道名稱縮寫。",
+-- ["Remove Channel Abbreviation"] = "移除頻道縮寫",
+-- ["Removes an an abbreviated channel name."] = "移除頻道名稱縮寫。",
+---- no use anymore ["Clear Channel Abbreviation"] = true,
+---- no use anymore ["Clears an abbreviated channel name."] = true,
+--
+-- ["space_name"] = "顯示空白間隔",
+-- ["space_desc"] = "切換頻道替換後增加空白間隔空間。",
+-- ["colon_name"] = "顯示冒號",
+-- ["colon_desc"] = "切換頻道替換後增加冒號。",
+--
+-- ["chanlink_name"] = "創建頻道連結",
+-- ["chanlink_desc"] = "使用戶可點選頻道名稱直接在此頻道上聊天。",
+--
+-- [""] = "<字串>",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["ChannelNames"] = "Noms des canaux",
+-- ["Channel name abbreviation options."] = "Options pour abbr\195\169ger les noms des canaux.",
+-- ["Replace"] = "Remplacer",
+-- ["Toggle replacing this channel."] = "Active/d\195\169sactive le remplacement pour ce canal.",
+-- ["Blank"] = "D\195\169sactiv\195\169",
+-- ["Dont display the channel/chat type name"] = "D\195\169sactiver ce canal.",
+-- ["Set"] = "Set",
+-- ["Channel %d"] = "Canal %d",
+-- ["%s settings."] = "R\195\169glages %s",
+-- ["Use a custom replacement for the chat %s text."] = "Utiliser un remplacement personnalis\195\169 pour le texte du chat %s.",
+-- ["space_name"] = "Afficher une espace",
+-- ["space_desc"] = "Ajoute ou non une espace après le nom remplac\195\169.",
+-- ["colon_name"] = "Afficher \":\"",
+-- ["colon_desc"] = "Ajoute ou non \":\" après le nom remplac\195\169.",
+--} end)
+
+-- order to show channels
+local orderMap = {
+ "say",
+ "whisper",
+ "whisperincome",
+ "yell",
+ "party",
+ "guild",
+ "officer",
+ "raid",
+ "raidleader",
+ "raidwarning",
+ "battleground",
+ "battlegroundleader",
+}
+
+-- Look Up Our Settings Key event..message.CHANNUM
+local eventMap = {
+ CHAT_MSG_CHANNEL1 = "channel1",
+ CHAT_MSG_CHANNEL2 = "channel2",
+ CHAT_MSG_CHANNEL3 = "channel3",
+ CHAT_MSG_CHANNEL4 = "channel4",
+ CHAT_MSG_CHANNEL5 = "channel5",
+ CHAT_MSG_CHANNEL6 = "channel6",
+ CHAT_MSG_CHANNEL7 = "channel7",
+ CHAT_MSG_CHANNEL8 = "channel8",
+ CHAT_MSG_CHANNEL9 = "channel9",
+ CHAT_MSG_CHANNEL10 = "channel10",
+ CHAT_MSG_SAY = "say",
+ CHAT_MSG_GUILD = "guild",
+ CHAT_MSG_WHISPER = "whisperincome",
+ CHAT_MSG_WHISPER_INFORM = "whisper",
+ CHAT_MSG_YELL = "yell",
+ CHAT_MSG_PARTY = "party",
+ CHAT_MSG_OFFICER = "officer",
+ CHAT_MSG_RAID = "raid",
+ CHAT_MSG_RAID_LEADER = "raidleader",
+ CHAT_MSG_RAID_WARNING = "raidwarning",
+ CHAT_MSG_BATTLEGROUND = "battleground",
+ CHAT_MSG_BATTLEGROUND_LEADER = "battlegroundleader",
+}
+
+local module = Prat:NewModule(PRAT_MODULE, "AceEvent-3.0", "AceTimer-3.0")
+
+local CLR = Prat.CLR
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ space = true,
+ colon = true,
+ chanlink = true,
+ replace = {
+ say = true,
+ whisper = true,
+ whisperincome = true,
+ yell = true,
+ party = true,
+ guild = true,
+ officer = true,
+ raid = true,
+ raidleader = true,
+ raidwarning = true,
+ battleground = true,
+ battlegroundleader = true,
+ channel1 = true,
+ channel2 = true,
+ channel3 = true,
+ channel4 = true,
+ channel5 = true,
+ channel6 = true,
+ channel7 = true,
+ channel8 = true,
+ channel9 = true,
+ channel10 = true,
+ },
+ chanSave = {},
+ shortnames =
+ -- zhCN
+ PratCNlocal == "zhCN" and {
+ say = "[说]",
+ whisper = "[密]",
+ whisperincome = "[收]",
+ yell = "[喊]",
+ party = "[队]",
+ guild = "[会]",
+ officer = "[管]",
+ raid = "[团]",
+ raidleader = "[酱]",
+ raidwarning = "[警]",
+ battleground = "[战]",
+ battlegroundleader = "[蟀]",
+ channel1 = "[1]",
+ channel2 = "[2]",
+ channel3 = "[3]",
+ channel4 = "[4]",
+ channel5 = "[5]",
+ channel6 = "[6]",
+ channel7 = "[7]",
+ channel8 = "[8]",
+ channel9 = "[9]",
+ channel10 = "[10]",
+ }
+ --zhTW
+ or PratCNlocal == "zhTW" and {
+ say = "[說]",
+ whisper = "[密]",
+ whisperincome = "[聽]",
+ yell = "[喊]",
+ party = "[隊]",
+ guild = "[會]",
+ officer = "[官]",
+ raid = "[團]",
+ raidleader = "[團長]",
+ raidwarning = "[警]",
+ battleground = "[戰]",
+ battlegroundleader = "[戰領]",
+ channel1 = "[1]",
+ channel2 = "[2]",
+ channel3 = "[3]",
+ channel4 = "[4]",
+ channel5 = "[5]",
+ channel6 = "[6]",
+ channel7 = "[7]",
+ channel8 = "[8]",
+ channel9 = "[9]",
+ channel10 = "[10]",
+ }
+ --koKR
+ or PratCNlocal == "koKR" and {
+ say = "[대화]",
+ whisper = "[귓말]",
+ whisperincome = "[받은귓말]",
+ yell = "[외침]",
+ party = "[파티]",
+ guild = "[길드]",
+ officer = "[오피서]",
+ raid = "[공대]",
+ raidleader = "[공대장]",
+ raidwarning = "[공대경보]",
+ battleground = "[전장]",
+ battlegroundleader = "[전투대장]",
+ channel1 = "[1]",
+ channel2 = "[2]",
+ channel3 = "[3]",
+ channel4 = "[4]",
+ channel5 = "[5]",
+ channel6 = "[6]",
+ channel7 = "[7]",
+ channel8 = "[8]",
+ channel9 = "[9]",
+ channel10 = "[10]",
+ }
+ --Other
+ or {
+ say = "[S]",
+ whisper = "[W To]",
+ whisperincome = "[W From]",
+ yell = "[Y]",
+ party = "[P]",
+ guild = "[G]",
+ officer = "[O]",
+ raid = "[R]",
+ raidleader = "[RL]",
+ raidwarning = "[RW]",
+ battleground = "[B]",
+ battlegroundleader = "[BL]",
+ channel1 = "[1]",
+ channel2 = "[2]",
+ channel3 = "[3]",
+ channel4 = "[4]",
+ channel5 = "[5]",
+ channel6 = "[6]",
+ channel7 = "[7]",
+ channel8 = "[8]",
+ channel9 = "[9]",
+ channel10 = "[10]",
+ },
+
+ nickname = {}
+ }
+})
+
+
+
+local eventPlugins = { types={}, channels={} }
+local nickPlugins = { nicks={} }
+
+---module.toggleOptions = { optsep227_sep = 227, optsep_sep = 229, space = 230, colon = 240, sep241_sep = 241, chanlink = 242 }
+Prat:SetModuleOptions(module.name, {
+ name = L["ChannelNames"],
+ desc = L["Channel name abbreviation options."],
+ type = "group",
+ childGroups = "tab",
+ args = {
+ etypes = {
+ name = L["ChannelNames"],
+ desc = L["Channel name abbreviation options."],
+ type = "group",
+-- inline = true,
+ order = 1,
+ plugins= eventPlugins,
+ args = {}
+ },
+ ntypes = {
+ name = L["channelnick_name"],
+ desc = L["channelnick_desc"],
+ order = 2,
+-- inline = true,
+ type = "group",
+ plugins = nickPlugins,
+ args = {}
+ },
+ ctypes = {
+ name = L["otheropts_name"],
+ desc = L["otheropts_desc"],
+ order = 3,
+ type = "group",
+ args = {
+ chanlink = {
+ name = L["chanlink_name"],
+ desc = L["chanlink_desc"],
+ type = "toggle", },
+ space = {
+ name = L["space_name"],
+ desc = L["space_desc"],
+ type = "toggle", },
+ colon = {
+ name = L["colon_name"],
+ desc = L["colon_desc"],
+ type = "toggle", },
+ }
+ },
+ }
+})
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+function module:OnModuleEnable()
+ self:BuildChannelOptions()
+ self:RegisterEvent("UPDATE_CHAT_COLOR")
+
+ Prat.RegisterChatEvent(self, "Prat_PreAddMessage")
+
+ Prat.RegisterLinkType( { linkid="channel", linkfunc=module.Chan_Link, handler=module }, module.name )
+ Prat.RegisterLinkType( { linkid="chattyp", linkfunc=module.Chat_Link, handler=module }, module.name )
+
+-- Possible fix for channel messages not getting formatted
+-- Prat:EnableProcessingForEvent("CHAT_MSG_CHANNEL_NOTICE")
+-- Prat:EnableProcessingForEvent("CHAT_MSG_CHANNEL_NOTICE_USER")
+-- Prat:EnableProcessingForEvent("CHAT_MSG_CHANNEL_LEAVE")
+-- Prat:EnableProcessingForEvent("CHAT_MSG_CHANNEL_JOIN")
+end
+
+function module:OnModuleDisable()
+ self:UnregisterAllEvents()
+ Prat.UnregisterAllChatEvents(self)
+end
+
+
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+-- rebuild menu if chat colors change
+function module:UPDATE_CHAT_COLOR()
+ self:ScheduleTimer("RefreshOptions", 1)
+end
+
+function module:RefreshOptions()
+ LibStub("AceConfigRegistry-3.0"):NotifyChange("Prat")
+end
+
+
+
+
+function module:Chan_Link(link, text, button, ...)
+ if self.db.profile.chanlink then
+ local chan = strsub(link, 9)
+
+ local cf = SELECTED_CHAT_FRAME
+ local editBox = cf.editBox
+
+ editBox:SetAttribute("channelTarget", chan);
+ editBox:SetAttribute("chatType", "CHANNEL");
+
+ if ( not cf.editBox:IsShown() ) then
+ ChatFrame_OpenChat("", cf);
+ else
+ ChatEdit_UpdateHeader(editBox);
+ end
+
+ return false
+ end
+
+ return true
+end
+
+
+function module:Chat_Link(link, text, button, ...)
+ if self.db.profile.chanlink then
+ local ctype = strsub(link, 9)
+
+ local cf = SELECTED_CHAT_FRAME
+ local editBox = cf.editBox
+
+ editBox:SetAttribute("chatType", ctype);
+
+ if ( not cf.editBox:IsShown() ) then
+ ChatFrame_OpenChat("", cf);
+ else
+ ChatEdit_UpdateHeader(editBox);
+ end
+
+ return false
+ end
+
+ return true
+end
+
+
+function module:AddNickname(info, name)
+ self.db.profile.nickname[info[#info-1]] = name
+end
+
+function module:RemoveNickname(info, name)
+ if self.db.profile.nickname[info[#info-1]] then
+ self.db.profile.nickname[info[#info-1]] = nil
+ end
+end
+function module:GetNickname(info)
+ return self.db.profile.nickname[info[#info-1]]
+end
+function module:NotGetNickname(info)
+ return (self:GetNickname(info) == nil) and true or false
+end
+
+
+function module:MakeChan_Link(message)
+ local prof = self.db.profile
+ local cnum = message.ORG.CHANNELNUM
+
+ if prof.chanlink then
+ message.CHANLINK = nil
+
+ if type(cnum) == "number" or tonumber(cnum) then
+ message.CHANLINK = "channel:"..tostring(cnum)
+ elseif not message.CHATTYPE:find("WHISPER") then
+ message.CHANLINK = "chattyp:"..message.CHATTYPE
+ end
+
+ if message.CHANLINK then
+ message.nN = "|H"
+ message.NN = "|h"
+ message.Nn = "|h"
+ end
+ end
+end
+
+-- replace text using prat event implementation
+function module:Prat_PreAddMessage(arg, message, frame, event)
+ if message.TYPEPREFIX and message.TYPEPOSTFIX then
+ local cfg = eventMap[event..(message.CHANNELNUM or "")]
+ if self.db.profile.nickname[message.CHANNEL] then
+ message.CHANNEL = self.db.profile.nickname[message.CHANNEL]
+ if message.CHANNEL:sub(1,1) == "#" then
+ message.CHANNEL=message.CHANNEL:sub(2)
+ else
+ message.CHANNELNUM, message.CC = "", ""
+ end
+ self:MakeChan_Link(message, event)
+ elseif self.db.profile.replace[cfg] then
+ message.cC , message.CHANNELNUM, message.CC, message.CHANNEL, message.Cc = "","","","",""
+-- local space = self.db.profile.space and " " or ""
+ local space = self.db.profile.space and self.db.profile.shortnames[cfg] and self.db.profile.shortnames[cfg] ~= "" and " " or ""
+ local colon = self.db.profile.colon and ":" or ""
+ message.TYPEPREFIX = self.db.profile.shortnames[cfg] or ""
+
+ if message.TYPEPREFIX:len() > 0 then
+ self:MakeChan_Link(message)
+ end
+
+ message.TYPEPREFIX = message.TYPEPREFIX..space
+
+ if message.PLAYERLINK and strlen(message.PLAYERLINK) > 0 or strlen(message.TYPEPREFIX) > 0 then
+ message.TYPEPOSTFIX = colon.."\32"
+ else
+ message.TYPEPOSTFIX = ""
+ end
+ end
+ end
+end
+
+--[[------------------------------------------------
+ Menu Builder Functions
+------------------------------------------------]]--
+
+function module:BuildChannelOptions()
+ for _, v in ipairs(orderMap) do
+ self:CreateTypeOption(eventPlugins["types"], v)
+ end
+ for i=1,10 do
+ self:CreateChannelOption(eventPlugins["channels"], "channel"..i, i)
+ end
+
+ for _, v in ipairs(DEFAULT_CHAT_FRAME.channelList) do
+ self:CreateChanNickOption(nickPlugins["nicks"], v)
+ end
+
+end
+function module:CreateChanNickOption(args, keyname)
+ local text = keyname
+ local name = keyname
+ args[name] = args[name] or {
+ name = text,
+ desc = string.format(L["%s settings."], text),
+ type = "group",
+ order = 228,
+ args = {
+ addnick = {
+ name = L["Add Channel Abbreviation"],
+ desc = L["addnick_desc"],
+ type = "input",
+ order = 140,
+ usage = "",
+ get = "GetNickname",
+ set = "AddNickname",
+ },
+ removenick = {
+ name = L["Remove Channel Abbreviation"],
+ desc = L["Removes an an abbreviated channel name."],
+ type = "execute",
+ order = 150,
+ func = "RemoveNickname",
+ disabled = "NotGetNickname";
+ },
+ }
+ }
+end
+
+function module:GetChanOptValue(info, ...)
+ return self.db.profile[info[#info]][info[#info-1]]
+end
+
+function module:SetChanOptValue(info, val, ...)
+ self.db.profile[info[#info]][info[#info-1]] = val
+end
+
+do
+ local function revLookup(keyname)
+ for k,v in pairs(eventMap) do
+ if keyname == v then
+ return k
+ end
+ end
+ end
+
+ local function GetChatCLR(name)
+ local type = strsub(name, 10);
+ local info = ChatTypeInfo[type];
+ if not info then
+ return CLR.COLOR_NONE
+ end
+ return CLR:GetHexColor(info)
+ end
+
+ local function ChatType(text, type) return CLR:Colorize(GetChatCLR(type), text) end
+
+
+ local optionGroup = {
+ type = "group",
+ name = function(info) return ChatType(_G[revLookup(info[#info])], revLookup(info[#info])) end,
+ desc = function(info) return (L["%s settings."]):format(_G[revLookup(info[#info])]) end,
+ get = "GetChanOptValue",
+ set = "SetChanOptValue",
+ args = {
+ shortnames = {
+ name = function(info) return ChatType(_G[revLookup(info[#info-1])], revLookup(info[#info-1])) end,
+ desc = function(info) return (L["Use a custom replacement for the chat %s text."]):format(ChatType(_G[revLookup(info[#info-1])], revLookup(info[#info-1]))) end,
+ order = 1,
+ type = "input",
+ usage = L[""],
+ },
+ replace = {
+ name = L["Replace"],
+ desc = L["Toggle replacing this channel."],
+ type = "toggle",
+ order = 3,
+ },
+ }
+ }
+
+ local optionGroupChan = {
+ type = "group",
+ name = function(info) return ChatType((L["Channel %d"]):format(info[#info]:sub(-1)), revLookup(info[#info])) end,
+ desc = function(info) return (L["%s settings."]):format(ChatType((L["Channel %d"]):format(info[#info]:sub(-1)), revLookup(info[#info]))) end,
+ get = "GetChanOptValue",
+ set = "SetChanOptValue",
+ order = function(info) return 200+tonumber(info[#info]:sub(-1)) end,
+ args = {
+ shortnames = {
+ name = function(info) return ChatType((L["Channel %d"]):format(info[#info-1]:sub(-1)), revLookup(info[#info-1])) end,
+ desc = function(info) return (L["Use a custom replacement for the chat %s text."]):format(ChatType((L["Channel %d"]):format(info[#info-1]:sub(-1)), revLookup(info[#info-1]))) end,
+ order = 1,
+ type = "input",
+ usage = L[""],
+ },
+ replace = {
+ name = L["Replace"],
+ desc = L["Toggle replacing this channel."],
+ type = "toggle",
+ order = 3,
+ },
+ }
+ }
+
+ function module:CreateTypeOption(args, keyname)
+ if not args[keyname] then
+ args[keyname] = optionGroup
+ end
+ end
+
+ function module:CreateChannelOption(args, keyname, keynum)
+ if not args[keyname] then
+ args[keyname] = optionGroupChan
+ end
+ end
+end
+
+
+
+
+ return
+end ) -- Prat:AddModuleToLoad
diff --git a/modules/ChannelSticky.lua b/modules/ChannelSticky.lua
new file mode 100644
index 00000000..9712c21d
--- /dev/null
+++ b/modules/ChannelSticky.lua
@@ -0,0 +1,437 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratChannelSticky
+Revision: $Revision: 80710 $
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+ Sylvanaar (sylvanaar@mindspring.com)
+Inspired by: idChat2_StickyChannels by Industrial
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#ChannelSticky
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that toggles sticky of different chat channel types on and off (default=on).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("ChannelSticky")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["ChannelSticky"] = true,
+ ["Chat channel sticky options."] = true,
+ ["ChatType"] = true,
+ ["Per chat type options."] = true,
+ ["Channel"] = true,
+ ["Sticky %s"] = true,
+ ["Toggles sticky on and off for %s."] = true,
+ ["smartgroup_name"] = "Smart Groups",
+ ["smartgroup_desc"] = "Adds a /gr command which automatically picks the correct type of chat, RAID, PARTY, or BATTLEGROUND",
+ ["Sticky Per Chat Frame"] = true,
+ ["Toggle remembering the chat type last used per chat frame."] = true,
+})
+
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["ChannelSticky"] = "Persistance des canaux",
+-- ["Chat channel sticky options."] = "Options de persistance de canal.",
+-- ["ChatType"] = "Type de chat",
+-- ["Per chat type options."] = "Options par type de chat",
+-- ["Channel"] = "Canal",
+-- ["Sticky %s"] = "Persistance %s",
+-- ["Toggles sticky on and off for %s."] = "Active ou d\195\169sactive la persistance pour %s.",
+-- ["Sticky Per Chat Frame"] = "Persistance par fen\195\170tre de chat",
+-- ["Toggle remembering the chat type last used per chat frame."] = "Active/d\195\169sactive le type de chat utilis\195\169 la dernière fois pour chaque fen\195\170tre.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["ChannelSticky"] = "Haftende Kanäle",
+-- ["Chat channel sticky options."] = "Haftende Chatkanäle Optionen",
+-- ["ChatType"] = "Chat Typ",
+-- ["Per chat type options."] = "Nach Chat Typ Optionen",
+-- ["Channel"] = "Kanal",
+-- ["Sticky %s"] = "%s Haftend",
+-- ["Toggles sticky on and off for %s."] = "Schaltet haftend an und aus f\195\188r %s.",
+-- ["Sticky Per Chat Frame"] = "Haftende Fenster Chat Typen",
+-- ["Toggle remembering the chat type last used per chat frame."] = "Schaltet das merken des zuletzt genutzten Chat Typen pro Chatfenster ein.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["ChannelSticky"] = "Canales Pegajosos",
+-- ["Chat channel sticky options."] = "Opciones para canales pegajosos",
+-- ["ChatType"] = "Tipo de Chat",
+-- ["Per chat type options."] = "Opciones por tipo de chat",
+-- ["Channel"] = "Canal",
+-- ["Sticky %s"] = "%s Pegajoso",
+-- ["Toggles sticky on and off for %s."] = "Determina si %s es pegajoso",
+-- ["Sticky Per Chat Frame"] = "Tipo de Marco de Chat Pegajoso",
+-- ["Toggle remembering the chat type last used per chat frame."] = "Determina si se recuerda el \195\186ltimo tipo de chat usado por marco de chat",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["ChannelSticky"] = "채널 고정",
+-- ["Chat channel sticky options."] = "대화 채널 고정 설정입니다.",
+-- ["ChatType"] = "대화 종류",
+-- ["Per chat type options."] = "대화 종류에 따른 설정입니다.",
+-- ["Channel"] = "채널",
+-- ["Sticky %s"] = "%s 고정",
+-- ["Toggles sticky on and off for %s."] = "%s에 대한 고정 기능을 사용합니다.",
+-- ["smartgroup_name"] = "스마트 파티",
+-- ["smartgroup_desc"] = "대화, 공격대, 파티 혹은 전장 대화를 자동으로 선택하는 /gr 명령어를 추가합니다.",
+-- ["Sticky Per Chat Frame"] = "대화창별 고정",
+-- ["Toggle remembering the chat type last used per chat frame."] = "대화창에 따라 마지막에 사용된 대화 종류를 기억합니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["ChannelSticky"] = "頻道固定",
+-- ["Chat channel sticky options."] = "固定聊天頻道選項。",
+---- no use anymore ["ChatType"] = true,
+---- no use anymore ["Per chat type options."] = true,
+-- ["Channel"] = "頻道",
+-- ["Sticky %s"] = "固定%s",
+-- ["Toggles sticky on and off for %s."] = "切換是否固定%s頻道。",
+-- ["smartgroup_name"] = "智慧群組",
+-- ["smartgroup_desc"] = "增加一個 /gr 指令用以自動選擇正確的頻道類型: 團隊,隊伍或戰場。",
+-- ["Sticky Per Chat Frame"] = "固定每個聊天視窗",
+-- ["Toggle remembering the chat type last used per chat frame."] = "切換記憶每個聊天視窗最後的頻道類型。",
+--} end)
+--
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["ChannelSticky"] = "固定频道",
+-- ["Chat channel sticky options."] = "固定聊天频道选项。",
+-- ["ChatType"] = "聊天分类",
+-- ["Per chat type options."] = "聊天类型选项。",
+-- ["Channel"] = "频道",
+-- ["Sticky %s"] = "固定%s",
+-- ["Toggles sticky on and off for %s."] = "切换固定%s频道.",
+-- ["smartgroup_name"] = "智能团队",
+-- ["smartgroup_desc"] = "添加 /gr 命令, 自动获取团队/队伍/战场聊天类型",
+-- ["Sticky Per Chat Frame"] = "固定每个聊天框架",
+-- ["Toggle remembering the chat type last used per chat frame."] = "切换记忆每个聊天框架最后的聊天分类",
+--} end)
+
+-- chat channel list
+local chatList = {
+ "SAY",
+ "WHISPER",
+ "YELL",
+ "PARTY",
+ "GUILD",
+ "OFFICER",
+ "RAID",
+ "RAID_WARNING",
+ "BATTLEGROUND",
+ "CHANNEL",
+ "EMOTE",
+}
+
+local module = Prat:NewModule(PRAT_MODULE, "AceEvent-3.0", "AceTimer-3.0", "AceHook-3.0")
+
+Prat:SetModuleDefaults(module, {
+ profile = {
+ on = true,
+ say = true,
+ whisper = true,
+ yell = true,
+ party = true,
+ guild = true,
+ officer = true,
+ raid = true,
+ raid_warning = true,
+ battleground = true,
+ channel = true,
+ emote = true,
+ perframe = false,
+ smartgroup = false,
+ }
+} )
+
+local chatTypePlugins = { ctype = {} }
+
+Prat:SetModuleOptions(module, {
+ name = L["ChannelSticky"],
+ desc = L["Chat channel sticky options."],
+ type = "group",
+ plugins = chatTypePlugins,
+ args = {
+ perframe = {
+ name = L["Sticky Per Chat Frame"],
+ desc = L["Toggle remembering the chat type last used per chat frame."],
+ type = "toggle",
+ },
+ smartgroup = {
+ name = L["smartgroup_name"],
+ desc = L["smartgroup_desc"],
+ type = "toggle",
+ }
+ }
+ }
+)
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+function module:OnModuleEnable()
+ self:BuildChannelList()
+
+ self:RegisterEvent("UPDATE_CHAT_COLOR")
+
+ local prof = self.db.profile
+
+ -- sticky each channel based on db settings
+ self:Stickum("SAY",prof.say)
+ self:Stickum("WHISPER",prof.whisper)
+ self:Stickum("YELL",prof.yell)
+ self:Stickum("PARTY",prof.party)
+ self:Stickum("GUILD",prof.guild)
+ self:Stickum("OFFICER",prof.officer)
+ self:Stickum("RAID",prof.raid)
+ self:Stickum("RAID_WARNING",prof.raid_warning)
+ self:Stickum("BATTLEGROUND",prof.battleground)
+ self:Stickum("CHANNEL",prof.channel)
+ self:Stickum("EMOTE",prof.emote)
+
+ self:StickyFrameChan(prof.perframe)
+
+ Prat.RegisterChatEvent(self, "Prat_OutboundChat")
+
+ if prof.smartgroup then
+ self:RegisterSmartGroup()
+ end
+end
+
+function module:OnModuleDisable()
+ -- dont sticky no mo!
+ self:Stickum("SAY",false)
+ self:Stickum("WHISPER",false)
+ self:Stickum("YELL",false)
+ self:Stickum("PARTY",false)
+ self:Stickum("GUILD",false)
+ self:Stickum("OFFICER",false)
+ self:Stickum("RAID",false)
+ self:Stickum("RAID_WARNING",false)
+ self:Stickum("BATTLEGROUND",false)
+ self:Stickum("CHANNEL",false)
+ self:Stickum("EMOTE",false)
+ -- forget about per chat frame stickying
+ self:StickyFrameChan(false)
+ -- unregister events
+ self:UnregisterAllEvents()
+
+ Prat.UnregisterAllChatEvents(self)
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+-- rebuild options menu is chat colors change
+function module:UPDATE_CHAT_COLOR()
+ self:ScheduleTimer("BuildChannelList", 1)
+end
+
+function module:StickyFrameChan(enabled)
+ if not enabled then
+ self:UnhookAll()
+ else
+ self.perframe = {}
+ self.perframechannum = {}
+ self:RawHook("ChatFrame_OpenChat", true)
+ self:SecureHook("ChatEdit_OnEscapePressed")
+ self:SecureHook("SendChatMessage")
+ self:SecureHook("ChatEdit_OnEnterPressed")
+ end
+end
+
+function module:ChatFrame_OpenChat(text, chatFrame)
+ if ( not chatFrame ) then
+ chatFrame = SELECTED_CHAT_FRAME
+ end
+
+ local eb = chatFrame.editBox
+
+ if eb == nil then
+ return self.hooks["ChatFrame_OpenChat"](text, chatFrame)
+ end
+
+ local chatFrameN = chatFrame:GetName()
+
+ --Prat.Print(eb:GetAttribute("chatType"))
+
+ if eb:GetAttribute("chatType") == "WHISPER" then
+ -- NADA
+-- elseif eb:GetAttribute("chatType") == "GROUPSAY" then
+-- eb:SetAttribute("origchatType", "GROUPSAY");
+ elseif self.perframe[chatFrameN] then
+ eb:SetAttribute("channelTarget", self.perframechannum[chatFrameN]);
+ eb:SetAttribute("chatType", self.perframe[chatFrameN]);
+ eb:SetAttribute("stickyType", self.perframe[chatFrameN]);
+ end
+
+ self.hooks["ChatFrame_OpenChat"](text, chatFrame)
+end
+
+function module:SendChatMessage(msg, chatType, language, channel)
+ if self.memoNext then
+ self.perframe[self.memoNext] = chatType
+ self.perframechannum[self.memoNext] = channel
+ end
+end
+
+function module:ChatEdit_OnEscapePressed(this)
+ self.memoNext = nil
+end
+
+function module:ChatEdit_OnEnterPressed(this)
+ this = this or _G.this
+ local chatFrameN = SELECTED_CHAT_FRAME:GetName()
+ local chatType = this:GetAttribute("chatType")
+
+ local channel = this:GetAttribute("channelTarget")
+ self.perframe[chatFrameN] = chatType
+ self.perframechannum[chatFrameN] = channel
+ self.memoNext = nil
+end
+
+function module:Stickum(channel, stickied)
+ ChatTypeInfo[channel:upper()].sticky = stickied and 1 or 0
+end
+
+--[[------------------------------------------------
+ Menu Builder Functions
+------------------------------------------------]]--
+
+local CLR = Prat.CLR
+local function StkyChatType(text, type) return CLR:Colorize(module:GetChatCLR(type), text) end
+
+function module:BuildChannelList()
+ local o = chatTypePlugins["ctype"]
+
+ for _,va in ipairs(chatList) do
+ local val = va:lower()
+ local chan
+ if va ~= "CHANNEL" then
+ chan = TEXT(getglobal("CHAT_MSG_"..va))
+ else
+ chan = L["Channel"]
+ end
+
+ o[val] = o[val] or {
+ type = "toggle",
+ }
+
+ o[val].name = (L["Sticky %s"]):format(StkyChatType(chan:gsub(" ", ""), va))
+ o[val].desc = (L["Toggles sticky on and off for %s."]):format(chan)
+ end
+end
+
+function module:OnValueChanged(info, b)
+ local o = info[#info]
+
+ if o == "smartgroup" then
+ if b then self:RegisterSmartGroup() end
+ elseif o == "perframe" then
+ self:StickyFrameChan(b)
+ else
+ self:Stickum(o, b)
+ end
+end
+
+function module:GetChatCLR(name)
+ local info = ChatTypeInfo[name];
+ if not info then
+ return CLR.COLOR_NONE
+ end
+ return CLR:GetHexColor(info)
+end
+
+
+
+function module:RegisterSmartGroup()
+ if not self.smart_group then
+ self:SecureHook("ChatEdit_SendText", function(this) if self.groupsay then this:SetAttribute("chatType", "GROUPSAY") self.groupsay=nil end end)
+
+ self.smart_group = true
+
+ SlashCmdList["SLASH_GROUPSAY"] = function(text)
+ if text:trim():len() > 0 then
+ local _,pvp = IsInInstance()
+ if pvp == "pvp" then
+ SendChatMessage(text, "BATTLEGROUND")
+ elseif GetNumRaidMembers() > 0 then
+ SendChatMessage(text, "RAID")
+ elseif GetNumPartyMembers() > 0 then
+ SendChatMessage(text, "PARTY")
+ end
+ end
+ end
+
+ SLASH_GROUPSAY1 = "/gr"
+ SLASH_GROUPSAY2 = "/group"
+ ChatTypeInfo["GROUPSAY"] = { r=0.5, g=0.9, b=0.9, sticky = 1 }
+ CHAT_GROUPSAY_SEND = "SmartGroup:\32 "
+ CHAT_GROUPSAY_GET = "SmartGroup: %1\32 "
+ end
+end
+
+
+function module:SmartGroupChatType()
+ local _,pvp = IsInInstance()
+
+ if pvp == "pvp" then
+ return "BATTLEGROUND"
+ elseif GetNumRaidMembers() > 0 then
+ return "RAID"
+ elseif GetNumPartyMembers() > 0 then
+ return "PARTY"
+ end
+
+ return "SAY"
+end
+
+function module:Prat_OutboundChat(arg, m)
+ if m.CTYPE == "GROUPSAY" then
+ self.groupsay = true
+ m.CTYPE = self:SmartGroupChatType()
+ end
+end
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/ChatFrames.lua b/modules/ChatFrames.lua
new file mode 100644
index 00000000..95df98c9
--- /dev/null
+++ b/modules/ChatFrames.lua
@@ -0,0 +1,321 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratChatFrames
+Revision: $Revision: 80703 $
+Author(s): Curney (asml8ed@gmail.com)
+ Sylvanaar (sylvanaar@mindspring.com)
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#ChatFrames
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that adds options for changing chat window parameters.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local Prat = Prat
+
+local PRAT_MODULE = Prat:RequestModuleName("Frames")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat.GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Frames"] = true,
+ ["Chat window frame parameter options"] = true,
+ ["minchatwidth_name"] = "Set Minimum Width",
+ ["minchatwidth_desc"] = "Sets the minimum width for all chat windows.",
+ ["maxchatwidth_name"] = "Set Maximum Width",
+ ["maxchatwidth_desc"] = "Sets the maximum width for all chat windows.",
+ ["minchatheight_name"] = "Set Minimum Height",
+ ["minchatheight_desc"] = "Sets the minimum height for all chat windows.",
+ ["maxchatheight_name"] = "Set Maximum Height",
+ ["maxchatheight_desc"] = "Sets the maximum height for all chat windows.",
+ ["mainchatonload_name"] = "Force Main Chat Frame On Load",
+ ["mainchatonload_desc"] = "Automatically select the first chat frame and make it active on load.",
+ ["framealpha_name"] = "Set Chatframe Alpha",
+ ["framealpha_desc"] = "Conrols the transparency of the chatframe when you hover over it with your mouse.",
+} )
+
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Frames"] = "Chatfenster",
+-- ["Chat window frame parameter options."] = "Chatfenster Optionen.",
+-- ["minchatwidth_name"] = "Minimum Breite einstellen",
+-- ["minchatwidth_desc"] = "Setzt die minimum Breite f\195\188r alle Chatfenster fest.",
+-- ["maxchatwidth_name"] = "Maximum Breite einstellen",
+-- ["maxchatwidth_desc"] = "Setzt die maximum Breite f\195\188r alle Chatfenster fest.",
+-- ["minchatheight_name"] = "Minimum H\195\182he einstellen",
+-- ["minchatheight_desc"] = "Setzt die minimum H\195\182he f\195\188r alle Chatfenster fest.",
+-- ["maxchatheight_name"] = "Maximum H\195\182he einstellen",
+-- ["maxchatheight_desc"] = "Setzt die maximum H\195\182he f\195\188r alle Chatfenster fest.",
+-- ["mainchatonload_name"] = "W\195\164hle Allgemein Chatfenster beim Laden",
+-- ["mainchatonload_desc"] = "Automatisch das erste Chatfenster beim Laden ausw\195\164hlen und es als aktives setzen.",
+-- ["Lock the Pet Action Bar"] = "Sperre die Begleiter Tastenleiste",
+-- ["Lock the Pet Action Bar and show it if not in combat. THIS SETTING IS NOT SAVED"] = "Sperre die Begleiter Tastenleiste und zeige sie wenn man nicht im Kampf ist. DIESE EINSTELLUNG WIRD NICHT GESPEICHERT",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["Frames"] = "Fen\195\170tres",
+-- ["Chat window frame parameter options."] = "Options des fen\195\170tres de chat.",
+-- ["minchatwidth_name"] = "D\195\169finir la largeur minimum",
+-- ["minchatwidth_desc"] = "D\195\169finit la largeur minimale de toutes les fen\195\170tres de chat.",
+-- ["maxchatwidth_name"] = "D\195\169finir la largeur maximum",
+-- ["maxchatwidth_desc"] = "D\195\169finit la largeur maximale de toutes les fen\195\170tres de chat.",
+-- ["minchatheight_name"] = "D\195\169finir la largeur minimum",
+-- ["minchatheight_desc"] = "D\195\169finit la hauteur minimale de toutes les fen\195\170tres de chat.",
+-- ["maxchatheight_name"] = "D\195\169finir la largeur maximum",
+-- ["maxchatheight_desc"] = "D\195\169finit la hauteur maximale de toutes les fen\195\170tres de chat.",
+-- ["mainchatonload_name"] = "Forcer la fen\195\170tre principale au chargement",
+-- ["mainchatonload_desc"] = "S\195\169lectionne automatiquement le premier onglet et le rend actif au chargement.",
+-- ["Lock the Pet Action Bar"] = "Verrouiller la barre d'action du familier",
+-- ["Lock the Pet Action Bar and show it if not in combat. THIS SETTING IS NOT SAVED"] = "Verrouille la barre d'action du familier et l'affiche si hors combat. CE REGLAGE N'EST PAS SAUVE",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Frames"] = "Ventanas de Chat",
+-- ["Chat window frame parameter options."] = "Opciones de los par\195\161metros de las ventanas de chat",
+-- ["minchatwidth_name"] = "Anchura m\195\173nima",
+-- ["minchatwidth_desc"] = "Establece la anchura m\195\173nima de las ventanas de chat",
+-- ["maxchatwidth_name"] = "Anchura m\195\161xima",
+-- ["maxchatwidth_desc"] = "Establece la anchura m\195\161xima de las ventanas de chat",
+-- ["minchatheight_name"] = "Altura m\195\173nima",
+-- ["minchatheight_desc"] = "Establece la altura m\195\173nima de las ventanas de chat",
+-- ["maxchatheight_name"] = "Altura m\195\161xima",
+-- ["maxchatheight_desc"] = "Establece la altura m\195\161xima de las ventanas de chat",
+-- ["mainchatonload_name"] = "Forzar Ventana de Chat Principal al Cargar",
+-- ["mainchatonload_desc"] = "Elige autom\195\161ticamente la primera ventana de chat y la hace activa al cargar",
+-- ["Lock the Pet Action Bar"] = "Bloquear la barra de acciones de la mascota",
+-- ["Lock the Pet Action Bar and show it if not in combat. THIS SETTING IS NOT SAVED"] = "Bloquea la barra de acciones de la mascota y la muestra si no est\195\161s en combate. ESTA OPCI\195\147N NO SER\195\129 GUARDADA",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Frames"] = "대화창",
+-- ["Chat window frame parameter options."] = "대화창 제한 설정입니다.",
+-- ["minchatwidth_name"] = "최소 넓이 설정",
+-- ["minchatwidth_desc"] = "대화창의 최소 넓이를 설정합니다.",
+-- ["maxchatwidth_name"] = "최대 넓이 설정",
+-- ["maxchatwidth_desc"] = "대화창의 최대 넓이를 설정합니다.",
+-- ["minchatheight_name"] = "최소 높이 설정",
+-- ["minchatheight_desc"] = "대화창의 최소 높이를 설정합니다.",
+-- ["maxchatheight_name"] = "최대 높이 설정",
+-- ["maxchatheight_desc"] = "대화창의 최대 높이를 설정합니다.",
+-- ["mainchatonload_name"] = "접속 시 주 대화창 강제 지정",
+-- ["mainchatonload_desc"] = "접속 시 첫번째 대화창을 주 대화창으로 자동으로 선택합니다.",
+-- ["framealpha_name"] = "투명도 제한선",
+-- ["framealpha_desc"] = "모든 대화창의 '페이드-인' 투명도를 설정합니다. 만약 현재 대화창이 낮은 투명도로 설정되어 있다면, 마우스를 올렸을 때 '페이드-인' 될 것 입니다.",
+-- ["Lock the Pet Action Bar"] = "소황수 행동 바 고정",
+-- ["Lock the Pet Action Bar and show it if not in combat. THIS SETTING IS NOT SAVED"] = "소환수 행동바를 고정하고 전투 중이 아닐 때 표시합니다. 이 설정은 저장되지 않습니다.",
+-- ["WARNING: "] = "경고: ",
+-- ["Your pet action bar has become tainted. Enable the "] = "Your pet action bar has become tainted. Enable the ",
+-- ["'Lock the Pet Action Bar'"] = "'Lock the Pet Action Bar'",
+-- [" option in the "] = " option in the ",
+-- ["ChatFrames"] = "대화창",
+-- [" module, or "] = " module, or ",
+-- ["/rl"] = "/rl",
+-- [" to reload your UI"] = " to reload your UI",
+--} end)
+--
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Frames"] = "聊天框架",
+-- ["Chat window frame parameter options."] = "聊天框架设置选项.",
+-- ["minchatwidth_name"] = "设定最小宽度值",
+-- ["minchatwidth_desc"] = "对所有聊天窗口设定最小宽度值",
+-- ["maxchatwidth_name"] = "设定最大宽度值",
+-- ["maxchatwidth_desc"] = "对所有聊天窗口设定最大宽度值",
+-- ["minchatheight_name"] = "设定最小高度值",
+-- ["minchatheight_desc"] = "对所有聊天窗口设定最小高度值",
+-- ["maxchatheight_name"] = "设定最大高度值",
+-- ["maxchatheight_desc"] = "对所有聊天窗口设定最大高度值",
+-- ["mainchatonload_name"] = "强制使用主聊天窗口",
+-- ["mainchatonload_desc"] = "自动选择第一聊天窗口并加载.",
+-- ["framealpha_name"] = "透明度",
+-- ["framealpha_desc"] = "设置所有聊天窗口‘淡入’的透明度。若当前的聊天窗口本有较低的透明度值,鼠标停留时会有‘淡入’效果",
+-- ["Lock the Pet Action Bar"] = "锁定宠物动作条",
+-- ["Lock the Pet Action Bar and show it if not in combat. THIS SETTING IS NOT SAVED"] = "锁定宠物动作条并在非战斗装都显示. !!此设置不能保存!!",
+-- ["WARNING: "] = "警告: ",
+-- ["Your pet action bar has become tainted. Enable the "] = "宠物动作条有问题。请启用。",
+-- ["'Lock the Pet Action Bar'"] = "「锁定宠物动作条」",
+-- [" option in the "] = "选项 (在",
+-- ["ChatFrames"] = "聊天窗口",
+-- [" module, or "] = "模块),或 ",
+-- ["/rl"] = "/rl",
+-- [" to reload your UI"] = " 重载你的使用界面。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Frames"] = "聊天視窗",
+-- ["Chat window frame parameter options."] = "聊天視窗設定選項。",
+-- ["minchatwidth_name"] = "設定寬度最小值",
+-- ["minchatwidth_desc"] = "設定全部聊天視窗的寬度最小值。",
+-- ["maxchatwidth_name"] = "設定寬度最大值",
+-- ["maxchatwidth_desc"] = "設定全部聊天視窗的寬度最大值。",
+-- ["minchatheight_name"] = "設定高度最小值",
+-- ["minchatheight_desc"] = "設定全部聊天視窗的高度最小值。",
+-- ["maxchatheight_name"] = "設定高度最大值",
+-- ["maxchatheight_desc"] = "設定全部聊天視窗的高度最大值。",
+-- ["mainchatonload_name"] = "載入時強制啟用聊天視窗1",
+-- ["mainchatonload_desc"] = "自動選擇聊天視窗1並啟用。",
+-- ["framealpha_name"] = "透明度",
+-- ["framealpha_desc"] = "設定所有聊天視窗的「淡入」透明度。若當前的聊天視窗有較低的透明度值,滑鼠停留時會有「淡入」效果。",
+-- ["Lock the Pet Action Bar"] = "鎖定寵物動作條",
+-- ["Lock the Pet Action Bar and show it if not in combat. THIS SETTING IS NOT SAVED"] = "鎖定寵物動作條並在非戰鬥狀態時顯示。不會儲存此設定!",
+-- ["WARNING: "] = "警告: ",
+-- ["Your pet action bar has become tainted. Enable the "] = "寵物動作條有問題。請啟用",
+-- ["'Lock the Pet Action Bar'"] = "「鎖定寵物動作條」",
+-- [" option in the "] = "選項 (在",
+-- ["ChatFrames"] = "聊天視窗",
+-- [" module, or "] = "模組),或 ",
+-- ["/rl"] = "/rl",
+-- [" to reload your UI"] = " 重載你的使用者介面。",
+--} end)
+
+local mod = Prat:NewModule(PRAT_MODULE)
+
+
+Prat:SetModuleDefaults(mod.name, {
+ profile = {
+ on = true,
+ minchatwidth = 160,
+ minchatwidthdefault = 160,
+ maxchatwidth = 800,
+ maxchatwidthdefault = 800,
+ minchatheight = 120,
+ minchatheightdefault = 120,
+ maxchatheight = 600,
+ maxchatheightdefault = 600,
+ mainchatonload = true,
+ framealpha = DEFAULT_CHATFRAME_ALPHA
+ }
+})
+
+do
+ local frameoption = {
+ name = function(info) return L[info[#info].."_name"] end,
+ desc = function(info) return L[info[#info].."_desc"] end,
+ type="range", min=25, max=1024, step=1
+ }
+
+ Prat:SetModuleOptions(mod.name, {
+ name = L["Frames"],
+ desc = L["Chat window frame parameter options"],
+ type = "group",
+ args = {
+ minchatwidth = frameoption,
+ maxchatwidth = frameoption,
+ minchatheight = frameoption,
+ maxchatheight = frameoption,
+ framealpha = {
+ name = L["framealpha_name"],
+ desc = L["framealpha_desc"],
+ type="range", min=0.0, max=1.0, step=.01, order=190,
+ },
+ -- mainchatonload = 200,
+ }
+ }
+ )
+end
+
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+Prat:SetModuleInit(module, function(self) self:GetDefaults() end)
+
+function mod:OnModuleEnable()
+ self:ConfigureAllChatFrames()
+end
+
+function mod:OnModuleDisable()
+ self:ConfigureAllChatFrames()
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+-- make ChatFrame1 the selected chat frame
+function mod:AceEvent_FullyInitialized()
+ if self.db.profile.mainchatonload then
+ FCF_SelectDockFrame(ChatFrame1)
+ end
+end
+
+-- set parameters for each chatframe
+function mod:ConfigureAllChatFrames(enabled)
+ for _,v in ipairs(Prat.Frames) do
+ self:SetParameters(v, enabled)
+ end
+
+ DEFAULT_CHATFRAME_ALPHA = self.db.profile.framealpha
+end
+
+-- get the defaults for chat frame1 max/min width/height for use when disabling the module
+function mod:GetDefaults()
+ local cf = _G["ChatFrame1"]
+ local prof = self.db.profile
+
+ local minwidthdefault, minheightdefault = cf:GetMinResize()
+ local maxwidthdefault, maxheightdefault = cf:GetMaxResize()
+
+ prof.minchatwidthdefault = minwidthdefault
+ prof.maxchatwidthdefault = maxwidthdefault
+ prof.minchatheightdefault = minheightdefault
+ prof.maxchatheightdefault = maxheightdefault
+
+ prof.initialized = true
+end
+
+-- set the max/min width/height for a chatframe
+function mod:SetParameters(cf, enabled)
+ local prof = self.db.profile
+ if enabled then
+ cf:SetMinResize(prof.minchatwidth, prof.minchatheight)
+ cf:SetMaxResize(prof.maxchatwidth, prof.maxchatheight)
+ else
+ cf:SetMinResize(prof.minchatwidthdefault, prof.minchatheightdefault)
+ cf:SetMaxResize(prof.maxchatwidthdefault, prof.maxchatheightdefault)
+ end
+end
+
+
+function mod:OnValueChanged()
+ self:ConfigureAllChatFrames()
+end
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/ChatLink.lua b/modules/ChatLink.lua
new file mode 100644
index 00000000..b11fe4df
--- /dev/null
+++ b/modules/ChatLink.lua
@@ -0,0 +1,206 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: ChatLink
+Revision: $Revision: 81459 $
+Author(s): Krtek (krtek4@gmail.com)
+ Sylvanaar (sylvanaar@mindspring.com)
+Inspired by: ChatLink by Yrys
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#ChatLink
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that shows item links in chat channels.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("ChatLink")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["module_name"] = "ChannelLinks",
+ ["module_desc"] = "Chat channel item link options.",
+-- ["clink_name"] = "ChatLink",
+-- ["clink_desc"] = "Toggle sending items in ChatLink format.",
+-- ["gem_name"] = "GEM Compatibility",
+-- ["gem_desc"] = "Enable GEM Compatiblity Mode",
+ ["Trade"] = true
+
+})
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["ChannelLinks"] = "ChatLink",
+-- ["Chat channel item link options."] = "Chat Kanal Item Link Optionen.",
+-- ["cm_name"] = "Chat Manager",
+-- ["cm_desc"] = "Aktiviere das Senden von Items im Cirk\" ChatManager Format.",
+-- ["clink_name"] = "Chat Link",
+-- ["clink_desc"] = "Aktiviere das Senden von items im ChatLink Format.",
+-- ["gem_name"] = "GEM Kompatibilität",
+-- ["gem_desc"] = "Aktiviere den GEM Kompatibilitätsmodus",
+-- ["Trade"] = "Handel"
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["ChannelLinks"] = "Enlace de Chat",
+-- ["Chat channel item link options."] = "Opciones de enlace de objeto en un canal de chat",
+-- ["cm_name"] = "ChatManager",
+-- ["cm_desc"] = "Determina si se envian los objetos en el formato Cirk\" ChatManager",
+-- ["clink_name"] = "Enlace de Chat",
+-- ["clink_desc"] = "Activa y desactiva los objetos en formato Enlace de Chat.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["ChannelLinks"] = "채널링크",
+-- ["Chat channel item link options."] = "대화 채널 아이템 링크 설정입니다.",
+-- ["cm_name"] = "ChatManager",
+-- ["cm_desc"] = "Cirk\" Chatmanager 형식으로 아이템을 전송합니다.",
+-- ["clink_name"] = "ChatLink",
+-- ["clink_desc"] = "ChatLink 형식으로 아이템을 전송합니다.",
+-- ["gem_name"] = "GEM 호환",
+-- ["gem_desc"] = "GEM 호환 모드를 사용합니다.",
+-- ["Trade"] = "거래"
+--} end)
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["ChannelLinks"] = "聊天链接",
+-- ["Chat channel item link options."] = "聊天频道物品链接选项。",
+-- ["cm_name"] = "聊天管理",
+-- ["cm_desc"] = "切换以 Cirk\" 聊天管理模式发送物品。",
+-- ["clink_name"] = "聊天链接",
+-- ["clink_desc"] = "切换聊天链接物品发送格式。",
+-- ["Trade"] = "交易"
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["ChannelLinks"] = "聊天連結",
+-- ["Chat channel item link options."] = "聊天頻道物品連結選項。",
+-- ["cm_name"] = "ChatManager",
+-- ["cm_desc"] = "切換為 Cirk's ChatManager 格式。",
+-- ["clink_name"] = "ChatLink",
+-- ["clink_desc"] = "切換為 ChatLink 格式。",
+-- ["gem_name"] = "兼容 GEM",
+-- ["gem_desc"] = "啟用 GEM 兼容模式。",
+-- ["Trade"] = "交易"
+--
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["ChannelLinks"] = "Liens",
+-- ["Chat channel item link options."] = "Options des liens d'objets dans les chats.",
+-- ["cm_name"] = "ChatManager",
+-- ["cm_desc"] = "Active l'envoi des liens d'objet au format de Cirk\" ChatManager.",
+-- ["clink_name"] = "ChatLink",
+-- ["clink_desc"] = "Active l'envoi des liens d'objets au format ChatLink.",
+--} end)
+
+
+
+local module = Prat:NewModule(PRAT_MODULE)
+
+Prat:SetModuleDefaults(module, {
+ profile = {
+ on = false,
+ }
+} )
+
+Prat:SetModuleOptions(module, {
+ name = L["module_name"],
+ desc = L["module_desc"],
+ type = "group",
+ args = {
+ info = {
+ name = "This module allows you to link items into non-trade chat channels ie. General, or private channels such as your class channel. To users without an addon capable of decoding it, it will look like spam, so be courteous",
+ type = "description",
+ }
+ }
+ }
+)
+
+local function linkedInTrade()
+ local _, name
+
+ if Prat.CurrentMsg.CHANNEL then
+ _, name = GetChannelName(Prat.CurrentMsg.CHANNEL)
+ end
+
+ --Prat:Print("linked in: "..tostring(name))
+ --Prat:PrintLiteral(Prat.CurrentMsg)
+ if Prat.CurrentMsg.CTYPE ~= "CHANNEL" or name:find(L["Trade"]) then
+ return true
+ end
+end
+
+
+-- CREDIT TO: Yrys - Hellscream, author of ChatLink (Adapted for the Prat 3.0 Framework
+local function ComposeItem(a1, a2, a3)
+ if linkedInTrade() then return end
+ return Prat:RegisterMatch(("{CLINK:item:%s:%s:%s}"):format(a1, a2, a3), "OUTBOUND")
+end
+local function ComposeEnchant(a1, a2, a3, a4) if linkedInTrade() then return end return Prat:RegisterMatch(("{CLINK:%s:%s:%s:%s}"):format(a2, a1, a3, a4),"OUTBOUND") end
+local function ComposeQuest(a1, a2, a3, a4, a5) if linkedInTrade() then return end return Prat:RegisterMatch(("{CLINK:%s:%s:%s:%s:%s}"):format(a2, a1, a3, a4, a5), "OUTBOUND") end
+local function ComposeSpell(a1, a2, a3, a4) if linkedInTrade() then return end return Prat:RegisterMatch(("{CLINK:%s:%s:%s:%s}"):format(a2, a1, a3, a4), "OUTBOUND") end
+
+local function DecomposeItem(a1, a2, a3) return Prat:RegisterMatch(("|c%s|Hitem:%s|h[%s]|h|r"):format(a1, a2, a3), "FRAME") end
+local function DecomposeEnchant(a1, a2, a3) return Prat:RegisterMatch(("|c%s|Henchant:%s|h[%s]|h|r"):format(a1, a2, a3),"FRAME") end
+local function DecomposeQuest(a1, a2, a3, a4, a5) return Prat:RegisterMatch(("|cff%s|Hquest:%s:%s|h[%s]|h|r"):format(Prat.CLR:GetHexColor(GetDifficultyColor(tonumber(a3))), a2, a3, a4), "FRAME") end
+local function DecomposeSpell(a1, a2, a3) return Prat:RegisterMatch(("|c%s|Hspell:%s|h[%s]|h|r"):format(a1, a2, a3), "FRAME") end
+
+local function GEM() return Prat:RegisterMatch("|") end
+
+
+-- /print ("||cff0070dd||Hitem:35570:2669:0:0:0:0:0:1385174015:78||h[Keleseth's Blade of Evocation]||h||r"):match("||c(%x+)||Hitem:(%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-)||h%[([^%]]-)%]||h||r")
+-- |cff0070dd|Hitem:35570:2669:0:0:0:0:0:1385174015:78|h[Keleseth's Blade of Evocation]|h|r
+Prat:SetModulePatterns(module, {
+ { pattern = Prat.WOTLK and "|c(%x+)|Hitem:(%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-)|h%[([^%]]-)%]|h|r" or
+ "|c(%x+)|Hitem:(%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-)|h%[([^%]]-)%]|h|r", matchfunc=ComposeItem, type = "OUTBOUND"},
+ { pattern = "|c(%x+)|H(enchant):(%-?%d-)|h%[([^%]]-)%]|h|r", matchfunc=ComposeEnchant, type = "OUTBOUND"},
+ { pattern = "|c(%x+)|H(quest):(%-?%d-):(%-?%d-)|h%[([^%]]-)%]|h|r", matchfunc=ComposeQuest, type = "OUTBOUND"},
+ { pattern = "|c(%x+)|H(spell):(%-?%d-)|h%[([^%]]-)%]|h|r", matchfunc=ComposeSpell, type = "OUTBOUND"},
+
+
+ { pattern = Prat.WOTLK and "{CLINK:item:(%x+):(%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-):([^}]-)}" or
+ "{CLINK:item:(%x+):(%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-):([^}]-)}", matchfunc=DecomposeItem },
+ { pattern = "{CLINK:enchant:(%x+):(%-?%d-):([^}]-)}", matchfunc=DecomposeEnchant },
+ { pattern = "{CLINK:quest:(%x+):(%-?%d-):(%-?%d-):([^}]-)}", matchfunc=DecomposeQuest},
+ { pattern = "{CLINK:spell:(%x+):(%-?%d-):([^}]-)}", matchfunc=DecomposeSpell },
+ --{ pattern = "{CLINK:(%x+):(%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-:%-?%d-):([^}]-)}", matchfunc=DecomposeItem },
+
+ { pattern = "\127p", matchfunc=GEM, type="FRAME" }
+})
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/ChatLog.lua b/modules/ChatLog.lua
new file mode 100644
index 00000000..bd122f3d
--- /dev/null
+++ b/modules/ChatLog.lua
@@ -0,0 +1,255 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratChatLog
+Revision: $Revision: 80298 $
+Author(s): Sylvanaar (sylvanaar@mindspring.com)
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#ChatLog
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that controls toggling the chat and combat logs on and off (default=off).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("ChatLog")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["ChatLog"] = true,
+ ["A module to automaticaly enable chat and combat logging."] = true,
+ ["Toggle Chat Log"] = true,
+ ["Toggle chat log on and off."] = true,
+ ["Toggle Combat Log"] = true,
+ ["Toggle combat log on and off."] = true,
+ ["Combat Log: Enabled"] = true,
+ ["Combat log recorded to \\Logs\\WoWCombatLog.txt only upon logout."] = true,
+ ["Combat Log: Disabled"] = true,
+ ["Chat Log: Enabled"] = true,
+ ["Chat log recorded to \\Logs\\WoWChatLog.txt only upon logout."] = true,
+ ["Chat Log: Disabled"] = true,
+ ["quiet_name"] = "Suppress Feedback Messages",
+ ["quiet_desc"] = "Dont display any messages when this mod is enabled, or when it changes the log settings.",
+})
+
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["ChatLog"] = "Chat Aufzeichnung",
+-- ["A module to automaticaly enable chat and combat logging."] = "Ein Modul um automatisch die Chat und Kampfaufzeichnung (Chatlog) zu aktivieren.",
+-- ["Toggle Chat Log"] = "Aktiviere Chat Log",
+-- ["Toggle chat log on and off."] = "Schalte Chat Log an und aus.",
+-- ["Toggle Combat Log"] = "Aktiviere Kampf Log",
+-- ["Toggle combat log on and off."] = "Schalte Kampf Log an und aus.",
+-- ["Combat Log: Enabled"] = "Kampf Log: Aktiviert",
+-- ["Combat log recorded to \\Logs\\WoWCombatLog.txt only upon logout."] = "Kampf Log gespeichert in \\Logs\\WoWCombatLog.txt nur beim Logut aus dem Spiel.",
+-- ["Combat Log: Disabled"] = "Kampf Log: Deaktiviert",
+-- ["Chat Log: Enabled"] = "Chat Log: Aktiviert",
+-- ["Chat log recorded to \\Logs\\WoWChatLog.txt only upon logout."] = "Chat Log gespeichert in \\Logs\\WoWChatLog.txt nur beim Logut aus dem Spiel.",
+-- ["Chat Log: Disabled"] = "Chat Log: Deaktiviert"
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["ChatLog"] = "Enregistrement des chats",
+-- ["A module to automaticaly enable chat and combat logging."] = "Un module pour activer automatiquement l'enregistrement des logs des discussions et du journal de combat.",
+-- ["Toggle Chat Log"] = "Active/d\195\169sactive l'enregistrement des discussions",
+-- ["Toggle chat log on and off."] = "Active/d\195\169sactive l'enregistrement des discussions",
+-- ["Toggle Combat Log"] = "Active/d\195\169sactive l'enregistrement du journal de combat",
+-- ["Toggle combat log on and off."] = "Active/d\195\169sactive l'enregistrement du journal de combat",
+-- ["Combat Log: Enabled"] = "Journal de combat : activ\195\169",
+-- ["Combat log recorded to \\Logs\\WoWCombatLog.txt only upon logout."] = "Journal de combat enregistr\195\169 \195\160 \\Logs\\WoWCombatLog.txt quand vous vous d\195\169connectez.",
+-- ["Combat Log: Disabled"] = "Journal de combat : activ\195\169",
+-- ["Chat Log: Enabled"] = "Enregistrement des discussions : activ\195\169",
+-- ["Chat log recorded to \\Logs\\WoWChatLog.txt only upon logout."] = "discussions enregistr\195\169es \195\160 \\Logs\\WoWChatLog.txt quand vous vous d\195\169connectez.",
+-- ["Chat Log: Disabled"] = "Enregistrement des discussions : d\195\169sactiv\195\169",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["ChatLog"] = "Registro de Chat",
+-- ["A module to automaticaly enable chat and combat logging."] = "Un m\195\179dulo que activa el registro de chat y combate de forma autom\195\161tica",
+-- ["Toggle Chat Log"] = "Activar Registro de Chat",
+-- ["Toggle chat log on and off."] = "Activa el registro de chat.",
+-- ["Toggle Combat Log"] = "Activar Registro de Combate",
+-- ["Toggle combat log on and off."] = "Activa el registro de combate.",
+-- ["Combat Log: Enabled"] = "Registro de Combate: Activado",
+-- ["Combat log recorded to \\Logs\\WoWCombatLog.txt only upon logout."] = "El registro de combate se guardar\195\161 en \\Logs\\WoWCombatLog.txt cuando desconectes",
+-- ["Combat Log: Disabled"] = "Registro de Combate: Desactivado",
+-- ["Chat Log: Enabled"] = "Registro de Chat: Activado",
+-- ["Chat log recorded to \\Logs\\WoWChatLog.txt only upon logout."] = "El registro de chat se guardar\195\161 en \\Logs\\WoWChatLog.txt cuando desconectes",
+-- ["Chat Log: Disabled"] = "Registro de Chat: Desactivado",
+-- ["quiet_name"] = "No mostrar mensajes",
+-- ["quiet_desc"] = "No se mostrarán los mensajes cuando se activa este módulo, o cuando cambia los ajustes del registro.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["ChatLog"] = "대화로그",
+-- ["A module to automaticaly enable chat and combat logging."] = "대화와 전투를 자동으로 기록하는 기능입니다.",
+-- ["Toggle Chat Log"] = "대화 로그 사용",
+-- ["Toggle chat log on and off."] = "대화 로그를 사용합니다.",
+-- ["Toggle Combat Log"] = "전투 로그 사용",
+-- ["Toggle combat log on and off."] = "전투 로그를 사용합니다.",
+-- ["Combat Log: Enabled"] = "전투 로그: 사용중",
+-- ["Combat log recorded to \\Logs\\WoWCombatLog.txt only upon logout."] = "전투 로그는 접속 종료 시 \\Logs\\WoWCombatLog.txt 에 기록됩니다.",
+-- ["Combat Log: Disabled"] = "전투 로그: 사용 하지 않음",
+-- ["Chat Log: Enabled"] = "대화 로그: 사용중",
+-- ["Chat log recorded to \\Logs\\WoWChatLog.txt only upon logout."] = "대화 로그는 접속 종료 시 \\Logs\\WoWChatLog.txt 에 기록됩니다.",
+-- ["Chat Log: Disabled"] = "대화 로그: 사용 하지 않음",
+-- ["quiet_name"] = "피드백 메세지 차단",
+-- ["quiet_desc"] = "이 모듈이 활성화 되거나 로그 설정이 변경되었을 때 어떠한 메세지도 표시 하지 않도록 합니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["ChatLog"] = "聊天紀錄",
+-- ["A module to automaticaly enable chat and combat logging."] = "可自動紀錄聊天訊息與戰鬥日誌的模組。",
+-- ["Toggle Chat Log"] = "啟用聊天紀錄",
+-- ["Toggle chat log on and off."] = "切換是否啟用聊天訊息紀錄。",
+-- ["Toggle Combat Log"] = "啟用戰鬥記錄",
+-- ["Toggle combat log on and off."] = "切換是否啟用戰鬥日誌記錄。",
+-- ["Combat Log: Enabled"] = "戰鬥日誌紀錄: 已啟用",
+-- ["Combat log recorded to \\Logs\\WoWCombatLog.txt only upon logout."] = "戰鬥日誌紀錄僅會在登出時儲存於\\Logs\\WoWCombatLog.txt。",
+-- ["Combat Log: Disabled"] = "戰鬥日誌紀錄: 已停用",
+-- ["Chat Log: Enabled"] = "聊天訊息紀錄: 已啟用",
+-- ["Chat log recorded to \\Logs\\WoWChatLog.txt only upon logout."] = "聊天訊息紀錄僅會在登出時儲存於\\Logs\\WoWChatLog.txt。",
+-- ["Chat Log: Disabled"] = "聊天訊息紀錄: 已停用",
+-- ["quiet_name"] = "禁用反饋資訊",
+-- ["quiet_desc"] = "當此模組啟用或更改任何紀錄設定時也不顯示訊息。",
+--} end)
+--
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["ChatLog"] = "聊天记录",
+-- ["A module to automaticaly enable chat and combat logging."] = "可自动记录聊天信息及战斗日志的模块",
+-- ["Toggle Chat Log"] = "启用聊天记录",
+-- ["Toggle chat log on and off."] = "切换是否启用聊天记录",
+-- ["Toggle Combat Log"] = "启用战斗日志",
+-- ["Toggle combat log on and off."] = "切换是否启用战斗日志",
+-- ["Combat Log: Enabled"] = "战斗日志: 启用",
+-- ["Combat log recorded to \\Logs\\WoWCombatLog.txt only upon logout."] = "战斗日至记录保存于\\Logs\\WoWCombatLog.txt only upon logout.",
+-- ["Combat Log: Disabled"] = "战斗日志: 禁用",
+-- ["Chat Log: Enabled"] = "聊天记录启用",
+-- ["Chat log recorded to \\Logs\\WoWChatLog.txt only upon logout."] = "聊天记录保存于\\Logs\\WoWChatLog.txt only upon logout.",
+-- ["Chat Log: Disabled"] = "聊天记录: 禁用",
+-- ["quiet_name"] = "禁用反馈信息",
+-- ["quiet_desc"] = "当次模块启用或更改任何记录设定时将不显示信息.",
+--} end)
+
+
+
+local module = Prat:NewModule(PRAT_MODULE)
+
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = false,
+ chat = false,
+ combat = false,
+ quiet = true,
+ }
+} )
+
+Prat:SetModuleOptions(module.name, {
+ name = L["ChatLog"],
+ desc = L["A module to automaticaly enable chat and combat logging."],
+ type = "group",
+ args = {
+ chat = {
+ name = L["Toggle Chat Log"],
+ desc = L["Toggle chat log on and off."],
+ type = "toggle",
+ get = "GetValue",
+ set = "SetChatLog",
+ },
+ combat = {
+ name = L["Toggle Combat Log"],
+ desc = L["Toggle combat log on and off."],
+ type = "toggle",
+ get = "GetValue",
+ set = "SetCombatLog",
+ }
+ }
+ })
+
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+-- things to do when the module is enabled
+function module:OnModuleEnable()
+ self:SetChatLog(self.db.profile.chat)
+ self:SetCombatLog(self.db.profile.combat)
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+-- enable or disable the chat log
+function module:SetChatLog(info, val)
+ self.db.profile.chat = val
+ if self.db.profile.chat then
+ self:Print(L["Chat Log: Enabled"])
+ self:Print(L["Chat log recorded to \\Logs\\WoWChatLog.txt only upon logout."])
+ LoggingChat(1)
+ else
+ LoggingChat(0)
+ self:Print(L["Chat Log: Disabled"])
+ end
+end
+
+-- enable or disable the combat log
+function module:SetCombatLog(info, val)
+ self.db.profile.combat = val
+ if self.db.profile.combat then
+ self:Print(L["Combat Log: Enabled"])
+ self:Print(L["Combat log recorded to \\Logs\\WoWCombatLog.txt only upon logout."])
+ LoggingCombat(1)
+ else
+ LoggingCombat(0)
+ self:Print(L["Combat Log: Disabled"])
+ end
+end
+
+function module:Print(str)
+ if self.db.profile.quiet then return end
+
+ Prat:Print(str)
+end
+
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/ChatTabs.lua b/modules/ChatTabs.lua
new file mode 100644
index 00000000..e3400e90
--- /dev/null
+++ b/modules/ChatTabs.lua
@@ -0,0 +1,356 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratChatTabs
+Revision: $Revision: 80499 $
+Author(s): Sylvanaar (sylvanaar@mindspring.com)
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Tabs
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that adds chat window tab options (default = hidden).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("ChatTabs")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Tabs"] = true,
+ ["Chat window tab options."] = true,
+ ["Set Display Mode"] = true,
+ ["Set tab display mode for each chat window."] = true,
+ ["Set ChatFrame%d Display Mode"] = true,
+ ["Set tab display to always, hidden or the Blizzard default."] = true,
+ ["Active Alpha"] = true,
+ ["Sets alpha of chat tab for active chat frame."] = true,
+ ["Not Active Alpha"] = true,
+ ["Sets alpha of chat tab for not active chat frame."] = true,
+ ["All"] = true,
+ ["Individual"] = true,
+ ["Always"] = true,
+ ["Hidden"] = true,
+ ["Default"] = true,
+ ["disableflash_name"] = "Disable Flashing",
+ ["disableflash_desc"] = "Disable flashing of the chat tabs.",
+ ["preventdrag_name"] = "Prevent Dragging",
+ ["preventdrag_desc"] = "Prevent dragging chat tabs with mouse",
+})
+
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Tabs"] = "Chat Karteikartentasten",
+-- ["Chat window tab options."] = "Chatfenster Karteikartentasten Optionen",
+-- ["Set Display Mode"] = "Justiere Anzeigeart",
+-- ["Set tab display mode for each chat window."] = "Justiere Karteikartentasten Anzeigeart f\195\188r jedes chatfenster.",
+-- ["Set ChatFrame%d Display Mode"] = "Justiere Chatfenster %d Anzeigeart",
+-- ["Set tab display to always, hidden or the Blizzard default."] = "Justiere Karteikartentasten Anzeige zu immer, versteckt oder der Blizzard's vorgabe.",
+-- ["Active Alpha"] = "Aktive Helligkeit",
+-- ["Sets alpha of chat tab for active chat frame."] = "Justiert die Helligkeit der Karteikartentasten f\195\188r aktive Fenster ein.",
+-- ["Not Active Alpha"] = "Keine Aktive Helligkeit",
+-- ["Sets alpha of chat tab for not active chat frame."] = "Justiert die Helligkeit der Karteikartentasten f\195\188r nicht aktive Fenster ein.",
+-- ["All"] = "Alle",
+-- ["Individual"] = "Individuell",
+-- ["Always"] = "Immer sichtbar",
+-- ["Hidden"] = "Versteckt",
+-- ["Default"] = "Grundeinstellung",
+-- ["disableflash_name"] = "Deaktiviere Aufblinken",
+-- ["disableflash_desc"] = "Deaktiviert das aufblinken der Karteikartentasten."
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Tabs"] = "Pesta\195\177as de Chat",
+-- ["Chat window tab options."] = "Opciones de las pesta\195\177as de chat",
+-- ["Set ChatFrame%d Display Mode"] = "Pesta\195\177a de Chat %d",
+-- ["Set tab display to always, hidden or the Blizzard default."] = "Determina las opciones de la pesta\195\177a de chat de la ventana de chat %d",
+-- ["Active Alpha"] = "Transparencia Activos",
+-- ["Sets alpha of chat tab for active chat frame."] = "Establece el \195\173ndice de transparencia de la pesta\195\177a de chat para los marcos de chat activos.",
+-- ["Not Active Alpha"] = "Transparencia No Activos",
+-- ["Sets alpha of chat tab for not active chat frame."] = "Establece el \195\173ndice de transparencia de la pesta\195\177a de chat para los marcos de chat no activos.",
+-- ["All"] = "Todos",
+-- ["Individual"] = "Individual",
+-- ["Always"] = "Siempre Visible",
+-- ["Hidden"] = "Oculto",
+-- ["Default"] = "Por Defecto",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Tabs"] = "대화탭",
+-- ["Chat window tab options."] = "대화탭 설정",
+-- ["Set Display Mode"] = "표시 모드 설정",
+-- ["Set tab display mode for each chat window."] = "각 대화창에 대한 탭 표시 모드를 설정합니다.",
+-- ["Set ChatFrame%d Display Mode"] = "%d 대화창 표시 모드 설정",
+-- ["Set tab display to always, hidden or the Blizzard default."] = "항상, 숨김 혹은 블리자드 기본값으로 탭 표시를 설정합니다.",
+-- ["Active Alpha"] = "활성화 투명도",
+-- ["Sets alpha of chat tab for active chat frame."] = "활성화된 대화창에 대한 대화탭의 투명도를 설정합니다.",
+-- ["Not Active Alpha"] = "비활성화 투명도",
+-- ["Sets alpha of chat tab for not active chat frame."] = "비활성화 대화창에 대한 대화탭의 투명도를 설정합니다.",
+-- ["All"] = "모두",
+-- ["Individual"] = "개별",
+-- ["Always"] = "항상",
+-- ["Hidden"] = "숨김",
+-- ["Default"] = "기본값",
+-- ["disableflash_name"] = "번쩍임 미사용",
+-- ["disableflash_desc"] = "대화탭의 번쩍임을 사용하지 않습니다.",
+-- ["preventdrag_name"] = "움직임 방지",
+-- ["preventdrag_desc"] = "마우스로 대화탭을 움직이지 않게 합니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["Tabs"] = "Onglets",
+-- ["Chat window tab options."] = "Options des onglets.",
+-- ["Set ChatFrame%d Display Mode"] = "Onglets de la fen\195\170tre %d",
+-- ["Set tab display to always, hidden or the Blizzard default."] = "Change les options d'onglet de la fen\195\170tre %d.",
+-- ["Active Alpha"] = "Transparence lorsque actif",
+-- ["Sets alpha of chat tab for active chat frame."] = "R\195\168gle la transparence des onglets de la fen\195\170tre active.",
+-- ["Not Active Alpha"] = "Transparence lorsque inactif",
+-- ["Sets alpha of chat tab for not active chat frame."] = "R\195\168gle la transparence des onglets des fen\195\170tres inactives.",
+-- ["All"] = "Toutes les fen\195\170tres",
+-- ["Individual"] = "Fen\195\170tre par fen\195\170tre",
+-- ["Always"] = "Toujours visible",
+-- ["Hidden"] = "Cach\195\169s",
+-- ["Default"] = "Par d\195\169faut",
+--} end)
+--
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 80499 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Tabs"] = "聊天标签",
+-- ["Chat window tab options."] = "聊天窗口标签选项",
+-- ["Set ChatFrame%d Display Mode"] = "聊天窗口 %d 标签",
+-- ["Set tab display to always, hidden or the Blizzard default."] = "切换聊天窗口 %d 标签选项",
+-- ["Active Alpha"] = "激活透明度",
+-- ["Sets alpha of chat tab for active chat frame."] = "设置激活的聊天窗口标签透明度",
+-- ["Not Active Alpha"] = "未激活透明度",
+-- ["Sets alpha of chat tab for not active chat frame."] = "设置未激活的聊天窗口标签透明度",
+-- ["All"] = "全部",
+-- ["Individual"] = "独立",
+-- ["Always"] = "永远可见",
+-- ["Hidden"] = "隐藏",
+-- ["Default"] = "默认",
+-- ["disableflash_name"] = "取消闪光",
+-- ["disableflash_desc"] = "取消聊天标签闪光"
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Tabs"] = "聊天視窗標籤",
+-- ["Chat window tab options."] = "聊天視窗的標籤選項。",
+-- ["Set Display Mode"] = "顯示模式",
+-- ["Set tab display mode for each chat window."] = "設定各個聊天視窗的顯示模式。",
+-- ["Set ChatFrame%d Display Mode"] = "聊天視窗%d顯示模式",
+-- ["Set tab display to always, hidden or the Blizzard default."] = "設定顯示模式。",
+-- ["Active Alpha"] = "使用中透明度",
+-- ["Sets alpha of chat tab for active chat frame."] = "設定使用中的聊天視窗的標籤透明度。",
+-- ["Not Active Alpha"] = "待命中透明度",
+-- ["Sets alpha of chat tab for not active chat frame."] = "設定待命中的聊天視窗的標籤透明度。",
+---- no use anymore ["All"] = true,
+---- no use anymore ["Individual"] = true,
+-- ["Always"] = "永遠可見",
+-- ["Hidden"] = "隱藏",
+-- ["Default"] = "預設",
+-- ["disableflash_name"] = "停用閃爍",
+-- ["disableflash_desc"] = "停用聊天視窗的標籤閃爍。",
+-- ["preventdrag_name"] = "防止拖曳",
+-- ["preventdrag_desc"] = "防止用滑鼠拖曳聊天視窗的標籤。",
+--} end)
+
+
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = false,
+ displaymode = { },
+ disableflash = false,
+ notactivealpha = 0.5,
+ activealpha = 1,
+ preventdrag = false,
+ }
+} )
+
+--module.toggleOptions = { sep115_sep = 115, disableflash = 120, preventdrag = 125 }
+
+Prat:SetModuleOptions(module.name, {
+ name = L["Tabs"],
+ desc = L["Chat window tab options."],
+ type = "group",
+ args = {
+ displaymode = {
+ name = L["Set Display Mode"],
+ desc = L["Set tab display mode for each chat window."],
+ type = "multiselect",
+ tristate = true,
+ order = 110,
+ values = Prat.FrameList,
+ get = "GetSubValue",
+ set = "SetSubValue",
+ },
+ disableflash = {
+ name = L["disableflash_name"],
+ desc = L["disableflash_desc"],
+ type = "toggle",
+ order = 120
+ },
+ preventdrag = {
+ name = L["preventdrag_name"],
+ desc = L["preventdrag_desc"],
+ type = "toggle",
+ order = 120
+ },
+ activealpha = {
+ name = L["Active Alpha"],
+ desc = L["Sets alpha of chat tab for active chat frame."],
+ type = "range",
+ order = 130,
+ min = 0.1,
+ max = 1,
+ step = 0.1,
+ },
+ notactivealpha = {
+ name = L["Not Active Alpha"],
+ desc = L["Sets alpha of chat tab for not active chat frame."],
+ type = "range",
+ order = 140,
+ min = 0.1,
+ max = 1,
+ step = 0.1,
+ },
+ }
+ }
+)
+
+--local tabmode = { ["true"] = "ALWAYS", ["false"] = "HIDDEN", ["nil"] = "DEFAULT" }
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+-- things to do when the module is enabled
+function module:OnModuleEnable()
+ self:SecureHook("FCF_FlashTab")
+ self:InstallHooks()
+ self:UpdateAllTabs()
+end
+
+-- things to do when the module is enabled
+function module:OnModuleDisable()
+ self:RemoveHooks()
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+function module:InstallHooks()
+ for k, v in pairs(Prat.Frames) do
+ local cftab = getglobal(k.."Tab")
+ cftab:SetScript("OnShow", function(this) module:OnTabShow(this) end)
+ cftab:SetScript("OnHide", function(this) module:OnTabHide(this) end)
+ self:HookScript(cftab,"OnDragStart", "OnTabDragStart")
+ end
+end
+
+function module:RemoveHooks()
+ for k, v in pairs(Prat.Frames) do
+ local cftab = getglobal(k.."Tab")
+ cftab:SetScript("OnShow", function() return end)
+ cftab:SetScript("OnHide", function() return end)
+ end
+ -- unhook functions
+ self:UnhookAll()
+end
+
+function module:OnValueChanged(info, b)
+ self:UpdateAllTabs()
+end
+
+function module:UpdateAllTabs()
+ for i = 1,FCF_GetNumActiveChatFrames() do
+ local chatTab = getglobal("ChatFrame"..i.."Tab")
+ chatTab:Show()
+ chatTab:Hide()
+ FloatingChatFrame_Update(i)
+ end
+end
+
+function module:OnTabShow(tab, ...)
+ if self.db.profile.displaymode[tab:GetName()] == false then
+ tab:Hide()
+ end
+end
+
+function module:OnTabHide(tab, ...)
+
+
+ local p = self.db.profile
+ local i = tab:GetID()
+
+ if self.db.profile.displaymode[tab:GetName()] == true then
+ tab:Show()
+ if SELECTED_CHAT_FRAME:GetID() == i then
+ tab:SetAlpha(p.activealpha)
+ else
+ tab:SetAlpha(p.notactivealpha)
+ end
+ end
+end
+
+function module:OnTabDragStart(this, ...)
+ local p = self.db.profile
+
+ if p.preventdrag and p.on then return end
+
+ self.hooks[this].OnDragStart(this, ...)
+end
+
+
+function module:FCF_FlashTab(this)
+ local this = Prat.WOTLK and this or _G.this
+ local i = this:GetName()
+ local p = self.db.profile
+
+ if p.disableflash or p.displaymode[i] == false then
+ UIFrameFlashStop(getglobal(i.."TabFlash"))
+ end
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Clear.lua b/modules/Clear.lua
new file mode 100644
index 00000000..6bc7a355
--- /dev/null
+++ b/modules/Clear.lua
@@ -0,0 +1,187 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+--[[
+Name: module
+Revision: $Revision: r24999 $
+Author(s): Fin (fin@instinct.org)
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Clear
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Adds /clear (or /cls) and /clearall (or /clsall) commands for clearing chat frames (default=off).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("Clear")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Clear"] = true,
+ ["Adds clear text slash commands (/clear)(/cls)(/clearall)(/clsall)."] = true,
+ ["Clears the current chat frame."] = true,
+ ["Clearall"] = true,
+ ["Clears all chat frames."] = true,
+})
+
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Clear"] = "Leeren",
+-- ["Adds clear text slash commands (/clear)(/cls)(/clearall)(/clsall)."] = "F\195\188gt /clear (oder /cls) und /clearall (oder /clsall) Befehle f\195\188rs Leeren der Chatfenster hinzu.",
+-- ["Clears the current chat frame."] = "Leert das gegenw\195\164rtige Chatfenster.",
+-- ["Clearall"] = "Leere alles",
+-- ["Clears all chat frames."] = "Leert alle Chatfenster.",
+--} end)
+--
+----[[
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["Clear"] = "",
+-- ["Adds clear text slash commands (/clear)(/cls)(/clearall)(/clsall)."] = "",
+-- ["Clears the current chat frame."] = "",
+-- ["Clearall"] = "",
+-- ["Clears all chat frames."] = "",
+--} end)
+--]]
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Clear"] = "Borrar",
+-- ["Adds clear text slash commands (/clear)(/cls)(/clearall)(/clsall)."] = "Añade los comandos /clear (o /cls) y /clearall (o /clsall) para borrar el contenido de las ventanas de chat",
+-- ["Clears the current chat frame."] = "Borra el contenido de la ventana de chat actual",
+-- ["Clearall"] = "'Borrartodo'",
+-- ["Clears all chat frames."] = "Borra el contenido de todas las ventanas de chat",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Clear"] = "클리어",
+-- ["Adds clear text slash commands (/clear)(/cls)(/clearall)(/clsall)."] = "클리어 명령어 (/clear)(/cls)(/clearall)(/clsall)을 추가합니다.",
+-- ["Clears the current chat frame."] = "현재 대화창을 클리어 합니다.",
+-- ["Clearall"] = "전체클리어",
+-- ["Clears all chat frames."] = "모든 대화창을 클리어 합니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Clear"] = "清除視窗指令",
+-- ["Adds clear text slash commands (/clear)(/cls)(/clearall)(/clsall)."] = "增加 /clear (或 /cls) 以及 /clearall (或 /clsall) 指令以清除聊天視窗。",
+-- ["Clears the current chat frame."] = "清除目前聊天視窗。",
+-- ["Clearall"] = "全部清除",
+-- ["Clears all chat frames."] = "清除所有聊天視窗。",
+--} end)
+--
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Clear"] = "清除",
+-- ["Adds clear text slash commands (/clear)(/cls)(/clearall)(/clsall)."] = "增加/clear (或/cls)以及/clearall (或 /clsall)命令清除聊天窗口",
+-- ["Clears the current chat frame."] = "清除当前聊天窗信息",
+-- ["Clearall"] = "全部清除",
+-- ["Clears all chat frames."] = "清除所有聊天窗信息",
+--} end)
+
+
+local module = Prat:NewModule(PRAT_MODULE)
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = false,
+ }
+} )
+
+Prat:SetModuleOptions(module.name, {
+ name = L["Clear"],
+ desc = L["Adds clear text slash commands (/clear)(/cls)(/clearall)(/clsall)."],
+ type = "group",
+ args = {
+ }
+ }
+)
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+-- things to do when the module is enabled
+function module:OnModuleEnable()
+ Prat.RegisterChatCommand("clear", function() module:clear(SELECTED_CHAT_FRAME) end )
+ Prat.RegisterChatCommand("cls", function() module:clear(SELECTED_CHAT_FRAME) end )
+ Prat.RegisterChatCommand("clearall", function() module:clearAll() end )
+ Prat.RegisterChatCommand("clsall", function() module:clearAll() end )
+
+-- local slashcmds, cmdopts
+--
+-- -- clear
+-- cmdopts_clear = {
+-- name = L["Clear"],
+-- desc = L["Clears the current chat frame."],
+-- type = "execute",
+-- func = function() module:clear(SELECTED_CHAT_FRAME) end,
+-- }
+--
+-- -- cleartastic
+-- cmdopts_clearall = {
+-- name = L["Clearall"],
+-- desc = L["Clears all chat frames."],
+-- type = "execute",
+-- func = function() module:clearAll() end,
+-- }
+
+-- TODO - need to find call equivalent to RCC in Ace2
+-- Prat.Addon:RegisterChatCommand({ '/clear', '/cls' }, cmdopts_clear)
+-- Prat.Addon:RegisterChatCommand({ '/clearall', '/clsall' }, cmdopts_clearall)
+end
+
+function module:OnModuleDisable()
+end
+
+--[[ - - ------------------------------------------------
+ Core Functions
+--------------------------------------------- - ]]--
+
+function module:clear(chatframe)
+ local vartype = type(chatframe)
+ local type = chatframe:GetFrameType() or nil
+
+ if self.db.profile.on and type == 'ScrollingMessageFrame' then
+ chatframe:Clear()
+ end
+end
+
+function module:clearAll()
+ for i = 1, NUM_CHAT_WINDOWS do
+ self:clear(getglobal('ChatFrame' .. i))
+ end
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/CopyChat.lua b/modules/CopyChat.lua
new file mode 100644
index 00000000..fccc66da
--- /dev/null
+++ b/modules/CopyChat.lua
@@ -0,0 +1,464 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: PratCopyChat
+Revision: $Revision: 81859 $
+Author(s): Sylvanaar
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#CopyChat
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that allows you to copy text from the active chat window.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+
+local PRAT_MODULE = Prat:RequestModuleName("CopyChat")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["CopyChat"] = true,
+ ["Copy text from the active chat window."] = true,
+ ["Copy Text"] = true,
+ ["Copy all of the text in the selected chat frame into an edit box"] = true,
+ ["showbutton_name"] = "Copy Button",
+ ["showbutton_desc"] = "Show a button on the chatframe",
+ ["ChatFrame"] = true,
+ [" Text"] = true,
+ ["Message From : %s"] = true,
+ ["Copy Text Format"] = true,
+ ["Should the copied text be plain, or formatted so you can see the colors."] = true,
+ ["Plain"] = true,
+ ["HTML"] = true,
+ ["BBCode"] = true
+})
+
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["CopyChat"] = "Chat Kopieren",
+-- ["Copy text from the active chat window."] = "Ein Modul das dich Text aus dem Chat kopieren l\195\164\195\159t.",
+-- ["Copy Text"] = "Kopieren",
+-- ["Copy all of the text in the selected chat frame into an edit box"] = "Kopiert den gesammten Text im ausgew\195\164hlten Chatfenster in das Editierfeld.",
+-- ["showbutton_name"] = "Kopieren Taste",
+-- ["showbutton_desc"] = "Zeige einen Taste auf dem Chatfenster.",
+-- ["showbutton_perframename"] = "Fenster %s Taste",
+-- ["showbutton_perframedesc"] = "Zeige eine Taste auf dem %s ",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["CopyChat"] = "대화 복사",
+-- ["Copy text from the active chat window."] = "활성화된 대화창의 대화를 복사합니다.",
+-- ["Copy Text"] = "대화글 복사",
+-- ["Copy all of the text in the selected chat frame into an edit box"] = "입력창에 선택된 대화창의 모든 대화글을 복사합니다.",
+-- ["showbutton_name"] = "복사 버튼",
+-- ["showbutton_desc"] = "대화창에 복사 버튼을 표시합니다.",
+-- ["showbutton_perframename"] = "대화창%d 버튼",
+-- ["showbutton_perframedesc"] = "대화창%d에 버튼을 표시합니다.",
+-- ["ChatFrame"] = "대화창",
+-- [" Text"] = " 글자",
+-- ["Message From : %s"] = "받은 메세지 : %s",
+-- ["Copy Text Format"] = "텍스트 형식 복사",
+-- ["Should the copied text be plain, or formatted so you can see the colors."] = "Should the copied text be plain, or formatted so you can see the colors.",
+-- ["Plain"] = "Plain",
+-- ["HTML"] = "HTML",
+-- ["BBCode"] = "BBCode"
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["CopyChat"] = "Copier un chat",
+-- ["Copy text from the active chat window."] = "Copier le texte depuis la fenêtre de chat active.",
+-- ["Copy Text"] = "Copier le texte",
+-- ["Copy all of the text in the selected chat frame into an edit box"] = "Copie tout le texte de la fenêtre sélectionner dans une boite d'édition.",
+-- ["showbutton_name"] = "Bouton Copier",
+-- ["showbutton_desc"] = "Affiche un bouton sur la fenêtre de chat.",
+-- ["showbutton_perframename"] = "Bouton de la fenêtre %s ",
+-- ["showbutton_perframedesc"] = "Affiche un bouton sur la fenêtre %s .",
+--
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["CopyChat"] = "Copiar Chat",
+-- ["Copy text from the active chat window."] = "Copia el texto de la ventana de chat activa",
+-- ["Copy Text"] = "Copiar Texto",
+-- ["Copy all of the text in the selected chat frame into an edit box"] = "Copia todo el texto de la ventana de chat seleccionada a una caja de edici\195\179n",
+-- ["showbutton_name"] = "Bot\195\179n de Copiar",
+-- ["showbutton_desc"] = "Muestra un bot\195\179n en la ventana de chat",
+-- ["showbutton_perframename"] = "Bot\195\179n en ventana %s ",
+-- ["showbutton_perframedesc"] = "Muestra un bot\195\179n en la ventana de %s ",
+--
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["CopyChat"] = "複製聊天訊息",
+-- ["Copy text from the active chat window."] = "從使用中的聊天視窗複製文字。",
+-- ["Copy Text"] = "複製文字",
+-- ["Copy all of the text in the selected chat frame into an edit box"] = "複製使用中的聊天視窗中所有的文字到彈出視窗的輸入框中。",
+-- ["showbutton_name"] = "複製按鈕",
+-- ["showbutton_desc"] = "切換是否在各個聊天視窗顯示複製按鈕。",
+-- ["showbutton_perframename"] = "聊天視窗%d複製按鈕",
+-- ["showbutton_perframedesc"] = "切換是否顯示複製按鈕。",
+-- ["ChatFrame"] = "聊天視窗",
+-- [" Text"] = "的文字",
+-- ["Message From : %s"] = "訊息來自 : %s",
+-- ["Copy Text Format"] = "被複製訊息的格式",
+-- ["Should the copied text be plain, or formatted so you can see the colors."] = "被複製訊息的格式 (純文字/已格式化)。",
+-- ["Plain"] = "純文字",
+-- ["HTML"] = "HTML",
+-- ["BBCode"] = "BBCode"
+--} end)
+--
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["CopyChat"] = "复制聊天信息",
+-- ["Copy text from the active chat window."] = "从聊天窗复制文字",
+-- ["Copy Text"] = "复制文字",
+-- ["Copy all of the text in the selected chat frame into an edit box"] = "复制你在聊天窗口中所选取的文字到输入框中",
+-- ["showbutton_name"] = "复制按钮",
+-- ["showbutton_desc"] = "在聊天框体显示按钮",
+-- ["showbutton_perframename"] = "%s 按钮",
+-- ["showbutton_perframedesc"] = "在%s显示按钮.",
+-- ["ChatFrame"] = "聊天窗口",
+-- [" Text"] = "的文字",
+-- ["Message From : %s"] = "消息来自 : %s",
+--
+--} end)
+
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0", "AceTimer-3.0")
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ showbutton = {["*"] = true},
+ copyformat = "plain"
+ }
+} )
+
+Prat:SetModuleOptions(module.name, {
+ name = L["CopyChat"],
+ desc = L["Copy text from the active chat window."],
+ type = "group",
+ args = {
+ showbutton = {
+ name = L["showbutton_name"],
+ desc = L["showbutton_desc"],
+ type = "multiselect",
+ values = Prat.HookedFrameList,
+ get = "GetSubValue",
+ set = "SetSubValue"
+ },
+ copy = {
+ name = L["Copy Text"],
+ desc = L["Copy all of the text in the selected chat frame into an edit box"],
+ type = "execute",
+ order = 190,
+ func = "MenuScrape"
+ },
+ copyformat = {
+ name = L["Copy Text Format"],
+ desc = L["Should the copied text be plain, or formatted so you can see the colors."],
+ type = "select",
+ order = 195,
+ get = "GetValue",
+ set = "SetValue",
+ values = { ["plain"] = L["Plain"], ["bbcode"] = L["BBCode"] },
+ },
+
+ }
+})
+
+function module:MenuScrape()
+ self:ScrapeChatFrame(SELECTED_CHAT_FRAME)
+ HideDropDownMenu(1)
+end
+
+
+Prat:SetModuleInit(module.name,
+ function(module)
+ PratCCFrameScrollText:SetScript("OnTextChanged", function(this) module:OnTextChanged(this) end)
+ PratCCFrameScrollText:SetScript("OnEscapePressed", function(this) PratCCFrame:Hide() module.str = nil end)
+ end
+)
+
+
+function module:OnModuleEnable()
+ self.buttons = {}
+ for k,v in pairs(Prat.HookedFrames) do
+ self.buttons[k] = self:MakeReminder(v:GetID())
+ self:showbutton(k, self.db.profile.showbutton[k])
+ end
+ UnitPopupButtons["COPYCHAT"] = { text =L["Copy Text"], dist = 0 , func = function(a1, a2) module:CopyLineFromPlayerlink(a1, a2) end , arg1 = "", arg2 = ""};
+ tinsert(UnitPopupMenus["FRIEND"],#UnitPopupMenus["FRIEND"]-1,"COPYCHAT");
+
+ self:SecureHook("UnitPopup_ShowMenu")
+ self:SecureHook("ChatFrame_OnHyperlinkShow")
+end
+
+function module:ChatFrame_OnHyperlinkShow(this, ...)
+ if not Prat.WOTLK then this = _G.this end
+ self.clickedframe = this
+end
+
+function module:OnModuleDisable()
+ self:hidebuttons()
+ PratCCFrame:Hide()
+end
+
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+module.lines = {}
+module.str = nil
+
+function module:UnitPopup_ShowMenu(dropdownMenu, which, unit, name, userData, ...)
+ local ORIGIN_FRAME = self.clickedframe
+
+ for i=1, UIDROPDOWNMENU_MAXBUTTONS do
+ button = getglobal("DropDownList"..UIDROPDOWNMENU_MENU_LEVEL.."Button"..i);
+
+ if button.value == "COPYCHAT" then
+ -- self:Debug(dropdownMenu:GetName(), which, unit, name, userData, button.value, ...)
+ button.func = UnitPopupButtons["COPYCHAT"].func
+ button.arg1 = ORIGIN_FRAME
+ end
+ end
+end
+
+
+function module:GetFormattedLine(line, r, g, b)
+ local prof = self.db.profile
+ local CLR = Prat.CLR
+
+ if prof.copyformat == "plain" then
+ return line
+ end
+
+ if prof.copyformat == "bbcode" then
+ local fline = line:gsub("|c[fF][fF](%w%w%w%w%w%w)", "[color=#%1]"):gsub("|r", "[/color]")
+
+ return "[color=#"..CLR:GetHexColor(r,g,b).."]"..fline.."[/color]"
+ end
+
+
+
+end
+
+
+
+function module:CopyLineFromPlayerlink(origin_frame, ...)
+
+ -- TODO: Consider just using self.clickedFrame (I dont remember why the other code is there)
+ local frame = (origin_frame and origin_frame:GetFrameType() == "ScrollingMessageFrame" and origin_frame) or self.clickedframe
+
+ for i=1, #self.lines do
+ self.lines[i] = nil
+ end
+
+ self:AddLines(self.lines, frame:GetRegions())
+
+ local dropdownFrame = _G[UIDROPDOWNMENU_INIT_MENU]
+
+ local name = dropdownFrame.name
+ local server = dropdownFrame.server or ""
+ local linenum = dropdownFrame.lineID
+
+ local fullname = name;
+
+ if server:len()>0 then
+ fullname = name.."-"..server;
+ end
+
+ local findname = "|Hplayer:"..fullname..":"..tostring(linenum)
+
+ for i=1, #self.lines do
+ if self.lines[i]:find(findname) then
+ self:StaticPopupCopyLine(fullname, self.lines[i])
+ end
+ end
+
+end
+
+
+function module:StaticPopupCopyLine(sender, text)
+ StaticPopupDialogs["COPY_LINE"] = StaticPopupDialogs["COPY_LINE"] or {
+ text = L["Message From : %s"],
+ chattext = "",
+ button2 = ACCEPT,
+ hasEditBox = 1,
+ hasWideEditBox = 1,
+
+ OnShow = function()
+ this:SetWidth(420)
+ local editBox = _G[this:GetName().."WideEditBox"];
+ editBox:SetText(StaticPopupDialogs["COPY_LINE"].chattext);
+ editBox:SetFocus();
+ editBox:HighlightText(0);
+
+ local button = getglobal(this:GetName().."Button2");
+ button:ClearAllPoints();
+ button:SetWidth(200);
+ button:SetPoint("CENTER", editBox, "CENTER", 0, -30);
+ end,
+
+ OnHide = function() end,
+ OnAccept = function() end,
+ OnCancel = function() end,
+ EditBoxOnEscapePressed = function() this:GetParent():Hide(); end,
+ timeout = 0,
+ whileDead = 1,
+ hideOnEscape = 1
+ };
+
+ StaticPopupDialogs["COPY_LINE"].chattext = text
+ StaticPopup_Show ("COPY_LINE", sender);
+end
+
+
+function module:ScrapeChatFrame(frame, noshow)
+ frame:ScrollToBottom()
+ self:ScheduleTimer("DoCopyChatScroll", 0.1, frame)
+end
+
+function module:DoCopyChatScroll(frame, noshow)
+ self.longstr = ""
+ self.str = ""
+
+ repeat
+ self:DoCopyChat(frame, nil, true)
+ self.longstr = self.str..self.longstr -- TODO use a table, then concat
+ frame:PageUp()
+ until frame:AtTop()
+
+ frame:ScrollToBottom()
+
+ self.str, self.longstr = self.longstr
+
+ if not noshow then
+ PratCCText:SetText(L["ChatFrame"]..frame:GetName():gsub("ChatFrame", "")..L[" Text"], lines)
+ PratCCFrameScrollText:SetText(self.str or "")
+ PratCCFrame:Show()
+ end
+end
+function module:DoCopyChatArg(arg)
+ self:DoCopyChat(unpack(arg))
+end
+
+function module:DoCopyChat(frame, oldsize, noshow)
+ for i=1, #self.lines do
+ self.lines[i] = nil
+ end
+
+ self:AddLines(self.lines, frame:GetRegions())
+
+ self.str = table.concat(self.lines, "\n")
+
+ if oldsize then
+ FCF_SetChatWindowFontSize(frame, oldsize)
+ end
+
+ if not noshow then
+ PratCCText:SetText(L["ChatFrame"]..frame:GetName():gsub("ChatFrame", "")..L[" Text"], lines)
+ PratCCFrameScrollText:SetText(self.str or "")
+ PratCCFrame:Show()
+ end
+end
+
+function module:CopyChat()
+ module:ScrapeChatFrame(SELECTED_CHAT_FRAME)
+end
+
+function module:AddLines(lines, ...)
+ for i=select("#", ...),1,-1 do
+ local x = select(i, ...)
+ if x:GetObjectType() == "FontString" and not x:GetName() then
+ table.insert(lines, self:GetFormattedLine(x:GetText(), x:GetTextColor()))
+ end
+ end
+end
+
+function module:OnTextChanged(this)
+ if self.str and this:GetText() ~= self.str then
+ this:SetText(self.str)
+ self.str = nil
+ end
+ local s = PratCCFrameScrollScrollBar
+ this:GetParent():UpdateScrollChildRect()
+ local _, m = s:GetMinMaxValues()
+ if m > 0 and this.max ~= m then
+ this.max = m
+ s:SetValue(m)
+ end
+end
+
+function module:hidebuttons()
+ for k,v in pairs(self.buttons) do
+ v:Hide()
+ end
+end
+
+function module:showbutton(id, show)
+ local b = self.buttons[id]
+ if show then b:Show() else b:Hide() end
+end
+
+do
+ local function reminderOnClick(self, button, down) PlaySound("igChatBottom"); module:ScrapeChatFrame(self:GetParent()) end
+ local function reminderOnEnter(self, motion) self:SetAlpha(0.9) end
+ local function reminderOnLeave(self, motion) self:SetAlpha(0.2) end
+
+ function module:MakeReminder(id)
+ local cf = _G["ChatFrame"..id]
+ local name = "ChatFrame"..id.."PratCCReminder"
+ local b = _G[name]
+ if not b then
+ b = CreateFrame("Button", name, cf)
+ b:SetFrameStrata("BACKGROUND")
+ b:SetWidth(24)
+ b:SetHeight(24)
+ b:SetNormalTexture("Interface\\Addons\\Prat-3.0\\textures\\prat-chatcopy2")
+ b:SetPushedTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollEnd-Down")
+ b:SetHighlightTexture("Interface\\Buttons\\UI-Common-MouseHilight")
+ b:SetPoint("TOPLEFT", cf, "TOPLEFT", 0, 0)
+ b:SetScript("OnClick", reminderOnClick)
+ b:SetScript("OnEnter", reminderOnEnter)
+ b:SetScript("OnLeave", reminderOnLeave)
+ b:SetAlpha(0.2)
+ b:Hide()
+ end
+
+ return b
+ end
+end
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/CustomFilters.lua b/modules/CustomFilters.lua
new file mode 100644
index 00000000..2bf10bd7
--- /dev/null
+++ b/modules/CustomFilters.lua
@@ -0,0 +1,823 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+--[[
+Name: module
+Revision: $Revision: 80572 $
+Author(s): Sylvanaar (sylvanaar@mindspring.com)
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#CustomFilters
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module to support custom filters. (default=off).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("CustomFilters")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["module_name"] = "CustomFilters",
+ ["module_desc"] = "Module to support custom filters.",
+ ["Add Pattern"] = true,
+ ["Add a pattern to search for."] = true,
+ ["Remove Pattern"] = true,
+ ["Remove an existing pattern."] = true,
+ ["Pattern Options"] = true,
+ ["Inbound"] = true,
+ ["Outbound"] = true,
+ ["Search Pattern"] = true,
+ ["Search Format String"] = true,
+ ["Supplied pattern is a format string instead of a pattern"] = true,
+ [""] = true,
+ ["Replacement Text"] = true,
+ ["Block Message"] = true,
+ ["Prevent the message from being displayed"] = true,
+ ["Hilight Match Text"] = true,
+ ["Hilight Color"] = true,
+ ["Secondary Output"] = true,
+ ["Send to a secondary output"] = true,
+ ["Play Sound"] = true,
+ ["Play a sound when this message is output to the chatframe"] = true,
+ ["Forward"] = true,
+ ["ForwardMessage"] = true,
+ ["Forward the message to a chat channel."] = true,
+ ["Output Channel"] = true,
+ ["Channel to send output text to."] = true,
+ ["Channel Data"] = true,
+ ["Extra data for WHISPER (target) and CHANNEL (channel name or num)"] = true,
+ ["Output Message Only"] = true;
+ ["Only output the message portion of the chat text, leave out the channel, and playername etc."] = true
+})
+
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["module_name"] = "사용자 필터",
+-- ["module_desc"] = "사용자 필터를 지원하는 모듈입니다.",
+-- ["Add Pattern"] = "패턴 추가",
+-- ["Add a pattern to search for."] = "탐색할 패턴을 추가합니다.",
+-- ["Remove Pattern"] = "패턴 제거",
+-- ["Remove an existing pattern."] = "기존의 패턴을 삭제합니다.",
+-- ["Pattern Options"] = "패턴 설정",
+-- ["Inbound"] = "받는 메세지",
+-- ["Outbound"] = "보내는 메세지",
+-- ["Search Pattern"] = "패턴 탐색",
+-- ["Search Format String"] = "형식 문자열 탐색",
+-- ["Supplied pattern is a format string instead of a pattern"] = "제공된 패턴은 패턴 대신 형식 문자열입니다.",
+-- [""] = "<문자열>",
+-- ["Replacement Text"] = "문장 대체",
+-- ["Block Message"] = "메세지 차단",
+-- ["Prevent the message from being displayed"] = "메세지가 표시되는 것을 차단합니다.",
+-- ["Hilight Match Text"] = "일치 문장 강조",
+-- ["Hilight Color"] = "강조 색상",
+-- ["Secondary Output"] = "두번째 출력",
+-- ["Send to a secondary output"] = "두번째 출력에 전송합니다.",
+-- ["Play Sound"] = "효과음 재생",
+-- ["Play a sound when this message is output to the chatframe"] = "해당 메세지를 대화창에 출력할 때 효과음을 재생합니다.",
+-- ["Forward"] = "전달",
+-- ["ForwardMessage"] = "전달 메세지",
+-- ["Forward the message to a chat channel."] = "대화 채널에 메세지를 전달합니다.",
+-- ["Output Channel"] = "출력 채널",
+-- ["Channel to send output text to."] = "출력 텍스트를 전송할 채널입니다.",
+-- ["Channel Data"] = "채널 데이터",
+-- ["Extra data for WHISPER (target) and CHANNEL (channel name or num)"] = "귓속말 (대상) 과 채널 (채널명 혹은 번호)에 대한 부가 데이터",
+-- ["Output Message Only"] = "출력 메세지만",
+-- ["Only output the message portion of the chat text, leave out the channel, and playername etc."] = "대화글, 채널 떠남과 플레이어 이름등의 메세지 일부만 출력합니다."
+--} end)
+--
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["module_name"] = "自定义过滤",
+-- ["module_desc"] = "支持自定义过滤模块",
+-- ["Add Pattern"] = "增加字符串",
+-- ["Add a pattern to search for."] = "增加搜索字符串",
+-- ["Remove Pattern"] = "移出字符串",
+-- ["Remove an existing pattern."] = "移出当前字符串",
+-- ["Pattern Options"] = "字符串设置",
+-- ["Inbound"] = "入站",
+-- ["Outbound"] = "出站",
+-- ["Search Pattern"] = "搜索字符串",
+-- [""] = "<字符串>",
+-- ["Replacement Text"] = "关键字",
+-- ["Block Message"] = "屏蔽信息",
+-- ["Prevent the message from being displayed"] = "屏蔽此类信息显示",
+-- ["Hilight Match Text"] = "高亮匹配文字",
+-- ["Hilight Color"] = "颜色高亮",
+-- ["Secondary Output"] = "其他输出",
+-- ["Send to a secondary output"] = "发送到其他输出。",
+-- ["Play Sound"] = "播放音效",
+-- ["Play a sound when this message is output to the chatframe"] = "当输出消息到聊天窗口时播放音效。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["module_name"] = "自訂過濾",
+-- ["module_desc"] = "支援自訂過濾的模組。",
+-- ["Add Pattern"] = "增加字串式樣",
+-- ["Add a pattern to search for."] = "增加搜尋的字串式樣。",
+-- ["Remove Pattern"] = "移除字串式樣",
+-- ["Remove an existing pattern."] = "移除現有的字串式樣。",
+-- ["Pattern Options"] = "字串式樣選項",
+-- ["Inbound"] = "入",
+-- ["Outbound"] = "出",
+-- ["Search Pattern"] = "搜尋字串式樣",
+-- ["Search Format String"] = "搜尋格式字串",
+-- ["Supplied pattern is a format string instead of a pattern"] = "提供的式樣是格式字串而不是字串式樣。",
+-- [""] = "<字串>",
+-- ["Replacement Text"] = "替換文字",
+-- ["Block Message"] = "封鎖訊息",
+-- ["Prevent the message from being displayed"] = "阻止顯示訊息。",
+-- ["Hilight Match Text"] = "高亮符合的文字",
+-- ["Hilight Color"] = "高亮顏色",
+-- ["Secondary Output"] = "其他輸出",
+-- ["Send to a secondary output"] = "發送到其他輸出。",
+-- ["Play Sound"] = "播放音效",
+-- ["Play a sound when this message is output to the chatframe"] = "當輸出訊息到聊天視窗時播放音效。",
+-- ["Forward"] = "轉送",
+-- ["ForwardMessage"] = "轉送訊息",
+-- ["Forward the message to a chat channel."] = "轉送訊息到聊天頻道。",
+-- ["Output Channel"] = "輸出頻道",
+-- ["Channel to send output text to."] = "訊息輸出頻道。",
+-- ["Channel Data"] = "頻道資料",
+-- ["Extra data for WHISPER (target) and CHANNEL (channel name or num)"] = "輸出額外資料 (密語對象,頻道名稱/編號)。",
+-- ["Output Message Only"] = "只輸出訊息";
+-- ["Only output the message portion of the chat text, leave out the channel, and playername etc."] = "只輸出訊息部分。"
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["module_name"] = "CustomFilter",
+-- ["module_desc"] = "Ein Modul das selbsterstelle Filter verwaltet.",
+-- ["Add Pattern"] = "Filter hinzufügen",
+-- ["Add a pattern to search for."] = "Kurznamen für den Textfilter eingeben nach dem gesucht wird.",
+-- ["Remove Pattern"] = "Entferne Filter",
+-- ["Remove an existing pattern."] = "Entfernt ein existierenden Textfilter.",
+-- ["Pattern Options"] = "Textfilter Optionen",
+-- ["Inbound"] = "Eingehend",
+-- ["Outbound"] = "Ausgehend",
+-- ["Search Pattern"] = "Zu suchender Text",
+-- [""] = "",
+-- ["Replacement Text"] = "Ersatz Text",
+-- ["Block Message"] = "Blockiere Nachricht",
+-- ["Prevent the message from being displayed"] = "Verhindere das diese Nachricht angezeigt wird.",
+-- ["Hilight Match Text"] = "Zutreffenden Text hervorheben",
+-- ["Hilight Color"] = "Farbe hervorheben",
+--} end)
+
+
+local eventMap = {
+ CHAT_MSG_CHANNEL_LIST,
+ CHAT_MSG_SAY,
+ CHAT_MSG_GUILD,
+ CHAT_MSG_WHISPER_INFORM,
+ CHAT_MSG_YELL,
+ CHAT_MSG_PARTY,
+ CHAT_MSG_OFFICER,
+ CHAT_MSG_RAID,
+ CHAT_MSG_RAID_LEADER,
+ CHAT_MSG_BATTLEGROUND,
+ CHAT_MSG_BATTLEGROUND_LEADER,
+}
+
+local newmap = {}
+for i,v in ipairs(eventMap) do
+ newmap[v] = v
+end
+
+eventMap, newmap = newmap
+
+
+
+local module = Prat:NewModule(PRAT_MODULE, "LibSink-2.0")
+
+
+Prat:SetModuleDefaults(module, {
+ profile = {
+ on = false,
+
+ inbound = {
+ },
+ outbound = {
+ },
+
+ outputchannel = CHAT_MSG_SAY,
+ outputchanneldata = "",
+ sinkoptions = {}
+ }
+} )
+
+local modeOptions = { mode = {
+ inbound = {
+ type = "group",
+ name = L["Inbound"],
+ desc = L["Inbound"],
+ args = {
+ }
+ },
+ outbound = {
+ type = "group",
+ name = L["Outbound"],
+ desc = L["Outbound"],
+ args = {
+ }
+ },
+ }
+}
+
+Prat:SetModuleOptions(module, {
+ name = L["module_name"],
+ desc = L["module_desc"],
+ type = "group",
+ plugins = modeOptions,
+ args = {
+
+
+ outputchannel = {
+ type = "select",
+ name = L["Output Channel"],
+ desc = L["Channel to send output text to."],
+ order = 110,
+ values = eventMap,
+ },
+ outputchanneldata = {
+ type = "input",
+ order = 115,
+ name = L["Channel Data"],
+ desc = L["Extra data for WHISPER (target) and CHANNEL (channel name or num)"],
+ usage = "",
+ disabled = function(info) return not (info.handler.db.profile.outputchannel == CHAT_MSG_WHISPER_INFORM or info.handler.db.profile.outputchannel == CHAT_MSG_CHANNEL_LIST) end
+ },
+ outputmessageonly = {
+ type = "toggle",
+ name = L["Output Message Only"],
+ desc = L["Only output the message portion of the chat text, leave out the channel, and playername etc."],
+ order = 118,
+ }
+ }
+ }
+)
+
+
+-- local modeOpts = self.moduleOptions.args
+-- for k,v in pairs(modeOpts) do
+-- self:BuildModeOptions(k, modeOpts)
+-- end
+--
+-- self.moduleOptions.args.output = PRAT_LIBRARY(LIB.NOTIFICATIONS):GetAceOptionsDataTable(self).output
+-- self.moduleOptions.args.output.order = 107
+
+
+
+
+function module:BuildModeOptions(mode, opts)
+ local mode = mode
+ local po = opts[mode].args
+
+
+ self[mode] = {}
+ self[mode].validate = {}
+
+-- po.pathdr = {
+-- type = "header",
+-- name = L["Pattern Options"],
+-- order = 80,
+-- }
+
+ for k,v in pairs(self.db.profile[mode]) do
+ self:AddPatternOptions(po, k, mode)
+ table.insert(self[mode].validate, k)
+ end
+
+-- po.opspc = {
+-- type = "header",
+-- order = 94,
+-- }
+
+ po.addpattern = {
+ name = L["Add Pattern"],
+ desc = L["Add a pattern to search for."],
+ type = "input",
+ usage = L[""],
+ get = false,
+ set = "AddPattern"
+ }
+
+ po.removepattern = {
+ name = L["Remove Pattern"],
+ desc = L["Remove an existing pattern."],
+ type = "select",
+ get = function(info) return "" end,
+ set = "RemovePattern",
+ values = self[mode].validate,
+ disabled = function(info)
+ local mode = info[#info-1]
+ for k,v in pairs(info.handler.db.profile[mode]) do
+ return false
+ end return true end,
+ }
+
+end
+
+function module:AddPatternOptions(o, pattern, mode)
+ o[pattern] = o[pattern] or {}
+ local po = o[pattern]
+
+ local mode = mode
+ local pattern = pattern
+ po.type = "group"
+ po.name = pattern
+ po.desc = pattern
+ po.order = 90
+
+ po.args = {
+ searchfor = {
+ type = "input",
+ name = L["Search Pattern"],
+ desc = L["Search Pattern"],
+ usage = L[""],
+ get = "GetPatternValue",
+ set = "UpdatePatternValue"
+ },
+ searchfordeformat = {
+ type = "toggle",
+ name = L["Search Format String"],
+ desc = L["Supplied pattern is a format string instead of a pattern"],
+ get = "GetPatternValue",
+ set = "UpdatePatternValue"
+ },
+ replacewith = {
+ type = "input",
+ name = L["Replacement Text"],
+ desc = L["Replacement Text"],
+ usage = L[""],
+ get = "GetPatternValue",
+ set = "UpdatePatternValue",
+ disabled = "GetDisableReplace",
+ },
+ block = {
+ type = "toggle",
+ name = L["Block Message"],
+ desc = L["Prevent the message from being displayed"],
+ get = "GetPatternValue",
+ set = "SetPatternValue"
+ },
+ tosink = {
+ type = "toggle",
+ name = L["Secondary Output"],
+ desc = L["Send to a secondary output"],
+ get = "GetPatternValue",
+ set = "SetPatternValue"
+ },
+ sound = {
+ type = "select",
+ name = L["Play Sound"],
+ desc = L["Play a sound when this message is output to the chatframe"],
+ dialogControl = 'LSM30_Sound',
+ get = "GetPatternValue",
+ set = "SetPatternValue",
+ values = AceGUIWidgetLSMlists.sound,
+ },
+ hilight = {
+ type = "toggle",
+ name = L["Hilight Match Text"],
+ desc = L["Hilight Match Text"],
+ get = "GetPatternValue",
+ set = "UpdatePatternValue",
+ disabled = "GetBlockMessage",
+ },
+ hilight_color = {
+ type = "color",
+ name = L["Hilight Color"],
+ desc = L["Hilight Color"],
+ get = "GetPatternColorValue",
+ set = "SetPatternColorValue",
+ disabled = "GetBlockMessage",
+ },
+
+
+ }
+
+-- po.IsActive = function() return true end
+
+ --self.SetSinkStorage(passval, passval)
+-- po.args.output = PRAT_LIBRARY(LIB.NOTIFICATIONS):GetAceOptionsDataTable(passval).output
+ --po.args.output = self.GetSinkAce3OptionsDataTable(passval)
+end
+
+local CLR = Prat.CLR
+
+local function match(text, matchopts, mode)
+ local matchtype
+ if mode == "inbound" then
+ matchtype = "FRAME"
+ else
+ matchtype = "OUTBOUND"
+ end
+
+ local textout = text
+
+ -- in the deformat case, prat hasnt matched anythign
+ -- we have to do it here
+ if matchopts.deformat then
+ deformat = deformat or PRAT_LIBRARY(LIB.PARSING)
+ local d = { deformat:Deformat(text, matchopts.searchfor) }
+
+ if #d > 0 then
+ for i=1,#d do
+ if matchopts.hilight then
+ local hexcolor = CLR:GetHexColor(matchopts.hilight_color)
+ textout = textout:gsub(d[i], Prat:RegisterMatch(CLR:Colorize(hexcolor, d[i]), matchtype))
+ end
+ end
+ end
+ else
+
+ if matchopts.replacewith and matchopts.replacewith ~= matchopts.searchfor then
+ textout = matchopts.replacewith
+ end
+
+ if matchopts.hilight then
+ local hexcolor = CLR:GetHexColor(matchopts.hilight_color)
+ textout = CLR:Colorize(hexcolor, textout)
+ end
+
+ if matchopts.sink10OutputSink then
+ if mode == "inbound" then
+ Prat.SplitMessage.CF_SINK_OUT = matchopts
+ else
+ Prat.SplitMessageOut.CF_SINK_OUT = matchopts
+ end
+ end
+
+ if matchopts.tosink then
+ if mode == "inbound" then
+ Prat.SplitMessage.CF_SINK = true
+ else
+ Prat.SplitMessageOut.CF_SINK = true
+ end
+ end
+
+ if matchopts.sound then
+ if mode == "inbound" then
+ Prat.SplitMessage.CF_SOUND = matchopts.sound
+ else
+ Prat.SplitMessageOut.CF_SOUND = matchopts.sound
+ end
+ end
+
+ if matchopts.block then
+ if mode == "inbound" then
+ Prat.SplitMessage.DONOTPROCESS = true
+ else
+ Prat.SplitMessageOut.MESSAGE = ""
+ end
+ end
+
+
+ textout = Prat:RegisterMatch(textout, matchtype)
+ end
+
+ return textout
+end
+
+module.modulePatterns = {}
+
+function module:RegisterPattern(matchopts, mode)
+ local mode = mode
+ local matchopts = matchopts
+ if mode == "inbound" then
+ matchtype = "FRAME"
+ else
+ matchtype = "OUTBOUND"
+ end
+ local patterninfo = { pattern = matchopts.searchfor,
+ matchopts = matchopts,
+ matchfunc =
+ function(text, ...)
+ return match(text, matchopts, mode)
+ end,
+ type = matchtype,
+ deformat = matchopts.deformat }
+
+ Prat.RegisterPattern(patterninfo, self.name)
+
+ table.insert(self.modulePatterns, patterninfo)
+end
+
+function module:UnregisterPattern(matchopts)
+ local patterninfo
+ for _,v in pairs (self.modulePatterns) do
+ if v.matchopts == matchopts then
+ patterninfo = v
+ end
+ end
+
+ if patterninfo == nil then return end
+
+ if patterninfo.idx then
+ Prat.UnregisterPattern(patterninfo.idx)
+ end
+
+ local idx
+ for k,v in pairs(self.modulePatterns) do
+ if v == patterninfo then
+ idx = k
+ end
+ end
+
+ table.remove(self.modulePatterns, idx)
+end
+
+function module:UpdatePattern(matchopts)
+ local patterninfo
+ for _,v in pairs (self.modulePatterns) do
+ if v.matchopts == matchopts then
+ patterninfo = v
+ end
+ end
+
+ if patterninfo == nil then return end
+
+ local mode
+ local matchopts = matchopts
+ if patterninfo.type == "FRAME" then
+ mode = "inbound"
+ else
+ mode = "outbound"
+ end
+
+ patterninfo.pattern = matchopts.searchfor
+ patterninfo.deformat = matchopts.deformat
+ patterninfo.matchfunc =
+ function(text, ...)
+ return match(text, matchopts, mode)
+ end
+end
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+Prat:SetModuleInit(module,
+ function(self)
+ self:RegisterSink(
+ L["Forward"],
+ L["ForwardMessage"],
+ L["Forward the message to a chat channel."],
+ "Forward"
+ )
+
+ local modeOpts = modeOptions.mode
+ for k,v in pairs(modeOpts) do
+ self:BuildModeOptions(k, modeOpts)
+ end
+
+-- self:SetSinkStorage(self.db.profile.sinkoptions)
+-- self.pluginOptions.sink["output"] = self:GetSinkAce3OptionsDataTable()
+-- self.pluginOptions.sink["output"].inline = true
+-- self.pluginOptions = nil
+ end
+)
+
+-- things to do when the module is enabled
+function module:OnModuleEnable()
+ local modeOpts = modeOptions.mode
+ local mode
+ for mode,_ in pairs(modeOpts) do
+ if type(self.db.profile[mode]) == "table" then
+ local patopts
+ for _,patopts in pairs(self.db.profile[mode]) do
+ self:RegisterPattern(patopts, mode)
+ end
+ end
+ end
+
+ Prat.RegisterChatEvent(self, Prat.Events.POST_ADDMESSAGE)
+end
+
+
+function module:OnModuleDisable()
+ Prat.UnregisterAllChatEvents(self)
+end
+
+function module:Prat_PostAddMessage(message, frame, event, text, r, g, b, id)
+ local uid = Prat.EVENT_ID
+ if uid and
+ uid == self.lastevent and
+ self.lasteventtype == event then
+ return
+ end
+
+ self.lasteventtype = event
+ self.lastevent = uid
+
+
+ if message.CF_SINK or message.CF_SINK_OUT then
+ if self.db.profile.outputmessageonly then
+ self.Pour(message.CF_SINK_OUT or self, message.MESSAGE, r, g, b)
+ else
+ self.Pour(message.CF_SINK_OUT or self, text, r, g, b)
+ end
+ end
+
+ if message.CF_SOUND then
+ Prat:PlaySound(message.CF_SOUND)
+ end
+end
+
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+function module:GetPatternValue(info)
+ return self.db.profile[info[#info-2]][info[#info-1]][info[#info]]
+end
+
+function module:UpdatePatternValue(info, v)
+ self.db.profile[info[#info-2]][info[#info-1]][info[#info]] = v
+ self:UpdatePattern(self.db.profile[info[#info-2]][info[#info-1]])
+end
+
+function module:SetPatternValue(info, v)
+ self.db.profile[info[#info-2]][info[#info-1]][info[#info]] = v
+end
+
+
+local defclr = { r=1, b=1, g=1, a=1 }
+function module:GetPatternColorValue(info)
+ local c = self.db.profile[info[#info-2]][info[#info-1]][info[#info]]
+ if c == nil then
+ self.db.profile[info[#info-2]][info[#info-1]][info[#info]] = { r=1, g=1, b=1, a=1 }
+ c = self.db.profile[info[#info-2]][info[#info-1]][info[#info]]
+ end
+ return c.r, c.g, c.b, c.a
+end
+function module:SetPatternColorValue(info, r,g,b,a)
+ self.db.profile[info[#info-2]][info[#info-1]][info[#info]] = { r=r, g=g, b=b, a=a }
+end
+
+
+function module:GetPatternSearch(info)
+ return self.db.profile[info[#info-2]][info[#info-1]][info[#info]]
+end
+function module:SetPatternSearch(info, v)
+ self.db.profile[info[#info-2]][info[#info-1]][info[#info]] = v
+ self:UpdatePattern(self.db.profile[info[#info-2]][info[#info-1]])
+end
+function module:GetPatternReplace(info)
+ return self.db.profile[info[#info-2]][info[#info-1]][info[#info]]
+end
+function module:SetPatternReplace(info, v)
+ self.db.profile[info[#info-2]][info[#info-1]][info[#info]] = v
+ self:UpdatePattern(self.db.profile[info[#info-2]][info[#info-1]])
+end
+function module:GetPatternHilight(p)
+ return p.hilight
+end
+function module:SetPatternHilight(p, v)
+ p.hilight = v
+
+ self:UpdatePattern(p)
+end
+
+function module:GetDisableReplace(p)
+ return p.block or p.tosink
+end
+
+function module:GetBlockMessage(p)
+ return p.block
+end
+
+function module:SetBlockMessage(p, v)
+ p.block = v
+end
+
+function module:GetSinkMessage(p)
+ return p.tosink
+end
+function module:SetSinkMessage(p, v)
+ p.tosink = v
+end
+
+function module:GetSoundMessage(p)
+ return p.sound
+end
+function module:SetSoundMessage(p, v)
+ p.sound = v
+
+ Prat:PlaySound(v)
+end
+
+
+function module:GetUseDeformat(p)
+ return p.deformat
+end
+function module:SetUseDeformat(p, v)
+ p.deformat = v
+ self:UpdatePattern(p)
+end
+
+
+local white_clr = {r=1.0, b=1.0, g=1.0}
+function module:GetPatternHilightClr(p)
+ local h = p.hilight_color or white_clr
+ return h.r or 1.0, h.g or 1.0, h.b or 1.0
+end
+function module:SetPatternHilightClr(p, r,g,b)
+ p.hilight_color = p.hilight_color or {}
+ local h = p.hilight_color
+ h.r, h.g, h.b = r, g, b
+
+ self:UpdatePattern(p)
+end
+
+
+
+function module:AddPattern(info, pattern)
+ local mode = info[#info-1]
+ local p = self.db.profile[mode]
+
+ for k, v in pairs(p) do
+ if v.name == pattern then
+ return
+ end
+ end
+
+ local pattern = pattern
+ p[pattern] = { searchfor = pattern, replacewith = pattern }
+
+
+ self[mode].validate = self[mode].validate or {}
+ local v = self[mode].validate
+ table.insert(v, pattern)
+
+ local o = modeOptions.mode[mode].args
+ self:AddPatternOptions(o, pattern, mode)
+
+ self:RegisterPattern(p[pattern], mode)
+
+end
+
+function module:RemovePattern(info, pattern)
+ local mode = info[#info-1]
+ local p = self.db.profile[info[#info-1]]
+
+ local v = self[mode].validate
+ local idx
+
+ for k, p in pairs(v) do if pattern == k then idx = p end end
+
+ self:UnregisterPattern(p[idx])
+ p[idx] = nil
+
+ table.remove(v, pattern)
+
+ modeOptions.mode[mode].args[idx] = nil
+end
+--msg, chatType, language, channel)
+function module:Forward(source, text, r,g,b, ...)
+ local cleantext = text:gsub("|c%x%x%x%x%x%x%x%x", ""):gsub("|r", ""):gsub("|H.-|h", ""):gsub("|h", "")
+
+ if self.db.profile.outputchannel == CHAT_MSG_WHISPER_INFORM then
+ SendChatMessage(cleantext, "WHISPER", GetDefaultLanguage("player"), self.db.profile.outputchanneldata)
+ elseif self.db.profile.outputchannel == CHAT_MSG_CHANNEL_LIST then
+ SendChatMessage(cleantext, "CHANNEL", GetDefaultLanguage("player"), GetChannelName(self.db.profile.outputchanneldata))
+ else
+ local chatType = strsub(self.db.profile.outputchannel, 10)
+ SendChatMessage(cleantext, chatType, GetDefaultLanguage("player"))
+ end
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Deprecated/ChannelReordering.lua b/modules/Deprecated/ChannelReordering.lua
new file mode 100644
index 00000000..948a21b8
--- /dev/null
+++ b/modules/Deprecated/ChannelReordering.lua
@@ -0,0 +1,664 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratChannelReordering
+Revision: $Revision: 80298 $
+Author(s): Sylvanaar (sylvanaar@mindspring.com)
+ SlackerJer (slackerjer@gmail.com)
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#ChannelReordering
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that renumbers chat channels to your specification.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+-- Get Utility Libraries
+local util, DBG, CLR = GetPratUtils()
+
+local LIB = PRATLIB
+local PRAT_LIBRARY = PRAT_LIBRARY
+-- set prat module name
+local PRAT_MODULE = Prat:RequestModuleName("PratChannelReordering")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+-- define localized strings
+local loc = PRAT_LIBRARY(LIB.LOCALIZATION)
+local L = loc[PRATLIB.NEWLOCALENAMESPACE](loc, PRAT_MODULE)
+
+L[LIB.NEWLOCALE](L, "enUS", function() return {
+ ["ChannelReordering"] = true,
+ ["Channel renumbering options."] = true,
+ ["Save"] = true,
+ ["Save channel list based on current channels"] = true,
+ ["Sort"] = true,
+ ["Sort channel list in order"] = true,
+ ["Toggle"] = true,
+ ["Toggle sorting channels on load on and off."] = true,
+ ["Sort channel list in order"] = true,
+ ["Sorting on load"] = true,
+ ["Edit List"] = true,
+ ["Edit current order list"] = true,
+ ["%dth channel"] = true,
+ ["%dst channel"] = true,
+ ["%dnd channel"] = true,
+ ["%drd channel"] = true,
+ ["Set %dth channel."] = true,
+ ["Set %dst channel."] = true,
+ ["Set %dnd channel."] = true,
+ ["Set %drd channel."] = true,
+ [""] = true,
+ ["There are not enough channels available to rejoin the following:"] = true,
+ ["If you free up channels and then re-sort, the previous channels will be added"] = true,
+} end)
+
+L[LIB.NEWLOCALE](L, "koKR", function() return {
+ ["ChannelReordering"] = "채널재배열",
+ ["Channel renumbering options."] = "채널 재배열 설정입니다.",
+ ["Save"] = "저장",
+ ["Save channel list based on current channels"] = "현재 채널 상태에 따른 채널 목록을 저장합니다.",
+ ["Sort"] = "정렬",
+ ["Sort channel list in order"] = "순서대로 채널 목록을 정렬합니다.",
+ ["Toggle"] = "사용",
+ ["Toggle sorting channels on load on and off."] = "접속시 채널 정렬 사용을 켜거나 끕니다.",
+-- ["Sort channel list in order"] = "순서대로 채널 목록을 정렬합니다.",
+ ["Sorting on load"] = "접속 시 정렬 기능",
+ ["Edit List"] = "목록 편집",
+ ["Edit current order list"] = "현재 순서 목록을 편집합니다.",
+ ["%dth channel"] = "%d번째 채널",
+ ["%dst channel"] = "%d번째 채널",
+ ["%dnd channel"] = "%d번째 채널",
+ ["%drd channel"] = "%d번째 채널",
+ ["Set %dth channel."] = "%d번째 채널을 설정합니다.",
+ ["Set %dst channel."] = "%d번째 채널을 설정합니다.",
+ ["Set %dnd channel."] = "%d번째 채널을 설정합니다.",
+ ["Set %drd channel."] = "%d번째 채널을 설정합니다.",
+ [""] = "<채널명>",
+ ["There are not enough channels available to rejoin the following:"] = "다음의 재참여를 위한 사용 가능한 충분한 채널이 없습니다:",
+ ["If you free up channels and then re-sort, the previous channels will be added"] = "만약 채널에 여유를 만들고 재정렬한다면, 이전 채널들이 추가될 것입니다.",
+} end)
+
+L[LIB.NEWLOCALE](L, "esES", function() return {
+ ["ChannelReordering"] = "Reordenación de Canales",
+ ["Channel renumbering options."] = "Opciones de Reordenación de canales",
+ ["Save"] = "Guardar",
+ ["Save channel list based on current channels"] = "Guarda la lista de canales basada en los canales actuales",
+ ["Sort"] = "Ordenar",
+ ["Sort channel list in order"] = "Ordena la lista de canales",
+ ["Toggle"] = "Activar",
+ ["Toggle sorting channels on load on and off."] = "Determina si ordena los canales al cargar",
+ ["Sort channel list in order"] = "Ordena la lista de canales",
+ ["Sorting on load"] = "Ordenar al cargar",
+ ["Edit List"] = "Editar lista",
+ ["Edit current order list"] = "Edita la lista de orden actual",
+ ["%dth channel"] = "Canal n\195\186m. %d",
+ ["%dst channel"] = "Canal n\195\186m. %d",
+ ["%dnd channel"] = "Canal n\195\186m. %d",
+ ["%drd channel"] = "Canal n\195\186m. %d",
+ ["Set %dth channel."] = "Establecer como canal n\195\186mero %d",
+ ["Set %dst channel."] = "Establecer como canal n\195\186mero %d",
+ ["Set %dnd channel."] = "Establecer como canal n\195\186mero %d",
+ ["Set %drd channel."] = "Establecer como canal n\195\186mero %d",
+ [""] = "",
+} end)
+
+L[LIB.NEWLOCALE](L, "deDE", function() return {
+ ["ChannelReordering"] = "Kanal Neu Nummerrierung",
+ ["Channel renumbering options."] = "Kanal Neu Nummerrierungs Optionen",
+ ["Save"] = "Speichern",
+ ["Save channel list based on current channels"] = "Speichere die Kanalliste basierend auf den gegenw\195\164rtigen Kan\195\164len",
+ ["Sort"] = "Sortiere",
+ ["Sort channel list in order"] = "Sortiere die Kanal Liste nach Anordnung.",
+ ["Toggle"] = "Lade Sortierung",
+ ["Toggle sorting channels on load on and off."] = "Schaltet die Sortierung beim Laden an und aus.",
+ ["Sort channel list in order"] = "Sortiere die Kanal Liste nach Anordnung.",
+ ["Sorting on load"] = "Sortiere beim Laden",
+ ["Edit List"] = "Editiere Liste",
+ ["Edit current order list"] = "Editiere gegenw\195\164rtige Anordnungsliste",
+ ["%dth channel"] = "%dter Kanal",
+ ["Set %dth channel."] = "Setze %dten Kanal",
+ [""] = "",
+} end)
+
+L[LIB.NEWLOCALE](L, "frFR", function() return {
+ ["ChannelReordering"] = "R\195\169organisation des canaux",
+ ["Channel renumbering options."] = "Options de r\195\169organisation des canaux.",
+ ["Save"] = "Sauver",
+ ["Save channel list based on current channels"] = "Sauver la liste des canaux bas\195\169e sur les canaux courants.",
+ ["Sort"] = "Trier",
+ ["Sort channel list in order"] = "Trier la liste des canaux",
+ ["Toggle"] = "Activer/d\195\169sactiver",
+ ["Toggle sorting channels on load on and off."] = "Active/d\195\169sactive le tri des canaux au chargement.",
+ ["Sorting on load"] = "Tri au chargement",
+ ["Edit List"] ="Editer la liste",
+ ["Edit current order list"] = "Edite l'ordre actuel",
+ ["%dth channel"] = "%d\195\168me canal",
+ ["Set %dth channel."] = "R\195\168gle le %d\195\168me canal.",
+ [""] = "",
+} end)
+
+L[LIB.NEWLOCALE](L, "zhTW", function() return {
+ ["ChannelReordering"] = "頻道重新排序",
+ ["Channel renumbering options."] = "頻道數字變更選項。",
+ ["Save"] = "儲存",
+ ["Save channel list based on current channels"] = "依目前的頻道設定儲存頻道清單。",
+ ["Sort"] = "排序",
+ ["Sort channel list in order"] = "將頻道清單依序排列。",
+-- no use anymore ["Toggle"] = true,
+ ["Toggle sorting channels on load on and off."] = "切換模組載入後切換是否啟用頻道排序。",
+-- duplicated entry ["Sort channel list in order"] = true,
+ ["Sorting on load"] = "模組載入後排序",
+ ["Edit List"] = "編輯清單",
+ ["Edit current order list"] = "編輯現在的排序清單。",
+ ["%dth channel"] = "%d號頻道",
+ ["%dst channel"] = "%d號頻道",
+ ["%dnd channel"] = "%d號頻道",
+ ["%drd channel"] = "%d號頻道",
+ ["Set %dth channel."] = "設定%d號頻道。",
+ ["Set %dst channel."] = "設定%d號頻道。",
+ ["Set %dnd channel."] = "設定%d號頻道。",
+ ["Set %drd channel."] = "設定%d號頻道。",
+ [""] = "<頻道名稱>",
+ ["There are not enough channels available to rejoin the following:"] = "頻道不足,無法加入以下頻道:",
+ ["If you free up channels and then re-sort, the previous channels will be added"] = "如果你釋放頻道後再將其重新排序,之前的頻道將會自動加入",
+} end)
+--Chinese Translation: 月色狼影@CWDG
+--CWDG site: http://Cwowaddon.com
+L[LIB.NEWLOCALE](L, "zhCN", function() return {
+ ["ChannelReordering"] = "频道重新排列",
+ ["Channel renumbering options."] = "频道数字变更设置",
+ ["Save"] = "保存",
+ ["Save channel list based on current channels"] = "以当前频道配置保存到频道清单中",
+ ["Sort"] = "排序",
+ ["Sort channel list in order"] = "依序排列频道清单",
+ ["Toggle"] = "启用",
+ ["Toggle sorting channels on load on and off."] = "切换频道排列顺序打开或关闭",
+ ["Sort channel list in order"] = "依序排列频道清单",
+ ["Sorting on load"] = "排列接收",
+ ["Edit List"] = "编辑清单",
+ ["Edit current order list"] = "编辑当前排列清单",
+ ["%dth channel"] = "%d频道",
+ ["%dst channel"] = "%d频道",
+ ["%dnd channel"] = "%d频道",
+ ["%drd channel"] = "%d频道",
+ ["Set %dth channel."] = "设置%d频道",
+ ["Set %dst channel."] = "设置%d频道",
+ ["Set %dnd channel."] = "设置%d频道",
+ ["Set %drd channel."] = "设置%d频道",
+ [""] = "<频道名称>",
+ ["There are not enough channels available to rejoin the following:"] = "频道不足,无法加在以下频道:",
+ ["If you free up channels and then re-sort, the previous channels will be added"] = "如果你进行频道整理后重新排列,之前的频道将会自动载入",
+} end)
+
+-- define bogus channels
+local bogusChannels = {
+ [1] = "xz9lq121",
+ [2] = "xz9lq122",
+ [3] = "xz9lq123",
+ [4] = "xz9lq124",
+ [5] = "xz9lq125",
+ [6] = "xz9lq126",
+ [7] = "xz9lq127",
+ [8] = "xz9lq128",
+ [9] = "xz9lq129",
+ [10] = "xz9lq120",
+}
+
+-- holds list of channels that need to be rejoined
+local rejoinChannels = {};
+
+
+
+-- create prat module
+Prat_ChannelReordering = Prat:NewModule(PRAT_MODULE, LIB.HOOKS)
+local Prat_ChannelReordering = Prat_ChannelReordering
+Prat_ChannelReordering.pratModuleName = PRAT_MODULE
+Prat_ChannelReordering.revision = tonumber(string.sub("$Revision: 80298 $", 12, -3))
+
+-- define key module values
+Prat_ChannelReordering.moduleName = L["ChannelReordering"]
+Prat_ChannelReordering.moduleDesc = L["Channel renumbering options."]
+Prat_ChannelReordering.consoleName = "chanrenumbering"
+Prat_ChannelReordering.guiName = L["ChannelReordering"]
+
+--Prat_ChannelReordering.status = "BROKEN"
+
+-- define the default db values
+Prat_ChannelReordering.defaultDB = {
+ on = false,
+ sortonload = true,
+}
+
+-- create a moduleOptions stub (for setting self.moduleOptions)
+Prat_ChannelReordering.moduleOptions = {}
+
+-- add module options not covered by templates
+function Prat_ChannelReordering:GetModuleOptions()
+ self.moduleOptions = {
+ name = L["ChannelReordering"],
+ desc = L["Channel renumbering options."],
+ type = "group",
+ args = {
+ sort = {
+ name = L["Sort"],
+ desc = L["Sort channel list in order"],
+ type = "execute",
+ order = 100,
+ func = function() self:Sort() end,
+ disabled = function() return self.currentlySorting end,
+ },
+ save = {
+ name = L["Save"],
+ desc = L["Save channel list based on current channels"],
+ type = "execute",
+ order = 110,
+ func = function() self:Save() end,
+ disabled = function() return self.currentlySorting end,
+ },
+ edit = {
+ name = L["Edit List"],
+ desc = L["Edit current order list"],
+ type = "group",
+ disabled = function() return self.currentlySorting end,
+ order = 120,
+ args = {
+ channel1 = {
+ name = string.format(L["%dst channel"], 1),
+ desc = string.format(L["Set %dst channel."], 1),
+ type = "text",
+ usage = L[""],
+ order = 121,
+ get = function() return self.db.char.orderList[1] end,
+ set = function(v) self.db.char.orderList[1] = Prat_ChannelReordering:CleanseChannel(v) end,
+ },
+ channel2 = {
+ name = string.format(L["%dnd channel"], 2),
+ desc = string.format(L["Set %dnd channel."], 2),
+ type = "text",
+ usage = L[""],
+ order = 122,
+ get = function() return self.db.char.orderList[2] end,
+ set = function(v) self.db.char.orderList[2] = Prat_ChannelReordering:CleanseChannel(v) end,
+ },
+ channel3 = {
+ name = string.format(L["%drd channel"], 3),
+ desc = string.format(L["Set %drd channel."], 3),
+ type = "text",
+ usage = L[""],
+ order = 123,
+ get = function() return self.db.char.orderList[3] end,
+ set = function(v) self.db.char.orderList[3] = Prat_ChannelReordering:CleanseChannel(v) end,
+ },
+ channel4 = {
+ name = string.format(L["%dth channel"], 4),
+ desc = string.format(L["Set %dth channel."], 4),
+ type = "text",
+ usage = L[""],
+ order = 124,
+ get = function() return self.db.char.orderList[4] end,
+ set = function(v) self.db.char.orderList[4] = Prat_ChannelReordering:CleanseChannel(v) end,
+ },
+ channel5 = {
+ name = string.format(L["%dth channel"], 5),
+ desc = string.format(L["Set %dth channel."], 5),
+ type = "text",
+ order = 125,
+ usage = L[""],
+ get = function() return self.db.char.orderList[5] end,
+ set = function(v) self.db.char.orderList[5] = Prat_ChannelReordering:CleanseChannel(v) end,
+ },
+ channel6 = {
+ name = string.format(L["%dth channel"], 6),
+ desc = string.format(L["Set %dth channel."], 6),
+ type = "text",
+ order = 126,
+ usage = L[""],
+ get = function() return self.db.char.orderList[6] end,
+ set = function(v) self.db.char.orderList[6] = Prat_ChannelReordering:CleanseChannel(v) end,
+ },
+ channel7 = {
+ name = string.format(L["%dth channel"], 7),
+ desc = string.format(L["Set %dth channel."], 7),
+ type = "text",
+ order = 127,
+ usage = L[""],
+ get = function() return self.db.char.orderList[7] end,
+ set = function(v) self.db.char.orderList[7] = Prat_ChannelReordering:CleanseChannel(v) end,
+ },
+ channel8 = {
+ name = string.format(L["%dth channel"], 8),
+ desc = string.format(L["Set %dth channel."], 8),
+ type = "text",
+ order = 128,
+ usage = L[""],
+ get = function() return self.db.char.orderList[8] end,
+ set = function(v) self.db.char.orderList[8] = Prat_ChannelReordering:CleanseChannel(v) end,
+ },
+ channel9 = {
+ name = string.format(L["%dth channel"], 9),
+ desc = string.format(L["Set %dth channel."], 9),
+ type = "text",
+ order = 129,
+ usage = L[""],
+ get = function() return self.db.char.orderList[9] end,
+ set = function(v) self.db.char.orderList[9] = Prat_ChannelReordering:CleanseChannel(v) end,
+ },
+ channel10 = {
+ name = string.format(L["%dth channel"], 10),
+ desc = string.format(L["Set %dth channel."], 10),
+ type = "text",
+ order = 130,
+ usage = L[""],
+ get = function() return self.db.char.orderList[10] end,
+ set = function(v) self.db.char.orderList[10] = Prat_ChannelReordering:CleanseChannel(v) end,
+ },
+ },
+ },
+ load = {
+ name = L["Sorting on load"],
+ desc = L["Toggle sorting channels on load on and off."],
+ type = "toggle",
+ order = 140,
+ get = function() return self.db.profile.sortonload end,
+ set = function(v) self.db.profile.sortonload = v end,
+ }
+ }
+ }
+ return self.moduleOptions
+end
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+-- things to do when the module is initialized
+function Prat_ChannelReordering:OnModuleInit()
+ Prat:RegisterDefaults("PratChannelReordering", "char", {
+ orderList = {},
+ suspendedChannels = {},
+ })
+ self.currentlySorting = false
+end
+
+-- things to do when the module is enabled
+function Prat_ChannelReordering:OnModuleEnable()
+ -- register events
+ self[LIB.REGISTEREVENT](self, "AceEvent_FullyInitialized")
+ self[LIB.REGISTEREVENT](self, "CHAT_MSG_CHANNEL_NOTICE");
+end
+
+-- things to do when the module is disabled
+function Prat_ChannelReordering:OnModuleDisable()
+ -- unregister events
+ self:UnregisterAllEvents()
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+-- we watch this for suspended channel action (ie, trade channel)
+function Prat_ChannelReordering:CHAT_MSG_CHANNEL_NOTICE()
+ if (arg1 == "SUSPENDED") then -- suspending a server channel
+ self.db.char.suspendedChannels[arg8] = self:CleanseChannel(arg9);
+ elseif (arg1 == "YOU_JOINED") then -- check if it's a suspended channel
+-- if (self.db.char.suspendedChannels[arg8] == self:CleanseChannel(arg9)) or (self.db.char.suspendedChannels[arg8] == "UNKNOWN_SUSPENDED_CHANNEL") then -- it's ours, we're back so clear it
+ if (self.db.char.suspendedChannels[arg8] ~= nil) then -- if any channel is here, it's either not suspended or got moved
+ self.db.char.suspendedChannels[arg8] = nil;
+ end
+ end
+-- self:Debug(arg1 .. "-" .. arg2 .. "-" .. arg3 .. "-" .. arg4 .. "-" .. arg5 .. "-" .. arg6 .. "-" .. arg7 .. "-" .. arg8 .. "-" .. arg9);
+end
+
+-- this reduces server zone channels (general, trade, etc to their base parts with no zone info)
+function Prat_ChannelReordering:CleanseChannel(cname)
+ if (cname == nil) then return nil; end
+ local spaceFound = string.find(cname, " ");
+ if (spaceFound) then
+ cname = string.sub(cname, 1, spaceFound - 1);
+ end
+ return cname;
+end
+
+function Prat_ChannelReordering:AceEvent_FullyInitialized()
+ if self.db.profile.sortonload then
+ self:ScheduleEvent("Sort", self.Sort, 1, self)
+ end
+end
+
+function Prat_ChannelReordering:Save()
+ self.db.char.orderList = {};
+ for i=1,10 do
+ local cid, cname = GetChannelName(i);
+ cname = self:CleanseChannel(cname);
+ if cid > 0 and cname ~= nil then
+ self.db.char.orderList[cid] = cname;
+ end
+ end
+end
+
+function Prat_ChannelReordering:Sort()
+ self.currentlySorting = true;
+ self:Hook("ChatFrame_MessageEventHandler", true);
+ self:LeaveChannels();
+ self:ScheduleEvent("JoinChannels", self.JoinChannels, 2, self)
+end
+
+function Prat_ChannelReordering:LeaveChannels()
+ for i=1,10 do
+ local cid, cname = GetChannelName(i);
+ cname = self:CleanseChannel(cname);
+ if cid > 0 and cname ~= nil then
+ -- does this channel explicity belong here?
+ if ((self.db.char.orderList[cid]) and (string.lower(cname) == string.lower(self.db.char.orderList[cid]))) then
+ self:Debug("Found " .. cname .. " on " .. cid .. " where it belongs");
+ elseif self:IsSavedChannel(cname) then -- is this a saved chan that should be elsewhere?
+ self:Debug("Leaving " .. cid .. "-" .. cname .. " to move it");
+ LeaveChannelByName(cname);
+ elseif (self.db.char.orderList[cid] and self.db.char.orderList[cid] ~= "") then -- do we need this channel for one of our saved chans?
+ self:Debug("Leaving " .. cid .. "-" .. cname .. " to reclaim this number");
+ LeaveChannelByName(cname);
+ -- need to save and rejoin this channel later
+ table.insert(rejoinChannels, cname);
+ end
+ end
+ end
+end
+
+function Prat_ChannelReordering:GetMaxSavedChannelNumber()
+ local maxnum = 1;
+ for i = 1, 10 do
+ if (self.db.char.orderList[i] and self.db.char.orderList[i] ~= "") then
+ maxnum = i;
+ end
+ end
+ return maxnum;
+end
+
+function Prat_ChannelReordering:IsSavedChannel(channame)
+ channame = string.lower(channame);
+ for i = 1, 10 do
+ if (self.db.char.orderList[i] and string.lower(self.db.char.orderList[i]) == channame) then
+ return true;
+ end
+ end
+ return false;
+end
+
+function Prat_ChannelReordering:IsSuspendedChannel(channum)
+ if self.db.char.suspendedChannels[channum] ~= nil then
+ return true;
+ else
+ return false;
+ end
+end
+
+function Prat_ChannelReordering:CheckForSuspendedChannel(channum, channame)
+ local checkid, checkname = GetChannelName(channum);
+-- if string.lower(checkname or "1") ~= string.lower(channame or "2") then
+ self:Debug("CheckSusp: want: " .. channame .. " on " .. channum .. " have " .. (checkname or "nil"));
+ if checkname == nil then -- if no channel name then we couldn't place here
+ -- this will happen if the channel is a suspended server channel (like trade)
+ self:UnregisterAllEvents();
+ self:Debug("Found possible unknown suspended channel on " .. channum);
+ self.db.char.suspendedChannels[channum] = "UNKNOWN_SUSPENDED_CHANNEL";
+ self:ScheduleEvent("LeaveChannels", self.LeaveChannels, 2, self);
+ self:ScheduleEvent("JoinChannels", self.JoinChannels, 6, self);
+ end
+end
+
+function Prat_ChannelReordering:GetNumberSuspendedChannels()
+ local numsuspendedchans = 0;
+ for i = 1, 10 do
+ if self.db.char.suspendedChannels[i] ~= nil then
+ numsuspendedchans = numsuspendedchans + 1;
+ end
+ end
+ return numsuspendedchans;
+end
+
+function Prat_ChannelReordering:GetNumRejoinChannels()
+ local numrejoinchans = 0;
+ for key,value in pairs(rejoinChannels) do
+ numrejoinchans = numrejoinchans + 1;
+ end
+ return numrejoinchans;
+end
+
+function Prat_ChannelReordering:JoinChannels()
+ local numchannels = 0;
+ for i, v in ipairs( { GetChannelList() } ) do
+ numchannels = numchannels + 1;
+ end
+ numchannels = numchannels / 2; -- halve it because previous loop gets us chan number and name
+ numchannels = numchannels + self:GetNumberSuspendedChannels(); -- suspended chans will not be in our total yet
+ self:Debug("Starting channels: .. " .. numchannels);
+ local serverchans = { EnumerateServerChannels() };
+ local maxnum = self:GetMaxSavedChannelNumber();
+ for i = 1, maxnum do
+ if not Prat_ChannelReordering:IsSuspendedChannel(i) then
+ local checkid, checkname = GetChannelName(i);
+ checkname = self:CleanseChannel(checkname);
+ if (self.db.char.orderList[i] and self.db.char.orderList[i] ~= "") then -- we need to put a chan here
+ if (string.lower(checkname or "1") ~= string.lower(self.db.char.orderList[i] or "2")) then -- skip if our channel is already set for us
+ if string.lower(self.db.char.orderList[i]) ~= "trade" then -- trade is special, server should keep for us?
+ if (checkid == 0 and checkname == nil) then
+ self:Join(self.db.char.orderList[i]);
+ numchannels = numchannels + 1;
+ self:ScheduleEvent("CheckForSuspendedChannel"..i, self.CheckForSuspendedChannel, 1, self, i, self.db.char.orderList[i]);
+ else
+ -- if we got here, not all channels are available to us, re-leave and try to join again
+ self:Debug("Something is wrong. Channel " .. checkid .. " should be clear, but it is not. Starting over.");
+ self:ScheduleEvent("LeaveChannels", self.LeaveChannels, 2, self);
+ self:ScheduleEvent("JoinChannels", self.JoinChannels, 6, self);
+ return;
+ end
+ end
+ end
+ elseif ((checkid == 0 and checkname == nil) and (i ~= maxnum)) then -- don't fill automatically if it's the last channel we need
+ if (self:GetNumRejoinChannels() > 0) then -- fill with one of our rejoin channels
+ local rejchan = table.remove(rejoinChannels)
+ self:Join(rejchan);
+ numchannels = numchannels + 1;
+ self:ScheduleEvent("CheckForSuspendedChannel"..i, self.CheckForSuspendedChannel, 1, self, i, rejchan);
+ else -- fill with a bogus channel
+ self:Join(bogusChannels[i]);
+ numchannels = numchannels + 1;
+ self:ScheduleEvent("CheckForSuspendedChannel"..i, self.CheckForSuspendedChannel, 1, self, i, bogusChannels[i]);
+ end
+ end
+ end
+ end
+ if (numchannels >= 10) and (self:GetNumRejoinChannels() > 0) then
+ DEFAULT_CHAT_FRAME:AddMessage(L["There are not enough channels available to rejoin the following:"]);
+ end
+ for key,value in pairs(rejoinChannels) do -- rejoin any remaining leftover channels
+ if (numchannels < 10) then
+ self:Join(value);
+ table.remove(rejoinChannels, key);
+ numchannels = numchannels + 1;
+ else
+ DEFAULT_CHAT_FRAME:AddMessage("- " .. value);
+ end
+ end
+ if (self:GetNumRejoinChannels() > 0) then
+ DEFAULT_CHAT_FRAME:AddMessage(L["If you free up channels and then re-sort, the previous channels will be added"]);
+ end
+ self:ScheduleEvent("LeaveBogusChannels", self.LeaveBogusChannels, 1, self)
+end
+
+function Prat_ChannelReordering:LeaveBogusChannels()
+ for i = 1, 10 do
+ local cid, cname = GetChannelName(i);
+ if ((cid > 0) and (string.sub(cname,1,7) == string.sub(bogusChannels[1],1,7))) then
+ LeaveChannelByName(cname);
+ end
+ end
+ self:ScheduleEvent("SortingDone", self.SortingDone, 1, self);
+end
+
+function Prat_ChannelReordering:SortingDone()
+ if self:IsHooked("ChatFrame_MessageEventHandler") then
+ self:Unhook("ChatFrame_MessageEventHandler")
+ end
+ self.currentlySorting = false
+end
+
+function Prat_ChannelReordering:ChatFrame_MessageEventHandler(event)
+ local type = strsub(event, 10);
+ if (type == "CHANNEL_NOTICE") then return true end
+ return self.hooks["ChatFrame_MessageEventHandler"](event)
+end
+
+function Prat_ChannelReordering:Join(name)
+ self:Debug("Joining channel: " .. name);
+ local zoneChannel, channelName = JoinChannelByName(name, password, DEFAULT_CHAT_FRAME:GetID())
+ if channelName then
+ name = channelName
+ end
+ if not zoneChannel then
+ return
+ end
+ local i = 1
+ while DEFAULT_CHAT_FRAME.channelList[i] do
+ i = i + 1
+ end
+ DEFAULT_CHAT_FRAME.channelList[i] = name
+ DEFAULT_CHAT_FRAME.zoneChannelList[i] = zoneChannel
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Deprecated/ChatButtons.lua b/modules/Deprecated/ChatButtons.lua
new file mode 100644
index 00000000..a69b02f2
--- /dev/null
+++ b/modules/Deprecated/ChatButtons.lua
@@ -0,0 +1,620 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratChatButtons
+Revision: $Revision: 80298 $
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+ Sylvanaar (sylvanaar@mindspring.com)
+Inspired by: idChat2_Buttons by Industrial
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Buttons
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that adds chat menu and button options.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+-- Get Utility Libraries
+local util, DBG, CLR = GetPratUtils()
+
+local Prat = Prat
+
+local LIB = PRATLIB
+local PRAT_LIBRARY = PRAT_LIBRARY
+-- set prat module name
+local PRAT_MODULE = Prat:RequestModuleName("PratChatButtons")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+-- define localized strings
+local loc = PRAT_LIBRARY(LIB.LOCALIZATION)
+local L = loc[PRATLIB.NEWLOCALENAMESPACE](loc, PRAT_MODULE)
+
+L[LIB.NEWLOCALE](L, "enUS", function() return {
+ ["Buttons"] = true,
+ ["Chat window button options."] = true,
+ ["chatmenu_name"] = "Show Chat Menu",
+ ["chatmenu_desc"] = "Toggles chat menu on and off.",
+ ["Show Arrows"] = true,
+ ["Toggle showing chat arrows for each chat window."] = true,
+ ["Show Chat%d Arrows"] = true,
+ ["Toggles navigation arrows on and off."] = true,
+ ["reminder_name"] = "Show ScrollDown Reminder",
+ ["reminder_desc"] = "Show reminder button when not at the bottom of a chat window.",
+ ["Set Position"] = true,
+ ["Sets position of chat menu and arrows for all chat windows."] = true,
+ ["Default"] = true,
+ ["Right, Inside Frame"] = true,
+ ["Right, Outside Frame"] = true,
+ ["alpha_name"] = "Set Alpha",
+ ["alpha_desc"] = "Sets alpha of chat menu and arrows for all chat windows.",
+} end)
+
+--Chinese Translation: 月色狼影@CWDG
+--CWDG site: http://Cwowaddon.com
+L[LIB.NEWLOCALE](L, "zhCN", function() return {
+ ["Buttons"] = "按钮",
+ ["Chat window button options."] = "聊天窗口菜单及按钮选项。",
+ ["chatmenu_name"] = "聊天菜单",
+ ["chatmenu_desc"] = "显示聊天菜单打开与关闭。",
+ ["Show Arrows"] = "聊天按钮",
+ ["Toggle showing chat arrows for each chat window."] = "切换显示聊天按钮打开与关闭。",
+ ["Show Chat%d Arrows"] = "聊天%d 按钮",
+ ["Toggles navigation arrows on and off."] = "显示第 %d 聊天窗口按钮。",
+ ["reminder_name"] = "显示提示按钮",
+ ["reminder_desc"] = "聊天窗口不在底部时显示提示按钮。",
+ ["Set Position"] = "设置定位",
+ ["Sets position of chat menu and arrows for all chat windows."] = "为所有聊天窗口定义按钮位置.",
+ ["Default"] = "默认",
+ ["Right, Inside Frame"] = "右,聊天框内",
+ ["Right, Outside Frame"] = "右,聊天框外",
+ ["alpha_name"] = "设置透明度",
+ ["alpha_desc"] = "设置所有聊天窗按钮的透明度.",
+} end)
+
+L[LIB.NEWLOCALE](L, "zhTW", function() return {
+ ["Buttons"] = "聊天按鈕",
+ ["Chat window button options."] = "聊天視窗選單及按鈕選項。",
+ ["chatmenu_name"] = "顯示聊天功能表",
+ ["chatmenu_desc"] = "切換是否顯示聊天功能表。",
+ ["Show Arrows"] = "顯示聊天按鈕",
+ ["Toggle showing chat arrows for each chat window."] = "切換是否在各個聊天視窗顯示聊天按鈕。",
+ ["Show Chat%d Arrows"] = "聊天視窗%d顯示聊天按鈕",
+ ["Toggles navigation arrows on and off."] = "切換是否顯示聊天按鈕。",
+ ["reminder_name"] = "顯示提示按鈕",
+ ["reminder_desc"] = "聊天視窗沒有捲到最底時顯示提示按鈕。",
+ ["Set Position"] = "設定位置",
+ ["Sets position of chat menu and arrows for all chat windows."] = "設定全部聊天視窗的聊天按鈕位置。",
+ ["Default"] = "預設",
+ ["Right, Inside Frame"] = "右邊,聊天視窗內",
+ ["Right, Outside Frame"] = "右邊,聊天視窗外",
+ ["alpha_name"] = "設定透明度",
+ ["alpha_desc"] = "設定全部聊天視窗的聊天按鈕透明度。",
+} end)
+
+L[LIB.NEWLOCALE](L, "deDE", function() return {
+ ["Buttons"] = "Chat Tasten",
+ ["Chat window button options."] = "Chat Fenster Men\195\188 und Tasten Optionen.",
+ ["chatmenu_name"] = "Zeige Chat Menu",
+ ["chatmenu_desc"] = "Schaltet das Chat Men\195\188 ein und aus.",
+ ["Show Arrows"] = "Zeige Chat Tasten",
+ ["Toggle showing chat arrows for each chat window."] = "Schaltet die Chat Tastens ein und aus für jedes Chatfenster.",
+ ["Show Chat%d Arrows"] = "%d Tasten",
+ ["Toggles navigation arrows on and off."] = "Schaltet die Buttons ein und aus f\195\188r das %d .",
+ ["reminder_name"] = "Zeige Erinnerungs Button",
+ ["reminder_desc"] = "Zeige den Erinnerungs Button wenn man nicht am Ende des Chattextes ist.",
+ ["Set Position"] = "Position festlegen",
+ ["Sets position of chat menu and arrows for all chat windows."] = "Position der Tasten festlegen f\195\188r alle Chatfenster.",
+ ["Default"] = "Grundeinstellung",
+ ["Right, Inside Frame"] = "Rechts, im Fensters",
+ ["Right, Outside Frame"] = "Rechts, am Fenster",
+ ["alpha_name"] = "Helligkeit festlegen",
+ ["alpha_desc"] = "Helligkeit der Tasten festlegen f\195\188r alle Chatfenster.",
+} end)
+
+L[LIB.NEWLOCALE](L, "frFR", function() return {
+ ["Buttons"] = "Boutons de discussion",
+ ["Chat window button options."] = "Options du menu et des boutons de chat.",
+ ["chatmenu_name"] = "Afficher le menu de chat",
+ ["chatmenu_desc"] = "Affiche ou masque le menu de chat.",
+ ["Show Arrows"] = "Afficher les boutons de chat",
+ ["Toggle showing chat arrows for each chat window."] = "Affiche ou masque les boutons pour chaque fen\195\170tre de chat.",
+ ["Show Chat%d Arrows"] = "Boutons du %d ",
+ ["Toggles navigation arrows on and off."] = "Affiche ou masque les boutons pour la fen\195\170tre de %d .",
+ ["reminder_name"] = "Afficher le bouton de rappel de d\195\169filement",
+ ["reminder_desc"] = "Affiche un bouton pour retourner en bas de la fen\195\170tre de chat quand vous n'y \195\170tes pas.",
+ ["Set Position"] = "Position des boutons",
+ ["Sets position of chat menu and arrows for all chat windows."] = "Change la position des boutons pour chaque fen\195\170tre de chat.",
+ ["Default"] = "D\195\169faut",
+ ["Right, Inside Frame"] = "Droite, à l'int\195\169rieur",
+ ["Right, Outside Frame"] = "Droite, a l'ext\195\169rieur",
+ ["alpha_name"] = "R\195\169gler la transparence",
+ ["alpha_desc"] = "R\195\168gle la transparence de tous les boutons.",
+} end)
+
+L[LIB.NEWLOCALE](L, "esES", function() return {
+ ["Buttons"] = "Botones",
+ ["Chat window button options."] = "Opciones del men\195\186 de chat y botones",
+ ["chatmenu_name"] = "Men\195\186 de Chat",
+ ["chatmenu_desc"] = "Activa y desactiva el men\195\186 de chat",
+ ["Show Arrows"] = "Botones de Chat",
+ ["Toggle showing chat arrows for each chat window."] = "Activa y desactiva los botones de las ventanas de chat",
+ ["Show Chat%d Arrows"] = "Botones del %d ",
+ ["Toggles navigation arrows on and off."] = "Activa y desactiva los cursores en la caja de edici\195\179n del chat",
+ ["reminder_name"] = "Mostrar Bot\195\179n de Recordatorio",
+ ["reminder_desc"] = "Muestra el bot\195\179n de recordatorio cuando no est\195\161s en la parte inferior de una ventana de chat.",
+ ["Set Position"] = "Posici\195\179n",
+ ["Sets position of chat menu and arrows for all chat windows."] = "Posici\195\179n de los botones para todas las ventanas de chat.",
+ ["Default"] = "Por Defecto",
+ ["Right, Inside Frame"] = "Derecha, dentro del marco",
+ ["Right, Outside Frame"] = "Derecha, fuera del marco",
+ ["alpha_name"] = "Transparencia",
+ ["alpha_desc"] = "Transparencia de los botones para todas las ventanas de chat.",
+} end)
+
+L[LIB.NEWLOCALE](L, "koKR", function() return {
+ ["Buttons"] = "버튼",
+ ["Chat window button options."] = "대화창 버튼 설정입니다.",
+ ["chatmenu_name"] = "대화 메뉴 표시",
+ ["chatmenu_desc"] = "대화 메뉴를 표시합니다.",
+ ["Show Arrows"] = "버튼 표시",
+ ["Toggle showing chat arrows for each chat window."] = "각 대화창에 대한 대화 버튼 표시를 전환합니다.",
+ ["Show Chat%d Arrows"] = "%d 대화창 버튼 표시",
+ ["Toggles navigation arrows on and off."] = "네비게이션 버튼 켜고 끄기를 전환합니다.",
+ ["reminder_name"] = "스크롤 버튼 표시",
+ ["reminder_desc"] = "대화창의 하단이 아니면 스크롤 버튼을 표시합니다.",
+ ["Set Position"] = "위치 설정",
+ ["Sets position of chat menu and arrows for all chat windows."] = "모든 대화창에 대한 대화 메뉴와 버튼의 의치를 설정합니다.",
+ ["Default"] = "기본",
+ ["Right, Inside Frame"] = "우측, 창 내부",
+ ["Right, Outside Frame"] = "우측, 창 외부",
+ ["alpha_name"] = "투명도 설정",
+ ["alpha_desc"] = "모든 대화창에 대한 대화 메뉴와 버튼의 투명도를 설정합니다.",
+} end)
+
+
+
+-- create prat module
+Prat_ChatButtons = Prat:NewModule(PRAT_MODULE, LIB.HOOKS)
+local Prat_ChatButtons = Prat_ChatButtons
+Prat_ChatButtons.pratModuleName = PRAT_MODULE
+Prat_ChatButtons.revision = tonumber(string.sub("$Revision: 80298 $", 12, -3))
+
+-- define key module values
+Prat_ChatButtons.moduleName = L["Buttons"]
+Prat_ChatButtons.moduleDesc = L["Chat window button options."]
+Prat_ChatButtons.consoleName = "buttons"
+Prat_ChatButtons.guiName = L["Buttons"]
+
+
+-- define the default db values
+Prat_ChatButtons.defaultDB = {
+ on = true,
+ chatmenu = false,
+ chatbutton = {false, false, false, false, false, false, false},
+ position = "DEFAULT",
+ reminder = false,
+ alpha = 1.0,
+}
+
+-- create a moduleOptions stub (for setting self.moduleOptions)
+Prat_ChatButtons.moduleOptions = {}
+
+-- build the options menu using prat templates
+Prat_ChatButtons.toggleOptions = {
+ chatmenu = {
+ type = "toggle",
+ order = 110,
+ set = function(v) Prat_ChatButtons.db.profile.chatmenu = v Prat_ChatButtons:ChatMenu(v) end,
+ },
+ sep125_sep = 125,
+ reminder = 130,
+ sep135_sep = 135,
+ alpha = {
+ type = "range",
+ set = function(v) Prat_ChatButtons.db.profile.alpha = v; Prat_ChatButtons:ConfigureAllFrames() end,
+ min = 0.1,
+ max = 1,
+ step = 0.1,
+ order = 150
+ }
+}
+
+-- add module options not covered by templates
+function Prat_ChatButtons:GetModuleOptions()
+ self.moduleOptions = {
+ name = L["Buttons"],
+ desc = L["Chat window button options."],
+ type = "group",
+ args = {
+ chatarrows = {
+ name = L["Show Arrows"],
+ desc = L["Toggle showing chat arrows for each chat window."],
+ type = "group",
+ order = 120,
+ args = {
+ chat1 = {
+ name = string.format(L["Show Chat%d Arrows"], 1),
+ desc = string.format(L["Toggles navigation arrows on and off."], 1),
+ type = "toggle",
+ get = function() return self.db.profile.chatbutton[1] end,
+ set = function(v) self.db.profile.chatbutton[1] = v; self:chatbutton(1,v) end
+ },
+ chat2 = {
+ name = string.format(L["Show Chat%d Arrows"], 2),
+ desc = string.format(L["Toggles navigation arrows on and off."], 2),
+ type = "toggle",
+ get = function() return self.db.profile.chatbutton[2] end,
+ set = function(v) self.db.profile.chatbutton[2] = v; self:chatbutton(2,v) end
+ },
+ chat3 = {
+ name = string.format(L["Show Chat%d Arrows"], 3),
+ desc = string.format(L["Toggles navigation arrows on and off."], 3),
+ type = "toggle",
+ get = function() return self.db.profile.chatbutton[3] end,
+ set = function(v) self.db.profile.chatbutton[3] = v; self:chatbutton(3,v) end
+ },
+ chat4 = {
+ name = string.format(L["Show Chat%d Arrows"], 4),
+ desc = string.format(L["Toggles navigation arrows on and off."], 4),
+ type = "toggle",
+ get = function() return self.db.profile.chatbutton[4] end,
+ set = function(v) self.db.profile.chatbutton[4] = v; self:chatbutton(4,v) end
+ },
+ chat5 = {
+ name = string.format(L["Show Chat%d Arrows"], 5),
+ desc = string.format(L["Toggles navigation arrows on and off."], 5),
+ type = "toggle",
+ get = function() return self.db.profile.chatbutton[5] end,
+ set = function(v) self.db.profile.chatbutton[5] = v; self:chatbutton(5,v) end
+ },
+ chat6 = {
+ name = string.format(L["Show Chat%d Arrows"], 6),
+ desc = string.format(L["Toggles navigation arrows on and off."], 6),
+ type = "toggle",
+ get = function() return self.db.profile.chatbutton[6] end,
+ set = function(v) self.db.profile.chatbutton[6] = v; self:chatbutton(6,v) end
+ },
+ chat7 = {
+ name = string.format(L["Show Chat%d Arrows"], 7),
+ desc = string.format(L["Toggles navigation arrows on and off."], 7),
+ type = "toggle",
+ get = function() return self.db.profile.chatbutton[7] end,
+ set = function(v) self.db.profile.chatbutton[7] = v; self:chatbutton(7,v) end
+ },
+ }
+ },
+ position = {
+ name = L["Set Position"],
+ desc = L["Sets position of chat menu and arrows for all chat windows."],
+ type = "text",
+ order = 140,
+ get = function() return self.db.profile.position end,
+ set = function(v) self.db.profile.position = v; self:ConfigureAllFrames() end,
+ validate = {["DEFAULT"] = L["Default"], ["RIGHTINSIDE"] = L["Right, Inside Frame"], ["RIGHTOUTSIDE"] = L["Right, Outside Frame"]}
+ }
+ }
+ }
+ return self.moduleOptions
+end
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+-- things to do when the module is enabled
+function Prat_ChatButtons:OnModuleEnable()
+ -- stub variables for frame handling
+ self.frames = {}
+ self.reminders = {}
+ -- create reminder buttons
+ for i = 1,NUM_CHAT_WINDOWS do
+ table.insert(self.reminders, self:MakeReminder(i))
+ self:chatbutton(i,self.db.profile.chatbutton[i])
+ end
+ self:ChatMenu(self.db.profile.chatmenu)
+ -- set OnUpdateInterval, if they are profiling, update less
+ if GetCVar("scriptProfile") == "1" then
+ self.OnUpdateInterval = 0.5
+ else
+ self.OnUpdateInterval = 0.05
+ end
+ -- hook functions
+ self:SecureHook("ChatFrame_OnUpdate", "ModuleOnUpdateHook")
+end
+
+-- things to do when the module is disabled
+function Prat_ChatButtons:OnModuleDisable()
+ -- show chatmenu
+ self:ChatMenu(true)
+ -- show all the chatbuttons
+ for i = 1,NUM_CHAT_WINDOWS do
+ self:chatbutton(i,true)
+ end
+ -- unhook functions
+ self:UnhookAll()
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+function Prat_ChatButtons:ConfigureAllFrames()
+ for i = 1,NUM_CHAT_WINDOWS do
+ self:chatbutton(i,self.db.profile.chatbutton[i])
+ end
+ self:ChatMenu(self.db.profile.chatmenu)
+end
+
+-- do something with the hook
+function Prat_ChatButtons:OnModuleOnUpdateHook(this, elapsed)
+ if ( not this:IsShown() ) then
+ return;
+ end
+ local id = this:GetID()
+ local prof = self.db.profile
+ local show = prof.chatbutton[id]
+
+ self:chatbutton(id, show)
+ self:ChatFrame_OnUpdateTextFlow(this, elapsed)
+
+ -- This is all code for the 'reminder' from here on
+ if show then
+ return
+ end
+ if not prof.reminder then
+ return
+ end
+ local remind = getglobal(this:GetName().."ScrollDownReminder");
+ local flash = getglobal(this:GetName().."ScrollDownReminderFlash");
+ if ( not flash ) then
+ return
+ end
+ if ( this:AtBottom() ) then
+ if ( remind:IsShown() ) then
+ remind:Hide();
+ UIFrameFlashRemoveFrame(flash)
+ end
+ return;
+ else
+ if ( remind:IsShown() ) then
+ return
+ end
+ remind:Show()
+ UIFrameFlash(flash, 0, 0, -1, false, CHAT_BUTTON_FLASH_TIME, CHAT_BUTTON_FLASH_TIME)
+ end
+end
+
+-- manipulate chatframe menu button
+function Prat_ChatButtons:ChatMenu(visible)
+ -- define variables used
+ local f = self.frames[1]
+ if not f then
+ self.frames[1] = {}
+ f = self.frames[1]
+ end
+ f.cfScrl = f.cfScrl or {}
+ f.cfScrl.up = getglobal("ChatFrame1UpButton")
+ -- chatmenu position:
+ -- position chatmenu under the UpButton for chatframe1 if button position is set to "RIGHTINSIDE"
+ -- otherwise position chatmenu above the UpButton for chatframe1
+ ChatFrameMenuButton:ClearAllPoints()
+ if self.db.profile.position == "RIGHTINSIDE" then
+ ChatFrameMenuButton:SetPoint("TOP", f.cfScrl.up, "BOTTOM")
+ else
+ ChatFrameMenuButton:SetPoint("BOTTOM", f.cfScrl.up, "TOP")
+ end
+ -- chatmenu alpha:
+ -- set alpha of the chatmenu based on the alpha setting
+ ChatFrameMenuButton:SetAlpha(self.db.profile.alpha)
+ -- chatmenu visibility
+ -- show buttons based on show settings
+ if visible then
+ ChatFrameMenuButton:Show()
+ else
+ ChatFrameMenuButton:Hide()
+ end
+end
+
+-- manipulate chatframe scrolling and reminder buttons
+function Prat_ChatButtons:chatbutton(id,visible)
+ -- define variables used
+ local f = self.frames[id]
+ local id = this:GetID()
+ if not f then
+ self.frames[id] = {}
+ f = self.frames[id]
+ end
+
+ f.cfScrl = f.cfScrl or {}
+ f.cf = f.cf or getglobal("ChatFrame"..id)
+ f.cfScrl.up = f.cfScrl.up or getglobal("ChatFrame"..id.."UpButton")
+ f.cfScrl.down = f.cfScrl.down or getglobal("ChatFrame"..id.."DownButton")
+ f.cfScrl.bottom = f.cfScrl.bottom or getglobal("ChatFrame"..id.."BottomButton")
+
+ f.cfScrlheight = (f.cfScrlheight and f.cfScrlheight > 0) and f.cfScrlheight or ((f.cfScrl.up and f.cfScrl.down and f.cfScrl.bottom) and
+ (f.cfScrl.up:GetHeight() + f.cfScrl.down:GetHeight() + f.cfScrl.bottom:GetHeight()) or 0)
+ f.cfreminder = f.cfreminder or self:MakeReminder(id)
+ f.cfreminderflash = f.cfreminderflash or getglobal("ChatFrame"..id.."ScrollDownReminderFlash")
+
+ -- chatbuttons position:
+ -- position of the chatbuttons based on position setting
+ if f.cfScrl.bottom and f.cfScrl.up then
+ f.cfScrl.bottom:ClearAllPoints()
+ f.cfScrl.up:ClearAllPoints()
+ if self.db.profile.position == "RIGHTINSIDE" then
+ f.cfScrl.bottom:SetPoint("BOTTOMRIGHT", f.cf, "BOTTOMRIGHT", 0, -4)
+ f.cfScrl.up:SetPoint("TOPRIGHT", f.cf, "TOPRIGHT", 0, -4)
+ elseif self.db.profile.position == "RIGHTOUTSIDE" then
+ f.cfScrl.bottom:SetPoint("BOTTOMLEFT", f.cf, "BOTTOMRIGHT", 0, -4)
+ f.cfScrl.up:SetPoint("BOTTOM", f.cfScrl.down, "TOP", 0, -2)
+ else
+ f.cfScrl.bottom:SetPoint("BOTTOMLEFT", f.cf, "BOTTOMLEFT", -32, -4)
+ f.cfScrl.up:SetPoint("BOTTOM", f.cfScrl.down, "TOP", 0, -2)
+ end
+ end
+
+ -- chatbuttons alpha:
+ -- set alpha of the chatbuttons based on the alpha setting
+ for _,v in pairs(f.cfScrl) do
+ v:SetAlpha(self.db.profile.alpha)
+ end
+ -- chatbuttons visibility:
+ -- show buttons based on visible value passed to function
+ if f.cf then
+ if visible and (f.cf:GetHeight() > f.cfScrlheight) then
+ for k, v in pairs(f.cfScrl) do
+ f.cfScrl[k]:Show()
+ end
+ else
+ for k, v in pairs(f.cfScrl) do
+ f.cfScrl[k]:Hide()
+ end
+ -- reminder visibility:
+ -- show the reminder button (if enabled) when not at the bottom of the chatframe
+ if (not f.cf:AtBottom()) and self.db.profile.reminder and (f.cf:GetHeight() > f.cfreminder:GetHeight()) then
+ f.cfreminder:Show()
+ f.cfreminderflash:Show()
+ else
+ f.cfreminder:Hide()
+ f.cfreminderflash:Hide()
+ end
+ end
+ end
+end
+
+-- create a "reminder" button
+function Prat_ChatButtons:MakeReminder(id)
+ -- define variables used
+ local cf = getglobal("ChatFrame"..id)
+ local b = getglobal("ChatFrame"..id.."ScrollDownReminder")
+ if b then return b end
+ b = CreateFrame("Button","ChatFrame"..id.."ScrollDownReminder",cf )
+ -- define the parameters for the button
+ b:SetFrameStrata("BACKGROUND")
+ b:SetWidth(24)
+ b:SetHeight(24)
+ b:SetNormalTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollEnd-Up")
+ b:SetPushedTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollEnd-Down")
+ b:SetHighlightTexture("Interface\\Buttons\\UI-Common-MouseHilight")
+ b:SetPoint("RIGHT", cf, "RIGHT", 0, 0)
+ b:SetPoint("LEFT", cf, "RIGHT", -32, 0)
+ b:SetPoint("TOP", cf, "BOTTOM", 0, 28)
+ b:SetPoint("BOTTOM", cf, "BOTTOM", 0, 0)
+ b:SetScript("OnClick", function() PlaySound("igChatBottom"); this:GetParent():ScrollToBottom() end)
+ -- hide the button by default
+ b:Hide()
+ -- add a flash texture for the reminder button
+ self:AddFlashTexture(b)
+
+ return b
+end
+
+-- create a "flash" texture
+function Prat_ChatButtons:AddFlashTexture(frame)
+ -- define variables used
+ local t = frame:CreateTexture(frame:GetName().."Flash", "OVERLAY")
+ -- define the parameters for the texture
+ t:SetTexture("Interface\\ChatFrame\\UI-ChatIcon-BlinkHilight")
+ t:SetPoint("CENTER", frame, "CENTER", 0, 1)
+ t:SetBlendMode("ADD")
+ t:SetAlpha(0.5)
+ -- hide the texture by default
+ t:Hide()
+end
+
+-- used for flowing text around a button which is on the frame
+local avoid_frames = {}
+
+-- used for flowing text around a button which is on the frame
+local function intersects_pts(o1t, o1b, o2t, o2b)
+ -- above
+ local above = o1t > o2t and o1b > o2t
+ -- below
+ local below = o1t < o2b and o1b < o2b
+ -- either one true and we dont intersect
+ return not( above or below )
+end
+
+-- used for flowing text around a button which is on the frame
+local function intersects_line(line, frame)
+ return intersects_pts(line:GetTop(), line:GetBottom(), frame:GetTop(), frame:GetBottom())
+end
+
+-- flow text around a button which is on the frame
+function Prat_ChatButtons:ChatFrame_OnUpdateTextFlow(this, elapsed)
+ if self.db.profile.position == "RIGHTINSIDE" then
+ local id = this:GetID()
+ local af = avoid_frames[id]
+ if not af then
+ avoid_frames[id] = {}
+ af = avoid_frames[id]
+ end
+ af.cfup = af.cfup or getglobal("ChatFrame"..id.."UpButton")
+ af.cfdown = af.cfdown or getglobal("ChatFrame"..id.."DownButton")
+ af.cfbottom = af.cfbottom or getglobal("ChatFrame"..id.."BottomButton")
+ af.cfreminder = af.cfreminder or getglobal("ChatFrame"..id.."ScrollDownReminder")
+ for i=this:GetNumRegions(),1,-1 do
+ local line = select(i, this:GetRegions())
+ if line:GetObjectType() == "FontString" then
+ local found = false
+ for k,v in pairs(af) do
+ if v:IsVisible() and intersects_line(line, v) then
+ line:SetPoint("RIGHT", v, "LEFT", 0, 0)
+ local w = select(3, line:GetRect())
+ line:SetWidth(w)
+ found = true
+ break
+ end
+ end
+ if not found then
+ line:SetPoint("RIGHT", this, "RIGHT", 0, 0)
+ local w = select(3, line:GetRect())
+ line:SetWidth(w)
+ end
+
+ if line:GetTop() > this:GetTop() then
+ line:Hide()
+ else
+ line:Show()
+ end
+ end
+ end
+ end
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Deprecated/ChatLangButton.lua b/modules/Deprecated/ChatLangButton.lua
new file mode 100644
index 00000000..3ceb9bfd
--- /dev/null
+++ b/modules/Deprecated/ChatLangButton.lua
@@ -0,0 +1,153 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratChatLangButton
+Revision: $Revision: 25389 $
+Author(s): Derkyle (derkyle@gmail.com)
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Buttons
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that adds the chat language button to chat frame.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+-- Get Utility Libraries
+local util, DBG, CLR = GetPratUtils()
+
+local LIB = PRATLIB
+local PRAT_LIBRARY = PRAT_LIBRARY
+-- set prat module name
+local PRAT_MODULE = Prat:RequestModuleName("PratChatLangButton")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+-- define localized strings
+local loc = PRAT_LIBRARY(LIB.LOCALIZATION)
+local L = loc[PRATLIB.NEWLOCALENAMESPACE](loc, PRAT_MODULE)
+
+
+L[LIB.NEWLOCALE](L, "enUS", function() return {
+ ["ChatLangButton"] = true,
+ ["Toggle the chat language button."] = true,
+} end)
+
+L[LIB.NEWLOCALE](L, "deDE", function() return {
+ ["ChatLangButton"] = "Chat Sprachentaste",
+ ["Toggle the chat language button."] = "Aktiviert die Chat Sprachentaste.",
+} end)
+
+L[LIB.NEWLOCALE](L, "frFR", function() return {
+ ["ChatLangButton"] = "Choix de la langue",
+ ["Toggle the chat language button."] = "Active/dsactive le bouton de choix de la langue.",
+} end)
+
+L[LIB.NEWLOCALE](L, "koKR", function() return {
+ ["ChatLangButton"] = "대화언어버튼",
+ ["Toggle the chat language button."] = "대화 언어 버튼을 표시합니다.",
+} end)
+
+L[LIB.NEWLOCALE](L, "zhTW", function() return {
+ ["ChatLangButton"] = "聊天語言按鈕",
+ ["Toggle the chat language button."] = "切換是否顯示聊天語言按鈕。",
+} end)
+
+L[LIB.NEWLOCALE](L, "esES", function() return {
+ ["ChatLangButton"] = "Botón de Idioma de Chat",
+ ["Toggle the chat language button."] = "Muestra y oculta el botón de idioma de chat",
+} end)
+--Chinese Translation: 月色狼影@CWDG
+--CWDG site: http://Cwowaddon.com
+L[LIB.NEWLOCALE](L, "zhCN", function() return {
+ ["ChatLangButton"] = "语言设置按钮",
+ ["Toggle the chat language button."] = "切换显示聊天框语言设置按钮",
+} end)
+
+
+
+-- create prat module
+Prat_ChatLangButton = Prat:NewModule(PRAT_MODULE)
+local Prat_ChatLangButton = Prat_ChatLangButton
+Prat_ChatLangButton.pratModuleName = PRAT_MODULE
+Prat_ChatLangButton.revision = tonumber(string.sub("$Revision: 25389 $", 12, -3))
+
+-- define key module values
+Prat_ChatLangButton.moduleName = L["ChatLangButton"]
+Prat_ChatLangButton.moduleDesc = L["Toggle the chat language button."]
+Prat_ChatLangButton.consoleName = "chatlangbutton"
+Prat_ChatLangButton.guiName = L["ChatLangButton"]
+
+
+-- define the default db values
+Prat_ChatLangButton.defaultDB = {
+ on = false,
+ colors = {},
+}
+
+-- create a moduleOptions stub (for setting self.moduleOptions)
+Prat_ChatLangButton.moduleOptions = {}
+
+-- build the options menu using prat templates
+Prat_ChatLangButton.toggleOptions = {}
+
+-- add module options not covered by templates
+function Prat_ChatLangButton:GetModuleOptions()
+ self.moduleOptions = {
+ name = L["ChatLangButton"],
+ desc = L["Toggle the chat language button."],
+ type = "group",
+ args = {
+ }
+ }
+ return self.moduleOptions
+end
+
+--[[------------------------------------------------
+ Module Toggle Functions
+------------------------------------------------]]--
+
+-- things to do when the module is enabled
+function Prat_ChatLangButton:OnModuleEnable()
+ ChatFrameMenuButton:Show();
+ --ChatMenu:Show();
+end
+
+-- things to do when the module is disabled
+function Prat_ChatLangButton:OnModuleDisable()
+ -- unregister events
+ ChatFrameMenuButton:Hide();
+end
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Editbox.lua b/modules/Editbox.lua
new file mode 100644
index 00000000..bdef5a45
--- /dev/null
+++ b/modules/Editbox.lua
@@ -0,0 +1,828 @@
+----------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratEditbox
+Revision: $Revision: 80463 $
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+Inspired by: idChat2_Editbox by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Editbox
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that adds editbox options.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("Editbox")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Editbox"] = true,
+ ["Editbox options."] = true,
+ ["Set Alpha"] = true,
+ ["Set the alpha of the editbox."] = true,
+ ["Set Position"] = true,
+ ["Set the position of the editbox."] = true,
+ ["Hide Border"] = true,
+ ["Hide the border around the edit box."] = true,
+ ["Set Width (NB: only enabled if the editbox is undocked)"] = true,
+ ["Set the width of the editbox."] = true,
+ ["Lock Position"] = true,
+ ["Lock editbox position if undocked."] = true,
+ ["Enable Arrowkeys"] = true,
+ ["Enable using arrowkeys in editbox without the alt key."] = true,
+ ["Autohide"] = true,
+ ["Hide the edit box after you have pressed enter."] = true,
+ ["Clickable"] = true,
+ ["Click the edit box to open it up for editing. Only available if Autohide is disabled."] = true,
+ ["Top"] = true,
+ ["Bottom"] = true,
+ ["Undocked"] = true,
+ ['Set the frame strata of the editbox.'] = true,
+ ['Set Strata'] = true,
+ ['DIALOG'] = true,
+ ['HIGH'] = true,
+ ['MEDIUM'] = true,
+ ['LOW'] = true,
+ ['BACKGROUND'] = true,
+ ['Texture'] = true,
+ ['Set the texture of the chat edit box'] = true,
+ ['Bar colour'] = true,
+ ['Set the edit box background colour'] = true,
+ ['Border width'] = true,
+ ["Set the width of the edit box's border"] = true,
+ ['Border colour'] = true,
+ ['Set the edit box border colour'] = true,
+ ['Padding'] = true,
+ ["Set the amount of padding inside the edit box"] = true,
+})
+
+----Chinese Translation: 月色狼影@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Editbox"] = "输入框",
+-- ["Editbox options."] = "输入框选项.",
+-- ["Set Alpha"] = "透明度",
+-- ["Set the alpha of the editbox."] = "设置编辑框透明度.",
+-- ["Set Position"] = "位置",
+-- ["Set the position of the editbox."] = "设置编辑框位置.",
+-- ["Hide Border"] = "隐藏边框",
+-- ["Hide the border around the edit box."] = "隐藏编辑框的边框.",
+-- ["Set Width (NB: only enabled if the editbox is undocked)"] = "宽度(仅当编辑框悬浮时有效)",
+-- ["Set the width of the editbox."] = "设置编辑框宽度",
+-- ["Lock Position"] = "锁定",
+-- ["Lock editbox position if undocked."] = "卸除时锁定编辑框位置.",
+-- ["Enable Arrowkeys"] = "开启方向键",
+-- ["Enable using arrowkeys in editbox without the alt key."] = "不用 直接使用方向键编辑.",
+-- ["Autohide"] = "自动隐藏",
+-- ["Hide the edit box after you have pressed enter."] = "按下输入键后隐藏编辑框.",
+-- ["Clickable"] = "可点击",
+-- ["Click the edit box to open it up for editing. Only available if Autohide is disabled."] = "点击打开编辑框编辑, 仅在自动隐藏关闭时有效.",
+-- ["Top"] = "顶部",
+-- ["Bottom"] = "底部",
+-- ["Undocked"] = "卸除",
+-- ['Set the frame strata of the editbox.'] = "设定聊天輸入框框架显示层级。",
+-- ['Set Strata'] = "显示层级",
+-- ['DIALOG'] = "对话框",
+-- ['HIGH'] = "高",
+-- ['MEDIUM'] = "中",
+-- ['LOW'] = "低",
+-- ['BACKGROUND'] = "背景",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["Editbox"] = "Zone de saisie",
+-- ["Editbox options."] = "Options de la zone de saisie",
+-- ["Set Alpha"] = "Transparence",
+-- ["Set the alpha of the editbox."] = "R\195\168gle la transparence de la zone de saisie.",
+-- ["Set Position"] = "Position",
+-- ["Set the position of the editbox."] = "Change la position de la zone de saisie",
+-- ["Hide Border"] = "Cache les bords",
+-- ["Hide the border around the edit box."] = "Ache les bordure autour de la zone de saisie",
+-- ["Set Width (NB: only enabled if the editbox is undocked)"] = "Definit la largeur",
+-- ["Set the width of the editbox."] = "Definit la largeur",
+-- ["Lock Position"] = "Verrouiller la position",
+-- ["Lock editbox position if undocked."] = "Verrouille la position de la zone de saisie si elle est libre.",
+-- ["Enable Arrowkeys"] = "Activer les fl\195\168ches du clavier",
+-- ["Enable using arrowkeys in editbox without the alt key."] = "Permet d'utiliser les fl\195\168ches du clavier sans utiliser Alt.",
+-- ["Autohide"] = "cache auto",
+-- ["Hide the edit box after you have pressed enter."] = "cacher la zone de saisie apr?s avoir presse Entrer",
+-- ["Clickable"] = "Cliquable",
+-- ["Click the edit box to open it up for editing. Only available if Autohide is disabled."] = "Cliquer sur la zone de saisie ouvre l'edition. Seulement valable si autohide est descative.",
+-- ["Top"] = "Haut",
+-- ["Bottom"] = "Bas",
+-- ["Undocked"] = "Mouvement libre",
+-- ['Set the frame strata of the editbox.'] = "Met la strata de la zone de saisie",
+-- ['Set Strata'] = "Defini le strata",
+-- ['DIALOG'] = "Dialog",
+-- ['HIGH'] = "Haut",
+-- ['MEDIUM'] = "Moyen",
+-- ['LOW'] = "Bas",
+-- ['BACKGROUND'] = "Fond",
+--
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Editbox"] = "입력창",
+-- ["Editbox options."] = "입력창 설정입니다.",
+-- ["Set Alpha"] = "투명도 설정",
+-- ["Set the alpha of the editbox."] = "입력창의 투명도를 설정합니다.",
+-- ["Set Position"] = "위치 설정",
+-- ["Set the position of the editbox."] = "입력창의 위치를 설정합니다.",
+-- ["Hide Border"] = "테두리 숨김",
+-- ["Hide the border around the edit box."] = "입력창 주변의 테두리를 숨깁니다.",
+-- ["Set Width (NB: only enabled if the editbox is undocked)"] = "너비 설정 (NB: 입력창이 분리되었을 때 적용)",
+-- ["Set the width of the editbox."] = "입력창의 넓이를 설정합니다.",
+-- ["Lock Position"] = "위치 고정",
+-- ["Lock editbox position if undocked."] = "입력창의 위치를 고정합니다.",
+-- ["Enable Arrowkeys"] = "방향키 사용",
+-- ["Enable using arrowkeys in editbox without the alt key."] = "ALT키를 누르지 않고 입력창에 방향키를 사용합니다.",
+-- ["Autohide"] = "자동 숨김",
+-- ["Hide the edit box after you have pressed enter."] = "엔터키 입력 후 입력창을 숨깁니다.",
+-- ["Clickable"] = "클릭 사용",
+-- ["Click the edit box to open it up for editing. Only available if Autohide is disabled."] = "Click the edit box to open it up for editing. Only available if Autohide is disabled.",
+-- ["Top"] = "상단",
+-- ["Bottom"] = "하단",
+-- ["Undocked"] = "분리됨",
+-- ['Set the frame strata of the editbox.'] = "입력창의 프레임 우선순위를 설정합니다.",
+-- ['Set Strata'] = "우선순위 설정",
+-- ['DIALOG'] = "DIALOG",
+-- ['HIGH'] = "HIGH",
+-- ['MEDIUM'] = "MEDIUM",
+-- ['LOW'] = "LOW",
+-- ['BACKGROUND'] = "BACKGROUND",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Editbox"] = "聊天輸入框",
+-- ["Editbox options."] = "聊天輸入框選項。",
+-- ["Set Alpha"] = "透明度",
+-- ["Set the alpha of the editbox."] = "設定聊天輸入框透明度。",
+-- ["Set Position"] = "位置",
+-- ["Set the position of the editbox."] = "設定聊天輸入框位置。",
+-- ["Hide Border"] = "隱藏邊框",
+-- ["Hide the border around the edit box."] = "隱藏聊天輸入框的邊框。",
+-- ["Set Width (NB: only enabled if the editbox is undocked)"] = "寬度 (註: 聊天輸入框浮動時才有效)",
+-- ["Set the width of the editbox."] = "設定聊天輸入框寬度。",
+-- ["Lock Position"] = "鎖定",
+-- ["Lock editbox position if undocked."] = "浮動時鎖定聊天輸入框位置。",
+-- ["Enable Arrowkeys"] = "啟用方向鍵",
+-- ["Enable using arrowkeys in editbox without the alt key."] = "不用Alt鍵直接使用方向鍵編輯。",
+-- ["Autohide"] = "自動隱藏",
+-- ["Hide the edit box after you have pressed enter."] = "按下輸入鍵後隱藏聊天輸入框。",
+-- ["Clickable"] = "可點擊",
+-- ["Click the edit box to open it up for editing. Only available if Autohide is disabled."] = "點擊打開輸入框編輯,僅在自動隱藏停用時有效。",
+-- ["Top"] = "頂部",
+-- ["Bottom"] = "底部",
+-- ["Undocked"] = "浮動",
+-- ['Set the frame strata of the editbox.'] = "設定聊天輸入框框架顯示層級。",
+-- ['Set Strata'] = "顯示層級",
+-- ['DIALOG'] = "對話框",
+-- ['HIGH'] = "高",
+-- ['MEDIUM'] = "中",
+-- ['LOW'] = "低",
+-- ['BACKGROUND'] = "背景",
+-- ['Texture'] = "材質",
+-- ['Set the texture of the chat edit box'] = "設定聊天輸入框的材質。",
+-- ['Bar colour'] = "背景顏色",
+-- ['Set the edit box background colour'] = "設定聊天輸入框的背景顏色。",
+-- ['Border width'] = "邊框寬度",
+-- ["Set the width of the edit box's border"] = "設定聊天輸入框的邊框寬度。",
+-- ['Border colour'] = "邊框顏色",
+-- ['Set the edit box border colour'] = "設定聊天輸入框的邊框顏色。",
+-- ['Padding'] = "間距",
+-- ["Set the amount of padding inside the edit box"] = "設定聊天輸入框的邊框間距。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Editbox"] = "Caja de Edici\195\179n",
+-- ["Editbox options."] = "Opciones de la caja de edici\195\179n",
+-- ["Set Alpha"] = "Transparencia",
+-- ["Set the alpha of the editbox."] = "Establece la transparencia de la caja de edici\195\179n",
+-- ["Set Position"] = "Posici\195\179n",
+-- ["Set the position of the editbox."] = "Establece la posici\195\179n de la caja de edici\195\179n",
+-- ["Set Width (NB: only enabled if the editbox is undocked)"] = "Anchura (Nota: Solo activo si la caja de edici\195\179n no est\195\161 anclada",
+-- ["Set the width of the editbox."] = "Establece la anchura de la caja de edici\195\179n",
+-- ["Lock Position"] = "Bloqueado",
+-- ["Lock editbox position if undocked."] = "Bloquea la posici\195\179n de la caja de edici\195\179n cuando no est\195\161 anclada",
+-- ["Enable Arrowkeys"] = "Teclas de Direcci\195\179n",
+-- ["Enable using arrowkeys in editbox without the alt key."] = "Determina si se usan las teclas de direcci\195\179n en la caja de edici\195\179n sin la tecla Alt",
+-- ["Autohide"] = "AutoOcultar",
+-- ["Hide the edit box after you have pressed enter."] = "Oculta la caja de edici\195\179n despu\195\169s de pulsar enter.",
+-- ["Clickable"] = "Cliqueable",
+-- ["Click the edit box to open it up for editing. Only available if Autohide is disabled."] = "Click la caja de edici\195\179n para abrirla para editarla. Solo disponible si AutoOcultar est\195\161 desactivado.",
+-- ["Top"] = "Arriba",
+-- ["Bottom"] = "Abajo",
+-- ["Undocked"] = "Suelto",
+-- ['Set the frame strata of the editbox.'] = "Establece el orden del marco de la caja de edici\195\179n.",
+-- ['Set Strata'] = "Establecer el Orden",
+-- ['DIALOG'] = "DIALOGO",
+-- ['HIGH'] = "ALTO",
+-- ['MEDIUM'] = "MEDIO",
+-- ['LOW'] = "BAJO",
+-- ['BACKGROUND'] = "FONDO",
+-- ['Texture'] = "Textura",
+-- ['Set the texture of the chat edit box'] = "Establece la textura de la caja de edici\195\179n del chat",
+-- ['Bar colour'] = "Color de la Barra",
+-- ['Set the edit box background colour'] = "Establece el color de fondo de la caja de edici\195\179n",
+-- ['Border width'] = "Ancho del borde",
+-- ["Set the width of the edit box's border"] = "Establece el ancho del borde de la caja de edici\195\179n",
+-- ['Border colour'] = "Color del borde",
+-- ['Set the edit box border colour'] = "Establece el color del borde de la caja de edici\195\179n",
+-- ['Padding'] = "Margen",
+-- ["Set the amount of padding inside the edit box"] = "Establece el margen del interior de la caja de edici\195\179n",
+--} end)
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Editbox"] = "Eingabefeld",
+-- ["Editbox options."] = "Eingabefeld Optionen.",
+-- ["Set Alpha"] = "Helligkeit einstellen",
+-- ["Set the alpha of the editbox."] = "Stellt die Helligkeit f\195\188r das Eingabefeld ein.",
+-- ["Set Position"] = "Position einstellen",
+-- ["Set the position of the editbox."] = "Position des Eingabefelds festlegen",
+-- ["Hide Border"] = "Rahmen verstecken",
+-- ["Hide the border around the edit box."] = "Rahmen um das Eingabefeld verstecken",
+-- ["Set Width (NB: only enabled if the editbox is undocked)"] = "Breite einstellen",
+-- ["Set the width of the editbox."] = "Stellt die Breite des Eingabefelds ein.",
+-- ["Lock Position"] = "Sperre Position",
+-- ["Lock editbox position if undocked."] = "Sperrt die Position des Eingabefelds falls freigegeben.",
+-- ["Enable Arrowkeys"] = "Aktiviere Pfeiltasten",
+-- ["Enable using arrowkeys in editbox without the alt key."] = "Aktiviere das benutzen von Pfeiltasten ohne die Alt-Taste benutzen zu m\195\188ssen.",
+-- ["Autohide"] = "Automatisch Verstecken",
+-- ["Hide the edit box after you have pressed enter."] = "Versteckt das Eingabefeld nachdem du Enter gedr?ckt hast.",
+-- ["Clickable"] = "Klickbar",
+-- ["Click the edit box to open it up for editing. Only available if Autohide is disabled."] = "Klicke auf das Einfabefeld um es f?r Eingaben zu oeffnen.",
+-- ["Top"] = "Oben",
+-- ["Bottom"] = "Unten",
+-- ["Undocked"] = "Frei",
+-- ['Set the frame strata of the editbox.'] = "Bestimmt die Helligkeit des eingabefeldes",
+-- ['Set Strata'] = "Bestimmt die Helligkeit",
+-- ['DIALOG'] = "Dialog",
+-- ['HIGH'] = "Hoch",
+-- ['MEDIUM'] = "Mittel",
+-- ['LOW'] = "Niedrig",
+-- ['BACKGROUND'] = "Hintergrund",
+--} end)
+
+
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ alpha = 1,
+ position = "TOP",
+ hideborder = false,
+ width = 400,
+ undocked = {point = "CENTER", relativeTo="UIParent", relativePoint = "CENTER", xoff = 0, yoff = 0},
+ locked = false,
+ arrowkeys = true,
+ autohide = true,
+ clickable = false,
+ strata = nil,
+ texture = nil,
+ texturebg = nil,
+ backdropcolour = { 0, 0, 0, 1 },
+ bordercolour = { 0, 0, 0, 1 },
+ borderwidth = 0,
+ padding = 4,
+ }
+} )
+
+
+module.defaultRegions = nil
+module.using = false
+module.parent = nil
+
+Prat:SetModuleOptions(module, {
+ name = L["Editbox"],
+ desc = L["Editbox options."],
+ type = "group",
+ args = {
+ position = {
+ name = L["Set Position"],
+ desc = L["Set the position of the editbox."],
+ type = "select",
+ order = 110,
+ values = {["TOP"] = L["Top"], ["BOTTOM"] = L["Bottom"], ["UNDOCKED"] = L["Undocked"]},
+ },
+ width = {
+ name = L["Set Width (NB: only enabled if the editbox is undocked)"],
+ desc = L["Set the width of the editbox."],
+ type = "range",
+ order = 120,
+ min = 267,
+ max = 800,
+ step = 1,
+ disabled = function(info) if info.handler.db.profile.position == "UNDOCKED" then return false else return true end end,
+ },
+ locked = {
+ name = L["Lock Position"],
+ desc = L["Lock editbox position if undocked."],
+ type = "toggle",
+ order = 130,
+ disabled = function(info) if info.handler.db.profile.position == "UNDOCKED" then return false else return true end end,
+ },
+ alpha = {
+ name = L["Set Alpha"],
+ desc = L["Set the alpha of the editbox."],
+ type = "range",
+ order = 140,
+ min = 0,
+ max = 1,
+ step = 0.05,
+ },
+ strata = {
+ name = L['Set Strata'],
+ desc = L['Set the frame strata of the editbox.'],
+ type = 'select',
+ order = 150,
+ values = {
+ ['DIALOG'] = L['DIALOG'],
+ ['HIGH'] = L['HIGH'],
+ ['MEDIUM'] = L['MEDIUM'],
+ ['LOW'] = L['LOW'],
+ ['BACKGROUND'] = L['BACKGROUND'],
+ },
+ },
+ hideborder = {
+ name = L["Hide Border"],
+ desc = L["Hide the border around the edit box."],
+ type = "toggle",
+ order = 160,
+ },
+ arrowkeys = {
+ name = L["Enable Arrowkeys"],
+ desc = L["Enable using arrowkeys in editbox without the alt key."],
+ type = "toggle",
+ order = 170,
+z },
+ autohide = {
+ name = L["Autohide"],
+ desc = L["Hide the edit box after you have pressed enter."],
+ type = "toggle",
+ order = 180,
+ },
+ clickable = {
+ name = L["Clickable"],
+ desc = L["Click the edit box to open it up for editing. Only available if Autohide is disabled."],
+ type = "toggle",
+ order = 190,
+ disabled = function (info) return info.handler.db.profile.autohide end,
+ },
+ texture = {
+ name = L['Texture'],
+ order = 200,
+ desc = L['Set the texture of the chat edit box'],
+ type = 'select',
+ dialogControl = 'LSM30_Background',
+ values = AceGUIWidgetLSMlists.background,
+ get = function(info) return info.handler.db.profile.texture end,
+ set = function(info, texture)
+ info.handler.db.profile.texture = texture
+ info.handler:SetBackdrop(info.handler.db.profile.texture)
+ end,
+ },
+ bordertexture = {
+ name = 'Border Texture',
+ order = 200,
+ desc = 'Border Texture',
+ type = 'select',
+ dialogControl = 'LSM30_Border',
+ values = AceGUIWidgetLSMlists.border,
+ get = function(info) return info.handler.db.profile.bordertexture end,
+ set = function(info, bordertexture)
+ info.handler.db.profile.bordertexture = bordertexture
+ info.handler:SetBackdrop()
+ end,
+ },
+ backdropcolour = {
+ name = L['Bar colour'],
+ order = 205,
+ desc = L['Set the edit box background colour'],
+ type = 'color',
+ set = function(info, r, g, b, a)
+ info.handler.db.profile.backdropcolour = { r, g, b, a }
+ return info.handler:SetBackdropColourTo(unpack(info.handler.db.profile.backdropcolour))
+ end,
+ get = function(info)
+ return unpack(info.handler.db.profile.backdropcolour)
+ end,
+ hasAlpha = true,
+ },
+ borderwidth = {
+ name = L['Border width'],
+ order = 210,
+ type = 'range',
+ min = 1,
+ max = 30,
+ step = 1,
+ desc = L["Set the width of the edit box's border"],
+ set = function(info, width)
+ info.handler.db.profile.borderwidth = width
+ info.handler:SetBackdrop(info.handler.db.profile.texture)
+ info.handler:SetBackdropColourTo(unpack(info.handler.db.profile.backdropcolour))
+ end,
+ get = function(info) return info.handler.db.profile.borderwidth or 0 end,
+ --disabled = function(info) return info.handler.db.profile.hideborder end,
+ },
+ bordercolour = {
+ name = L['Border colour'],
+ order = 220,
+ desc = L['Set the edit box border colour'],
+ type = 'color',
+ set = function(info, r, g, b, a)
+ info.handler.db.profile.bordercolour = { r, g, b, a }
+ return info.handler:SetBackdropBorderColorTo(unpack(info.handler.db.profile.bordercolour))
+ end,
+ get = function(info)
+ return unpack(info.handler.db.profile.bordercolour)
+ end,
+ hasAlpha = true,
+ -- disabled = function(info) return info.handler.db.profile.hideborder end,
+ },
+ padding = {
+ name = L['Padding'],
+ order = 230,
+ type = 'range',
+ min = 1,
+ max = 30,
+ step = 1,
+ desc = L["Set the amount of padding inside the edit box"],
+ set = function(info, padding)
+ info.handler.db.profile.padding = padding
+ info.handler:SetBackdrop(info.handler.db.profile.texture)
+ info.handler:SetBackdropColourTo(unpack(info.handler.db.profile.backdropcolour))
+ end,
+ get = function(info) return info.handler.db.profile.padding or 4 end,
+ --disabled = function(info) return info.handler.db.profile.hideborder end,
+ },
+ }
+ }
+)
+
+function module:OnValueChanged(info, b)
+ local field = info[#info]
+ if field == "position" or field == "width" or field == "locked" then
+ self:Position(self.db.profile.position)
+ elseif field == "arrowkeys" then
+ self:ArrowKeys(b)
+ elseif field == "hideborder" then
+ self:HideBorder(b)
+ elseif field == "strata" then
+ self:SetStrata(b)
+ elseif field == "autohide" then
+ self:AutoHide(b)
+ elseif field == "clickable" then
+ self:Clickable(b)
+ elseif field == "alpha" then
+ self:Alpha(b)
+ end
+end
+
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+local SharedMedia = Prat.Media
+-- things to do when the module is enabled
+function module:OnModuleEnable()
+ self.parent = ChatFrameEditBox:GetParent()
+ self:Position(self.db.profile.position)
+ self:Alpha(self.db.profile.alpha)
+ self:ArrowKeys(self.db.profile.arrowkeys)
+
+
+ self:HideBorder(self.db.profile.hideborder)
+ self:AutoHide(self.db.profile.autohide)
+ self:Clickable(self.db.profile.clickable)
+
+ if self.db.profile.strata then
+ self:SetStrata(strata)
+ end
+
+ if self.db.profile.texture then
+ self:SetBackdrop(self.db.profile.texture)
+ self:SetBackdropColourTo(unpack(self.db.profile.backdropcolour))
+ end
+end
+
+-- things to do when the module is disabled
+function module:OnModuleDisable()
+ self:Position("BOTTOM")
+ self:Alpha(1)
+ self:HideBorder(false)
+ self:ArrowKeys(false)
+ self:AutoHide(true)
+ self:Clickable(false)
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+function module:Alpha(value)
+ local eb = VisorEditbox or ChatFrameEditBox
+ for i,v in ipairs({eb:GetRegions()}) do
+ if i==6 or i==7 or i==8 then
+ v:SetAlpha(value)
+ end
+ end
+end
+
+function module:ArrowKeys(enabled)
+ local eb = VisorEditBox or ChatFrameEditBox
+ if enabled then eb:SetAltArrowKeyMode(false) else eb:SetAltArrowKeyMode(true) end
+end
+
+function module:Position(option)
+ local eb = VisorEditBox or ChatFrameEditBox
+ eb:ClearAllPoints()
+ if option == "TOP" then
+ eb:SetPoint("BOTTOMLEFT", "ChatFrame1", "TOPLEFT", -5, 0)
+ eb:SetPoint("BOTTOMRIGHT", "ChatFrame1", "TOPRIGHT", 5, 0)
+ end
+ if option == "BOTTOM" then
+ eb:SetPoint("TOPLEFT", "ChatFrame1", "BOTTOMLEFT", -5, 0)
+ eb:SetPoint("TOPRIGHT", "ChatFrame1", "BOTTOMRIGHT", 5, 0)
+ end
+ if option == "UNDOCKED" then
+ eb:SetMovable(true)
+ eb:EnableMouse(true)
+ eb:RegisterForDrag("LeftButton")
+ eb:SetScript("OnDragStart", function(eb) if not self.db.profile.locked then eb:StartMoving() end end)
+ eb:SetScript("OnDragStop", function(eb)
+ eb:StopMovingOrSizing()
+ local point, relativeTo, relativePoint, xoff, yoff = eb:GetPoint()
+ self.db.profile.undocked.point = point
+ -- self.db.profile.undocked.relativeTo = relativeTo:GetName() -- this causes game crash, keep commented out
+ self.db.profile.undocked.relativePoint = relativePoint
+ self.db.profile.undocked.xoff = xoff
+ self.db.profile.undocked.yoff = yoff
+ end)
+ eb:SetPoint(self.db.profile.undocked.point, self.db.profile.undocked.relativeTo, self.db.profile.undocked.relativePoint, self.db.profile.undocked.xoff, self.db.profile.undocked.yoff)
+ eb:SetWidth(self.db.profile.width)
+ end
+end
+
+function module:HideBorder(hide)
+ local eb = VisorEditbox or ChatFrameEditBox
+ local regions = { eb:GetRegions() }
+ local editBoxLeft = regions[6]
+ local editBoxRight = regions[7]
+ local editBoxMiddle = regions[8]
+
+ if (not self.defaultRegions) then
+ self.defaultRegions = {
+ left = {
+ width = editBoxLeft:GetWidth(),
+ height = editBoxLeft:GetHeight(),
+ texCoord = { editBoxLeft:GetTexCoord() },
+ texture = editBoxLeft:GetTexture(),
+ },
+ middle = {
+ width = editBoxMiddle:GetWidth(),
+ height = editBoxMiddle:GetHeight(),
+ texCoord = { editBoxMiddle:GetTexCoord() },
+ texture = editBoxMiddle:GetTexture(),
+ },
+ right = {
+ width = editBoxRight:GetWidth(),
+ height = editBoxRight:GetHeight(),
+ texCoord = { editBoxRight:GetTexCoord() },
+ texture = editBoxRight:GetTexture(),
+ },
+ }
+ end
+
+ if (hide) then
+
+ editBoxLeft:SetWidth(16)
+ editBoxLeft:SetHeight(32)
+ editBoxLeft:SetTexCoord(0, 0.0625, 0, 1.0)
+ editBoxLeft:SetTexture("Interface\\AddOns\\"..Prat.FolderLocation.."\\textures\\prat-editnotexture")
+
+ editBoxMiddle:SetWidth(1)
+ editBoxMiddle:SetHeight(32)
+ editBoxMiddle:SetTexCoord(0.0625, 0.9375, 0, 1.0)
+ editBoxMiddle:SetTexture("Interface\\AddOns\\"..Prat.FolderLocation.."\\textures\\prat-editnotexture")
+
+ editBoxRight:SetWidth(16)
+ editBoxRight:SetHeight(32)
+ editBoxRight:SetTexCoord(0.9375, 1.0, 0, 1.0)
+ editBoxRight:SetTexture("Interface\\AddOns\\"..Prat.FolderLocation.."\\textures\\prat-editnotexture")
+
+ else
+
+ editBoxLeft:SetWidth(self.defaultRegions.left.width)
+ editBoxLeft:SetHeight(self.defaultRegions.left.height)
+ editBoxLeft:SetTexCoord(self.defaultRegions.left.texCoord[1], self.defaultRegions.left.texCoord[2],
+ self.defaultRegions.left.texCoord[3], self.defaultRegions.left.texCoord[4],
+ self.defaultRegions.left.texCoord[5], self.defaultRegions.left.texCoord[6],
+ self.defaultRegions.left.texCoord[7], self.defaultRegions.left.texCoord[8])
+ editBoxLeft:SetTexture(self.defaultRegions.left.texture)
+
+ editBoxMiddle:SetWidth(self.defaultRegions.middle.width)
+ editBoxMiddle:SetHeight(self.defaultRegions.middle.height)
+ editBoxMiddle:SetTexCoord(self.defaultRegions.middle.texCoord[1], self.defaultRegions.middle.texCoord[2],
+ self.defaultRegions.middle.texCoord[3], self.defaultRegions.middle.texCoord[4],
+ self.defaultRegions.middle.texCoord[5], self.defaultRegions.middle.texCoord[6],
+ self.defaultRegions.middle.texCoord[7], self.defaultRegions.middle.texCoord[8])
+ editBoxMiddle:SetTexture(self.defaultRegions.middle.texture)
+
+ editBoxRight:SetWidth(self.defaultRegions.right.width)
+ editBoxRight:SetHeight(self.defaultRegions.right.height)
+ editBoxRight:SetTexCoord(self.defaultRegions.right.texCoord[1], self.defaultRegions.right.texCoord[2],
+ self.defaultRegions.right.texCoord[3], self.defaultRegions.right.texCoord[4],
+ self.defaultRegions.right.texCoord[5], self.defaultRegions.right.texCoord[6],
+ self.defaultRegions.right.texCoord[7], self.defaultRegions.right.texCoord[8])
+ editBoxRight:SetTexture(self.defaultRegions.right.texture)
+
+ end
+end
+
+function module:AutoHide(enabled)
+
+ if (enabled) then
+
+ if (self:IsHooked("ChatFrame_OpenChat")) then
+ self:Unhook("ChatFrame_OpenChat")
+ end
+ if (self:IsHooked(ChatFrameEditBox, "Hide")) then
+ self:Unhook(ChatFrameEditBox, "Hide")
+ end
+ if (self:IsHooked(ChatFrameEditBox, "IsVisible")) then
+ self:Unhook(ChatFrameEditBox, "IsVisible")
+ end
+ if (self:IsHooked(ChatFrameEditBox, "IsShown")) then
+ self:Unhook(ChatFrameEditBox, "IsShown")
+ end
+ if (self.parent and self:IsHooked(self.parent, "Show")) then
+ self:Unhook(self.parent, "Show")
+ end
+ self:ResetToAutoHide()
+
+ else
+
+ self:RawHook("ChatFrame_OpenChat", "OpenChat", true)
+ self:RawHook(ChatFrameEditBox, "Hide", true)
+ self:RawHook(ChatFrameEditBox, "IsVisible", "IsUsing", true)
+ self:RawHook(ChatFrameEditBox, "IsShown", "IsUsing", true)
+ if self.parent then
+ self:SecureHook(self.parent, "Show", "parentShow")
+ end
+ self:OpenChat("", nil)
+ self:Hide()
+ end
+end
+
+function module:OpenChat(text, chatFrame)
+ self.using = true
+
+ ChatFrameEditBox:EnableKeyboard(true)
+
+ ChatEdit_UpdateHeader(ChatFrameEditBox)
+
+ if self.hooks['ChatFrame_OpenChat'] then
+ self.hooks["ChatFrame_OpenChat"](text, chatFrame)
+ end
+end
+
+function module:Hide()
+ self.using = false
+
+ ChatFrameEditBoxHeader:SetTextColor(0, 0, 0, 0)
+ ChatFrameEditBox:SetTextColor(0, 0, 0, 0)
+ ChatFrameEditBox:EnableKeyboard(false)
+end
+
+function module:parentShow()
+ self:OpenChat("", nil)
+ self:Hide()
+end
+
+function module:IsUsing()
+ return self.using
+end
+
+function module:ResetToAutoHide()
+
+ self.using = false
+
+ ChatFrameEditBox:EnableKeyboard(true)
+ ChatFrameEditBox:Hide()
+
+end
+
+function module:Clickable(enabled)
+
+ if (enabled) then
+
+ self:HookScript(ChatFrameEditBox, "OnMouseDown")
+
+ elseif (self:IsHooked(ChatFrameEditBox, "OnMouseDown")) then
+
+ self:Unhook(ChatFrameEditBox, "OnMouseDown")
+
+ end
+
+end
+
+function module:OnMouseDown(...)
+ if (not self.using) then
+ self:OpenChat("", nil)
+ else
+ self.hooks[ChatFrameEditBox]["OnMouseDown"](...)
+ end
+
+end
+
+function module:SetStrata(strata)
+ strata = strata or ChatFrameEditBox:GetFrameStrata()
+ ChatFrameEditBox:SetFrameStrata(strata)
+end
+
+function module:GetBackdropTexture()
+ return SharedMedia:Fetch('background', self.db.profile.texture)
+end
+
+
+function module:SetBackdrop(texture)
+ local texture = SharedMedia:Fetch('background', self.db.profile.texture)
+ local border = SharedMedia:Fetch('border', self.db.profile.bordertexture)
+ local borderwidth = self.db.profile.borderwidth or 0
+ local padding = self.db.profile.padding or 4
+
+ local backdrop = {
+ tileSize = 16,
+ tile = true,
+ bgFile = texture,
+ insets = {
+ top = padding,
+ bottom = padding,
+ left = padding,
+ right = padding,
+ }
+ }
+
+ if not self.db.profile.hideborder then
+ backdrop.edgeFile = border --SharedMedia:Fetch('border', 'Blizzard Dialog')
+ backdrop.edgeSize = borderwidth
+ end
+
+ ChatFrameEditBox:SetBackdrop(backdrop)
+
+ if not self.db.profile.hideborder then
+ self:SetBackdropBorderColorTo(unpack(self.db.profile.bordercolour))
+ end
+
+ self:SetBackdropColourTo(unpack(self.db.profile.backdropcolour))
+end
+
+
+
+function module:SetBackdropColourTo(r, g, b, a)
+ ChatFrameEditBox:SetBackdropColor(r, g, b, a)
+end
+
+function module:SetBackdropBorderColorTo(r, g, b, a)
+ ChatFrameEditBox:SetBackdropBorderColor(r, g, b, a)
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/EventNames.lua b/modules/EventNames.lua
new file mode 100644
index 00000000..fdacdce7
--- /dev/null
+++ b/modules/EventNames.lua
@@ -0,0 +1,157 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: PratEventNames
+Revision: $Revision: 82149 $
+Author(s): Sylvanaar
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#EventNames
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that toggles showing hidden addon messages on and off (default=off).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("EventNames")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["EventNames"] = true,
+ ["Chat window event name options."] = true,
+ ["Show"] = true,
+ ["Show events on chatframes"] = true,
+ ["show_name"] = "Show Event Names",
+ ["show_desc"] = "Toggle showing event names in each window.",
+})
+
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 82149 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["EventNames"] = "事件名称",
+-- ["Chat window event name options."] = "聊天窗口事件名称选项。",
+-- ["show_name"] = "显示事件",
+-- ["show_desc"] = "切换显示各个窗口的事件名称",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["EventNames"] = "Noms des \195\169venements",
+-- ["Chat window event name options."] = "Options d'affichage des \195\169v\195\168nements des fen\195\170tres.",
+-- ["show_name"] = "Afficher les \195\169v\195\168nements",
+-- ["show_desc"] = "Activer/d\195\169sactiver l'affichage des noms d'\195\169v\195\168nements pour chaque fen\195\170tre.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["EventNames"] = "事件名稱",
+-- ["Chat window event name options."] = "聊天視窗事件名稱選項。",
+-- ["show_name"] = "顯示事件名稱",
+-- ["show_desc"] = "切換是否在各個聊天視窗顯示事件名稱。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["EventNames"] = "이벤트명",
+-- ["Chat window event name options."] = "대화창 이벤트명 설정입니다.",
+-- ["show_name"] = "이벤트명 표시",
+-- ["show_desc"] = "각각의 대화창에 이벤트명을 표시합니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["EventNames"] = "Nombres de Evento",
+-- ["Chat window event name options."] = "Opciones de nombres de evento",
+-- ["show_name"] = "Mostrar Eventos",
+-- ["show_desc"] = "Determina si se muestran los nombres de evento para cada ventana",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["EventNames"] = "Event Namen",
+-- ["Chat window event name options."] = "Chatfenster Event Namen Optionen.",
+-- ["show_name"] = "Zeige Name",
+-- ["show_desc"] = "Aktiviert das Anzeigen von Event Namen in jedem Fenster.",
+--} end)
+
+
+local mod = Prat:NewModule(PRAT_MODULE)
+
+Prat:SetModuleDefaults(mod.name, {
+ profile = {
+ on = true,
+ show = {},
+ }
+} )
+
+Prat:SetModuleOptions(mod.name, {
+ name = L["EventNames"],
+ desc = L["Chat window event name options."],
+ type = "group",
+ args = {
+ show = {
+ name = L["show_name"],
+ desc = L["show_desc"],
+ type = "multiselect",
+ values = Prat.HookedFrameList,
+ get = "GetSubValue",
+ set = "SetSubValue"
+ }
+ }
+ }
+)
+
+function mod:OnModuleEnable()
+ Prat.RegisterChatEvent(self,"Prat_PreAddMessage","Prat_PreAddMessage")
+end
+
+function mod:OnModuleDisable()
+ Prat.UnregisterAllChatEvents(self)
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+do
+ local CLR = Prat.CLR
+ local function EventBrackets(text) return CLR:Colorize("ffffff", text) end
+ local function EventName(text, c) return CLR:Colorize(c, text) end
+ local desat = 192*0.7+63
+ local c
+ function mod:Prat_PreAddMessage(arg, message, frame, event, t, r, g, b)
+ if self.db.profile.show[frame:GetName()] then
+ c = ("%02x%02x%02x"):format((r or 1.0)*desat, (g or 1.0)*desat, (b or 1.0)*desat)
+ message.POST = " "..EventBrackets("(")..EventName(tostring(event), c)..EventBrackets(")")
+ end
+ end
+end
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Experimental.lua b/modules/Experimental.lua
new file mode 100644
index 00000000..71776723
--- /dev/null
+++ b/modules/Experimental.lua
@@ -0,0 +1,251 @@
+--Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("Experimental")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local PE = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+
+
+function PE:OnModuleEnable()
+
+ local ts = Prat.Addon:GetModule("Timestamps", true)
+
+ if ts == nil then
+ Prat:Print("Experimental Module Requires Timestamps Module")
+ self:Disable()
+ return
+ end
+
+ ts.db.profile.colortimestamp = true
+
+ if not ts:IsEnabled() then
+ ts:Enable()
+ end
+
+ self:RawHook("ChatFrame_OnUpdate", true)
+-- self:Hook("ChatFrame_OnUpdate", true)
+
+ for k,v in pairs(Prat.HookedFrames) do
+ self:HookScript(v, "OnHyperlinkEnter")
+ self:HookScript(v, "OnHyperlinkLeave")
+ end
+
+
+ CHAT_CONFIG_CHAT_RIGHT[7] = {
+ text = CHAT_MSG_WHISPER_INFORM,
+ type = "WHISPER_INFORM",
+ checked = function () return IsListeningForMessageType("WHISPER"); end;
+ func = function (checked) ToggleChatMessageGroup(checked, "WHISPER"); end;
+ }
+
+ CHAT_CONFIG_CHAT_LEFT[7].text = CHAT_MSG_WHISPER
+
+ Prat.RegisterChatEvent(self, Prat.Events.ENABLED, function() Prat:Print("|cffff4040EXPERIMENTAL MODULE ENABLED|r") end )
+end
+
+--local function DBG_FONT(...) DBG:Debug("FONT", ...) end
+--local function DUMP_FONT(...) DBG:Dump("FONT", ...) end
+
+function PE:OnModuleDisable()
+ self:UnhookAll()
+
+ for k,v in pairs(self.fs_pool) do
+ for k2, v2 in pairs(v) do
+ v2:SetText("")
+ end
+ end
+
+ for k,v in pairs(Prat.HookedFrames) do
+ if v:IsShown() then
+ v:Hide()
+ v:Show()
+ end
+ end
+end
+
+function PE:OnHyperlinkEnter(frame, link, ...)
+ local linktype = link:match("^([^:]+)")
+ if linktype == "player" then
+ self.overPlayer = link:match("^[^:]+:([^:%]||]+)")
+ end
+end
+
+function PE:OnHyperlinkLeave(frame, ...)
+ self.overPlayer = nil
+end
+
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+
+function PE:ChatFrame_OnUpdate(...)
+ if Prat.WOTLK then
+ this = ...
+ end
+
+ if this:GetID() ~=2 then
+ self:SplitFontStrings(this, this:GetRegions())
+ end
+
+ self.hooks["ChatFrame_OnUpdate"](...)
+end
+
+
+function PE:DumpRegion(frame, region)
+ local o = select(region, frame:GetRegions())
+
+ Prat.PrintLiteral(o)
+
+
+end
+
+-- /print experimental:FlashTimeStamp(0.5, 0.5, 1, 10, 1, 1, 0.5)
+function PE:FlashTimeStamp(n, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime)
+
+ local f = SELECTED_CHAT_FRAME
+ local ts = _G[f:GetName().."LeftExtra"..tostring(n)]
+
+ UIFrameFlash(ts, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime)
+
+end
+
+
+PE.fs_pool = {}
+
+local new, del
+do
+ local cache = setmetatable({}, {__mode='k'})
+ function new()
+ local t = next(cache)
+ if t then
+ cache[t] = nil
+ return t
+ else
+ return {}
+ end
+ end
+ function del(t)
+ for k in pairs(t) do
+ t[k] = nil
+ end
+ cache[t] = true
+ return nil
+ end
+end
+
+
+
+function PE:SplitFontStrings(this, ...)
+ local fs
+ local tmp = new()
+ for n=1,select("#", ...) do
+ local o = select(n, ...)
+ if o and o:GetObjectType() == "FontString" and not o:GetName() then
+ table.insert(tmp, o)
+ end
+ end
+
+ local last
+ for n,o in ipairs(tmp) do
+ --self.fs[n] = o -- debug
+ if not self.fs_pool[this:GetID()] then
+ self.fs_pool[this:GetID()] = {}
+ end
+
+ local pool = self.fs_pool[this:GetID()]
+ if not pool[n] then
+ pool[n] = this:CreateFontString(this:GetName().."LeftExtra"..n)
+ pool[n]:SetJustifyV("TOP")
+ end
+
+ if o:GetNumPoints() ~= 0 then
+ fs = pool[n]
+
+ fs:ClearAllPoints()
+ o:ClearAllPoints()
+
+ if not last then
+ fs:SetPoint("BOTTOMLEFT", this , "BOTTOMLEFT", 0, 0)
+ else
+ fs:SetPoint("BOTTOMLEFT", last, "TOPLEFT", 0, 0)
+ end
+
+ fs:SetFont(o:GetFont())
+
+ last = fs
+
+ local l = o:GetText()
+ if l:sub(1,1) ~= " " then
+ local pos = l:find("|r")
+ if pos then
+ fs:SetText(l:sub(1, pos-1))
+ o:SetText(" "..l:sub(pos))
+ end
+ end
+
+
+ o:SetPoint("BOTTOMLEFT", fs, "BOTTOMRIGHT", 0 , 0)
+ o:SetPoint("RIGHT", this, "RIGHT", 0 , 0)
+
+ -- Ensure proper text wrappring
+ o:SetWidth(o:GetRight()-o:GetLeft())
+ fs:SetHeight(o:GetHeight())
+
+ -- Deny text wrapping, and force ... to be displayed
+ --o:SetHeight(fs:GetHeight())
+
+ if self.overPlayer then
+ if l:match("player:"..self.overPlayer) then
+ o:SetAlpha(1)
+ if not o:IsShown() then
+ o.restoreTo = 0
+ o:Show()
+ end
+ else
+ if o.restoreTo == 0 then
+ o:Hide()
+ o.restoreTo = nil
+ else
+ o:SetAlpha(0.50)
+ o.restoreTo = 1
+ end
+ end
+ else
+ if o.restoreTo == 0 then
+ o:Hide()
+ o.restoreTo = nil
+ elseif o.restoreTo == 1 then
+ o.restoreTo = nil
+ o:SetAlpha(1)
+ end
+ end
+
+ fs:SetAlpha(o:GetAlpha())
+
+ if fs:GetTop() > this:GetTop() or l:trim():len() == 0 then
+ fs:Hide()
+ end
+
+ if o:GetTop() > this:GetTop() then
+ o:Hide()
+ end
+
+ if o:IsShown() then
+ fs:Show()
+ else
+ fs:Hide()
+ end
+ end
+ end
+
+ del(tmp)
+end
+
+-- return
+--end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Fading.lua b/modules/Fading.lua
new file mode 100644
index 00000000..0bd70fd3
--- /dev/null
+++ b/modules/Fading.lua
@@ -0,0 +1,199 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratFading
+Revision: $Revision: 80569 $
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+Inspired by: idChat2_DisableFade by Industrial
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Fading
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that adds text fading options for chat windows (default=off).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local Prat = Prat
+
+local PRAT_MODULE = Prat:RequestModuleName("Fading")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["module_name"] = "Fading",
+ ["module_desc"] = "Chat window text fading options.",
+ ["textfade_name"] = "Enable Fading",
+ ["textfade_desc"] = "Toggle enabling text fading for each chat window.",
+ ["duration_name"] = "Set Fading Delay (Seconds)",
+ ["duration_desc"] = "Set the number of seconds to wait before before fading text of chat windows.",
+} )
+
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["module_name"] = "淡出",
+-- ["module_desc"] = "聊天窗口文本淡入淡出选项.",
+-- ["Enable ChatFrame%d Fading"] = "聊天窗口 %d 淡出",
+-- ["Toggle text fading on and off."] = "切换聊天窗口 %d 文本淡出.",
+-- ["duration_name"] = "淡出延迟",
+-- ["duration_desc"] = "设置聊天窗口文本淡出延迟.",
+-- } end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["module_name"] = "文字淡出",
+-- ["module_desc"] = "聊天視窗文字淡出選項。",
+-- ["textfade_name"] = "啟用文字淡出",
+-- ["textfade_desc"] = "切換是否在各個聊天視窗啟用文字淡出。",
+-- ["Enable ChatFrame%d Fading"] = "聊天視窗%d啟用文字淡出",
+-- ["Toggle text fading on and off."] = "切換是否啟用文字淡出。",
+-- ["duration_name"] = "淡出時間",
+-- ["duration_desc"] = "設定聊天視窗文字淡出前的等待時間。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["module_name"] = "Disparition du texte",
+-- ["module_desc"] = "Configure les options de disparition du texte.",
+-- ["Enable ChatFrame%d Fading"] = "Fen\195\170tre %d",
+-- ["Toggle text fading on and off."] = "Active/d\195\169sactive la disparition du texte pour la fen\195\170tre %d.",
+-- ["duration_name"] = "Ajustement du d\195\169lai de disparition",
+-- ["duration_desc"] = "R\195\168gle le temps au bout duquel le texte disparait de la fen\195\170tre de chat.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["module_name"] = "숨김",
+-- ["module_desc"] = "대화글 숨김 설정입니다.",
+-- ["textfade_name"] = "숨김 사용",
+-- ["textfade_desc"] = "각 대화창에 대한 글자 숨김 사용을 전환합니다.",
+-- ["Enable ChatFrame%d Fading"] = "%d 대화창 숨김 사용",
+-- ["Toggle text fading on and off."] = "글자 숨김 켜고 끄기를 전환합니다.",
+-- ["duration_name"] = "숨김 지연시간 설정",
+-- ["duration_desc"] = "대화글 숨김까지의 지연시간을 설정합니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["module_name"] = "Desvanecimiento",
+-- ["module_desc"] = "Opciones de desvanecimiento de texto de la ventana de chat",
+-- ["Enable ChatFrame%d Fading"] = "Desvanecimiento en Chat %d",
+-- ["Toggle text fading on and off."] = "Determina si se activa o desactiva el desvanecimiento en la ventana de chat %d",
+-- ["duration_name"] = "Retraso del Desvanecimiento",
+-- ["duration_desc"] = "Establece el tiempo a esperar antes de que se desvanezca el texto de las ventanas de chat",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["module_name"] = "Ausblenden",
+-- ["module_desc"] = "Chatfenster Text Ausblenden Optionen.",
+-- ["Enable ChatFrame%d Fading"] = "Chat %d Ausblenden",
+-- ["Toggle text fading on and off."] = "Schaltet das Text ausblenden an und aus f\195\188r das Chatfenster %d.",
+-- ["duration_name"] = "Text Ausblenden Verz\195\182gerrung einstellen",
+-- ["duration_desc"] = "Stellt die Dauer ein bis der Chat in den Chatfenstern ausgeblendet wird.",
+--} end)
+
+
+
+local mod = Prat:NewModule(PRAT_MODULE)
+
+-- define the default db values
+Prat:SetModuleDefaults(mod.name, {
+ profile = {
+ on = true,
+ textfade = {["*"]=true},
+ duration = 5
+ }
+} )
+
+Prat:SetModuleOptions(mod.name, {
+ name = L["module_name"],
+ desc = L["module_desc"],
+ type = "group",
+ args = {
+ textfade = {
+ name = L["textfade_name"],
+ desc = L["textfade_desc"],
+ type = "multiselect",
+ values = Prat.HookedFrameList,
+ get = "GetSubValue",
+ set = "SetSubValue"
+ },
+ duration = {
+ name = L["duration_name"],
+ desc = L["duration_desc"],
+ type = "range",
+ order = 190,
+ min = 1,
+ max = 60,
+ step = 1
+ },
+ }
+ })
+
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+-- things to do when the module is enabled
+function mod:OnModuleEnable()
+ self:OnValueChanged()
+end
+
+-- things to do when the module is disabled
+function mod:OnModuleDisable()
+ for k,v in pairs(Prat.HookedFrames) do
+ self:Fade(v, true)
+ end
+end
+
+mod.OnSubValueChanged = mod.OnValueChanged
+function mod:OnValueChanged(...)
+ for k,v in pairs(Prat.HookedFrames) do
+ self:Fade(v, self.db.profile.textfade[v])
+ end
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+-- enable/disable fading
+function mod:Fade(cf, textfade)
+ if textfade then
+ cf:SetFading(1)
+ cf:SetFadeDuration(mod.db.profile.duration)
+ else
+ cf:SetFading(nil)
+ end
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Filtering.lua b/modules/Filtering.lua
new file mode 100644
index 00000000..e79ae6d2
--- /dev/null
+++ b/modules/Filtering.lua
@@ -0,0 +1,255 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratFiltering
+Revision: $Revision: 81859 $
+Author(s): Sylvanaar
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Filtering
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: A module to provide basic chat filtering. (default=off).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("Filtering")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Filtering"] = true,
+ ["A module to provide basic chat filtering."] = true,
+ ["leavejoin_name"] = "Filter Channel Leave/Join",
+ ["leavejoin_desc"] = "Filter out channel leave/join spam",
+ ["notices_name"] = "Filter Channel Notices",
+ ["notices_desc"] = "Filter out other custom channel notification messages, e.g. moderator changes.",
+ ["bgjoin_name"] = "Filter BG Leave/Join",
+ ["bgjoin_desc"] = "Filter out channel Battleground leave/join spam",
+-- ["tradespam_name"] = "tradespam",
+-- ["tradespam_desc"] = "tradespam",
+})
+
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 81859 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Filtering"] = "信息过滤",
+-- ["A module to provide basic chat filtering."] = "提供基本聊天过滤功能.",
+-- ["leavejoin_name"] = "过滤频道离开/加入",
+-- ["leavejoin_desc"] = "过滤离开/加入频道的讯息",
+-- ["notices_name"] = "过滤频道通知",
+-- ["notices_desc"] = "过滤其他频道通知讯息, 例如频道修改权限变化.",
+-- ["bgjoin_name"] = "过滤战场离开/加入",
+-- ["bgjoin_desc"] = "过滤离开/加入战场频道的讯息",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Filtering"] = "訊息過濾",
+-- ["A module to provide basic chat filtering."] = "提供基本過濾功能的模組。",
+-- ["leavejoin_name"] = "過濾離開/加入頻道",
+-- ["leavejoin_desc"] = "過濾離開/加入頻道的訊息。",
+-- ["notices_name"] = "過濾頻道通知",
+-- ["notices_desc"] = "過濾其他頻道通知訊息,例如頻道修改權變更。",
+-- ["bgjoin_name"] = "過濾戰場離開/加入",
+-- ["bgjoin_desc"] = "過濾戰場離開/加入的頻道訊息。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Filtering"] = "필터링",
+-- ["A module to provide basic chat filtering."] = "기본 대화 필터링을 제공하는 모듈입니다.",
+-- ["leavejoin_name"] = "채널 참가/떠남 필터",
+-- ["leavejoin_desc"] = "채널 참가/떠남 스팸을 제거합니다.",
+-- ["notices_name"] = "채널 알림 필터링",
+-- ["notices_desc"] = "다른 사용자 지정 채널 알림 메세지를 필터링합니다, 예. moderator changes.",
+-- ["bgjoin_name"] = "전장 떠남/참가 필터링",
+-- ["bgjoin_desc"] = "전장 떠남/참가 스팸을 필터링합니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Filtering"] = "Filterrung",
+-- ["A module to provide basic chat filtering."] = "Ein Modul das einen grundlegenden Chatfilter bietet.",
+-- ["leavejoin_name"] = "Filtere Kanal Verlassen/Betreten",
+-- ["leavejoin_desc"] = "Rausfiltern von Kanal verlassen/betreten Spam.",
+-- ["notices_name"] = "Filtere Kanal Benachrichtigungen",
+-- ["notices_desc"] = "Rausfiltern von vorgegeben Kanal Benachrichtigunsmeldungen, z.B: Moderator änderrungen.",
+-- ["bgjoin_name"] = "Filtere BG Verlassen/Betreten",
+-- ["bgjoin_desc"] = "Rausfiltern des Schlachtfeld Verlassen/Betreten Spam.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Filtering"] = "Filtrado",
+-- ["A module to provide basic chat filtering."] = "Un módulo que permite un filtrado de chat básico",
+-- ["leavejoin_name"] = "Filtrar Unión/Abandono de canal",
+-- ["leavejoin_desc"] = "Filtra los mensajes que aparecen cuando alguien se une o abandona un canal",
+-- ["notices_name"] = "Filtrar Noticias de Canal",
+-- ["notices_desc"] = "Filtra los mensajes de notificación de los canales, ej: cambios de moderador.",
+--} end)
+
+
+
+local module = Prat:NewModule(PRAT_MODULE)
+
+Prat:SetModuleDefaults(module, {
+ profile = {
+ on = false,
+ leavejoin = true,
+ notices = true,
+-- bgjoin = false,
+ tradespam = true,
+ }
+} )
+
+Prat:SetModuleOptions(module, {
+ name = L["Filtering"] ,
+ desc = L["A module to provide basic chat filtering."],
+ type = "group",
+ args = {
+-- leavejoin = {
+-- name = L["leavejoin_name"],
+-- desc = L["leavejoin_desc"],
+-- type = "toggle",
+-- order = 100
+-- },
+ notices = {
+ name = L["notices_name"],
+ desc = L["notices_desc"],
+ type = "toggle",
+ order = 110
+ },
+-- tradespam = {
+-- name = L["tradespam_name"],
+-- desc = L["tradespam_desc"],
+-- type = "toggle",
+-- order = 110
+-- },
+
+
+-- bgjoin = {
+-- name = L["bgjoin_name"],
+-- desc = L["bgjoin_desc"],
+-- type = "toggle",
+-- order = 111
+-- },
+ }
+ }
+)
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+local deformat
+
+function module:OnModuleEnable()
+ Prat.RegisterChatEvent(self, "Prat_FrameMessage")
+
+-- Prat.RegisterLinkType( { linkid="tradespam", linkfunc=module.TradeSpam, handler=module }, module.name)
+end
+
+-- things to do when the module is disabled
+function module:OnModuleDisable()
+ Prat.UnregisterAllChatEvents(self)
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+--
+-- Prat Event Implementation
+--
+
+--function module:TradeSpam(link, text, button, ...)
+-- local realtext = strsub(link, 11)
+--
+-- ShowUIPanel(ItemRefTooltip)
+-- if (not ItemRefTooltip:IsVisible()) then
+-- ItemRefTooltip:SetOwner(UIParent, "ANCHOR_PRESERVE");
+-- end
+--
+-- ItemRefTooltip:ClearLines()
+-- ItemRefTooltip:AddLine(realtext:gsub("@@", "|"), 1,1,1,1)
+-- ItemRefTooltip:Show()
+--
+-- return false
+--end
+--
+-----BuildLink(linktype, data, text, color, link_start, link_end)
+--local function buildSpamLink(text)
+-- return Prat.BuildLink("tradespam", text:gsub("|", "@@"), text:gsub("|c%x%x%x%x%x%x%x%x", ""):gsub("|r", ""):gsub("|H.-|h", ""):gsub("|h", ""):sub(1, 20).."...", "8080ff")
+--end
+
+
+function module:Prat_FrameMessage(arg, message, frame, event)
+-- if self.db.profile.leavejoin then
+-- if event == "CHAT_MSG_CHANNEL_JOIN" or event == "CHAT_MSG_CHANNEL_LEAVE" then
+-- message.DONOTPROCESS = true
+-- end
+-- end
+
+
+ if self.db.profile.notices then
+ if event == "CHAT_MSG_CHANNEL_NOTICE_USER" or event == "CHAT_MSG_CHANNEL_NOTICE" then
+ message.DONOTPROCESS = true
+ end
+ end
+
+-- if self.db.profile.tradespam then
+-- if message.ORG.CHANNEL and message.ORG.CHANNEL:find("Trade") and message.MESSAGE:len() > 40 then -- Temp implementation, todo: options?
+-- message.MESSAGE = buildSpamLink(message.MESSAGE)
+-- end
+-- end
+
+
+-- if self.db.profile.bgjoin and event == "CHAT_MSG_SYSTEM" then
+-- if MiniMapBattlefieldFrame.status == "active" then
+-- deformat = deformat or PRAT_LIBRARY(LIB.PARSING)
+--
+-- if deformat:Deformat(message.ORG.MESSAGE, ERR_BG_PLAYER_JOINED_SS) then
+-- self:Debug("bgjoin", message.ORG)
+-- message.DONOTPROCESS = true
+-- elseif deformat:Deformat(message.ORG.MESSAGE, ERR_BG_PLAYER_LEFT_S) then
+-- message.DONOTPROCESS = true
+-- self:Debug("bgleave", message.ORG)
+-- end
+-- end
+-- end
+end
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Font.lua b/modules/Font.lua
new file mode 100644
index 00000000..64a1cc21
--- /dev/null
+++ b/modules/Font.lua
@@ -0,0 +1,506 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratFont
+Revision: $Revision: 80703 $
+Author(s): Curney (asml8ed@gmail.com)
+Inspired by: ChatFrameExtender by Satrina
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Font
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that allows you to set the font face and size for chat windows (default=blizz default font face at size 12).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("Font")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Font"] = true,
+ ["Chat window font options."] = true,
+ ["Set Separately"] = true,
+ ["Toggle setting options separately for each chat window."] = true,
+ ["Set Font Face"] = true,
+ ["Set the text font face for all chat windows."] = true,
+ ["rememberfont_name"] = "Remember Font",
+ ["rememberfont_desc"] = "Remember your font choice and restore it at startup.",
+ ["Set Font Size"] = true,
+ ["Set text font size for each chat window."] = true,
+ ["Set ChatFrame%d Font Size"] = true,
+ ["Set text font size."] = true,
+ ["Auto Restore Font Size"] = true,
+ ["Workaround a Blizzard bug which changes the font size when you open a system menu."] = true,
+ ["outlinemode_name"] = "Set Outline Mode",
+ ["outlinemode_desc"] = "Sets mode for the outline around the font.",
+ ["None"] = true,
+ ["Outline"] = true,
+ ["Thick Outline"] = true,
+ ["monochrome_name"] = "Toggle Monochrome",
+ ["monochrome_desc"] = "Toggles monochrome coloring of the font.",
+ ["shadowcolor_name"] = "Set Shadow Color",
+ ["shadowcolor_desc"] = "Set the color of the shadow effect.",
+})
+
+--[[
+ Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+ CWDG site: http://Cwowaddon.com
+ $Rev: 80703 $
+]]
+
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Font"] = "字体尺寸",
+-- ["Chat window font options."] = "聊天窗口字体尺寸选项.",
+-- ["Set Font Face"] = "字体",
+-- ["Set the text font face for all chat windows."] = "设置聊天文本字体",
+-- ["rememberfont_name"] = "记录字体",
+-- ["rememberfont_desc"] = "记录字体选择并在启动时恢复.",
+-- ["Set Font Size"] = "字体大小",
+-- ["Set text font size for each chat window."] = "每个聊天窗口的字体大小.",
+-- ["Set ChatFrame%d Font Size"] = "聊天窗口 %d 字体大小",
+-- ["Set text font size."] = "设置聊天窗口 %d 字体大小.",
+-- ["Auto Restore Font Size"] = "自动恢复",
+-- ["Workaround a Blizzard bug which changes the font size when you open a system menu."] = "解决打开系统菜单后字体大小变化的错误.",
+-- ["outlinemode_name"] = "设定轮廓模式",
+-- ["outlinemode_desc"] = "设定字体阴影模式。",
+-- ["None"] = "无",
+-- ["Outline"] = "普通",
+-- ["Thick Outline"] = "厚",
+-- ["monochrome_name"] = "单色",
+-- ["monochrome_desc"] = "切换字体使用单色颜色。",
+-- ["shadowcolor_name"] = "阴影颜色",
+-- ["shadowcolor_desc"] = "设定字体阴影颜色。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Font"] = "字型",
+-- ["Chat window font options."] = "聊天視窗字型選項。",
+---- no use anymore ["Set Separately"] = true,
+---- no use anymore ["Toggle setting options separately for each chat window."] = true,
+-- ["Set Font Face"] = "字體",
+-- ["Set the text font face for all chat windows."] = "設定全部聊天視窗的字體。",
+-- ["rememberfont_name"] = "記住字型",
+-- ["rememberfont_desc"] = "進入系統後恢復選擇的字型。",
+-- ["Set Font Size"] = "字型大小",
+-- ["Set text font size for each chat window."] = "設定各個聊天視窗的字型大小。",
+-- ["Set ChatFrame%d Font Size"] = "聊天視窗%d字型大小",
+-- ["Set text font size."] = "設定字型大小。",
+-- ["Auto Restore Font Size"] = "自動恢復設定",
+-- ["Workaround a Blizzard bug which changes the font size when you open a system menu."] = "修正 Blizzard 的錯誤: 當你開啟系統選單時會改變字型大小。",
+-- ["outlinemode_name"] = "設定輪廓模式",
+-- ["outlinemode_desc"] = "設定字型陰影模式。",
+-- ["None"] = "無",
+-- ["Outline"] = "普通",
+-- ["Thick Outline"] = "厚",
+-- ["monochrome_name"] = "單色",
+-- ["monochrome_desc"] = "切換字型使用單色顏色。",
+-- ["shadowcolor_name"] = "陰影顏色",
+-- ["shadowcolor_desc"] = "設定字型陰影顏色。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["Font"] = "Taille du texte",
+-- ["Chat window font options."] = "Options des tailles des textes",
+-- ["Set Font Size"] = "Changer la taille des textes",
+-- ["Set text font size for each chat window."] = "Change la taille du texte pour chaque fen\195\170tre.",
+-- ["Set ChatFrame%d Font Size"] = "Taille du texte, fen\195\170tre %d",
+-- ["Set text font size."] = "Change la taille du texte pour la fen\195\170tre %d.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Font"] = "글꼴",
+-- ["Chat window font options."] = "대화창 글꼴 설정입니다.",
+-- ["Set Separately"] = "개별 설정",
+-- ["Toggle setting options separately for each chat window."] = "각 대화창에 대한 개별 설정을 사용합니다.",
+-- ["Set Font Face"] = "글꼴 서체 설정",
+-- ["Set the text font face for all chat windows."] = "모든 대화창에 대한 글꼴 서체를 설정합니다.",
+-- ["rememberfont_name"] = "글꼴 저장",
+-- ["rememberfont_desc"] = "선택된 글꼴을 저장하고 시작 시 적용합니다.",
+-- ["Set Font Size"] = "글꼴 크기 설정",
+-- ["Set text font size for each chat window."] = "각 대화창에 대한 글꼴 크기를 설정합니다.",
+-- ["Set ChatFrame%d Font Size"] = "%d 대화창 글꼴 크기 설정",
+-- ["Set text font size."] = "글자 글꼴 크기를 설정합니다.",
+-- ["Auto Restore Font Size"] = "글꼴 크기 자동 복원",
+-- ["Workaround a Blizzard bug which changes the font size when you open a system menu."] = "시스템 메뉴 열 때 글꼴 크기가 변경되는 게임 버그를 수정합니다.",
+-- ["outlinemode_name"] = "외곽선 모드 설정",
+-- ["outlinemode_desc"] = "글꼴 주위 외곽선을 위한 모드를 설정합니다.",
+-- ["None"] = "없음",
+-- ["Outline"] = "외곽선",
+-- ["Thick Outline"] = "두꺼운 외곽선",
+-- ["monochrome_name"] = "단색 전환",
+-- ["monochrome_desc"] = "글꼴의 단색화를 전환합니다.",
+-- ["shadowcolor_name"] = "그림자 색상 설정",
+-- ["shadowcolor_desc"] = "그림자 효과의 색상을 설정합니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Font"] = "Tama\195\177o de Fuente",
+-- ["Chat window font options."] = "Opciones del tama\195\177o de fuente en las ventanas de chat",
+-- ["Set Separately"] = "Establecer separadamente",
+-- ["Toggle setting options separately for each chat window."] = "Permite tener configuraciones separadas para cada ventana de chat.",
+-- ["Set Font Face"] = "Establecer Tipo de Fuente",
+-- ["Set the text font face for all chat windows."] = "Establece el tipo de fuente del texto para todas las ventanas del chat.",
+-- ["rememberfont_name"] = "Recordar Fuente",
+-- ["rememberfont_desc"] = "Recuerda tu selecci\195\179n de fuente y la restaura al inicio.",
+-- ["Set Font Size"] = "Tama\195\177o de Fuente",
+-- ["Set text font size for each chat window."] = "Establece el tama\195\177o de fuente para cada ventana de chat",
+-- ["Set ChatFrame%d Font Size"] = "Tama\195\177o de Fuente del Chat %d",
+-- ["Set text font size."] = "Establece el tama\195\177o de fuente para la ventana de chat %d",
+-- ["Auto Restore Font Size"] = "AutoRestaurar Tama\195\177o de la Fuente",
+-- ["Workaround a Blizzard bug which changes the font size when you open a system menu."] = "Solucina temporalmente un bug de Blizzard que cambia el tama\195\177o de fuente cuando abres el men\195\186 de sistema.",
+-- ["outlinemode_name"] = "Establecer Borde Fuente",
+-- ["outlinemode_desc"] = "Establece el modo para el borde de la fuente.",
+-- ["None"] = "Ninguno",
+-- ["Outline"] = "Borde",
+-- ["Thick Outline"] = "Borde Grueso",
+-- ["monochrome_name"] = "Monocromo",
+-- ["monochrome_desc"] = "Pono el color de la fuente en modo monocromo.",
+-- ["shadowcolor_name"] = "Establecer Color de Sombra",
+-- ["shadowcolor_desc"] = "Establece el color del efecto de la sombra.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Font"] = "Schriftgr\195\182\195\159e",
+-- ["Chat window font options."] = "Chatfenster Schriftgr\195\182\195\159en Optionen.",
+-- ["Set Font Size"] = "Setze Schriftgr\195\182\195\159e",
+-- ["Set text font size for each chat window."] = "Setze Schriftgr\195\182\195\159e f\195\188r jedes Fenster.",
+-- ["Set ChatFrame%d Font Size"] = "Chat %d Schriftgr\195\182\195\159e",
+-- ["Set text font size."] = "Setze Schrifgr\195\182\195\159e f\195\188r Chatfenster %d.",
+--} end)
+--
+
+
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+Prat:SetModuleDefaults(module, {
+ profile = {
+ on = true,
+ fontface = "",
+ rememberfont = false,
+ size = {["*"]=12},
+ autorestore = false,
+ outlinemode = "",
+ monochrome = false,
+ shadowcolor = {
+ r = 0,
+ g = 0,
+ b = 0,
+ a = 1,
+ },
+ }
+} )
+
+
+
+
+---- Fix the defaults that are being used for the chatframe text font size.
+--for i=1,NUM_CHAT_WINDOWS do
+-- local cf = getglobal("ChatFrame"..i)
+-- local _, s, _ = cf:GetFont()
+-- module.defaultDB.size[i] = s
+--end
+--
+---- build the options menu using prat templates
+--module.toggleOptions = {
+-- rememberfont = 120,
+-- sep125_sep = 125,
+-- sep145_sep = 145,
+-- outlinemode = {
+-- type = "text",
+-- order = 150,
+-- get = function() return module.db.profile.outlinemode end,
+-- set = function(v) module.db.profile.outlinemode = v; module:ConfigureAllChatFrames() end,
+-- validate = {[""] = L["None"], ["OUTLINE"] = L["Outline"], ["THICKOUTLINE"] = L["Thick Outline"]},
+-- },
+-- monochrome = {
+-- type = "toggle",
+-- order = 160,
+-- get = function() return module.db.profile.monochrome end,
+-- set = function(v) module.db.profile.monochrome = v; module:ConfigureAllChatFrames() end,
+-- },
+-- shadowcolor = {
+-- type = "color",
+-- order = 170,
+-- get = "GetShadowClr",
+-- set = "SetShadowClr",
+-- },
+--}
+
+--local fontslist = {}
+--local media
+--local cf, i, v, k
+--
+--function module:BuildFontList()
+-- for i,v in ipairs(fontslist) do
+-- fontslist[i] = nil
+-- end
+--
+-- for k,v in pairs(media:List(media.MediaType.FONT)) do
+-- table.insert(fontslist, v)
+-- end
+--end
+--
+--function module:SharedMedia_Registered(mediatype, name)
+-- self:Debug("SharedMedia_Registered", mediatype, name)
+-- if mediatype == media.MediaType.FONT then
+-- self:BuildFontList()
+-- end
+--end
+
+local frameOption =
+{
+-- name = string.format(L["Set ChatFrame%d Font Size"], num),
+ name = function(info) return Prat.FrameList[info[#info]] or "" end,
+ desc = L["Set text font size."],
+ type = "range",
+ get = "GetSubValue",
+ set = "SetSubValue",
+ min = 4,
+ max = 22,
+ step = 1,
+ hidden = function(info) return Prat.FrameList[info[#info]] == nil end,
+}
+
+
+Prat:SetModuleOptions(module, {
+ name = L["Font"],
+ desc = L["Chat window font options."],
+ type = "group",
+ args = {
+ fontface = {
+ name = L["Set Font Face"],
+ desc = L["Set the text font face for all chat windows."],
+ type = "select",
+ dialogControl = 'LSM30_Font',
+ values = AceGUIWidgetLSMlists.font,
+ order = 110,
+ },
+ size = {
+ name = L["Set Font Size"],
+ desc = L["Set text font size for each chat window."],
+ type = "group",
+ inline = true,
+ order = 130,
+ args = {
+ ChatFrame1 = frameOption,
+ ChatFrame2 = frameOption,
+ ChatFrame3 = frameOption,
+ ChatFrame4 = frameOption,
+ ChatFrame5 = frameOption,
+ ChatFrame6 = frameOption,
+ ChatFrame7 = frameOption,
+ }
+ },
+
+-- sep130 = { name="", order = 130, type = "header"},
+
+ outlinemode = {
+ name = L["outlinemode_name"],
+ desc = L["outlinemode_desc"],
+ type = "select",
+ order = 150,
+ values = {[""] = L["None"], ["OUTLINE"] = L["Outline"], ["THICKOUTLINE"] = L["Thick Outline"]},
+ },
+ monochrome = {
+ type = "toggle",
+ name = L["monochrome_name"],
+ desc = L["monochrome_desc"],
+ order = 160,
+ },
+ shadowcolor = {
+ name = L["shadowcolor_name"],
+ desc = L["shadowcolor_desc"],
+ type = "color",
+ order = 170,
+ get = "GetColorValue",
+ set = "SetColorValue",
+ },
+ rememberfont = {
+ type = "toggle",
+ order = 120,
+ name = L["rememberfont_name"],
+ desc = L["rememberfont_desc"],
+ },
+-- autorestore = {
+-- name = L["Auto Restore Font Size"],
+-- desc = L["Workaround a Blizzard bug which changes the font size when you open a system menu."],
+-- type = "toggle",
+-- order = 140,
+-- get = function() return self.db.profile.autorestore end,
+-- set = function(v) self.db.profile.autorestore = v; self:SetAutoRestore(v) end
+-- },
+ }
+ }
+)
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+function module:OnModuleEnable()
+ self.oldsize = {}
+
+ for k, cf in pairs(Prat.Frames) do
+ local _, s, _ = cf:GetFont()
+ self.oldsize[k] = s
+ end
+
+ if not self.db.profile.rememberfont then
+ self.db.profile.fontface = nil
+ end
+
+ self:ConfigureAllChatFrames()
+-- -- This will resolve the issue where, when font sizes are set smaller than 12,
+-- -- the size resets to 12 when closing UIOptionsFrame.
+-- self:SetAutoRestore(self.db.profile.autorestore)
+-- self:SecureHook("FCF_SetChatWindowFontSize")
+end
+
+function module:OnModuleDisable()
+ for k, cf in pairs(Prat.Frames) do
+ self:SetFontSize(cf,self.oldsize[k] or 12)
+ end
+ self:SetFontMode("")
+end
+
+function module:GetSubValue(info)
+ return self.db.profile[info[#info-1]][info[#info]]
+end
+function module:SetSubValue(info, b)
+ self.db.profile[info[#info-1]][info[#info]] = b
+ self:OnValueChanged(info, b)
+end
+
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+function module:ConfigureAllChatFrames()
+ local db = self.db.profile
+
+ if self.db.profile.fontface then
+ self:SetFont(self.db.profile.fontface)
+ end
+
+
+ -- apply font size settings
+ for k,v in pairs(Prat.Frames) do
+ self:SetFontSize(v, db.size[k])
+ end
+ -- apply font flag settings
+ if not db.monochrome then
+ self:SetFontMode(db.outlinemode)
+ else
+ self:SetFontMode(db.outlinemode..", MONOCHROME")
+ end
+end
+
+function module:SetFontSize(cf, size)
+ if Prat.WOTLK then
+ FCF_SetChatWindowFontSize(nil, cf, size)
+ else
+ FCF_SetChatWindowFontSize(cf, size)
+ end
+end
+
+
+
+function module:SetFont(font)
+ fontfile = Prat.Media:Fetch(Prat.Media.MediaType.FONT, font)
+ for k, cf in pairs(Prat.Frames) do
+ local f, s, m = cf:GetFont()
+ cf:SetFont(fontfile, s, m)
+ end
+end
+
+function module:SetFontMode(mode, monochrome)
+ for k, cf in pairs(Prat.Frames) do
+ local f, s, m = cf:GetFont()
+ cf:SetFont(f, s, mode)
+
+ if monochrome then
+ local c = self.db.profile.shadowcolor
+ cf:SetShadowColor(c.r, c.g, c.b, c.a)
+ end
+ end
+end
+
+function module:GetShadowClr()
+ local h = self.db.profile.shadowcolor or {}
+ return h.r or 1.0, h.g or 1.0, h.b or 1.0
+end
+
+function module:SetShadowClr(r,g,b)
+ local db = self.db.profile
+ db.shadowcolor = db.shadowcolor or {}
+ local h = db.shadowcolor
+ h.r, h.g, h.b = r, g, b
+ self:ConfigureAllChatFrames()
+end
+
+function module:FCF_SetChatWindowFontSize(fcfself, chatFrame, fontSize)
+ if not Prat.WOTLK then
+ chatFrame, fontSize = fcfself, chatFrame, fontSize
+ end
+
+ if ( not chatFrame ) then
+ chatFrame = FCF_GetCurrentChatFrame();
+ end
+ if ( not fontSize ) then
+ fontSize = chatFrame.value;
+ end
+ self.oldsize[chatFrame:GetName()] = fontSize
+ if self.db and self.db.profile.on then
+ self.db.profile.size[chatFrame:GetName()] = fontSize
+ end
+end
+
+--function module:SetAutoRestore(val)
+-- self.db.profile.autorestore = val
+-- if self.db.profile.autorestore then
+-- if not self:IsHooked("UpdateMicroButtons") then self:SecureHook("UpdateMicroButtons", "ConfigureAllChatFrames") end
+-- else
+-- if self:IsHooked("UpdateMicroButtons") then self:Unhook("UpdateMicroButtons") end
+-- end
+--end
+
+
+module.OnValueChanged = module.ConfigureAllChatFrames
+module.OnSubValueChanged = module.ConfigureAllChatFrames
+module.OnColorValueChanged = module.ConfigureAllChatFrames
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/History.lua b/modules/History.lua
new file mode 100644
index 00000000..a025198a
--- /dev/null
+++ b/modules/History.lua
@@ -0,0 +1,332 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+--[[
+Name: module
+Revision: $Revision: 80392 $
+Author(s): Krtek (krtek4@gmail.com); Fin (fin@instinct.org)
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#History
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that adds chat history options.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+--[[
+ 2007-06-24: added option to save cmd history - fin
+]]
+
+local PRAT_MODULE = Prat:RequestModuleName("History")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["History"] = true,
+ ["Chat history options."] = true,
+ ["Set Chat Lines"] = true,
+ ["Set the number of lines of chat history for each window."] = true,
+ ["Set Command History"] = true,
+ ["Maximum number of lines of command history to save."] = true,
+ ["Save Command History"] = true,
+ ["Saves command history between sessions (for use with alt+up arrow or just the up arrow)"] = true,
+})
+--
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 80392 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["History"] = "历史",
+-- ["Chat history options."] = "聊天历史选项.",
+-- ["Set Chat Lines"] = "设置",
+-- ["Set the number of lines of chat history for each window."] = "为每个聊天窗口设置历史记录行数.",
+-- ["Set ChatFrame%d Chat Lines"] = "聊天窗口 %d 历史",
+-- ["Sets the number of lines of chat history to save."] = "设置聊天窗口 %d 聊天历史记录",
+-- ["Save Command History"] = "保存命令历史",
+-- ["Saves command history between sessions (for use with alt+up arrow or just the up arrow)"] = "保存进程命令历史 (使用 或 <上> 键可搜索的)",
+-- ["Set Command History"] = "命令历史数",
+-- ["Maximum number of lines of command history to save."] = "保存命令历史最大条目",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["History"] = "이력",
+-- ["Chat history options."] = "대화 이력 설정입니다.",
+-- ["Set Chat Lines"] = "대화 라인 설정",
+-- ["Set the number of lines of chat history for each window."] = "각 대화창에 대한 대화 이력의 라인 수를 설정합니다.",
+-- ["Set ChatFrame%d Chat Lines"] = "%d 대화창 대화 라인 설정",
+-- ["Sets the number of lines of chat history to save."] = "저장할 대화 이력의 라인 수를 설정합니다.",
+-- ["Set Command History"] = "명령어 이력 설정",
+-- ["Maximum number of lines of command history to save."] = "저장할 명령어 이력의 최대 라인의 수입니다.",
+-- ["Save Command History"] = "명령어 이력 저장",
+-- ["Saves command history between sessions (for use with alt+up arrow or just the up arrow)"] = "접속간 명령어 이력을 저장합니다. (ALT+위 방향키 혹은 위 방향키 사용)",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["History"] = "歷史",
+-- ["Chat history options."] = "聊天歷史選項。",
+-- ["Set Chat Lines"] = "聊天行數",
+-- ["Set the number of lines of chat history for each window."] = "設定各個聊天視窗的聊天行數。",
+-- ["Set ChatFrame%d Chat Lines"] = "聊天視窗%d聊天行數",
+-- ["Sets the number of lines of chat history to save."] = "設定儲存的聊天歷史行數。",
+-- ["Set Command History"] = "指令歷史",
+-- ["Maximum number of lines of command history to save."] = "設定最多儲存多少行指令。",
+-- ["Save Command History"] = "儲存指令歷史",
+-- ["Saves command history between sessions (for use with alt+up arrow or just the up arrow)"] = "儲存指令歷史 (Alt-上或上鍵使用)。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["History"] = "Historial",
+-- ["Chat history options."] = "Opciones del historial de chat",
+-- ["Set Chat Lines"] = "Establecer",
+-- ["Set the number of lines of chat history for each window."] = "Establece el n\195\186mero de l\195\173neas de historial para cada ventana",
+-- ["Set ChatFrame%d Chat Lines"] = "Historial del Chat %d",
+-- ["Sets the number of lines of chat history to save."] = "Establece el historial para la ventana de chat %d",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["History"] = "Verlauf",
+-- ["Chat history options."] = "Chat Verlauf Optionen.",
+-- ["Set Chat Lines"] = "Setze",
+-- ["Set the number of lines of chat history for each window."] = "Setze die Anzahl der Verlauf Zeilen f\195\188r jedes Fenster.",
+-- ["Set ChatFrame%d Chat Lines"] = "Chat %d Verlauf",
+-- ["Sets the number of lines of chat history to save."] = "Setze Verlauf f\195\188r Chatfenster %d.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["History"] = "Historique",
+-- ["Chat history options."] = "Options de l'historique des chats",
+-- ["Set Chat Lines"] = "Nombre de lignes",
+-- ["Set the number of lines of chat history for each window."] = "R195\168gle le nombre de lignes d'historique à garder pour chaque fen\195\170tre.",
+-- ["Set ChatFrame%d Chat Lines"] = "Historique fen\195\170tre %d",
+-- ["Sets the number of lines of chat history to save."] = "R195\168gle l'historique pour la fen\195\170tre %d.",
+--} end)
+
+
+
+-- create prat module
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ chatlinesframes = {} ,
+ chatlines = 384,
+ maxlines = 50,
+ savehistory = false,
+ cmdhistory = {},
+ }
+})
+
+
+Prat:SetModuleOptions(module.name, {
+ name = L["History"],
+ desc = L["Chat history options."],
+ type = "group",
+ args = {
+ chatlinesframes = {
+ name = L["Set Chat Lines"],
+ desc = L["Set the number of lines of chat history for each window."],
+ type = "multiselect",
+ values = Prat.HookedFrameList,
+ get = "GetSubValue",
+ set = "SetSubValue"
+ },
+ chatlines = {
+ name = L["Set Chat Lines"],
+ desc = L["Set the number of lines of chat history for each window."],
+ type = "range",
+ order = 120, min = 300,
+ max = 5000,
+ step = 10,
+ bigStep = 50,
+ },
+ maxlines = {
+ name = L["Set Command History"],
+ desc = L["Maximum number of lines of command history to save."],
+ type = "range",
+ order = 120, min = 50,
+ max = 5000,
+ step = 10,
+ bigStep = 50,
+ },
+ savehistory = {
+ name = L["Save Command History"],
+ desc = L["Saves command history between sessions (for use with alt+up arrow or just the up arrow)"],
+ type = "toggle",
+ order = 130, },
+ }
+})
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+-- things to do when the module is enabled
+function module:OnModuleEnable()
+ self:ConfigureAllChatFrames()
+
+ if self.db.profile.saveHistory then
+ if not self.db.profile.cmdhistory then
+ self.db.profile.cmdhistory = {}
+ end
+
+ self:SecureHook(ChatFrameEditBox, "AddHistoryLine")
+ self:addSavedHistory()
+ end
+end
+
+-- things to do when the module is enabled
+function module:OnModuleDisable()
+ self:ConfigureAllChatFrames(384)
+
+ self.db.profile.cmdhistory = {}
+end
+
+function module:ConfigureAllChatFrames(lines)
+ local lines = lines or self.db.profile.chatlines
+
+ for k,v in pairs(self.db.profile.chatlinesframes) do
+ self:SetHistory(_G[k], lines)
+ end
+end
+
+function module:OnValueChanged()
+ self:ConfigureAllChatFrames()
+end
+
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+local aquire, reclaim
+do
+ local cache = setmetatable({}, {__mode='k'})
+ acquire = function()
+ local t = next(cache) or {}
+ cache[t] = nil
+ return t
+ end
+ reclaim = function (t)
+ for k in pairs(t) do
+ t[k] = nil
+ end
+ cache[t] = true
+ end
+end
+
+
+function module:SetHistory(f, lines)
+ if f:GetMaxLines() ~= lines then
+ local chatlines = acquire()
+ for i=f:GetNumRegions(),1,-1 do
+ local x = select(i, f:GetRegions())
+ if x:GetObjectType() == "FontString" then
+ table.insert(chatlines, { x:GetText(), x:GetTextColor() })
+ end
+ end
+
+ f:SetMaxLines(lines)
+
+ Prat.loading = true
+ for i,v in ipairs(chatlines) do
+ f:AddMessage(unpack(v))
+ end
+ Prat.loading = false
+
+ reclaim(chatlines)
+ end
+end
+
+function module:addSavedHistory(cmdhistory)
+ local cmdhistory = self.db.profile.cmdhistory
+ local cmdindex = #cmdhistory
+
+ -- where there"s a while, there"s a way
+ while cmdindex > 0 do
+ ChatFrameEditBox:AddHistoryLine(cmdhistory[cmdindex])
+ cmdindex = cmdindex - 1
+ -- way
+ end
+end
+
+function module:saveLine(text)
+ if not text or (text == "") then
+ return false
+ end
+
+ local maxlines = self.db.profile.maxlines
+ local cmdhistory = self.db.profile.cmdhistory
+
+ table.insert(cmdhistory, 1, text)
+
+ if #cmdhistory > maxlines then
+ for x = 1, (#cmdhistory - maxlines) do
+ table.remove(cmdhistory)
+ end
+ end
+
+ self.db.profile.cmdhistory = cmdhistory
+end
+
+function module:AddHistoryLine(editBox)
+ editBox = editBox or {}
+
+ -- following code mostly ripped off from Blizzard, but at least I understand it now
+ local text = ""
+ local type = editBox:GetAttribute("chatType")
+ local header = getglobal("SLASH_" .. type .. "1")
+
+ if (header) then
+ text = header
+ end
+
+ if (type == "WHISPER") then
+ text = text .. " " .. editBox:GetAttribute("tellTarget")
+ elseif (type == "CHANNEL") then
+ text = "/" .. editBox:GetAttribute("channelTarget")
+ end
+
+ local editBoxText = editBox:GetText();
+ if (strlen(editBoxText) > 0) then
+ text = text.." "..editBox:GetText();
+ self:saveLine(text)
+ end
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Keybindings.lua b/modules/Keybindings.lua
new file mode 100644
index 00000000..378be2a2
--- /dev/null
+++ b/modules/Keybindings.lua
@@ -0,0 +1,218 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratKeyBindings
+Revision: $Revision: 80432 $
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#KeyBindings
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that adds keybindings for modules.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+-- Get Utility Libraries
+local PRAT_MODULE = Prat:RequestModuleName("KeyBindings")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Prat Keybindings"] = true,
+ ["Officer Channel"] = true,
+ ["Guild Channel"] = true,
+ ["Party Channel"] = true,
+ ["Raid Channel"] = true,
+ ["Raid Warning Channel"] = true,
+ ["Battleground Channel"] = true,
+ ["Say"] = true,
+ ["Yell"] = true,
+ ["Whisper"] = true,
+ ["Channel %d"] = true,
+ ["Prat TellTarget"] = true,
+ ["TellTarget"] = true,
+ ["Prat CopyChat"] = true,
+ ["Copy Selected Chat Frame"] = true,
+ ["Smart Group Channel"] = true,
+})
+
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 80432 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Prat ChannelNames"] = "Prat 频道名称",
+-- ["Officer Channel"] = "官员频道",
+-- ["Guild Channel"] = "公会频道",
+-- ["Party Channel"] = "队伍频道",
+-- ["Raid Channel"] = "团队频道",
+-- ["Raid Warning Channel"] = "团队警报频道",
+-- ["Battleground Channel"] = "战场频道",
+-- ["Say"] = "说",
+-- ["Yell"] = "喊",
+-- ["Whisper"] = "密语",
+-- ["Channel %d"] = "频道 %d",
+-- ["Prat TellTarget"] = "Prat 通知目标",
+-- ["TellTarget"] = "通知目标",
+-- ["Prat CopyChat"] = "Prat 聊天复制",
+-- ["Copy Selected Chat Frame"] = "复制已选聊天窗口",
+-- ["Smart Group Channel"] = "智能群频道",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Prat ChannelNames"] = "Prat 頻道名稱",
+-- ["Officer Channel"] = "公會理事頻道",
+-- ["Guild Channel"] = "公會頻道",
+-- ["Party Channel"] = "隊伍頻道",
+-- ["Raid Channel"] = "團隊頻道",
+-- ["Raid Warning Channel"] = "團隊警告頻道",
+-- ["Battleground Channel"] = "戰場頻道",
+-- ["Say"] = "說",
+-- ["Yell"] = "大喊",
+-- ["Whisper"] = "悄悄話",
+-- ["Channel %d"] = "頻道%d",
+-- ["Prat TellTarget"] = "Prat 通知目標",
+---- no use anymore ["TellTarget"] = true,
+-- ["Prat CopyChat"] = "Prat 複製聊天訊息",
+-- ["Copy Selected Chat Frame"] = "從使用中的聊天視窗複製",
+-- ["Smart Group Channel"] = "智慧群組頻道",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Prat ChannelNames"] = "Prat 채널명",
+-- ["Officer Channel"] = "오피서 채널",
+-- ["Guild Channel"] = "길드 채널",
+-- ["Party Channel"] = "파티 채널",
+-- ["Raid Channel"] = "공격대 채널",
+-- ["Raid Warning Channel"] = "공격대경보 채널",
+-- ["Battleground Channel"] = "전장 채널",
+-- ["Say"] = "대화",
+-- ["Yell"] = "외치기",
+-- ["Whisper"] = "귓속말",
+-- ["Channel %d"] = "채널 %d",
+-- ["Prat TellTarget"] = "Prat 대상대화",
+-- ["TellTarget"] = "대상대화",
+-- ["Prat CopyChat"] = "Prat 대화복사",
+-- ["Copy Selected Chat Frame"] = "선택된 대화창 복사",
+-- ["Smart Group Channel"] = "스마트 파티 채널",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Prat ChannelNames"] = "Nombres de Canal de Prat",
+-- ["Officer Channel"] = "Canal de Oficial",
+-- ["Guild Channel"] = "Canal de Hermandad",
+-- ["Party Channel"] = "Canal de Grupo",
+-- ["Raid Channel"] = "Canal de Banda",
+-- ["Raid Warning Channel"] = "Canal de Aviso de Banda",
+-- ["Battleground Channel"] = "Canal de Campo de Batalla",
+-- ["Say"] = "Decir",
+-- ["Yell"] = "Gritar",
+-- ["Whisper"] = "Susurrar",
+-- ["Channel %d"] = "Canal %d",
+-- ["Prat TellTarget"] = "Susurrar a Objetivo de Prat",
+-- ["TellTarget"] = "Susurrar a Objetivo",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Prat ChannelNames"] = "Prat Kanal Namen",
+-- ["Officer Channel"] = "Offizier's Kanal",
+-- ["Guild Channel"] = "Gilden Kanal",
+-- ["Party Channel"] = "Gruppen Kanal",
+-- ["Raid Channel"] = "Schlachtgruppen Kanal",
+-- ["Raid Warning Channel"] = "Schlachtgruppenwarnung Kanal",
+-- ["Battleground Channel"] = "Schlachtfeld Kanal",
+-- ["Say"] = "Sagen",
+-- ["Yell"] = "Schreien",
+-- ["Whisper"] = "Fl\195\188stern",
+-- ["Channel %d"] = "Kanal %d",
+-- ["Prat TellTarget"] = "Prat Ziel Fl\195\188stern",
+-- ["TellTarget"] = "Ziel Fl\195\188stern",
+-- ["Prat CopyChat"] = "Prat Chat Kopieren",
+-- ["Copy Selected Chat Frame"] = "Kopiere das ausgewälte Chat Fenster.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["Prat ChannelNames"] = "Prat - Noms de canaux",
+-- ["Officer Channel"] = "Canal officiers",
+-- ["Guild Channel"] = "Canal de guilde",
+-- ["Party Channel"] = "Canal de groupe",
+-- ["Raid Channel"] = "Canal de raid",
+-- ["Raid Warning Channel"] = "Canal d'avertissement de raid",
+-- ["Battleground Channel"] = "Canal de champs de bataille",
+-- ["Say"] = "Dire",
+-- ["Yell"] = "Crier",
+-- ["Whisper"] = "Chuchoter",
+-- ["Channel %d"] = "Canal %d",
+-- ["Prat TellTarget"] = "Prat Dire \195\160 la cible",
+-- ["TellTarget"] = "Dire \195\160 la cible",
+-- ["Prat CopyChat"] = "Prat Copier un chat",
+-- ["Copy Selected Chat Frame"] = "Copier le texte de la fen\195\170tre s\195\169lectionn\195\169e",
+--} end)
+
+local module = Prat:NewModule(PRAT_MODULE)
+
+Prat:SetModuleInit(module,
+ function(self)
+ BINDING_HEADER_Prat = L["Prat Keybindings"]
+ BINDING_NAME_officer = L["Officer Channel"]
+ BINDING_NAME_guild = L["Guild Channel"]
+ BINDING_NAME_party = L["Party Channel"]
+ BINDING_NAME_raid = L["Raid Channel"]
+ BINDING_NAME_raidwarn = L["Raid Warning Channel"]
+ BINDING_NAME_battleground = L["Battleground Channel"]
+ BINDING_NAME_say = L["Say"]
+ BINDING_NAME_yell = L["Yell"]
+ BINDING_NAME_whisper = L["Whisper"]
+ BINDING_NAME_one = (L["Channel %d"]):format(1)
+ BINDING_NAME_two = (L["Channel %d"]):format(2)
+ BINDING_NAME_three = (L["Channel %d"]):format(3)
+ BINDING_NAME_four = (L["Channel %d"]):format(4)
+ BINDING_NAME_five = (L["Channel %d"]):format(5)
+ BINDING_NAME_six = (L["Channel %d"]):format(6)
+ BINDING_NAME_seven = (L["Channel %d"]):format(7)
+ BINDING_NAME_eight = (L["Channel %d"]):format(8)
+ BINDING_NAME_nine = (L["Channel %d"]):format(9)
+ BINDING_NAME_ten = (L["Channel %d"]):format(10)
+ BINDING_NAME_SmartGroup = L["Smart Group Channel"]
+-- BINDING_HEADER_Prat_TellTarget = L["Prat TellTarget"]
+-- BINDING_HEADER_Prat_CopyChat = L["Prat CopyChat"]
+ BINDING_NAME_CopySelected = L["Copy Selected Chat Frame"]
+ end
+)
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Paragraph.lua b/modules/Paragraph.lua
new file mode 100644
index 00000000..066feff9
--- /dev/null
+++ b/modules/Paragraph.lua
@@ -0,0 +1,249 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratParagraph
+Revision: $Revision: 80705 $
+Author(s): Curney (asml8ed@gmail.com)
+Thanks to: Wubin for helping me understand variables better
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Paragraph
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that gives options for paragraphs in chat windows (defaults=left-aligned text, linespacing=0).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+-- Get Utility Libraries
+local PRAT_MODULE = Prat:RequestModuleName("Paragraph")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Paragraph"] = true,
+ ["Chat window paragraph options."] = true,
+ ["justification_name"] = "Set Alignment",
+ ["justification_desc"] = "Set horizontal alignment for each chat window",
+ ["Line Spacing"] = true,
+ ["Set the line spacing for all chat windows."] = true,
+ ["adjustlinks_name"] = "Fix placement of player/item links",
+ ["adjustlinks_desc"] = "Adjust links to restore clickability on centered or right-aligned text.",
+ ["Center"] = true,
+ ["Right"] = true,
+ ["Left"] = true,
+})
+
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 80705 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Paragraph"] = "段落",
+-- ["Chat window paragraph options."] = "聊天窗口段落选项.",
+-- ["justification_name"] = "设置对齐",
+-- ["justification_desc"] = "设置每个聊天窗口对齐格式.",
+-- ["Set ChatFrame%d Alignment"] = "聊天窗口 %d 对齐",
+-- ["Set horizontal alignment to left, right, or center."] = "给聊天窗口 %d 设置对齐",
+-- ["Line Spacing"] = "行间距",
+-- ["Set the line spacing for all chat windows."] = "为全部聊天窗口设置行间距",
+-- ["adjustlinks_name"] = "修正玩家/物品链接位置",
+-- ["adjustlinks_desc"] = "右对齐或置中时调整链接保持点击功能.",
+-- ["Center"] = "置中",
+-- ["Right"] = "右",
+-- ["Left"] = "左",
+-- } end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Paragraph"] = "段落",
+-- ["Chat window paragraph options."] = "聊天視窗段落選項。",
+-- ["justification_name"] = "設定對齊",
+-- ["justification_desc"] = "設定各個聊天視窗的對齊。",
+-- ["Set ChatFrame%d Alignment"] = "聊天視窗%d對齊",
+-- ["Set horizontal alignment to left, right, or center."] = "設定聊天視窗的對齊選項。",
+-- ["Line Spacing"] = "行距",
+-- ["Set the line spacing for all chat windows."] = "設定全部聊天視窗的行距。",
+-- ["adjustlinks_name"] = "修正玩家/物品連結位置",
+-- ["adjustlinks_desc"] = "使連結在靠右或置中對齊時依然可以點擊。",
+-- ["Center"] = "置中",
+-- ["Right"] = "靠右",
+-- ["Left"] = "靠左",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["Paragraph"] = "Justification",
+-- ["Chat window paragraph options."] = "Options concernant la justification.",
+-- ["justification_name"] = "Justification",
+-- ["justification_desc"] = "Règle la justification pour toutes les fenêtres.",
+-- ["Set ChatFrame%d Alignment"] = "Fenêtre %d",
+-- ["Set horizontal alignment to left, right, or center."] = "R\195\168gle la justification pour la fenêtre %d.",
+-- ["adjustlinks_name"] = "Corrige le placement des liens",
+-- ["adjustlinks_desc"] = "Corrige le placement des liens lorsque la justification est sur Centrée ou Droite.",
+-- ["Center"] = "Centré",
+-- ["Right"] = "Aligné à droite",
+-- ["Left"] = "Aligné à gauche",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Paragraph"] = "단락",
+-- ["Chat window paragraph options."] = "대화창 단락 설정입니다.",
+-- ["justification_name"] = "정렬 설정",
+-- ["justification_desc"] = "각 대화창에 대한 수평 정렬을 설정합니다.",
+-- ["Set ChatFrame%d Alignment"] = "%d 대화창 정렬 설정",
+-- ["Set horizontal alignment to left, right, or center."] = "왼쪽, 오른쪽, 혹은 가운데 수평 정렬을 설정합니다.",
+-- ["Line Spacing"] = "줄 간격",
+-- ["Set the line spacing for all chat windows."] = "모든 대화창에 대한 줄 간력을 설정합니다.",
+-- ["adjustlinks_name"] = "플레이어/아이템 링크 위치 수정",
+-- ["adjustlinks_desc"] = "우측 혹은 가운데 정렬일 때 클릭가능한 것들을 복원하기 위내 링크를 조절합니다.",
+-- ["Center"] = "가운데",
+-- ["Right"] = "우측",
+-- ["Left"] = "좌측",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Paragraph"] = "Justificar",
+-- ["Chat window paragraph options."] = "Opciones de parrafo para la ventana de chat.",
+-- ["justification_name"] = "Establecer Justificaci\195\179n",
+-- ["justification_desc"] = "Establece la justificaci\195\179n para cada ventana",
+-- ["Set ChatFrame%d Alignment"] = "Justificaci\195\179n del Chat %d",
+-- ["Set horizontal alignment to left, right, or center."] = "Establece la justificaci\195\179n para la ventana de chat %d",
+-- ["Line Spacing"] = "Espaciado de L\195\173nea",
+-- ["Set the line spacing for all chat windows."] = "Establece el espaciado de l\195\173nea para todas las ventanas del chat",
+-- ["adjustlinks_name"] = "Arreglar la posici\195\179n de los enlaces de jugador/objeto",
+-- ["adjustlinks_desc"] = "Permite volver a hacer clic sobre los enlaces cuando la justificaci\195\179n es derecha o centro.",
+-- ["Center"] = "Centro",
+-- ["Right"] = "Derecha",
+-- ["Left"] = "Izquierda",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Paragraph"] = "Absatz",
+-- ["Chat window paragraph options."] = "Chatfenster Absatz Optionen",
+-- ["justification_name"] = "B\195\188ndigkeit einstellen",
+-- ["justification_desc"] = "Setze horizontale B\195\188ndigkeit f\195\188r jedes Fenster.",
+-- ["Set ChatFrame%d Alignment"] = "Chat %d B\195\188ndigkeit",
+-- ["Set horizontal alignment to left, right, or center."] = "Setze horizontale B\195\188ndigkeit auf Links, Rechts oder Mitte.",
+-- ["Line Spacing"] = "Zeilenabstand",
+-- ["Set the line spacing for all chat windows."] = "Justiere den Zeilenabstand f\195\188r alle chatfenster.",
+-- ["adjustlinks_name"] = "Fixiere Plazierung von Spieler/Item Links",
+-- ["adjustlinks_desc"] = "Justiere Links um ihre anklickbarkeit zu gew\195\164rleisten wenn die B\195\188ndigkeit auf rechts oder mitte eingestellt ist.",
+-- ["Center"] = "Mitte",
+-- ["Right"] = "Rechts",
+-- ["Left"] = "Links",
+--} end)
+--
+
+
+-- create prat module
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+
+
+
+Prat:SetModuleDefaults(module, {
+ profile = {
+ on = false,
+ justification = { ["*"] = "LEFT" },
+ adjustlinks = false,
+ }
+} )
+
+do
+ local justifyoption = {
+ name = function(info) return Prat.HookedFrameList[info[#info]] or "" end,
+ desc = L["justification_name"],
+ type="select",
+ values = { ["RIGHT"] = L["Right"], ["CENTER"] = L["Center"], ["LEFT"] = L["Left"]},
+ hidden = function(info) return Prat.HookedFrameList[info[#info]] == nil end,
+ }
+
+ Prat:SetModuleOptions(module, {
+ name = L["Paragraph"],
+ desc = L["Chat window paragraph options."],
+ type = "group",
+ args = {
+ justification = {
+ name = L["justification_name"],
+ desc = L["justification_desc"],
+ type = "group",
+ inline = true,
+ args = {
+ ChatFrame1 = justifyoption,
+ ChatFrame3 = justifyoption,
+ ChatFrame4 = justifyoption,
+ ChatFrame5 = justifyoption,
+ ChatFrame6 = justifyoption,
+ ChatFrame7 = justifyoption,
+ }
+ },
+
+ info = {
+ name = "Note: Playerlinks, itemlinks, and any other link type will not work when justification is set to anything other than 'Left'",
+ type = "description",
+ order = 110
+ }
+ }
+ }
+ )
+end
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+function module:OnModuleEnable()
+ self:ConfigureAllChatFrames(true)
+end
+
+function module:OnModuleDisable()
+ self:ConfigureAllChatFrames(false)
+ self:UnhookAll()
+end
+
+function module:OnSubValueChanged()
+ self:ConfigureAllChatFrames(true)
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+function module:ConfigureAllChatFrames(enable)
+ local prof = self.db.profile
+ for k,v in pairs(Prat.HookedFrames) do
+ v:SetJustifyH(enable and prof.justification[k] or "LEFT")
+ end
+end
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/PlayerNameGlobalPatterns.lua b/modules/PlayerNameGlobalPatterns.lua
new file mode 100644
index 00000000..04eb48d6
--- /dev/null
+++ b/modules/PlayerNameGlobalPatterns.lua
@@ -0,0 +1,91 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratPlayerNamesGlobalPatterns
+Revision: $Revision: 81333 $
+Author(s): Sylvanaar
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#PlayerNames
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Maintains patterns in the registry for coloring player names outside of links.
+Dependencies: Prat
+]]
+
+Prat:AddModuleExtension(function()
+ local module = Prat.Addon:GetModule("PlayerNames", true)
+
+ if not module then return end
+
+ local L = module.L
+
+ module.pluginopts["GlobalPatterns"] = {
+ coloreverywhere = {
+ type = "toggle",
+ name = L["coloreverywhere_name"],
+ desc = L["coloreverywhere_desc"],
+ order = 220
+ }
+ }
+
+
+ local class, level, subgroup
+
+ local function ColorPlayer(name)
+ class, level, subgroup = module:GetData(name)
+
+ return Prat:RegisterMatch(Prat.CLR:Player(name, name, class))
+ end
+
+ -- Thanks for the frontier pattern: Josh Borke & Arrowmaster
+ local function newPattern(name)
+ return { pattern = "%f[%w]"..("[%s%s]%s"):format(name:sub(1,1):upper(), name:sub(1,1):lower(), name:sub(2)).."%f[%W]", matchfunc=ColorPlayer }
+ end
+
+ do
+ local namePatterns = {}
+
+ function module:OnPlayerDataChangedThrottled(Name)
+ if self.db.profile.coloreverywhere and Name then
+ if not namePatterns[Name] and Name:len() > 1 then
+ namePatterns[Name] = Prat.RegisterPattern(newPattern(Name), self.name)
+ end
+ else
+ for k,v in pairs(namePatterns) do
+ Prat.UnregisterPattern(v)
+ namePatterns[k] = nil
+ end
+ end
+ end
+
+ function module:OnPlayerDataChanged(Name)
+ self:ScheduleTimer("OnPlayerDataChangedThrottled", 0, Name)
+ end
+ end
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/PlayerNames.lua b/modules/PlayerNames.lua
new file mode 100644
index 00000000..0d0506b4
--- /dev/null
+++ b/modules/PlayerNames.lua
@@ -0,0 +1,1455 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratPlayerNames
+Revision: $Revision: 82160 $
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+Inspired by: idChat2_PlayerNames by Industrial
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#PlayerNames
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that adds player name options.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("PlayerNames")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+-- define localized strings
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["PlayerNames"] = true,
+ ["Player name formating options."] = true,
+ ["Brackets"] = true,
+ ["Square"] = true,
+ ["Angled"] = true,
+ ["None"] = true,
+ ["Class"] = true,
+ ["Random"] = true,
+ ["Reset Settings"] = true,
+ ["No additional coloring"] = true,
+ ["Restore default settings, and delete stored character data."] = true,
+ ["Sets style of brackets to use around player names."] = true,
+ ["Unknown Use Common Color"] = true,
+ ["Toggle using a common color for unknown player names."] = true,
+ ["Unknown Common Color"] = true,
+ ["Set common color of unknown player names."] = true,
+ ["Enable TabComplete"] = true,
+ ["Toggle tab completion of player names."] = true,
+ ["Show Level"] = true,
+ ["Toggle level showing."] = true,
+ ["Level Color Mode"] = true,
+ ["Use Player Color"] = true,
+ ["Use Channel Color"] = true,
+ ["Color by Level Difference"] = true,
+ ["How to color other player's level."] = true,
+ ["Show Group"] = true,
+ ["Toggle raid group showing."] = true,
+ ["Show Raid Target Icon"] = true,
+ ["Toggle showing the raid target icon which is currently on the player."] = true,
+
+ -- In the high-cpu pullout
+ ["coloreverywhere_name"] = "Color Names Everywhere",
+ ["coloreverywhere_desc"] = "Color player names if they appear in the text of the chat message",
+
+ ["Keep Info"] = true,
+ ["Keep Lots Of Info"] = true,
+ ["Keep player information between session for all players except cross-server players"] = true,
+ ["Keep player information between session, but limit it to friends and guild members."] = true,
+ ["Player Color Mode"] = true,
+ ["How to color player's name."] = true,
+ ["Unknown Common Color From TasteTheNaimbow"] = true,
+ ["Let TasteTheNaimbow set the common color for unknown player names."] = true,
+ ["Enable Alt-Invite"] = true,
+ ["Toggle group invites by alt-clicking on player name."] = true,
+ ["Enable Invite Links"] = true,
+ ["Toggle group invites by alt-clicking hyperlinked keywords like 'invite'."] = true,
+ ["Brackets Common Color"] = true,
+ ["Sets common color of brackets to use around player names."] = true,
+ ["Brackets Use Common Color"] = true,
+ ["Toggle using a common color for brackets around player names."] = true,
+ ["linkifycommon_name"] = "Linkify Common Messages",
+ ["linkifycommon_desc"] = "Linkify Common Messages",
+ ["Prat_Playernames: Stored Player Data Cleared"] = true,
+
+ ["tabcomplete_name"] = "Possible Names",
+ ["Tab completion : "] = true,
+ ["Too many matches (%d possible)"] = true,
+ ["Actively Query Player Info"] = true,
+ ["Query the server for all player names we do not know. Note: This happpens pretty slowly, and this data is not saved."] = true,
+})
+
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 82160 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["PlayerNames"] = "玩家姓名",
+-- ["Player name formating options."] = "玩家姓名格式选项.",
+-- ["Brackets"] = "圆弧",
+-- ["Square"] = "方形",
+-- ["Angled"] = "折角",
+-- ["None"] = "无",
+-- ["Class"] = "职业",
+-- ["Random"] = "随机",
+-- ["Reset Settings"] = "重置设置",
+-- ["No additional coloring"] = "无附加颜色",
+-- ["Restore default settings, and delete stored character data."] = "恢复默认设置, 删除保存的角色数据.",
+-- ["Sets style of brackets to use around player names."] = "设置玩家姓名括号样式.",
+-- ["Unknown Use Common Color"] = "使用特殊颜色",
+-- ["Toggle using a common color for unknown player names."] = "未知玩家姓名使用特殊颜色",
+-- ["Unknown Common Color"] = "设置特殊颜色",
+-- ["Set common color of unknown player names."] = "改变玩家姓名特殊颜色",
+-- ["Enable TabComplete"] = "标签",
+-- ["Toggle tab completion of player names."] = "为玩家姓名作标签.",
+-- ["Show Level"] = "显示等级",
+-- ["Toggle level showing."] = "人物等级显示.",
+-- ["Level Color Mode"] = "等级颜色模式",
+-- ["Use Player Color"] = "使用玩家等级",
+-- ["Use Channel Color"] = "使用频道颜色",
+-- ["Color by Level Difference"] = "不同等级颜色",
+-- ["How to color other player's level."] = "其他玩家等级颜色设置.",
+-- ["Show Group"] = "显示小组",
+-- ["Toggle raid group showing."] = "团队小组显示.",
+-- ["Keep Info"] = "保留信息",
+-- ["Keep Lots Of Info"] = "保留多数信息",
+-- ["Keep player information between session for all players except cross-server players"] = "保留除跨服外的全部角色信息.",
+-- ["Keep player information between session, but limit it to friends and guild members."] = "保留玩家信息, 仅限于好友和公会成员.",
+-- ["Player Color Mode"] = "颜色模式",
+-- ["How to color player's name."] = "玩家姓名颜色.",
+-- ["Unknown Common Color From TasteTheNaimbow"] = "TasteTheNaimbow 的通用颜色",
+-- ["Let TasteTheNaimbow set the common color for unknown player names."] = "使用 TasteTheNaimbow 设置未知玩家颜色",
+-- ["Enable Alt-Invite"] = "开启 邀请",
+-- ["Toggle group invites by alt-clicking on player name."] = "按下 键点击邀请玩家",
+-- ["Enable Invite Links"] = "开启邀请链接",
+-- ["Toggle group invites by alt-clicking hyperlinked keywords like 'invite'."] = "按下 键点击超链接关键词邀请玩家",
+-- ["Brackets Common Color"] = "括号颜色",
+-- ["Sets common color of brackets to use around player names."] = "设置指示玩家名字括号的颜色",
+-- ["Brackets Use Common Color"] = "括号使用通用颜色",
+-- ["Toggle using a common color for brackets around player names."] = "指示玩家名字的括号使用通用颜色.",
+-- ["linkifycommon_name"] = "链接通用信息",
+-- ["linkifycommon_desc"] = "链接通用信息",
+-- ["module: Stored Player Data Cleared"] = "module: 已删除储存的玩家资料",
+-- ["Tab completion : "] = "Tab 补齐 : ",
+-- ["Too many matches (%d possible)"] = "Tab 补齐 : 存在太多 (%d) 符合的名字",
+-- ["Actively Query Player Info"] = "自动查询玩家信息",
+-- ["Query the server for all player names we do not know. Note: This happpens pretty slowly, and this data is not saved."] = "主动查询服务器未知玩家的信息。注意: 这是个很慢的操作指令,这些信息也不会被储存。",
+--
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["PlayerNames"] = "플레이어명",
+-- ["Player name formating options."] = "플레이어명 형식을 설정합니다.",
+-- ["Brackets"] = "괄호",
+-- ["Square"] = "사각형",
+-- ["Angled"] = "각진형",
+-- ["None"] = "없음",
+-- ["Class"] = "직업",
+-- ["Random"] = "무작위",
+-- ["Reset Settings"] = "설정 초기화",
+-- ["No additional coloring"] = "색상 미사용",
+-- ["Restore default settings, and delete stored character data."] = "기본 설정을 복원하고 저장된 케릭터 데이터를 삭제합니다.",
+-- ["Sets style of brackets to use around player names."] = "플레이어명 주위 괄호의 스타일을 설정합니다.",
+-- ["Unknown Use Common Color"] = "공통 색상 사용",
+-- ["Toggle using a common color for unknown player names."] = "알려지지 않은 플레이어명에 대해 공통 색상을 사용합니다.",
+-- ["Unknown Common Color"] = "공통 색상 설정",
+-- ["Set common color of unknown player names."] = "플레이어명의 공통 색상을 설정합니다.",
+-- ["Enable TabComplete"] = "탭완성 사용",
+-- ["Toggle tab completion of player names."] = "플레이어명의 탭 완성기능을 사용합니다.",
+-- ["Show Level"] = "레벨 표시",
+-- ["Toggle level showing."] = "레벨을 표시합니다.",
+-- ["Level Color Mode"] = "레벨 색상 모드",
+-- ["Use Player Color"] = "플레이어 색상 사용",
+-- ["Use Channel Color"] = "채널 색상 사용",
+-- ["Color by Level Difference"] = "레벨 차이에 의한 색상",
+-- ["How to color other player's level."] = "다른 플레이어의 레벨 색상 표시 방법을 설정합니다.",
+-- ["Show Group"] = "파티 표시",
+-- ["Toggle raid group showing."] = "공격대 내의 파티 번호를 표시합니다.",
+-- ["Keep Info"] = "정보 유지",
+-- ["Keep Lots Of Info"] = "각종 정보 유지",
+-- ["Keep player information between session for all players except cross-server players"] = "서버가 다른 플레이어를 제외하고 모든 플레이어에 대해 접속간 플레이어 정보를 유지합니다.",
+-- ["Keep player information between session, but limit it to friends and guild members."] = "접속간 플레이어 정보를 유지합니다. 친구와 길드원에 한함.",
+-- ["Player Color Mode"] = "플레이어 색상 모드",
+-- ["How to color player's name."] = "플레이어의 이름 색상을 변경합니다.",
+-- ["Unknown Common Color From TasteTheNaimbow"] = "TasteTheNaimbow의 공통 색상을 사용합니다.",
+-- ["Let TasteTheNaimbow set the common color for unknown player names."] = "알려지지 않은 플레이어 이름에 대한 공통 색상 설정을 TasteTheNaimbow가 하도록 합니다.",
+-- ["Enable Alt-Invite"] = "ALT-초대 사용",
+-- ["Toggle group invites by alt-clicking on player name."] = "플레이어 이름에 ALT-클릭으로 초대합니다.",
+-- ["Enable Invite Links"] = "링크 초대 사용",
+-- ["Toggle group invites by alt-clicking hyperlinked keywords like 'invite'."] = "'초대'같은 키워드로 된 링크를 ALT-클릭으로 초대합니다.",
+-- ["Brackets Common Color"] = "괄호 공통 색상",
+-- ["Sets common color of brackets to use around player names."] = "플레이어 이름 주변에 사용할 괄호의 공통 색상을 설정합니다.",
+-- ["Brackets Use Common Color"] = "괄호 공통 색상 사용",
+-- ["Toggle using a common color for brackets around player names."] = "플레이어 이름 주변에 사용되는 괄호에 공통 색상을 사용합니다.",
+-- ["linkifycommon_name"] = "링크가능한 일반 메세지",
+-- ["linkifycommon_desc"] = "링크가능한 일반 메세지",
+-- ["module: Stored Player Data Cleared"] = "module: Stored Player Data Cleared",
+-- ["Tab completion : "] = "탭 완성 : ",
+-- ["Too many matches (%d possible)"] = "탭 완성 : 너무 많이 일치함 (%d개 이용 가능)",
+-- ["Actively Query Player Info"] = "Actively Query Player Info",
+-- ["Query the server for all player names we do not know. Note: This happpens pretty slowly, and this data is not saved."] = "Query the server for all player names we do not know. Note: This happpens pretty slowly, and this data is not saved.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["PlayerNames"] = "玩家名字",
+-- ["Player name formating options."] = "玩家名字格式選項。",
+-- ["Brackets"] = "括弧",
+-- ["Square"] = "方形",
+-- ["Angled"] = "折角",
+-- ["None"] = "無",
+-- ["Class"] = "職業",
+-- ["Random"] = "隨機",
+-- ["Reset Settings"] = "重設",
+-- ["No additional coloring"] = "沒有額外著色。",
+-- ["Restore default settings, and delete stored character data."] = "重設回預設設定,並刪除已儲存的玩家資料。",
+-- ["Sets style of brackets to use around player names."] = "設定包圍玩家名字的括號。",
+-- ["Unknown Use Common Color"] = "未知玩家使用共用顏色",
+-- ["Toggle using a common color for unknown player names."] = "切換未知玩家名字是否使用共用顏色。",
+-- ["Unknown Common Color"] = "未知玩家共用顏色",
+-- ["Set common color of unknown player names."] = "改變未知玩家名字的共用顏色。",
+-- ["Enable TabComplete"] = "啟用補齊",
+-- ["Toggle tab completion of player names."] = "切換是否開啟Tab鍵補齊功能,為玩家名字作補齊。",
+-- ["Show Level"] = "顯示等級",
+-- ["Toggle level showing."] = "人物等級顯示。",
+-- ["Level Color Mode"] = "等級顏色模式",
+-- ["Use Player Color"] = "使用玩家顏色",
+-- ["Use Channel Color"] = "使用頻道顏色",
+-- ["Color by Level Difference"] = "依等級差距著色",
+-- ["How to color other player's level."] = "如何為其他玩家的等級著色。",
+-- ["Show Group"] = "顯示小隊",
+-- ["Toggle raid group showing."] = "團隊小隊顯示。",
+-- ["Keep Info"] = "保存資訊",
+-- ["Keep Lots Of Info"] = "保存大量資訊",
+-- ["Keep player information between session for all players except cross-server players"] = "保存所有玩家資訊但不含跨伺服器的玩家。",
+-- ["Keep player information between session, but limit it to friends and guild members."] = "保存玩家資訊,但僅限於好友及公會會員。",
+-- ["Player Color Mode"] = "玩家顏色模式",
+-- ["How to color player's name."] = "如何為玩家名字著色。",
+-- ["Unknown Common Color From TasteTheNaimbow"] = "TasteTheNaimbow 的未知玩家共用顏色",
+-- ["Let TasteTheNaimbow set the common color for unknown player names."] = "讓 TasteTheNaimbow 插件設定未知玩家名字的共用顏色。",
+-- ["Enable Alt-Invite"] = "啟用Alt-邀請",
+-- ["Toggle group invites by alt-clicking on player name."] = "使用Alt-左擊聊天視窗內的玩家名字可邀請玩家組隊。",
+-- ["Enable Invite Links"] = "啟用邀請連結",
+-- ["Toggle group invites by alt-clicking hyperlinked keywords like 'invite'."] = "使用Alt-左擊關鍵字連結可邀請玩家組隊,例如「邀請」。",
+-- ["Brackets Common Color"] = "括弧共用顏色",
+-- ["Sets common color of brackets to use around player names."] = "改變包圍玩家名字的括號共用顏色。",
+-- ["Brackets Use Common Color"] = "括弧使用共用顏色",
+-- ["Toggle using a common color for brackets around player names."] = "切換括弧是否使用共用顏色。",
+-- ["linkifycommon_name"] = "連結化公共資訊",
+-- ["linkifycommon_desc"] = "連結化公共資訊。",
+-- ["module: Stored Player Data Cleared"] = "module: 已刪除儲存的玩家資料",
+-- ["Tab completion : "] = "Tab鍵補齊 : ",
+-- ["Too many matches (%d possible)"] = "Tab鍵補齊 : 太多 (%d) 符合的名字",
+-- ["Actively Query Player Info"] = "主動查詢玩家資訊",
+-- ["Query the server for all player names we do not know. Note: This happpens pretty slowly, and this data is not saved."] = "主動查詢伺服器未知玩家的資訊。注意: 這是個很慢的操作指令,這些資訊也不會被儲存。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["PlayerNames"] = "Nombres de Jugador",
+-- ["Player name formating options."] = "Opciones de formateado de nombres de jugador",
+-- ["Brackets"] = "Par\195\169ntesis",
+-- ["Square"] = "Corchetes",
+-- ["Angled"] = "Llaves",
+-- ["None"] = "Ninguno",
+-- ["Class"] = "Clase",
+-- ["Random"] = "Aleatorio",
+-- ["Sets style of brackets to use around player names."] = "Establece el estilo de los par\195\169ntesis a usar alrededor de los nombres de jugador",
+-- ["Unknown Use Common Color"] = "Usar color com\195\186n",
+-- ["Toggle using a common color for unknown player names."] = "Determina si se usa el color com\195\186n para los nombres de jugadores desconocidos",
+-- ["Unknown Common Color"] = "Establecer color com\195\186n",
+-- ["Set common color of unknown player names."] = "Cambia el color com\195\186n de los nombres de jugador",
+-- ["Enable TabComplete"] = "Usar Tab para Completar",
+-- ["Toggle tab completion of player names."] = "Determina si se usa Tab para completar nombres de jugadores",
+-- ["Show Level"] = "Mostrar Nivel",
+-- ["Toggle level showing."] = "Determina si se muestra el nivel",
+-- ["Show Group"] = "Mostrar Grupo",
+-- ["Toggle raid group showing."] = "Determina si se muestra el grupo en banda",
+-- ["Keep Info"] = "Guardar Info",
+-- ["Keep Lots Of Info"] = "Guardar Montones de Info",
+-- ["Keep player information between session for all players except cross-server players"] = "Guarda la informaci\195\179n sobre jugadores entre sesiones para todos los jugadores excepto los de otros servidores",
+-- ["Keep player information between session, but limit it to friends and guild members."] = "Guarda la informaci\195\179n sobre jugadores entre sesiones, pero lo limita a los amigos y miembros de hermandad",
+-- ["Player Color Mode"] = "Modo de Color",
+-- ["How to color player's name."] = "C\195\179mo se colorean los nombres de jugador",
+-- ["Unknown Common Color From TasteTheNaimbow"] = "Color Com\195\186n de TasteTheNaimbow",
+-- ["Let TasteTheNaimbow set the common color for unknown player names."] = "Permite a TasteTheNaimbow establecer el color de los jugadores desconocidos",
+-- ["Enable Alt-Invite"] = "Activar Alt-Invitar",
+-- ["Toggle group invites by alt-clicking on player name."] = "Invita a jugadores hacienco Clic+Alt en su nombre en la ventana de chat",
+-- ["Enable Invite Links"] = "Activar Enlaces de Invitaci\195\179n",
+-- ["Toggle group invites by alt-clicking hyperlinked keywords like 'invite'."] = "Invita a los jugadores haciendo Clic+Alt en palabras clave enlazadas como 'invitar'",
+-- ["Brackets Common Color"] = "Color de Par\195\169ntesis",
+-- ["Sets common color of brackets to use around player names."] = "Establece el color del par\195\169ntesis de los nombres de jugador",
+-- ["Brackets Use Common Color"] = "Par\195\169ntesis usan color com\195\186n",
+-- ["Toggle using a common color for brackets around player names."] = "Determina si se usa un color com\195\186n para los par\195\169ntesis de los nombres de jugador",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["PlayerNames"] = "Spieler Namen",
+-- ["Player name formating options."] = "Spielernamen Formatierungs Optionen.",
+-- ["Brackets"] = "Winkel",
+-- ["Square"] = "Quadrat",
+-- ["Angled"] = "Spitzwinkel",
+-- ["None"] = "Kein",
+-- ["Class"] = "Klasse",
+-- ["Random"] = "Zufall",
+-- ["Sets style of brackets to use around player names."] = "Setze Typ der Klammern die Spieler Namen umranden.",
+-- ["Unknown Use Common Color"] = "Nutze allgemeine Farbe",
+-- ["Toggle using a common color for unknown player names."] = "Aktiviert das benutzen der allgemeinen Farbe f\195\188r Unbekannte Spieler.",
+-- ["Unknown Common Color"] = "Setze allgemeine Farbe",
+-- ["Set common color of unknown player names."] = "Allgemeine Farbe der Spielernamen \195\164ndern.",
+-- ["Enable TabComplete"] = "Benutze Tab Verfolst\195\164ndigen",
+-- ["Toggle tab completion of player names."] = "Aktiviere Tab Verfolst\195\164ndigen der Spielernamen.",
+-- ["Show Level"] = "Zeige Level",
+-- ["Toggle level showing."] = "Aktiviere das Anzeigen des Levels.",
+-- ["Show Group"] = "Zeige Gruppe",
+-- ["Toggle raid group showing."] = "Aktiviere das Anzeigen der Schlachtgruppe.",
+-- ["Keep Info"] = "Behalte Infos",
+-- ["Keep Lots Of Info"] = "Behalte viele Infos",
+-- ["Keep player information between session for all players except cross-server players"] = "Behalte Spieler Informationen zwischen Spielsessions für alle Spieler außer Serverübergreifende Namen.",
+-- ["Keep player information between session, but limit it to friends and guild members."] = "Behalte Spielernamen zwischen Spielesessions. Limitiere sie jedoch auf Freunde und Gildenmitglieder.",
+-- ["Player Color Mode"] = "Farben Modus",
+-- ["How to color player's name."] = "Wie Spielernamen einzuf\195\164rben sind.",
+-- ["Unknown Common Color From TasteTheNaimbow"] = "Allgemeine Farben von TasteTheNaimbow",
+-- ["Let TasteTheNaimbow set the common color for unknown player names."] = "Lass TasteTheNaimbow die Farbe f\195\188r Unbekannte Spieler festlegen.",
+-- ["Enable Alt-Invite"] = "Aktiviere Alt-Einladen",
+-- ["Toggle group invites by alt-clicking on player name."] = "Lade Spieler durch Alt-Klicken ihrer Namen im Chat.",
+-- ["Enable Invite Links"] = "Aktivieren Einladen Links",
+-- ["Toggle group invites by alt-clicking hyperlinked keywords like 'invite'."] = "Lade Spieler ein durch Alt-Klicken hypergelinkter Passw\195\182rter wie 'Einladen'.",
+-- ["Brackets Common Color"] = "Klammern Farbe",
+-- ["Sets common color of brackets to use around player names."] = "Stellt die Farbe der Klammern ein welche um die Spielernamen angezeigt werden.",
+-- ["Brackets Use Common Color"] = "Klammern benutzen allgemeine Farbe",
+-- ["Toggle using a common color for brackets around player names."] = "Bestimmt ob die allgemeine Farbe f\195\188r die Klammern um Spielernamen verwendet wird.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["PlayerNames"] = "Nom des joueurs",
+-- ["Player name formating options."] = "Options d'affichage des noms des joueurs",
+-- ["Brackets"] = "Parentese",
+-- ["Square"] = "Crochets",
+-- ["Angled"] = "truc",
+-- ["None"] = "Aucun",
+-- ["Class"] = "Classe",
+-- ["Random"] = "Al\195\169atoire",
+-- ["Sets style of brackets to use around player names."] = "S\195\169lectionne le style de crochets \195\160 utiliser pour encadrer les noms de joueurs",
+-- ["Unknown Use Common Color"] = "Utiliser une couleur par d\195\169faut",
+-- ["Toggle using a common color for unknown player names."] = "Active/d\195\169sactive l'utilisation d'une couleur par d\195\169faut quand la classe du joueur est inconnue",
+-- ["Unknown Common Color"] = "Couleur par d\195\169faut",
+-- ["Set common color of unknown player names."] = "Change la couleur par d\195\169faut",
+-- ["Enable TabComplete"] = "Compl\195\169tion avec Tab",
+-- ["Toggle tab completion of player names."] = "Compl\195\169ter le nom des joueurs avec Tab",
+-- ["Show Level"] = "Afficher le level",
+-- ["Toggle level showing."] = "Active/d\195\169sactive l'affichage du niveau",
+-- ["Show Group"] = "Afficher le groupe",
+-- ["Toggle raid group showing."] = "Affiche le groupe du joueur en raid",
+-- ["Keep Info"] = "Garder Info",
+-- ["Keep Lots Of Info"] = "Garder toute les Info",
+-- ["Keep player information between session for all players except cross-server players"] = "Garder les informations des joueurs entre les sessions pour tous les joueurs excepté les joueurs des autres serveurs",
+-- ["Keep player information between session, but limit it to friends and guild members."] = "Garde les informacions des joueurs entre sessions, seulement pour les amis et les guildeux",
+-- ["Player Color Mode"] = "Mode de Coloration",
+-- ["How to color player's name."] = "Choisit comment coloriser les noms des joueurs",
+-- ["Unknown Common Color From TasteTheNaimbow"] = "Couleur par d\195\169faut tir\195\169e de TasteTheNaimbow",
+-- ["Let TasteTheNaimbow set the common color for unknown player names."] = "Laisser TasteTheNaimbow choisir la couleur pour les joueurs inconnus",
+-- ["Enable Alt-Invite"] = "Invitation sur Alt-Clic",
+-- ["Toggle group invites by alt-clicking on player name."] = "Invite le joueur en faisant Alt-Clic sur son nom dans le chat",
+-- ["Enable Invite Links"] = "Mot invite cliquable",
+-- ["Toggle group invites by alt-clicking hyperlinked keywords like 'invite'."] = "Inviter le joueur en faisant Alt-Clic sur le mot 'invite'",
+-- ["Brackets Common Color"] = "Couleur des crochets",
+-- ["Sets common color of brackets to use around player names."] = "Choisit la couleur des crochets autour du nom des joueurs",
+-- ["Brackets Use Common Color"] = "Couleur par d\195\169faut pour les crochets",
+-- ["Toggle using a common color for brackets around player names."] = "Choisit une couleur par d\195\169faut pour les crochets autour du nom des joueurs",
+--} end)
+
+
+--local BC = PRAT_LIBRARY(PRATLIB.CLASSTRANSLATIONS)
+
+
+local module = Prat:NewModule(PRAT_MODULE, "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0")
+module.L = L
+
+
+module.Classes = {}
+module.Levels = {}
+module.Subgroups = {}
+
+local NOP = function(self) return end
+
+module.OnPlayerDataChanged = NOP
+
+
+--module.toggleOptions = {
+-- sep115_sep = 115,
+-- sep125_sep = 125,
+-- sep135_sep = 135,
+-- sep145_sep = 145,
+-- linkifycommon = 153,
+-- sep155_sep = 155,
+-- sep165_sep = 205,
+--}
+
+
+Prat:SetModuleDefaults(module.name, {
+ realm = {
+ classes = {},
+ levels = {}
+ },
+ profile = {
+ on = true,
+ brackets = "Square",
+ tabcomplete = true,
+ tabcompletelimit = 20,
+ level = true,
+ levelcolor = "DIFFICULTY",
+ subgroup = true,
+ showtargeticon = true,
+ keep = false,
+ keeplots = false,
+ colormode = "CLASS",
+ coloreverywhere = true,
+ usecommoncolor = true,
+ altinvite = false,
+ linkinvite = false,
+ bracketscommoncolor = true,
+ linkifycommon = true,
+ bracketscolor = {
+ r = 0.85,
+ g = 0.85,
+ b = 0.85,
+ a = 1.0
+ },
+ useTTN = true,
+ usewho = false,
+ color = {
+ r = 0.65,
+ g = 0.65,
+ b = 0.65,
+ a = 1.0
+ },
+ }
+})
+
+module.pluginopts = {}
+
+Prat:SetModuleOptions(module, {
+ name = L["PlayerNames"],
+ desc = L["Player name formating options."],
+ type = "group",
+ plugins = module.pluginopts,
+ args = {
+ brackets = {
+ name = L["Brackets"],
+ desc = L["Sets style of brackets to use around player names."],
+ type = "select",
+ order = 110,
+ values = {["Square"] = L["Square"], ["Angled"] = L["Angled"], ["None"] = L["None"]}
+ },
+ bracketscommoncolor = {
+ name = L["Brackets Use Common Color"],
+ desc = L["Toggle using a common color for brackets around player names."],
+ type = "toggle",
+ order = 111,
+ },
+ bracketscolor = {
+ name = L["Brackets Common Color"],
+ desc = L["Sets common color of brackets to use around player names."],
+ type = "color",
+ order = 112,
+ get = "GetColorValue",
+ set = "SetColorValue",
+ disabled = function(info) return not info.handler.db.profile.bracketscommoncolor end,
+ },
+ usecommoncolor = {
+ name = L["Unknown Use Common Color"],
+ desc = L["Toggle using a common color for unknown player names."],
+ type = "toggle",
+ order = 120,
+ },
+ color = {
+ name = L["Unknown Common Color"],
+ desc = L["Set common color of unknown player names."],
+ type = "color",
+ order = 121,
+ get = "GetColorValue",
+ set = "SetColorValue",
+ disabled = function(info) if not info.handler.db.profile.usecommoncolor then return true else return false end end,
+ },
+ useTTN = {
+ name = L["Unknown Common Color From TasteTheNaimbow"],
+ desc = L["Let TasteTheNaimbow set the common color for unknown player names."],
+ type = "toggle",
+ order = 122,
+ hidden = function(info) if TasteTheNaimbow_Loaded then return false else return true end end,
+ disabled = function(info) if not info.handler.db.profile.usecommoncolor then return true else return false end end,
+ },
+ colormode = {
+ name = L["Player Color Mode"],
+ desc = L["How to color player's name."],
+ type = "select",
+ order = 130,
+ values = {["RANDOM"] = L["Random"], ["CLASS"] = L["Class"], ["NONE"] = L["None"]}
+ },
+ levelcolor = {
+ name = L["Level Color Mode"],
+ desc = L["How to color other player's level."],
+ type = "select",
+ order = 131,
+ values = {["PLAYER"] = L["Use Player Color"], ["CHANNEL"] = L["Use Channel Color"], ["DIFFICULTY"] = L["Color by Level Difference"], ["NONE"] = L["No additional coloring"]}
+ },
+ level = {
+ name = L["Show Level"],
+ desc = L["Toggle level showing."],
+ type = "toggle",
+ order = 140,
+ },
+ subgroup = {
+ name = L["Show Group"],
+ desc = L["Toggle raid group showing."],
+ type = "toggle",
+ order = 141,
+ },
+ showtargeticon = {
+ name = L["Show Raid Target Icon"],
+ desc = L["Toggle showing the raid target icon which is currently on the player."],
+ type = "toggle",
+ order = 142,
+ },
+
+-- tabcomplete = {
+-- name = L["Enable TabComplete"],
+-- desc = L["Toggle tab completion of player names."],
+-- type = "toggle",
+-- order = 150,
+-- get = function() return module.db.profile.tabcomplete end,
+-- set = function(info, v) module.db.profile.tabcomplete = v; module:TabComplete(v) end
+-- },
+ altinvite = {
+ name = L["Enable Alt-Invite"],
+ desc = L["Toggle group invites by alt-clicking on player name."],
+ type = "toggle",
+ order = 151,
+ },
+ linkinvite = {
+ name = L["Enable Invite Links"],
+ desc = L["Toggle group invites by alt-clicking hyperlinked keywords like 'invite'."],
+ type = "toggle",
+ order = 152,
+ },
+ keep = {
+ name = L["Keep Info"],
+ desc = L["Keep player information between session, but limit it to friends and guild members."],
+ type = "toggle",
+ order = 200,
+ },
+ keeplots = {
+ name = L["Keep Lots Of Info"],
+ desc = L["Keep player information between session for all players except cross-server players"],
+ type = "toggle",
+ order = 201,
+ disabled = function(info) return not info.handler.db.profile.keep end,
+ },
+
+ usewho = {
+ name = L["Actively Query Player Info"],
+ desc = L["Query the server for all player names we do not know. Note: This happpens pretty slowly, and this data is not saved."],
+ type = "toggle",
+ order = 202,
+ hidden = function(info) local name, title, notes, enabled, loadable, reason, security = GetAddOnInfo("WhoLib") if reason == "MISSING" then return true end return false end
+ },
+ reset = {
+ name = L["Reset Settings"],
+ desc = L["Restore default settings, and delete stored character data."],
+ type = "execute",
+ order = 250,
+ func = "resetStoredData"
+ },
+ }
+ }
+)
+
+--function module:OnModuleInit()
+-- self:Debug("OnModuleInit")
+-- Prat:RegisterDefaults("PlayerNames", "realm", {
+-- classes = {},
+-- levels = {}
+-- })
+--end
+
+--local Glory = PRAT_LIBRARY:HasInstance(LIB.PVP, false) and PRAT_LIBRARY(LIB.PVP)
+
+function module:OnValueChanged(info, b)
+ local field = info[#info]
+ if field == "altinvite" or field == "linkinvite" then
+ self:SetAltInvite()
+ elseif field == "useWho" then
+ self:updateAll()
+ elseif field == "coloreverywhere" then
+ self:OnPlayerDataChanged(b and UnitName("player") or nil)
+ end
+end
+
+
+function module:OnModuleEnable()
+ Prat.RegisterChatEvent(self, "Prat_FrameMessage")
+ Prat.RegisterChatEvent(self, "Prat_Ready")
+
+ self:SetAltInvite()
+
+ Prat.RegisterMessageItem("PREPLAYERDELIM", "PLAYER", "before")
+ Prat.RegisterMessageItem("POSTPLAYERDELIM", "PLAYER", "after")
+
+ Prat.RegisterMessageItem("PLAYERTARGETICON", "PLAYER", "after")
+
+ Prat.EnableProcessingForEvent("CHAT_MSG_GUILD_ACHIEVEMENT")
+
+ Prat.RegisterMessageItem("PLAYERLEVEL", "PREPLAYERDELIM", "before")
+ Prat.RegisterMessageItem("PLAYERGROUP", "POSTPLAYERDELIM", "after")
+
+ self:RegisterEvent("FRIENDLIST_UPDATE", "updateFriends")
+ self:RegisterEvent("GUILD_ROSTER_UPDATE", "updateGuild")
+ self:RegisterEvent("RAID_ROSTER_UPDATE", "updateRaid")
+ self:RegisterEvent("PLAYER_LEVEL_UP", "updatePlayerLevel")
+ self:RegisterEvent("PARTY_MEMBERS_CHANGED", "updateParty")
+ self:RegisterEvent("PLAYER_TARGET_CHANGED", "updateTarget")
+ self:RegisterEvent("UPDATE_MOUSEOVER_UNIT", "updateMouseOver")
+ self:RegisterEvent("WHO_LIST_UPDATE", "updateWho")
+ self:RegisterEvent("CHAT_MSG_SYSTEM", "updateWho") -- for short /who command
+
+ self:RegisterEvent("PLAYER_LEAVING_WORLD", "EmptyDataCache")
+
+ self:RawHook('FriendsFrame_OnEvent', true)
+
+ self.NEEDS_INIT = true
+
+ self:TabComplete(module.db.profile.tabcomplete)
+
+ Prat.RegisterLinkType( { linkid="invplr", linkfunc=self.Invite_Link, handler=self }, self.name)
+ Prat.RegisterLinkType( { linkid="player", linkfunc=self.Player_Link, handler=self }, self.name)
+end
+
+
+--function module:AceLibrary_Register(major)
+-- if major == PRATLIB.PVP then
+-- Glory = PRAT_LIBRARY(LIB.PVP)
+-- end
+--end
+
+function module:OnModuleDisable()
+ self:TabComplete(false)
+ self:UnregisterAllEvents()
+ Prat.UnregisterAllChatEvents(self)
+end
+
+
+function module:Prat_Ready()
+ self:updateAll()
+end
+
+local cache = { module.Levels,
+ module.Classes,
+ module.Subgroups }
+local who
+
+function module:EmptyDataCache(force)
+ for k,v in pairs(cache) do
+ for x,y in pairs(v) do
+ v[x] = nil
+ end
+ end
+
+ self.NEEDS_INIT = true
+
+ self:OnPlayerDataChanged()
+end
+
+function module:FriendsFrame_OnEvent(event, ...)
+ if(not (event == 'WHO_LIST_UPDATE' and self.WhoSent))then
+ self.hooks.FriendsFrame_OnEvent(...)
+ else
+ self.WhoSent = nil
+ WhoFrameEditBox:SetText()
+ end
+end
+
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+function module:updateAll()
+ module:updatePlayer()
+ module:updateParty()
+
+ if MiniMapBattlefieldFrame.status == "active" then
+ module:updateBG()
+ else
+ module:updateRaid()
+ end
+
+ module:updateFriends()
+
+ if self.db.profile.usewho then
+ -- Load all the players in all channels
+ who = who or PRAT_LIBRARY:HasInstance(LIB.WHO) and PRAT_LIBRARY(LIB.WHO)
+
+ if who then
+ self[LIB.REGISTEREVENT](self, "CHAT_MSG_CHANNEL_LIST")
+ self.listingchan = 1
+ ListChannelByName("10")
+ ListChannelByName("9")
+ ListChannelByName("8")
+ ListChannelByName("7")
+ ListChannelByName("6")
+ ListChannelByName("5")
+ ListChannelByName("4")
+ ListChannelByName("3")
+ ListChannelByName("2")
+ ListChannelByName("1")
+ end
+ end
+
+ self.NEEDS_INIT = nil
+
+ module:updateGuild(module.db.profile.keeplots)
+
+ -- self:Debug("updateAll <--")
+end
+
+
+function module:CHAT_MSG_CHANNEL_LIST(arg, list, chan, channum, ...)
+ -- self:Debug(list, self.listingchan, chan, channum, ...)
+
+ local q = self:ReadChannelMembers(util:acquire(), strsplit(",", list))
+
+ for k,v in pairs(q) do
+ who:UserInfo(k:trim(), { timeout = -1 } )
+ end
+
+ util:reclaim(q)
+
+ if channum == self.listingchan then
+ self:ScheduleEvent("Prat_ChannelListDone", self.ChannelListDone, 1, self)
+ end
+end
+
+function module:ChannelListDone()
+ self:UnregisterEvent("CHAT_MSG_CHANNEL_LIST")
+end
+
+function module:ReadChannelMembers(t, ...)
+ for k in pairs(t) do
+ t[k] = nil
+ end
+ for i=1, select('#', ...) do
+ local name = select(i, ...)
+ if name and name:len() > 0 then
+ t[name] = true
+ end
+ end
+ return t
+end
+
+
+
+function module:updateGF()
+ module:updateGuild()
+ module:updateFriends()
+ if MiniMapBattlefieldFrame.status == "active" then
+ module:updateBG()
+ end
+ module:updateWho()
+end
+
+function module:updatePlayer()
+ local PlayerClass = select(2, UnitClass("player"))
+ local Name, Server = UnitName("player")
+ module:addName(Name, Server, PlayerClass, UnitLevel("player"), nil, "PLAYER")
+end
+
+function module:updatePlayerLevel()
+ local Level = arg1
+ local PlayerClass = select(2, UnitClass("player"))
+ local Name, Server = UnitName("player")
+ module:addName(Name, Server, PlayerClass, Level, nil, "PLAYER")
+end
+
+function module:updateFriends()
+ -- self:Debug("updateFriends -->")
+ local Name, Class, Level
+ for i = 1, GetNumFriends() do
+ Name, Level, Class = GetFriendInfo(i) -- name, level, class, area, connected, status
+ module:addName(Name, nil, Class, Level, nil, "FRIEND")
+ end
+ -- self:Debug("updateFriends <--")
+end
+
+function module:updateGuild(lots)
+ if IsInGuild() == 1 then
+ if GetNumGuildMembers(false) == 0 then
+ GuildRoster()
+ self.NEEDS_INIT = true
+ end
+
+ local Name, Class, Level, _
+ for i = 1, GetNumGuildMembers(false) do
+ Name, _, _, Level, _, _, _, _, _, _, Class = GetGuildRosterInfo(i)
+ self:addName(Name, nil, Class, Level, nil,"GUILD")
+ end
+ end
+end
+
+function module:updateRaid()
+ -- self:Debug("updateRaid -->")
+ local Name, Class, SubGroup, Level, Server
+ local _, zone, online, isDead, role, isML
+ for k,v in pairs(self.Subgroups) do
+ self.Subgroups[k] = nil
+ end
+ for i = 1, GetNumRaidMembers() do
+ _, rank, SubGroup, Level, _, Class, zone, online, isDead, role, isML = GetRaidRosterInfo(i)
+ Name, Server = UnitName("raid" .. i)
+ self:addName(Name, Server, Class, Level, SubGroup, "RAID")
+ end
+ -- self:Debug("updateRaid <--")
+end
+
+function module:updateParty()
+ local Class, Unit, Name, Server, _
+ for i = 1, GetNumPartyMembers() do
+ Unit = "party" .. i
+ _, Class = UnitClass(Unit)
+ Name, Server = UnitName(Unit)
+ self:addName(Name, Server, Class, UnitLevel(Unit), nil, "PARTY")
+ end
+end
+
+function module:updateTarget()
+ local Class, Name, Server
+ if not UnitIsPlayer("target") or not UnitIsFriend("player", "target") then
+ return
+ end
+ Class = select(2, UnitClass("target"))
+ Name, Server = UnitName("target")
+ self:addName(Name, Server, Class, UnitLevel("target"), nil, "TARGET")
+end
+
+function module:updateMouseOver()
+ local Class, Name, Server
+ if not UnitIsPlayer("mouseover") or not UnitIsFriend("player", "mouseover") then
+ return
+ end
+ Class = select(2, UnitClass("mouseover"))
+ Name, Server = UnitName("mouseover")
+ module:addName(Name, Server, Class, UnitLevel("mouseover"), nil, "MOUSE")
+end
+
+function module:updateWho()
+ if who then return end
+
+ local Name, Class, Level, Server, _
+ for i = 1, GetNumWhoResults() do
+ Name, _, Level, _, _, _, Class = GetWhoInfo(i)
+ module:addName(Name, Server, Class, Level, nil, "WHO")
+ end
+end
+
+function module:updateBG()
+ -- self:Debug("updateBG -->")
+ for i = 1, GetNumBattlefieldScores() do
+ local name, killingBlows, honorKills, deaths, honorGained, faction, rank, race, class, filename, damageDone, healingDone = GetBattlefieldScore(i);
+
+ if name then
+ local plr, svr = strsplit("-", name)
+ module:addName(plr, svr, class, nil, nil, "BATTLEFIELD")
+ module:addName(plr, nil, class, nil, nil, "BATTLEFIELD")
+ end
+ end
+ -- self:Debug("updateBG <--")
+ module:updateRaid()
+end
+
+
+function module:resetStoredData()
+ -- module:ResetDB()
+
+ module.db.realm.classes = {}
+ module.db.realm.levels = {}
+
+ self:EmptyDataCache(true)
+
+ Prat:Print(L["Prat_Playernames: Stored Player Data Cleared"])
+end
+
+--
+-- Coloring Functions
+--
+local CLR = Prat.CLR
+function CLR:Bracket(text) return self:Colorize(module:GetBracketCLR(), text) end
+function CLR:Common(text) return self:Colorize(module:GetCommonCLR(), text) end
+function CLR:Random(text, seed) return self:Colorize(module:GetRandomCLR(seed), text) end
+function CLR:Class(text, class) return self:Colorize(self:GetClassColor(class), text) end
+function CLR:Level(text, level, name, class)
+ local mode = module.db.profile.levelcolor
+ if mode and type(level) == "number" and level > 0 then
+ if mode == "DIFFICULTY" then
+ local diff = GetDifficultyColor(level)
+ return self:Colorize(CLR:GetHexColor(CLR:Desaturate(diff)), text)
+ elseif mode == "PLAYER" then
+ return self:Player(text, name, class)
+ end
+ end
+
+ return text
+end
+function CLR:Player(text, name, class)
+ return self:Colorize(module:GetPlayerCLR(name, class), text)
+end
+
+
+function module:addName(Name, Server, Class, Level, SubGroup, Source)
+ if Name then
+ local nosave
+
+-- Prat.Print("Add n="..Name.." c="..Class.." s="..Source)
+ -- Messy negations, but this says dont save data from
+ -- sources other than guild or friends unless you enable
+ -- the keeplots option
+ if Source ~= "GUILD" and Source ~= "FRIEND" and Source ~= "PLAYER" then
+ nosave = not module.db.profile.keeplots
+ end
+
+ if Server and Server:len() > 0 then
+ nosave = true
+ end
+
+
+ Name = Name..(Server and Server:len()>0 and ("-"..Server) or "")
+
+ local changed
+ if Level and Level > 0 then
+ module.Levels[Name:lower()] = Level
+ if ((not nosave) and module.db.profile.keep) then
+ module.db.realm.levels[Name:lower()] = Level
+ else -- Update it if it exists
+ if module.db.realm.levels[Name:lower()] then
+ module.db.realm.levels[Name:lower()] = Level
+ end
+ end
+
+ changed = true
+ end
+ if Class and Class ~= UNKNOWN then
+-- if module.Classes[Name] == nil then
+-- self:Debug("addName", Name, Class, Level, SubGroup, Source)
+-- end
+ module.Classes[Name:lower()] = Class
+ if ((not nosave) and module.db.profile.keep ) then module.db.realm.classes[Name:lower()] = Class end
+
+ changed = true
+ end
+ if SubGroup then
+ module.Subgroups[Name:lower()] = SubGroup
+
+ changed = true
+ end
+
+ if changed then
+ self:OnPlayerDataChanged(Name)
+ end
+ end
+end
+
+function module:getClass(player)
+ return self.Classes[player:lower()] or module.db.realm.classes[player:lower()] or module.db.realm.classes[player]
+end
+
+function module:getLevel(player)
+ return self.Levels[player:lower()] or module.db.realm.levels[player:lower()] or module.db.realm.levels[player]
+end
+
+function module:getSubgroup(player)
+ return self.Subgroups[player:lower()]
+end
+
+function module:GetData(player)
+ return self:getClass(player), self:getLevel(player), self:getSubgroup(player)
+end
+
+function module:GetClassColor(class)
+ return CLR:GetHexColor(Prat.GetClassGetColor(class))
+end
+
+function module:addInfo(Name, Server)
+ return CLR:Player(Name, Name, self:getClass(Name))
+end
+
+
+
+function module:FormatPlayer(message, Name)
+ local class, level, subgroup = self:GetData(Name)
+
+-- Prat.Print("c="..tostring(class).." l="..tostring(level).." n="..Name)
+
+ if who then
+ local user, cachetime = who:UserInfo(Name, { timeout = -1 })
+
+ if user then
+ level = user.Level
+ class = user.Class
+ end
+ end
+
+ -- Add level information if needed
+ if level and module.db.profile.level then
+ message.PLAYERLEVEL = CLR:Level(tostring(level), level, Name, class)
+ message.PREPLAYERDELIM = ":"
+ end
+
+ -- Add raid subgroup information if needed
+ if subgroup and module.db.profile.subgroup and (GetNumRaidMembers() > 0) then
+ message.POSTPLAYERDELIM = ":"
+ message.PLAYERGROUP = subgroup
+ end
+
+ -- Add raid target icon
+ if self.db.profile.showtargeticon then
+ local icon = UnitExists(Name) and GetRaidTargetIndex(Name)
+ if icon then
+ message.PLAYERTARGETICON = ICON_LIST[icon].."0|t"
+ end
+ end
+
+ -- Add the player name in the proper color
+ message.PLAYER = CLR:Player(message.PLAYER, Name, class)
+
+
+ -- Add the correct bracket style and color
+ local prof_brackets = module.db.profile.brackets
+ if prof_brackets == "Angled" then
+ message.pP = CLR:Bracket("<")..message.pP
+ message.Pp = message.Pp..CLR:Bracket(">")
+ elseif prof_brackets == "None" then
+ else
+ message.pP = CLR:Bracket("[")..message.pP
+ message.Pp = message.Pp..CLR:Bracket("]")
+ end
+end
+
+
+
+--ERR_FRIEND_ONLINE_SS = "|Hplayer:%s|h[%s]|h has come online."
+local _, _, FRIEND_ONLINE = string.match(ERR_FRIEND_ONLINE_SS, "|Hplayer:(.-)|h%[(.-)%]|h(.+)")
+
+--ERR_BG_PLAYER_JOINED_SS = "|Hplayer:%s|h[%s]|h has joined the battle";
+local _, _, BG_JOIN = string.match(ERR_BG_PLAYER_JOINED_SS, "|Hplayer:(.-)|h%[(.-)%]|h(.+)")
+
+--
+-- Prat Event Implementation
+--
+local EVENTS_FOR_RECHECK = {
+ ["CHAT_MSG_GUILD"] = module.updateGuild,
+ ["CHAT_MSG_OFFICER"] = module.updateGuild,
+ ["CHAT_MSG_PARTY"] = module.updateParty,
+ ["CHAT_MSG_RAID"] = module.updateRaid,
+ ["CHAT_MSG_RAID_LEADER"] = module.updateRaid,
+ ["CHAT_MSG_RAID_WARNING"] = module.updateRaid,
+ ["CHAT_MSG_BATTLEGROUND"] = module.updateBG,
+ ["CHAT_MSG_BATTLEGROUND_LEADER"] = module.updateBG,
+ ["CHAT_MSG_SYSTEM"] = module.updateGF,
+}
+
+
+local RAID_JOIN = string.gsub( ERR_RAID_MEMBER_ADDED_S, "%%s(.*)", "(.+)(%1)")
+local RAID_LEAVE = string.gsub( ERR_RAID_MEMBER_REMOVED_S, "%%s(.*)", "(.+)(%1)")
+
+function module:AddPlayerLinks(message, frame, event)
+ local name, rest
+
+ if event == "CHAT_MSG_SYSTEM" then
+ name, rest = string.match(message.MESSAGE, RAID_JOIN)
+ if name then self:MakePlayer(message, name) message.MESSAGE = rest return end
+
+ name, rest = string.match(message.MESSAGE, RAID_LEAVE)
+ if name then self:MakePlayer(message, name) message.MESSAGE = rest return end
+
+ end
+end
+
+function module:MakePlayer(message, name)
+ if type(name) == "string" then
+ local plr, svr = strsplit("-", name)
+ -- self:Debug("MakePlayer", name, plr, svr)
+
+ message.lL = "|Hplayer:"
+ message.PLAYERLINK = name
+ message.LL = "|h"
+ message.PLAYER = plr
+ message.Ll = "|h"
+
+ if svr and strlen(svr) > 0 then
+ message.sS = "-"
+ message.SERVER = svr
+ end
+ end
+end
+
+
+function module:Prat_FrameMessage(info, message, frame, event)
+ if self.NEEDS_INIT then
+ self:updateAll()
+ end
+
+
+ if who then
+ if event == "CHAT_MSG_CHANNEL_LIST" and self:IsEventRegistered("CHAT_MSG_CHANNEL_LIST") then
+ message.DONOTPROCESS = true
+ return
+ end
+
+ if Prat:GetEventID() and
+ Prat:GetEventID() == self.lastevent and
+ self.lasteventtype == event then
+
+ self.lastevent = Prat:GetEventID()
+ self.lasteventtype = event
+
+ if event == "CHAT_MSG_NOTICE" and message.MESSAGE == "YOU_JOINED" then
+ self.listingchan = message.CHANNUM
+ self[LIB.REGISTEREVENT](self, "CHAT_MSG_CHANNEL_LIST")
+ -- self:Debug(self.listingchan)
+ ListChannelByName(tostring(self.listingchan))
+ end
+ end
+ end
+
+ local Name = message.PLAYERLINK or ""
+ message.Pp = ""
+ message.pP = ""
+ if strlen(Name) == 0 then
+ if self.db.profile.linkifycommon then
+ self:AddPlayerLinks(message, frame, event)
+ end
+
+ Name = message.PLAYERLINK or ""
+
+ if strlen(Name) == 0 then
+ return
+ end
+ end
+
+
+
+ -- self:Debug("Prat_FrameMessage", message, frame, event, message.PLAYERLINK)
+
+ local class, level, subgroup = self:GetData(Name)
+
+ local prof_colormode = module.db.profile.colormode
+
+
+
+
+ if who then
+ local user, cachetime = who:UserInfo(Name, { timeout = -1 })
+
+ if user then
+ level = user.Level
+ class = user.Class
+ -- self:Debug("who", Name, level, class)
+ end
+ end
+
+ local fx = EVENTS_FOR_RECHECK[event]
+ if fx~=nil and (level==nil or level==0 or class==nil) then
+-- self:Debug(Name, level, class, subgroup, prof_colormode, event)
+
+ if event == "CHAT_MSG_SYSTEM" then
+ -- if message.MESSAGE == FRIEND_ONLINE or message.MESSAGE == BG_JOIN then
+ fx(self)
+ -- end
+ else
+ fx(self)
+ end
+
+ class, level, subgroup = self:GetData(Name)
+
+ -- You can have guild members who are not listed due to the 500 player limit cap
+ -- so for this we do a who on the guild when we see a blank link
+ if event == "CHAT_MSG_GUILD" and class == nil and not self.WhoSent and IsInGuild() == 1 then
+ WhoFrameEditBox:SetText(GetGuildInfo("player"))
+ SendWho(GetGuildInfo("player"))
+ self.WhoSent = true
+ end
+
+
+ -- self:Debug("Did a second check", Name, level, class, subgroup)
+ end
+
+ self:FormatPlayer(message, Name)
+end
+
+function module:GetPlayerCLR(name, class, mode)
+ if not mode then mode = module.db.profile.colormode end
+
+ if name and strlen(name) > 0 then
+ if class and mode == "CLASS" then
+ return self:GetClassColor(class)
+ elseif mode == "RANDOM" then
+ return self:GetRandomCLR(name)
+ else
+ return self:GetCommonCLR()
+ end
+ end
+end
+
+function module:GetBracketCLR()
+ if not self.db.profile.bracketscommoncolor then
+ return CLR.COLOR_NONE
+ else
+ local color = self.db.profile.bracketscolor
+ return CLR:GetHexColor(color)
+ end
+end
+function module:GetCommonCLR()
+ local color = CLR.COLOR_NONE
+ if module.db.profile.usecommoncolor then
+ if module.db.profile.useTTN and TasteTheNaimbow_Loaded then
+ color = TasteTheNaimbowExternalColor(name)
+ else
+ color = CLR:GetHexColor(module.db.profile.color)
+ end
+ end
+ return color
+end
+function module:GetRandomCLR(Name)
+ local hash = 17
+ for i=1,string.len(Name) do
+ hash = hash * 37 * string.byte(Name, i);
+ end
+
+ local r = math.floor(math.fmod(hash / 97, 255));
+ local g = math.floor(math.fmod(hash / 17, 255));
+ local b = math.floor(math.fmod(hash / 227, 255));
+
+ if ((r * 299 + g * 587 + b * 114) / 1000) < 105 then
+ r = math.abs(r - 255);
+ g = math.abs(g - 255);
+ b = math.abs(b - 255);
+ end
+
+ return string.format("%02x%02x%02x", r, g, b)
+end
+
+
+function module:TabComplete(enabled)
+ local AceTab = LibStub("AceTab-3.0")
+ if enabled then
+ if not AceTab:IsTabCompletionRegistered(L["tabcomplete_name"]) then
+ AceTab:RegisterTabCompletion(L["tabcomplete_name"], nil,
+ function(t, text, pos)
+ for name in pairs(self.Classes) do
+ table.insert(t, name)
+ end
+ end,
+ function(u, cands, ...)
+ local candcount = #cands
+ if candcount <= self.db.profile.tabcompletelimit then
+ local text
+ for _, cand in pairs(cands) do
+ cand = self:addInfo(cand)
+
+ text = text and (text .. ", " .. cand) or cand
+ end
+ return " "..text
+ else
+ return " "..L["Too many matches (%d possible)"]:format(candcount)
+ end
+ end,
+ nil,
+ function(name)
+ return name:sub(1,1):upper()..name:sub(2,-1)
+ end
+ )
+ end
+ else
+ if AceTab:IsTabCompletionRegistered(L["tabcomplete_name"]) then
+ AceTab:UnregisterTabCompletion(L["tabcomplete_name"])
+ end
+ end
+end
+
+function module:SetAltInvite()
+ local enabled = self.db.profile.linkinvite or self.db.profile.altinvite
+
+ if enabled then
+ for _,v in pairs(Prat.GetModulePatterns(self)) do
+ Prat:RegisterPattern(v, self.name)
+ end
+ else
+ Prat:UnregisterAllPatterns(self.name)
+ end
+end
+
+local EVENTS_FOR_INVITE = {
+ ["CHAT_MSG_GUILD"] = true,
+ ["CHAT_MSG_OFFICER"] = true,
+ ["CHAT_MSG_PARTY"] = true,
+ ["CHAT_MSG_RAID"] = true,
+ ["CHAT_MSG_RAID_LEADER"] = true,
+ ["CHAT_MSG_RAID_WARNING"] = true,
+ ["CHAT_MSG_SAY"] = true,
+ ["CHAT_MSG_YELL"] = true,
+ ["CHAT_MSG_WHISPER"] = true,
+ ["CHAT_MSG_CHANNEL"] = true,
+}
+
+local function Invite(text, ...)
+ if module.db.profile.linkinvite then
+ return module:ScanForLinks(text, Prat.SplitMessage.PLAYERLINK)
+ end
+end
+
+local INVALID_NAMES = {
+ ["meh"] = true,
+ ["now"] = true,
+ ["plz"] = true,
+ ["please"] = true,
+ ["when"] = true,
+ ["group"] = true,
+ ["raid"] = true,
+ ["grp"] = true,
+}
+
+local INVALID_NAME_REFERENCE = {
+ ["him"] = true,
+ ["her"] = true,
+ ["them"] = true,
+ ["someone"] = true,
+}
+
+local function InviteSomone(text, name)
+ if module.db.profile.linkinvite then
+ if name and name:len()>2 and not INVALID_NAMES[string.lower(name)] then
+ if INVALID_NAME_REFERENCE[string.lower(name)] then
+ return Prat:RegisterMatch(text)
+ else
+ return module:ScanForLinks(text, name)
+ end
+ end
+ end
+end
+
+
+Prat:SetModulePatterns(module, {
+ { pattern = "(send%s+invite%s+to%s+(%w+))", matchfunc=InviteSomone },
+ { pattern = "(invite%s+(%w+))", matchfunc=InviteSomone },
+ { pattern = "(invites?%??)", matchfunc=Invite },
+ { pattern = "(초대)", matchfunc=Invite },
+ { pattern = "(組%??)$", matchfunc=Invite },
+ { pattern = "(組我%??)$", matchfunc=Invite },
+})
+
+function module:Invite_Link(link, text, button, ...)
+ if self.db.profile.linkinvite then
+ local name = strsub(link, 8);
+ if ( name and (strlen(name) > 0) ) then
+ local begin = string.find(name, "%s[^%s]+$");
+ if ( begin ) then
+ name = strsub(name, begin+1);
+ end
+ if ( button == "LeftButton" ) then
+ InviteUnit(name);
+ end
+ end
+
+ end
+
+ return false
+end
+
+function module:Player_Link(link, text, button, ...)
+ if self.db.profile.altinvite then
+ local name = strsub(link, 8);
+ if ( name and (strlen(name) > 0) ) then
+ -- self:Debug(name, link, text, button, this:GetName())
+ local begin, nend = string.find(name, "%s*[^%s:]+");
+ if ( begin ) then
+ name = strsub(name, begin, nend);
+ end
+ if ( IsAltKeyDown() ) then
+ InviteUnit(name);
+ ChatEdit_OnEscapePressed(this.editBox)
+ return false;
+ end
+ end
+ end
+
+ return true
+end
+
+function module:ScanForLinks(text, name)
+ if text == nil then
+ return ""
+ end
+
+ local enabled = module.db.profile.linkinvite
+
+ if enabled and CanGroupInvite() then
+
+ if EVENTS_FOR_INVITE[event] then
+ return module:InviteLink(text, name)
+ end
+ end
+
+ return text
+end
+
+
+
+function module:InviteLink(link, name)
+ local returnedLink = ""
+
+ returnedLink = "|cffffff00"
+
+ returnedLink = returnedLink .. "|Hinvplr:" .. name .. "|h"
+
+ returnedLink = returnedLink .. "[" .. link .. "]"
+
+ returnedLink = returnedLink .. "|h|r"
+
+ return Prat:RegisterMatch(returnedLink)
+end
+
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/PopupMessage.lua b/modules/PopupMessage.lua
new file mode 100644
index 00000000..f4252388
--- /dev/null
+++ b/modules/PopupMessage.lua
@@ -0,0 +1,474 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: PratPopupMessage
+Revision: $Revision: 80460 $
+Author(s): Sylvanaar
+Inspired by: CleanChat
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#PopupMessage
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that displays chat with your name in a pop up window
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("PopupMessage")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["PopupMessage"] = true,
+ ["Shows messages with your name in a popup."] = true,
+ ["Set Separately"] = true,
+ ["Toggle setting options separately for each chat window."] = true,
+ ["show_name"] = "Show Popups",
+ ["show_desc"] = "Show Popups for each window.",
+ ["Show Popups"] = true,
+ ["Show Popups for each window."] = true,
+ ["show_perframename"] = "Show ChatFrame%d Popups",
+ ["show_perframedesc"] = "Toggles showing popups on and off.",
+ ["showall_name"] = "Show All Popups",
+ ["showall_desc"] = "Show Popups for all chat windows.",
+ ["Show All Popups"] = true,
+ ["Show Popups for all chat windows."] = true,
+ ["Add Nickname"] = true,
+ ["Adds an alternate name to show in popups."] = true,
+ ["Remove Nickname"] = true,
+ ["Removes an alternate name to show in popups."] = true,
+ ["Clear Nickname"] = true,
+ ["Clears alternate name to show in popups."] = true,
+ ["framealpha_name"] = "Popup Frame Alpha",
+ ["framealpha_desc"] = "Set the alpha value of the popup frame when fully faded in.",
+ ["Popup"] = true,
+ ["Shows messages in a popup window."] = true,
+-- ["Use SCT Message"] = true,
+-- ["Show the text as an SCT message instead of in its own frame"] = true,
+})
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["PopupMessage"] = "Alerte pseudo",
+-- ["Shows messages with your name in a popup."] = "Affiche dans une fenêtre les messages qui contiennent votre nom.",
+-- ["Set Separately"] = "Régler séparément",
+-- ["Toggle setting options separately for each chat window."] = "Règle les options séparément pour chaque fenêtre de chat.",
+-- ["Show Popups"] = "Fenêtre flottante",
+-- ["Show Popups for each window."] = "Afficher les fenêtres flottantes pour chaque fenêtre de discussion.",
+-- ["Show All Popups"] = "Afficher toutes les fenêtres flottantes",
+-- ["Show Popups for all chat windows."] = "Afficher les fenêtres flottantes pour toutes les fenêtres de chat.",
+-- ["Adds an alternate name to show in popups."] = "Ajoute un nom secondaire pour lequel afficher les alertes.",
+-- ["Add Nickname"] = "Ajouter un pseudo",
+-- ["Remove Nickname"] = "Supprimer un pseudo",
+-- ["Clear Nickname"] = "Vider les pseudos",
+---- ["Use SCT Message"] = "Utiliser les messages de SCT",
+---- ["Show the text as an SCT message instead of in its own frame"] = "Affiche le texte comme un message SCT",
+-- ["show_name"] = "Afficher",
+-- ["show_desc"] = "Afficher l'heure pour chaque fenêtre.",
+-- ["show_perframename"] = "Fenêtre %s ",
+-- ["show_perframedesc"] = "Affiche/masque les fenêtres flottantes pour la fenêtre %s .",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["PopupMessage"] = "메세지 팝업",
+-- ["Shows messages with your name in a popup."] = "당신의 이름을 포함한 메세지를 팝업으로 표시합니다.",
+-- ["Set Separately"] = "구분 설정",
+-- ["Toggle setting options separately for each chat window."] = "각각의 대화창에 구분 설정을 사용합니다.",
+-- ["show_name"] = "팝업 표시",
+-- ["show_desc"] = "각 대화창에 대한 팝업을 표시합니다.",
+-- ["Show Popups"] = "팝업 표시",
+-- ["Show Popups for each window."] = "각 대화창에 대한 팝업을 표시합니다.",
+-- ["show_perframename"] = "대화창%d 팝업 표시",
+-- ["show_perframedesc"] = "팝업 표시를 켜거나 끕니다.Toggles showing popups on and off.",
+-- ["showall_name"] = "모든 팝업 표시",
+-- ["showall_desc"] = "모든 대화창에 대한 팝업을 표시합니다.",
+-- ["Show All Popups"] = "모든 팝업 표시",
+-- ["Show Popups for all chat windows."] = "모든 대화창에 대한 팝업을 표시합니다.",
+-- ["Add Nickname"] = "별명 추가",
+-- ["Adds an alternate name to show in popups."] = "팝업에 표시할 별명을 추가합니다.",
+-- ["Remove Nickname"] = "별명 삭제",
+-- ["Removes an alternate name to show in popups."] = "팝업에 표시할 별명을 제거합니다.",
+-- ["Clear Nickname"] = "별명 초기화",
+-- ["Clears alternate name to show in popups."] = "팝업에 표시할 별명을 초기화합니다.",
+-- ["framealpha_name"] = "팝업창 투명도",
+-- ["framealpha_desc"] = "팝업창의 투명도를 설정합니다.",
+-- ["Popup"] = "팝업",
+-- ["Shows messages in a popup window."] = "팝업창에 메세지를 표시합니다.",
+---- ["Use SCT Message"] = "SCT 메세지 사용",
+---- ["Show the text as an SCT message instead of in its own frame"] = "SCT 메세지로 팝업을 표시합니다.",
+--} end)
+--
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 80460 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["PopupMessage"] = "弹出信息",
+-- ["Shows messages with your name in a popup."] = "弹出显示包含本人姓名的信息.",
+-- ["Set Separately"] = "独立设置",
+-- ["Toggle setting options separately for each chat window."] = "独立设置每个窗口的选项",
+-- ["show_name"] = "显示",
+-- ["show_desc"] = "切换每个窗口显示时间标签.",
+-- ["Show Popups"] = "弹出显示",
+-- ["Show Popups for each window."] = "弹出显示每个窗口信息.",
+-- ["show_perframename"] = "窗口 %s 弹出",
+-- ["show_perframedesc"] = "切换聊天窗口 %s 弹出显示.",
+-- ["showall_name"] = "全部弹出",
+-- ["showall_desc"] = "全部聊天窗口均弹出显示.",
+-- ["Show All Popups"] = "全部弹出",
+-- ["Show Popups for all chat windows."] = "全部聊天窗口均弹出显示",
+-- ["Add Nickname"] = "添加昵称",
+-- ["Remove Nickname"] = "移除昵称",
+-- ["Clear Nickname"] = "清除昵称",
+-- ["framealpha_name"] = "弹出窗口透明度",
+-- ["framealpha_desc"] = "设置弹出信息窗口的透明度",
+---- ["Use SCT Message"] = "使用 SCT 信息",
+---- ["Show the text as an SCT message instead of in its own frame"] = "使用 SCT 模式显示弹出信息替代自身框架",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["PopupMessage"] = "彈出訊息",
+-- ["Shows messages with your name in a popup."] = "將有你的名字的訊息顯示在彈出訊息中。",
+-- ["Set Separately"] = "個別設定",
+-- ["Toggle setting options separately for each chat window."] = "分別設定各聊天視窗。",
+-- ["show_name"] = "顯示彈出訊息",
+-- ["show_desc"] = "切換是否為各個聊天視窗顯示彈出訊息。",
+-- ["Show Popups"] = "顯示彈出訊息",
+-- ["Show Popups for each window."] = "切換是否為各個聊天視窗顯示彈出訊息。",
+-- ["show_perframename"] = "顯示聊天視窗%d彈出訊息",
+-- ["show_perframedesc"] = "切換是否顯示彈出訊息。",
+-- ["showall_name"] = "顯示全部彈出訊息",
+-- ["showall_desc"] = "為全部聊天視窗顯示彈出訊息。",
+-- ["Show All Popups"] = "顯示全部彈出訊息",
+-- ["Show Popups for all chat windows."] = "為全部聊天視窗顯示彈出訊息。",
+-- ["Add Nickname"] = "增加暱稱",
+-- ["Adds an alternate name to show in popups."] = "增加顯示在彈出訊息中的暱稱。",
+-- ["Remove Nickname"] = "移除暱稱",
+-- ["Removes an alternate name to show in popups."] = "移除顯示在彈出訊息中的暱稱。",
+-- ["Clear Nickname"] = "清除暱稱",
+-- ["Clears alternate name to show in popups."] = "清除全部顯示在彈出訊息中的暱稱。",
+-- ["framealpha_name"] = "彈出視窗透明度",
+-- ["framealpha_desc"] = "設定彈出視窗透明度。",
+-- ["Popup"] = "彈出視窗",
+-- ["Shows messages in a popup window."] = "在彈出視窗中顯示訊息。",
+---- ["Use SCT Message"] = "使用 SCT 訊息",
+---- ["Show the text as an SCT message instead of in its own frame"] = "將訊息以 SCT 訊息顯示而不顯示在自己的視窗中。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["PopupMessage"] = "Mensaje en Ventana Emergente",
+-- ["Shows messages with your name in a popup."] = "Muestras los mensajes con tu nombre en una ventana emergente",
+-- ["Set Separately"] = "Por Separado",
+-- ["Toggle setting options separately for each chat window."] = "Establece las opciones para cada ventana de chat por separado",
+-- ["show_name"] = "Mostrar",
+-- ["show_desc"] = "Muestra los ajustes de sello de tiempo para cada ventana.",
+-- ["Show Popups"] = "Mostrar ventanas emergentes",
+-- ["Show Popups for each window."] = "Muestra ventanas emergentes para cada ventana",
+-- ["show_perframename"] = "Mostrar Ventana Emergente en %s ",
+-- ["show_perframedesc"] = "Muestra las ventanas emergentes para la ventana de %s ",
+-- ["showall_name"] = "Mostrar Todas las Ventanas Emergentes",
+-- ["showall_desc"] = "Muestra las ventanas emergentes para todas las ventanas de chat",
+-- ["Show All Popups"] = "Mostrar Todas las Ventanas Emergentes",
+-- ["Show Popups for all chat windows."] = "Muestra las ventanas emergentes para todas las ventanas de chat",
+-- ["Add Nickname"] = "A\195\177adir Pseud\195\179nimmo",
+-- ["Adds an alternate name to show in popups."] = "A\195\177ade un nombre alternativo para mostrar en las ventanas emergentes",
+-- ["Remove Nickname"] = "Eliminar Pseud\195\179nimo",
+-- ["Removes an alternate name to show in popups."] = "Elimina un nombre alternativo para mostrar en las ventanas emergentes",
+-- ["Clear Nickname"] = "Borrar Pseud\195\179nimo",
+-- ["Clears alternate name to show in popups."] = "Limpia nombre alternativos a mostrar en ventanas emergentes.",
+-- ["framealpha_name"] = "Transparencia de Ventana Emergente",
+-- ["framealpha_desc"] = "Establece la transparencia de la ventana emergente cuando es mostrada",
+-- ["Popup"] = "Ventana Emergente",
+-- ["Shows messages in a popup window."] = "Muestra mensajes en una ventana emergente.",
+---- ["Use SCT Message"] = "Usar Mensaje SCT",
+---- ["Show the text as an SCT message instead of in its own frame"] = "Muestra el texto como un mensaje de SCT en vez de en su propio marco",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["PopupMessage"] = "Popup Nachrichten",
+-- ["Shows messages with your name in a popup."] = "Zeige Nachrichten mit deinem Namen in einem Popup.",
+-- ["Set Separately"] = "Seperat einstellen",
+-- ["Toggle setting options separately for each chat window."] = "Aktiviert das seperate Einstellen der Optionen für jedes Chatfenster.",
+-- ["show_name"] = "Zeige Namen",
+-- ["show_desc"] = "Zeige Namen f\195\188r jedes Fenster.",
+-- ["Show Popups"] = "Zeige Popups",
+-- ["Show Popups for each window."] = "Zeige Popups f\195\188r jedes Fenster.",
+-- ["show_perframename"] = "%s Popups Anzeigen",
+-- ["show_perframedesc"] = "Schaltet Popups an und aus f\195\188r %s .",
+-- ["showall_name"] = "Zeige alle Popups",
+-- ["showall_desc"] = "Zeige Popups f\195\188r alle Chatfenster.",
+-- ["Show All Popups"] = "Zeige alle Popups",
+-- ["Show Popups for all chat windows."] = "Zeige Popups f\195\188r alle Chatfenster.",
+-- ["Add Nickname"] = "Nicknamen hinzuf\195\188gen",
+-- ["Adds an alternate name to show in popups."] = "F\195\188gt einen alternativen Namen hinzu der in den Popup's anzeigt wird.",
+-- ["Remove Nickname"] = "Entferne Nicknamen",
+-- ["Removes an alternate name to show in popups."] = "Entfernt einen der alternativen Nicknamen die in den Popup's angezeigt werden.",
+-- ["Clear Nickname"] = "L\195\182sche Nicknamen",
+-- ["Clears alternate name to show in popups."] = "L\195\182sche alternativen Namen der in den Popup's angezeigt wird.",
+-- ["framealpha_name"] = "Popup Fenster Transparenz",
+-- ["framealpha_desc"] = "Justiere die Transparenz des Popup Fensters wenn es voll eingeblendet ist.",
+-- ["Popup"] = "Popup",
+-- ["Shows messages in a popup window."] = "Zeigt Nachrichten in einem Popup Fenster.",
+---- ["Use SCT Message"] = "Benutze SCT Nachrichtenfenster",
+---- ["Show the text as an SCT message instead of in its own frame"] = "Zeige die Texte als eine SCT Nachricht anstatt im eigenen Fenster.",
+--} end)
+
+local EVENTS_EMOTES = {
+ ["CHAT_MSG_BG_SYSTEM_ALLIANCE"] = true,
+ ["CHAT_MSG_BG_SYSTEM_HORDE"] = true,
+ ["CHAT_MSG_BG_SYSTEM_NEUTRAL"] = true,
+ ["CHAT_MSG_EMOTE"] = true,
+ ["CHAT_MSG_TEXT_EMOTE"] = true,
+ ["CHAT_MSG_MONSTER_EMOTE"] = true,
+ ["CHAT_MSG_MONSTER_SAY"] = true,
+ ["CHAT_MSG_MONSTER_WHISPER"] = true,
+ ["CHAT_MSG_MONSTER_YELL"] = true,
+ ["CHAT_MSG_RAID_BOSS_EMOTE"] = true
+};
+
+local EVENTS_IGNORE = {
+ ["CHAT_MSG_CHANNEL_NOTICE_USER"] = true,
+ ["CHAT_MSG_SYSTEM"] = true,
+}
+
+-- create prat module
+local module = Prat:NewModule(PRAT_MODULE, "LibSink-2.0")
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ separate = true,
+ show = {["*"]=false},
+ showall = false,
+ secure = true,
+ framealpha = 1.0,
+ nickname = {},
+ sinkoptions = { ["sink20OutputSink"] = "Popup" },
+ }
+} )
+--module.toggleOptions = {
+-- sep115_sep = 105,
+-- show = {},
+-- sep125_sep = 125,
+-- sep135_sep = 135,
+-- sep155_sep = 165,
+-- framealpha = {type = "range", min = 0.0, max = 1.0, step = 0.05, order = 170},
+--}
+
+module.pluginOptions = { sink = {} }
+
+Prat:SetModuleOptions(module, {
+ name = L["PopupMessage"],
+ desc = L["Shows messages with your name in a popup."],
+ type = "group",
+ plugins = module.pluginOptions,
+ args = {
+ show = {
+ name = L["Show Popups"],
+ desc = L["Show Popups for each window."],
+ type = "multiselect",
+ order = 10,
+ values = Prat.HookedFrameList,
+ get = "GetSubValue",
+ set = "SetSubValue"
+ },
+ addnick = {
+ name = L["Add Nickname"],
+ desc = L["Adds an alternate name to show in popups."],
+ type = "input",
+ order = 140,
+ usage = "",
+ get = false,
+ set = function(info, name) info.handler:AddNickname(name) end
+ },
+ removenick = {
+ name = L["Remove Nickname"],
+ desc = L["Removes an alternate name to show in popups."],
+ type = "select",
+ order = 150,
+ get = function(info) return "" end,
+ values = function(info) return info.handler.db.profile.nickname end,
+ disabled = function(info) return #info.handler.db.profile.nickname == 0 end,
+ set = function(info, value) info.handler:RemoveNickname(value) end
+ },
+ clearnick = {
+ name = L["Clear Nickname"],
+ desc = L["Clears alternate name to show in popups."],
+ type = "execute",
+ order = 160,
+ disabled = function(info) return (#info.handler.db.profile.nickname == 0) end,
+ func = "ClearNickname",
+ },
+ },
+})
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+Prat:SetModuleInit(module,
+ function(self)
+ self:RegisterSink(
+ L["Popup"],
+ L["PopupMessage"],
+ L["Shows messages in a popup window."],
+ "Popup"
+ )
+ self:SetSinkStorage(self.db.profile.sinkoptions)
+ self.pluginOptions.sink["output"] = self:GetSinkAce3OptionsDataTable()
+ self.pluginOptions.sink["output"].inline = true
+ self.pluginOptions = nil
+ end
+)
+
+-- things to do when the module is enabled
+function module:OnModuleEnable(first)
+ Prat.RegisterChatEvent(self, Prat.Events.POST_ADDMESSAGE)
+ self.playerName = UnitName("player"):lower();
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+-- /dump module.moduleOptions.args.output.get():find("Default")
+-- /script module.moduleOptions.args.output.set("PopupMessage")
+-- /dump module.db.profile
+-- /script module.db.profile.sink10OutputSink = nil
+function module:Popup(source, text, r,g,b, ...)
+ if UIFrameIsFlashing(Prat_PopupFrame) then
+ UIFrameFlashRemoveFrame(Prat_PopupFrame)
+ end
+
+ Prat_PopupFrame.fadeOut = 5;
+ Prat_PopupFrame:SetAlpha(module.db.profile.framealpha or 1.0);
+ Prat_PopupFrameText:SetTextColor(r,g,b)
+ Prat_PopupFrameText:SetText(text);
+
+ local font, _, style = ChatFrame1:GetFont()
+ local _, fontsize = GameFontNormal:GetFont()
+ Prat_PopupFrameText:SetFont( font, fontsize, style )
+ Prat_PopupFrameText:SetNonSpaceWrap(false)
+ Prat_PopupFrame:SetWidth(math.min(math.max(64, Prat_PopupFrameText:GetStringWidth()+20), 520))
+ Prat_PopupFrame:SetHeight(64)
+ Prat_PopupFrame:SetBackdropBorderColor(r,g,b)
+
+ Prat_PopupFrameText:ClearAllPoints()
+ Prat_PopupFrameText:SetPoint("TOPLEFT", Prat_PopupFrame, "TOPLEFT", 10, 10)
+ Prat_PopupFrameText:SetPoint("BOTTOMRIGHT", Prat_PopupFrame, "BOTTOMRIGHT", -10, -10)
+ Prat_PopupFrameText:Show()
+
+ local inTime, outTime, holdTime = 1, Prat_PopupFrame.fadeOut, 4
+
+ local fadeInfo = {}
+ fadeInfo.timeToFade = inTime
+ fadeInfo.mode = "IN"
+ fadeInfo.fadeHoldTime = holdTime
+ fadeInfo.startAlpha = 0
+ fadeInfo.endAlpha = module.db.profile.framealpha or 1.0
+
+ fadeInfo.finishedFunc = UIFrameFadeOut
+ fadeInfo.finishedArg1 = Prat_PopupFrame
+ fadeInfo.finishedArg2 = outTime
+ fadeInfo.finishedArg3 = module.db.profile.framealpha or 1.0
+ fadeInfo.finishedArg4 = 0
+ UIFrameFade(Prat_PopupFrame, fadeInfo)
+end
+
+local DEBUG = true
+function module:Prat_PostAddMessage(info, message, frame, event, text, r, g, b, id)
+ if Prat.EVENT_ID and
+ Prat.EVENT_ID == self.lastevent and
+ self.lasteventtype == event then
+ return
+ end
+
+ if not (EVENTS_EMOTES[event] or EVENTS_IGNORE[event]) then
+ if self.db.profile.showall or self.db.profile.show[frame:GetName()] then
+ if message.PLAYERLINK ~= self.playerName or DEBUG then
+ self:CheckText(message.MESSAGE, message.OUTPUT, event, r, g, b)
+ end
+ end
+ end
+end
+
+function module:AddNickname(name)
+ for _, v in ipairs(self.db.profile.nickname) do
+ if v:lower() == name:lower() then
+ return
+ end
+ end
+ tinsert(self.db.profile.nickname, name)
+end
+
+function module:RemoveNickname(idx)
+ tremove(self.db.profile.nickname, idx)
+end
+
+function module:ClearNickname()
+ while #self.db.profile.nickname > 0 do
+ tremove(self.db.profile.nickname)
+ end
+end
+
+local tmp_color = {}
+local function safestr(s) return s or "" end
+function module:CheckText(text, display_text, event, r, g, b)
+ local textL = safestr(text):lower()
+ local playerL = self.playerName
+ local show = false
+
+ if textL:find(playerL) then
+ show = true;
+ else
+ for i, v in ipairs(self.db.profile.nickname) do
+ local nicknameL = v:lower()
+
+ if (nicknameL ~= "" and not show) then
+ if textL:find(nicknameL) then
+ show = true
+ end
+ end
+ end
+ end
+
+ if show then
+ self.lasteventtype = event
+ self.lastevent = Prat.EVENT_ID
+ self:Pour(display_text or text, r,g,b)
+ Prat:PlaySound("popup");
+ end
+end
+
+
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Scroll.lua b/modules/Scroll.lua
new file mode 100644
index 00000000..ad701332
--- /dev/null
+++ b/modules/Scroll.lua
@@ -0,0 +1,391 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: module
+Revision: $Revision: 82149 $
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+Inspired by: idChat2_PlayerNames by Industrial
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Scroll
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that enables mousewheel scrolling and TheDownLow for chat windows (default=on).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("Scroll")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Scroll"] = true,
+ ["Chat window scrolling options."] = true,
+ ["mousewheel_name"] = "Enable MouseWheel",
+ ["mousewheel_desc"] = "Toggle mousewheel support for each chat window.",
+ ["Set MouseWheel Speed"] = true,
+ ["Set number of lines mousewheel will scroll."] = true,
+ ["Set Ctrl+MouseWheel Speed"] = true,
+ ["Set number of lines mousewheel will scroll when ctrl is pressed."] = true,
+ ["lowdown_name"] = "Enable TheLowDown",
+ ["lowdown_desc"] = "Toggle auto jumping to the bottom for each chat window.",
+ ["Set TheLowDown Delay"] = true,
+ ["Set time to wait before jumping to the bottom of chat windows."] = true,
+ ["Text scroll direction"] = true,
+ ["Control whether text is added to the frame at the top or the bottom."] = true,
+ ["Top"] = "Top to bottom",
+ ["Bottom"] = "Bottom to top",
+})
+
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 82149 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Scroll"] = "滚动",
+-- ["Chat window scrolling options."] = "聊天窗口滚动选项.",
+-- ["mousewheel_name"] = "开启鼠标滚轮",
+-- ["mousewheel_desc"] = "切换每个聊天窗口鼠标滚轮支持.",
+-- ["mousewheel_perframename"] = "%s 鼠标滚轮",
+-- ["mousewheel_perframedesc"] = "切换鼠标滚轮支持",
+-- ["Set MouseWheel Speed"] = "滚轮速度",
+-- ["Set number of lines mousewheel will scroll."] = "设置每次鼠标滚动行数.",
+-- ["Set Ctrl+MouseWheel Speed"] = " 速度",
+-- ["Set number of lines mousewheel will scroll when ctrl is pressed."] = "设置按下 Ctrl 键时每次鼠标滚动行数.",
+-- ["lowdown_name"] = "开启跳至底部",
+-- ["lowdown_desc"] = "切换每个窗口跳至底部功能.",
+-- ["lowdown_perframename"] = "%s 跳底",
+-- ["lowdown_perframedesc"] = "切换跳至底部功能",
+-- ["Set TheLowDown Delay"] = "跳至底部延迟",
+-- ["Set time to wait before jumping to the bottom of chat windows."] = "设置向上滚动后, 聊天窗口自动跳至底部的延迟.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Scroll"] = "스크롤",
+-- ["Chat window scrolling options."] = "대화창 스크롤에 관한 설정입니다.",
+-- ["mousewheel_name"] = "마우스휠 사용",
+-- ["mousewheel_desc"] = "각각의 대화창에 대한 마우스휠 기능을 사용합니다.",
+-- ["mousewheel_perframename"] = "대화창%d 마우스휠 사용",
+-- ["mousewheel_perframedesc"] = "마우스휠 기능을 사용합니다.",
+-- ["Set MouseWheel Speed"] = "마우스휠 속도 설정",
+-- ["Set number of lines mousewheel will scroll."] = "스크롤 할 라인 수를 설정합니다.",
+-- ["Set Ctrl+MouseWheel Speed"] = "CTRL+마우스휠 속도 설정",
+-- ["Set number of lines mousewheel will scroll when ctrl is pressed."] = "CTRL키를 눌렀을 때 스크롤 할 라인 수를 설정합니다.",
+-- ["lowdown_name"] = "자동하단 사용",
+-- ["lowdown_desc"] = "각각의 대화창에 대한 자동하단 기능을 사용합니다.",
+-- ["lowdown_perframename"] = "대화창%d 자동하단 사용",
+-- ["lowdown_perframedesc"] = "자동하단 기능을 사용합니다.",
+-- ["Set TheLowDown Delay"] = "자동하단 지연시간 설정",
+-- ["Set time to wait before jumping to the bottom of chat windows."] = "대화창의 하단으로 이동할 시간을 설정합니다.",
+-- ["Text scroll direction"] = "텍스트 스크롤 방향",
+-- ["Control whether text is added to the frame at the top or the bottom."] = "텍스트를 창의 상단 혹은 하단에 추가할지 여부를 조절합니다.",
+-- ["Top"] = "위에서 아래로",
+-- ["Bottom"] = "아래에서 위로",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Scroll"] = "捲動",
+-- ["Chat window scrolling options."] = "聊天視窗捲動選項。",
+-- ["mousewheel_name"] = "啟用滑鼠滾輪",
+-- ["mousewheel_desc"] = "切換是否在各個聊天視窗啟用滑鼠滾輪。",
+-- ["mousewheel_perframename"] = "聊天視窗%d啟用滑鼠滾輪",
+-- ["mousewheel_perframedesc"] = "切換是否啟用滑鼠滾輪。",
+-- ["Set MouseWheel Speed"] = "設定滾輪速度",
+-- ["Set number of lines mousewheel will scroll."] = "設定滾輪將會捲動多少行。",
+-- ["Set Ctrl+MouseWheel Speed"] = "設定Ctrl-滑鼠滾輪速度",
+-- ["Set number of lines mousewheel will scroll when ctrl is pressed."] = "設定Ctrl-滾輪將會捲動多少行。",
+-- ["lowdown_name"] = "啟用自動跳至最底端",
+-- ["lowdown_desc"] = "切換是否在各個聊天視窗啟用自動跳至最底端。",
+-- ["lowdown_perframename"] = "聊天視窗%d啟用自動跳至最底端",
+-- ["lowdown_perframedesc"] = "切換是否啟用自動跳至最底端。",
+-- ["Set TheLowDown Delay"] = "設定自動跳至最底端延遲時間",
+-- ["Set time to wait before jumping to the bottom of chat windows."] = "設定自動跳至最底端的延遲時間。",
+-- ["Text scroll direction"] = "文字加入方向",
+-- ["Control whether text is added to the frame at the top or the bottom."] = "控制文字加入聊天視窗的頂部/底部。",
+-- ["Top"] = "頂部到底部",
+-- ["Bottom"] = "底部到頂部",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Scroll"] = "Desplazamiento Vertical",
+-- ["Chat window scrolling options."] = "Opciones de desplazamiento vertical de las ventanas de chat",
+-- ["mousewheel_name"] = "Activar Rueda del Rat\195\179n",
+-- ["mousewheel_desc"] = "Determina si se activa el soporte para la rueda del rat\195\179n en cada ventana de chat",
+-- ["mousewheel_perframename"] = "Rueda de rat\195\179n en %s ",
+-- ["mousewheel_perframedesc"] = "Determina si se activa el soporte para la rueda del rat\195\179n",
+-- ["Set MouseWheel Speed"] = "Velocidad de la rueda del rat\195\179n",
+-- ["Set number of lines mousewheel will scroll."] = "N\195\186mero de l\195\173neas que la rueda del rat\195\179n desplazar\195\161 verticalmente",
+-- ["Set Ctrl+MouseWheel Speed"] = "Velocidad de Ctrl+Rueda del Rat\195\179n",
+-- ["Set number of lines mousewheel will scroll when ctrl is pressed."] = "N\195\186mero de l\195\173neas que la rueda del rat\195\179n desplazar\195\161 verticalmente cuando se presione la tecla Control",
+-- ["lowdown_name"] = "Saltar Abajo",
+-- ["lowdown_desc"] = "Determina si se activa el salto a la parte inferior de cada ventana de chat.",
+-- ["lowdown_perframename"] = "Salto Abajo en %s ",
+-- ["lowdown_perframedesc"] = "Determina si se activa el salto abajo",
+-- ["Set TheLowDown Delay"] = "Retraso de Salto Abajo",
+-- ["Set time to wait before jumping to the bottom of chat windows."] = "Establece el tiempo tras el que quieres saltar abajo",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Scroll"] = "Scrollen",
+-- ["Chat window scrolling options."] = "Chatfenster Scrollen Optionen",
+-- ["mousewheel_name"] = "Aktiviere Mausrad",
+-- ["mousewheel_desc"] = "Schaltet Mausrad Unterst\195\188tzung an und aus f\195\188r jedes Chatfenster.",
+-- ["mousewheel_perframename"] = "%s Mausrad",
+-- ["mousewheel_perframedesc"] = "Schaltet Mauserad Unterst\195\188tzung an und aus.",
+-- ["Set MouseWheel Speed"] = "Mausrad Geschwindigkeit einstellen",
+-- ["Set number of lines mousewheel will scroll."] = "Stellt die Anzahl an Zeilen ein die mit dem Mausrad gescrollt werden.",
+-- ["Set Ctrl+MouseWheel Speed"] = "Strg+Mausrad Geschwindigkeit einstellen",
+-- ["Set number of lines mousewheel will scroll when ctrl is pressed."] = "stellt ein wieviele Zeilen gescrollt werden wenn Strg gedr\195\188ckt gehalten wird.",
+-- ["lowdown_name"] = "Aktiviere Ganz runter",
+-- ["lowdown_desc"] = "Schaltet das springen zum Ende des Chattextes an und aus f\195\188r jedes Chatfenster.",
+-- ["lowdown_perframename"] = "%s Ganz runter",
+-- ["lowdown_perframedesc"] = "Schaltet das springen zum Ende an und aus.",
+-- ["Set TheLowDown Delay"] = "Ganz runter verz\195\182gerrung einstellen",
+-- ["Set time to wait before jumping to the bottom of chat windows."] = "Stellt ein nach welcher Zeit der Chattext in den chatfenstern zu seinem Ende springen soll.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["Scroll"] = "D\195\169filement",
+-- ["Chat window scrolling options."] = "Options de d\195\169filement.",
+-- ["mousewheel_name"] = "D\195\169filement avec la molette",
+-- ["mousewheel_desc"] = "Active le d\195\169filement du texte avec la molette.",
+-- ["mousewheel_perframename"] = "Fen\195\170tre %s ",
+-- ["mousewheel_perframedesc"] = "Activer/d\195\169sactiver le support de la molette.",
+-- ["Set MouseWheel Speed"] = "Vitesse de d\195\169filement - Molette",
+-- ["Set number of lines mousewheel will scroll."] = "Règle le nombre de lignes que fait d\195\169filer la molette.",
+-- ["Set Ctrl+MouseWheel Speed"] = "Vitesse de d\195\169filement - Ctrl+Molette",
+-- ["Set number of lines mousewheel will scroll when ctrl is pressed."] = "R\195\168gle le nombre de lignes que fait d\195\169filer Ctrl+molette.",
+-- ["lowdown_name"] = "Retour automatique en bas",
+-- ["lowdown_desc"] = "Active/d\195\169sactive le retour automatique en bas de la fen\195\170tre au bout d'un d\195\169lai pour chaque fen\195\170tre.",
+-- ["lowdown_perframename"] = "Fen\195\170tre %s ",
+-- ["lowdown_perframedesc"] = "Active/d\195\169sactive le retour automatique en bas de la fen\195\170tre au bout d'un d\195\169lai.",
+-- ["Set TheLowDown Delay"] = "D\195\169lai de retour automatique",
+-- ["Set time to wait before jumping to the bottom of chat windows."] = "R\195\168gle le d\195\169lai avant de revenir en bas de la fen\195\170tre.",
+--} end)
+
+
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ mousewheel = { ["*"] = true },
+ normscrollspeed = 1,
+ ctrlscrollspeed = 3,
+ lowdown = { ["*"] = true },
+ lowdowndelay = 20,
+ scrolldirection = "BOTTOM"
+ }
+} )
+
+
+---- build the options menu using prat templates
+--module.toggleOptions = {
+-- mousewheel_handler = {},
+-- sep135_sep = 135,
+-- lowdown_handler = {}
+--}
+
+
+Prat:SetModuleOptions(module.name, {
+ name = L["Scroll"],
+ desc = L["Chat window scrolling options."],
+ type = "group",
+ args = {
+ mousewheel = {
+ name = L["mousewheel_name"],
+ desc = L["mousewheel_desc"],
+ type = "multiselect",
+ order = 110,
+ values = Prat.HookedFrameList,
+ get = "GetSubValue",
+ set = "SetSubValue"
+ },
+ normscrollspeed = {
+ name = L["Set MouseWheel Speed"],
+ desc = L["Set number of lines mousewheel will scroll."],
+ type = "range",
+ order = 120,
+ min = 1,
+ max = 21,
+ step = 1,
+ },
+ scrolldirection = {
+ type = "select",
+ name = L["Text scroll direction"],
+ desc = L["Control whether text is added to the frame at the top or the bottom."],
+ values = { ["TOP"] = L["Top"], ["BOTTOM"] = L["Bottom"] },
+ },
+ ctrlscrollspeed = {
+ name = L["Set Ctrl+MouseWheel Speed"],
+ desc = L["Set number of lines mousewheel will scroll when ctrl is pressed."],
+ type = "range",
+ order = 130,
+ min = 3,
+ max = 21,
+ step = 3,
+ },
+-- lowdown = {
+-- name = L["lowdown_name"],
+-- desc = L["lowdown_desc"],
+-- type = "multiselect",
+-- order = 110,
+-- values = Prat.HookedFrameList,
+-- get = "GetSubValue",
+-- set = "SetSubValue"
+-- },
+-- lowdowndelay = {
+-- name = L["Set TheLowDown Delay"],
+-- desc = L["Set time to wait before jumping to the bottom of chat windows."],
+-- type = "range",
+-- order = 220,
+-- min = 1,
+-- max = 60,
+-- step = 1,
+-- },
+ }
+})
+
+module.OnSubValueChanged = module.ConfigureAllFrames
+
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+-- things to do when the module is enabled
+function module:OnModuleEnable()
+ self:ConfigureAllFrames()
+end
+
+
+
+-- things to do when the module is disabled
+function module:OnModuleDisable()
+ for k, v in pairs(Prat.Frames) do
+ self:MouseWheel(v,false)
+-- self:LowDown(v,false)
+ end
+
+ self:SetScrollDirection("BOTTOM")
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+function module:ConfigureAllFrames()
+ for k, v in pairs(Prat.Frames) do
+ self:MouseWheel(v, self.db.profile.mousewheel[k])
+-- self:LowDown(v, self.db.profile.lowdown[k])
+ end
+
+ self:SetScrollDirection(self.db.profile.scrolldirection)
+end
+
+do
+ local function scrollFrame(cf, up)
+ if IsShiftKeyDown() then
+ if up then cf:ScrollToTop() else cf:ScrollToBottom() end
+ else
+ if IsControlKeyDown() then
+ for i = 1,module.db.profile.ctrlscrollspeed do
+ if up then cf:ScrollUp() else cf:ScrollDown() end
+ end
+ else
+ for i = 1,module.db.profile.normscrollspeed do
+ if up then cf:ScrollUp() else cf:ScrollDown() end
+ end
+ end
+ end
+ end
+
+ function module:MouseWheel(cf, enabled)
+ if enabled then
+ cf:SetScript("OnMouseWheel", function(cf, arg1) scrollFrame(cf, arg1 > 0) end)
+ cf:EnableMouseWheel(true)
+ else
+ cf:SetScript("OnMouseWheel", nil)
+ cf:EnableMouseWheel(false)
+ end
+ end
+end
+
+--function module:LowDown(cf, enabled)
+-- local name = cf:GetName()
+-- local funcs = {"ScrollUp", "ScrollDown", "ScrollToTop", "PageUp", "PageDown"}
+--
+-- if enabled then
+-- for _,func in ipairs(funcs) do
+-- local f = function(cf)
+-- if self:IsEventScheduled(name.."DownTimeout") then self:CancelScheduledEvent(name.."DownTimeout") end
+-- self:ScheduleEvent(name.."DownTimeout", self.ResetFrame, self.db.profile.lowdowndelay, self, cf)
+-- end
+-- self:SecureHook(cf, func, f)
+-- end
+-- else
+-- for _,func in ipairs(funcs) do
+-- if self:IsHooked(cf, func) then self:Unhook(cf, func) end
+-- end
+-- end
+--end
+
+function module:ResetFrame(cf)
+ if not cf:AtBottom() then
+ cf:ScrollToBottom()
+ end
+end
+
+function module:SetScrollDirection(direction)
+ for k, v in pairs(Prat.HookedFrames) do
+ self:ScrollDirection(v, direction)
+ end
+
+ self.db.profile.scrolldirection = direction
+end
+
+function module:ScrollDirection(cf, direction)
+ if cf:GetInsertMode() ~= direction then
+ cf:SetMaxLines(cf:GetMaxLines())
+ cf:SetInsertMode(direction)
+ end
+end
+
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/ServerNames.lua b/modules/ServerNames.lua
new file mode 100644
index 00000000..ed630a2b
--- /dev/null
+++ b/modules/ServerNames.lua
@@ -0,0 +1,511 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: PratServerNames
+Revision: $Revision: 80432 $
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+ Sylvanaar (sylvanaar@mindspring.com)
+
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#ServerNames
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: Module for Prat that options for replacing server names with abbreviations.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("ServerNames")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["ServerNames"] = true,
+ ["Server name abbreviation options."] = true,
+ ["Replace"] = true,
+ ["Toggle replacing this server."] = true,
+ ["Blank"] = true,
+ ["Don't display the server name"] = true,
+ ["Set"] = true,
+ ["Server %d"] = true,
+ ["'%s - %s' display settings."] = true,
+ ["Use a custom replacement for the server %s text."] = true,
+ ["randomclr_name"] = "Random Colors",
+ ["randomclr_desc"] = "Use a random color for each server.",
+ ["Set color"] = true,
+ ["Change the color for this server name"] = true,
+ ["Use custom color"] = true,
+ ["Toggle useing custom color this server."] = true,
+ ["colon_name"] = "Show Colon",
+ ["colon_desc"] = "Toggle adding colon after server replacement.",
+ ["Unknown Battlegroup"] = true,
+ ["Glory-2.0 Not Loaded"] = true,
+ ["Click to load Glory-2.0"] = true,
+})
+
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["ServerNames"] = "服务器名称",
+-- ["Server name abbreviation options."] = "服务器名称缩写选项.",
+-- ["Replace"] = "替换",
+-- ["Toggle replacing this server."] = "替换此服务器.",
+-- ["Blank"] = "关闭",
+-- ["Don't display the server name"] = "关闭此服务器.",
+-- ["Set"] = "设置",
+-- ["Server %d"] = "%d 服务器",
+-- ["'%s - %s' display settings."] = "'%s - %s' 显示设置.",
+-- ["Use a custom replacement for the server %s text."] = "自定义聊天服务器 %s 文本替换.",
+-- ["randomclr_name"] = "随机颜色",
+-- ["randomclr_desc"] = "服务器使用随机颜色.",
+-- ["Set color"] = "颜色设置",
+-- ["Change the color for this server name"] = "更改此服务器名称颜色",
+-- ["Use custom color"] = "自定义颜色",
+-- ["Toggle useing custom color this server."] = "此服务器使用自定义颜色.",
+-- ["colon_name"] = "显示冒号",
+-- ["colon_desc"] = "切换频道替换后增加冒号.",
+-- ["Unknown Battlegroup"] = "未知的战场分组",
+-- ["Glory-2.0 Not Loaded"] = "未载入 Glory-2.0",
+-- ["Click to load Glory-2.0"] = "单击载入 Glory-2.0",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["ServerNames"] = "伺服器名稱",
+-- ["Server name abbreviation options."] = "伺服器名稱縮寫選項。",
+-- ["Replace"] = "替換",
+-- ["Toggle replacing this server."] = "是否替換伺服器名稱。",
+-- ["Blank"] = "空白",
+-- ["Don't display the server name"] = "不顯示伺服器名稱",
+---- no use anymore ["Set"] = true,
+---- no use anymore ["Server %d"] = true,
+-- ["'%s - %s' display settings."] = "「%s - %s」顯示設定。",
+-- ["Use a custom replacement for the server %s text."] = "以自定義文字替換伺服器%s文字。",
+-- ["randomclr_name"] = "隨機顏色",
+-- ["randomclr_desc"] = "為每個伺服器隨機著色。",
+-- ["Set color"] = "設定顏色",
+-- ["Change the color for this server name"] = "改變此伺服器名稱的顏色。",
+-- ["Use custom color"] = "使用自定義顏色",
+-- ["Toggle useing custom color this server."] = "切換是否使用自定義顏色。",
+-- ["colon_name"] = "顯示冒號",
+-- ["colon_desc"] = "切換頻道替換後增加冒號。",
+-- ["Unknown Battlegroup"] = "未知的戰場群組",
+-- ["Glory-2.0 Not Loaded"] = "未載入 Glory-2.0",
+-- ["Click to load Glory-2.0"] = "左擊載入 Glory-2.0",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["ServerNames"] = "Server Namen",
+-- ["Server name abbreviation options."] = "Server Namen Abk\195\188rzungsoptionen.",
+-- ["Replace"] = "Ersetze",
+-- ["Toggle replacing this server."] = "Schaltet das ersetzen dieses Servers ein.",
+-- ["Blank"] = "Aus",
+-- ["Don't display the server name"] = "Schaltet diesen Server aus.",
+-- ["Set"] = "Einstellen",
+-- ["Server %d"] = "server %d",
+-- ["'%s - %s' display settings."] = "'%s - %s' Einstellungen.",
+-- ["Use a custom replacement for the server %s text."] = "Benutze eigenen Namen f\195\188r den Server %s Text.",
+-- ["randomclr_name"] = "Zufalls Farben",
+-- ["randomclr_desc"] = "Benutzte eine zufällige Farbe für jeden Servernamen.",
+-- ["Set color"] = "Wähle Farbe",
+-- ["Change the color for this server name"] = "Ändere die Farbe für diesen Servernamen.",
+-- ["Use custom color"] = "Benutze eigene Farbe",
+-- ["Toggle useing custom color this server."] = "Aktiviere das verwenden einer selbst definierten Farbe für diesen Server.",
+-- ["colon_name"] = "Zeige Doppelpunkt",
+-- ["colon_desc"] = "Aktiviere das hinzuf\195\188gen eines Doppelpunkts nach dem eigenen Servernamen.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["ServerNames"] = "Nombres de Servidor",
+-- ["Server name abbreviation options."] = "Opciones de abreviaci\195\179n de los nombres de servidor",
+-- ["Replace"] = "Reemplazar",
+-- ["Toggle replacing this server."] = "Determina si se reemplaza este servidor",
+-- ["Blank"] = "Desactivar",
+-- ["Don't display the server name"] = "Desactivar este servidor",
+-- ["Set"] = "Establecer",
+-- ["Server %d"] = "Servidor %d",
+-- ["'%s - %s' display settings."] = "Ajustes de '%s - %s'",
+-- ["Use a custom replacement for the server %s text."] = "Usa un recambio personalizado para el texto del servidor %s",
+-- ["randomclr_name"] = "Colores Aleatorios",
+-- ["randomclr_desc"] = "Usar un color aleatorio para cada servidor.",
+-- ["colon_name"] = "Mostrar los Dos Puntos",
+-- ["colon_desc"] = "Determina si e aaden los dos puntos despu\195\169s del recambio de servidor.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["ServerNames"] = "서버명",
+-- ["Server name abbreviation options."] = "서버명 단축 설정입니다.",
+-- ["Replace"] = "대체",
+-- ["Toggle replacing this server."] = "해당 서버명을 대체합니다.",
+-- ["Blank"] = "공백",
+-- ["Don't display the server name"] = "서버명을 표시하지 않습니다.",
+-- ["Set"] = "켬",
+-- ["Server %d"] = "%d 서버",
+-- ["'%s - %s' display settings."] = "'%s - %s' 설정입니다.",
+-- ["Use a custom replacement for the server %s text."] = "서버 %s 글자에 대해 사용자 정의 대체를 사용합니다.",
+-- ["randomclr_name"] = "무작위 색상",
+-- ["randomclr_desc"] = "각 서버명에 무작위 색상을 사용합니다.",
+-- ["Set color"] = "색상 설정",
+-- ["Change the color for this server name"] = "해당 서버명의 색상을 변경합니다.",
+-- ["Use custom color"] = "사용자 정의 색상 사용",
+-- ["Toggle useing custom color this server."] = "해당 서버에 사용자 정의 색상을 사용합니다.",
+-- ["colon_name"] = "콜론 표시",
+-- ["colon_desc"] = "대체한 서버명 뒤에 콜론을 추가합니다.",
+-- ["Unknown Battlegroup"] = "알 수 없는 전장",
+-- ["Glory-2.0 Not Loaded"] = "Glory-2.0 라이브러리가 로드되지 않았습니다.",
+-- ["Click to load Glory-2.0"] = "Glory-2.0 불러오기를 클릭하세요.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["ServerNames"] = "Noms du serveur",
+-- ["Server name abbreviation options."] = "Options pour abbr\195\169ger les noms des serveurs.",
+-- ["Replace"] = "Remplacer",
+-- ["Toggle replacing this server."] = "Active/d\195\169sactive le remplacement pour ce serveur.",
+-- ["Blank"] = "D\195\169sactiv\195\169",
+-- ["Don't display the server name"] = "D\195\169sactiver ce serveur.",
+-- ["Set"] = "Set",
+-- ["Server %d"] = "Serveur %d",
+-- ["'%s - %s' display settings."] = "R\195\169glages '%s - %s'",
+-- ["Use a custom replacement for the server %s text."] = "Utiliser un remplacement personnalis\195\169 pour le texte du chat %s.",
+-- ["randomclr_name"] = "Couleurs aléatoires",
+-- ["randomclr_desc"] = "Utiliser une couleur aléatoire pour chaque serveur.",
+-- ["Set color"] = "Choisir la couleur",
+-- ["Change the color for this server name"] = "Choisit la couleur pour le nom de ce serveur",
+-- ["Use custom color"] = "Couleur personnalisée",
+-- ["Toggle useing custom color this server."] = "Active/désactive l'utilisation d'une couleur personnalisée pour ce serveur.",
+-- ["colon_name"] = "Afficher ':'",
+-- ["colon_desc"] = "Ajoute ou non un ':' après le nom du serveur.",
+--} end)
+
+local module = Prat:NewModule(PRAT_MODULE)
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ space = true,
+ colon = true,
+
+ chanSave = {},
+
+ serveropts = {
+ ["*"] = {
+ replace = false,
+ customcolor = false,
+ shortname = "",
+ color = {
+ r = 0.65,
+ g = 0.65,
+ b = 0.65,
+ a = 1,
+ },
+ },
+ },
+
+ randomclr = false,
+ }
+} )
+
+local serverPlugins = { servers={} }
+
+Prat:SetModuleOptions(module.name, {
+ name = L["ServerNames"],
+ desc = L["Server name abbreviation options."],
+ type = "group",
+ plugins = serverPlugins,
+ args = {
+ randomclr = {
+ type = "toggle",
+ name = L["randomclr_name"],
+ desc = L["randomclr_desc"],
+ order = 250
+ }
+ }
+ }
+)
+
+-- build the options menu using prat templates
+--module.toggleOptions = { optsep_sep = 240, randomclr = 250}
+--module.toggleOptions = { optsep_sep = 229, space = 230, colon = 240 }
+
+--local server_tags = {
+-- ["Normal"] = "(E)",
+-- ["PvP"] = "(P)",
+-- ["RP"] = "(R)",
+-- ["RP-PvP"] = "(PR)",
+--}
+--
+--local server_desctags = {
+-- ["Normal"] = "PvE",
+-- ["PvP"] = "PvP",
+-- ["RP"] = "RP",
+-- ["RP-PvP"] = "RPPvP",
+--}
+
+local CLR = Prat.CLR
+local function Server(server, text) return Prat.CLR:Colorize(module:GetServerCLR(server), text or server) end
+
+-- Get the key for the server specified, safe to pass this nil and "", if no key then it returns nil
+local function GetServerKey(server)
+ if server and strlen(server)>0 then
+ return server:gsub(" ", ""):lower()
+ end
+end
+
+function module:GetServerSettings(serverKey)
+ opts = self.db.profile.serveropts[serverKey]
+ if not opts then
+ self.db.profile.serveropts[serverKey] = {}
+ opts = self.db.profile.serveropts[serverKey]
+ end
+
+ return opts
+end
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+function module:OnModuleEnable()
+ self:BuildServerOptions()
+ Prat.RegisterChatEvent(self, "Prat_PreAddMessage")
+end
+
+function module:OnModuleDisable()
+ Prat.UnregisterAllChatEvents(self)
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+-- replace text using prat event implementation
+function module:Prat_PreAddMessage(m, frame, event)
+ local serverKey = GetServerKey(m.SERVER)
+ local opts = serverKey and self:GetServerSettingss(serverKey)
+
+ if opts and opts.replace then
+ m.SERVER = opts.shortname
+ end
+
+ if m.SERVER and strlen(m.SERVER)>0 then
+ m.SERVER = Server(serverKey, m.SERVER)
+ end
+
+ if not (m.SERVER and strlen(m.SERVER)>0) then
+ local s = Prat.SplitMessage
+ s.SERVER, s.sS, s.Ss = "", "", ""
+ end
+end
+
+local serverHashes = setmetatable({}, { __mode = "kv", __index = function(t,v) t[k] = CLR:GetHashColor(v) return t[v] end })
+local serverColors = setmetatable({}, { __mode = "kv", __index = function(t,v) t[k] = CLR:GetHexColor(k) return t[k] end })
+
+function module:GetServerCLR(server)
+ local serverKey = GetServerKey(server)
+
+ if serverKey then
+ local opts = GetServerSettings(serverKey)
+
+ if opts and opts.customcolor then
+ return serverColors[opts.color]
+ elseif self.db.profile.randomclr then
+ return serverHashes[serverKey]
+ end
+ end
+
+ return CLR.COLOR_NONE
+end
+
+--[[------------------------------------------------
+ Menu Builder Functions
+------------------------------------------------]]--
+
+function module:BuildServerOptions()
+-- if Glory then
+-- if opts.noglory then opts.noglory = nil end
+-- local serverList = {}
+-- local homeservName = GetRealmName()
+-- Glory:GetBattlegroupServers(nil, serverList)
+--
+-- local scount = 0
+--
+-- local serverKey, serverType
+-- for _,v in pairs(serverList) do
+-- -- Since we dont detect the home server, dont offer an option
+-- if v ~= homeservName then
+-- serverKey = GetServerKey(v)
+-- serverType = Glory:GetServerType(v)
+-- self:CreateServerOption(self.moduleOptions.args, v, serverKey, serverType)
+--
+-- scount = scount + 1
+-- end
+-- end
+--
+-- if scount == 0 then
+-- opts.noservers = {}
+-- opts.noservers.type = 'header'
+-- opts.noservers.name = L["Unknown Battlegroup"]
+-- else
+-- opts.noservers = nil
+-- end
+-- else
+--
+-- end
+
+
+end
+
+
+
+--
+--
+-- "-Name(type)" is how we have it
+--
+-- so provide
+--
+-- %S = Full Server Name
+-- %s = Abbreviated Server Name
+-- %T = Full Realm Type eg PvP
+-- %t = Abbreviated Realm Type e.g P
+--
+-- So the default format is:
+--
+-- -%S(%t)
+--
+-- We can support a coloring syntax
+-- which can say use the color of
+-- (some other field) Here, we can
+-- Set the color of the server to use
+-- the color value of the realm type
+--
+--
+local t_sort = {}
+function module:UpdateServerMenu()
+-- for k,v in pairs(args) do
+-- if v.name_org then
+-- local opts = self.db.profile.serveropts[k]
+--
+-- v.name = CLR:Server(v.name_org)
+-- if opts and opts.replace and opts.shortname and strlen(opts.shortname) > 0 then
+-- v.name = v.name .. " - (" .. CLR:Server(v.name_org, opts.shortname) .. ")"
+-- end
+--
+-- v.args.setname.name = v.name
+-- t_sort[#t_sort+1] = k
+-- end
+-- end
+--
+-- -- Now it must be sorted
+-- table.sort(t_sort)
+--
+-- -- Now apply ordering
+-- local o = 10
+-- for i,k in ipairs(t_sort) do
+-- t_sort[i] = nil
+-- args[k].order = o
+-- o = o + 1
+-- end
+end
+
+
+function module:CreateServerOption(args, servername, serverkey, servertype)
+-- local name = serverkey
+-- local text = servername
+-- local type = text
+--
+--
+--
+-- args[name] = {
+-- name = CLR:Server(text),
+-- name_org = text,
+-- type_org = servertype,
+-- desc = string.format(L["'%s - %s' display settings."], text, server_desctags[servertype]),
+-- type = "group",
+-- args = {
+-- setname = {
+-- name = CLR:Server(text),
+-- desc = string.format(L["Use a custom replacement for the server %s text."], text),
+-- order = 10,
+-- type = "text",
+-- usage = "",
+-- get = function() return self.db.profile.serveropts[name].shortname end,
+-- set = function(v) self.db.profile.serveropts[name].shortname = v end
+-- },
+-- optsep20 = {
+-- order = 20,
+-- type = 'header',
+-- },
+-- usecustomcolor = {
+-- name = L["Use custom color"],
+-- desc = L["Toggle useing custom color this server."],
+-- type = "toggle",
+-- order = 24,
+-- get = function() return self.db.profile.serveropts[name].customcolor end,
+-- set = function(v) self.db.profile.serveropts[name].customcolor = v end
+-- },
+-- customcolor = {
+-- name = L["Set color"],
+-- desc = L["Change the color for this server name"],
+-- type = "color",
+-- order = 25,
+-- get = function() local c = self.db.profile.serveropts[name].color
+-- return c.r, c.g, c.b end,
+-- set = function(r, g, b, a) local c = self.db.profile.serveropts[name].color
+-- c.r, c.g, c.b = r, g, b end,
+-- disabled = function() if not self.db.profile.serveropts[name].customcolor then return true else return false end end,
+-- },
+-- optsep27 = {
+-- order = 27,
+-- type = 'header',
+-- },
+-- replace = {
+-- name = L["Replace"],
+-- desc = L["Toggle replacing this server."],
+-- type = "toggle",
+-- order = 30,
+-- get = function() return self.db.profile.serveropts[name].replace end,
+-- set = function(v) self.db.profile.serveropts[name].replace = v end,
+-- },
+-- off = {
+-- name = L["Blank"],
+-- desc = L["Don't display the server name"],
+-- type = "execute",
+-- order = 40,
+-- func = function() self.db.profile.serveropts[name].shortname = "" end
+-- }
+-- }
+-- }
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Sounds.lua b/modules/Sounds.lua
new file mode 100644
index 00000000..bc5e53e5
--- /dev/null
+++ b/modules/Sounds.lua
@@ -0,0 +1,410 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+--[[
+Name: PratSounds
+Revision: $Revision: 80553 $
+Author(s): Sylvanaar - Copy/Pasted from ChatSounds hy TotalPackage
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Filtering
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: A port of the Chatsounds addon to the Prat framework. (default=off).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("Sounds")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Sounds"] = true,
+ ["A module to play sounds on certain chat messages."] = true,
+ ["Add a custom channel"] = true,
+ ["Play a sound for a certain channel name (can be a substring)"] = true,
+ ["Remove a custom channel"] = true,
+ ["Reset settings"] = true,
+ ["Restore default settings and resets custom channel list"] = true,
+ ["Incoming Sounds"] = true,
+ ["Sound selection for incoming chat messages"] = true,
+ ["party_name"] = "Party",
+ ["party_desc"] = "Sound for %s party messages",
+ ["raid_name"] = "Raid",
+ ["raid_desc"] = "Sound for %s raid or battleground group/leader messages",
+ ["guild_name"] = "Guild",
+ ["guild_desc"] = "Sound for %s guild messages",
+ ["officer_name"] = "Officer",
+ ["officer_desc"] = "Sound for %s officer or custom channel messages",
+ ["whisper_name"] = "Whisper",
+ ["whisper_desc"] = "Sound for %s whisper messages",
+ ["incoming"] = true,
+ ["outgoing"] = true,
+ ["Outgoing Sounds"] = true,
+ ["Sound selection for outgoing (from you) chat messages"] = true,
+ ["Custom Channels"] = true,
+})
+
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 80553 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Sounds"] = "声音",
+-- ["A module to play sounds on certain chat messages."] = "特定聊天消息出现时播放声音提醒.",
+-- ["Add a custom channel"] = "增加自定义频道",
+-- ["Play a sound for a certain channel name (can be a substring)"] = "频道有消息时播放音效 (可以是子字符串)。",
+-- ["Remove a custom channel"] = "移除自定义频道",
+-- ["Reset settings"] = "重设",
+-- ["Restore default settings and resets custom channel list"] = "重设回默认值和重设自定义频道列表。",
+-- ["Incoming Sounds"] = "音效 (入)",
+-- ["Sound selection for incoming chat messages"] = "聊天消息 (入) 的音效。",
+-- ["Party"] = "队伍",
+-- ["Sound for incoming party messages"] = "队伍频道 (入) 的音效。",
+-- ["Raid"] = "团队",
+-- ["Sound for incoming raid or battleground group/leader messages"] = "团队/团队队长/战场/战场指挥频道 (入) 的音效。",
+-- ["Guild"] = "公会",
+-- ["Sound for incoming guild messages"] = "公会频道 (入) 的音效。",
+-- ["Officer/Custom"] = "公会官员/自定义",
+-- ["Sound for incoming officer or custom channel messages"] = "公会官员/自定义频道 (入) 的音效。",
+-- ["Whisper"] = "悄悄话",
+-- ["Sound for incoming whisper messages"] = "悄悄话 (入) 的音效。",
+-- ["Outgoing Sounds"] = "音效 (出)",
+-- ["Sound selection for outgoing (from you) chat messages"] = "聊天消息 (出) 的音效。",
+-- ["Sound for outgoing party messages"] = "队伍频道 (出) 的音效。",
+-- ["Sound for outgoing raid or battleground group/leader messages"] = "团队/团队队长/战场/战场指挥频道 (出) 的音效。",
+-- ["Sound for outgoing guild messages"] = "公会频道 (出) 的音效。",
+-- ["Sound for outgoing officer or custom channel messages"] = "公会官员/自定义频道 (出) 的音效。",
+-- ["Sound for outgoing whisper messages"] = "悄悄话 (出) 的音效。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Sounds"] = "音效",
+-- ["A module to play sounds on certain chat messages."] = "在特定聊天訊息出現時播放音效。",
+-- ["Add a custom channel"] = "增加自訂頻道",
+-- ["Play a sound for a certain channel name (can be a substring)"] = "頻道有訊息時播放音效 (可以是子字串)。",
+-- ["Remove a custom channel"] = "移除自訂頻道",
+-- ["Reset settings"] = "重設",
+-- ["Restore default settings and resets custom channel list"] = "重設回預設值和重設自訂頻道列表。",
+-- ["Incoming Sounds"] = "音效 (入)",
+-- ["Sound selection for incoming chat messages"] = "聊天訊息 (入) 的音效。",
+-- ["Party"] = "隊伍",
+-- ["Sound for incoming party messages"] = "隊伍頻道 (入) 的音效。",
+-- ["Raid"] = "團隊",
+-- ["Sound for incoming raid or battleground group/leader messages"] = "團隊/團隊隊長/戰場/戰場領導者頻道 (入) 的音效。",
+-- ["Guild"] = "公會",
+-- ["Sound for incoming guild messages"] = "公會頻道 (入) 的音效。",
+-- ["Officer/Custom"] = "公會理事/自訂",
+-- ["Sound for incoming officer or custom channel messages"] = "公會理事/自訂頻道 (入) 的音效。",
+-- ["Whisper"] = "悄悄話",
+-- ["Sound for incoming whisper messages"] = "悄悄話 (入) 的音效。",
+-- ["Outgoing Sounds"] = "音效 (出)",
+-- ["Sound selection for outgoing (from you) chat messages"] = "聊天訊息 (出) 的音效。",
+-- ["Sound for outgoing party messages"] = "隊伍頻道 (出) 的音效。",
+-- ["Sound for outgoing raid or battleground group/leader messages"] = "團隊/團隊隊長/戰場/戰場領導者頻道 (出) 的音效。",
+-- ["Sound for outgoing guild messages"] = "公會頻道 (出) 的音效。",
+-- ["Sound for outgoing officer or custom channel messages"] = "公會理事/自訂頻道 (出) 的音效。",
+-- ["Sound for outgoing whisper messages"] = "悄悄話 (出) 的音效。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Sounds"] = "Sounds",
+-- ["A module to play sounds on certain chat messages."] = "Ein Modul um Sounds jeh nach Chatnachrichtenart abzuspielen.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Sounds"] = "효과음",
+-- ["A module to play sounds on certain chat messages."] = "특정 대화 메세지에 효과음을 재생하기 위한 모듈입니다.",
+-- ["Add a custom channel"] = "사용자 채널 추가",
+-- ["Play a sound for a certain channel name (can be a substring)"] = "특정 채널명에 대한 효과음을 재생합니다.(단축 문자열 가능)",
+-- ["Remove a custom channel"] = "사용자 채널 제거",
+-- ["Reset settings"] = "설정 초기화",
+-- ["Restore default settings and resets custom channel list"] = "사용자 채널 목록을 초기화 하고 기본 설정으로 복원합니다.",
+-- ["Incoming Sounds"] = "받은 메세지 효과음",
+-- ["Sound selection for incoming chat messages"] = "받은 대화 메세지에 대한 효과음 선택",
+-- ["Sound selection for outgoing (from you) chat messages"] = "보낸 대화 메세지에 대한 효과음 선택",
+-- ["Party"] = "파티",
+-- ["Sound for incoming party messages"] = "받은 파티 메세지에 대한 효과음",
+-- ["Raid"] = "공격대",
+-- ["Sound for incoming raid or battleground group/leader messages"] = "받은 공격대 혹은 전장 파티/지휘관 메세지에 대한 효과음",
+-- ["Guild"] = "길드",
+-- ["Sound for incoming guild messages"] = "받은 길드 메세지에 대한 효과음",
+-- ["Officer/Custom"] = "오피서/사용자",
+-- ["Sound for incoming officer or custom channel messages"] = "받은 오피서 혹은 사용자 채널 메세지에 대한 효과음",
+-- ["Whisper"] = "귓속말",
+-- ["Sound for incoming whisper messages"] = "받은 귓속말 메세지에 대한 효과음",
+-- ["Outgoing Sounds"] = "보낸 메세지 효과음",
+-- ["Sound for outgoing party messages"] = "보낸 파티 메세지에 대한 효과음",
+-- ["Sound for outgoing raid or battleground group/leader messages"] = "보낸 공격대 혹은 전장 파티/지휘관 메세지에 대한 효과음",
+-- ["Sound for outgoing guild messages"] = "보낸 길드 메세지에 대한 효과음",
+-- ["Sound for outgoing officer or custom channel messages"] = "보낸 오피서 혹은 사용자 채널 메세지에 대한 효과음",
+-- ["Sound for outgoing whisper messages"] = "보낸 귓속말 메세지에 대한 효과음",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Sounds"] = "Sonidos",
+-- ["A module to play sounds on certain chat messages."] = "Un módulo que permite reproducir sonidos para ciertos mensajes de chat.",
+--} end)
+
+
+
+-- create prat module
+local module = Prat:NewModule(PRAT_MODULE)
+
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = false,
+ ["incoming"] = {
+ ["GUILD"] = "Kachink",
+ ["OFFICER"] = "Link",
+ ["PARTY"] = "Text1",
+ ["RAID"] = "Text2",
+ ["WHISPER"] = "Heart",
+ },
+ ["outgoing"] = {
+ ["GUILD"] = "None",
+ ["OFFICER"] = "None",
+ ["PARTY"] = "None",
+ ["RAID"] = "None",
+ ["WHISPER"] = "None",
+ },
+ ["customlist"] = GetLocale() == "zhTW" and {
+ }
+ or {
+ "healer",
+ "pall",
+ "priest",
+ "warrior",
+ "mage",
+ "hunter",
+ "druid",
+ "lock",
+ "rogue",
+ },
+ }
+})
+
+
+
+local media, SOUND
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+-- things to do when the module is enabled
+function module:OnModuleEnable()
+ media = Prat.Media
+ SOUND = media.MediaType.SOUND
+ self:BuildSoundList()
+
+ Prat.RegisterChatEvent(self, Prat.Events.POST_ADDMESSAGE)
+
+ media.RegisterCallback(self, "LibSharedMedia_Registered", "SharedMedia_Registered")
+ media.RegisterCallback(self, "LibSharedMedia_SetGlobal", "SharedMedia_Registered")
+end
+
+-- things to do when the module is disabled
+function module:OnModuleDisable()
+ Prat.UnregisterAllChatEvents(self)
+ media.UnregisterAllCallbacks(self)
+end
+
+local soundslist = {}
+
+
+function module:BuildSoundList()
+ if not media then return end
+
+ for i,v in ipairs(soundslist) do
+ soundslist[i] = nil
+ end
+
+ for k,v in pairs(media.MediaTable[SOUND]) do
+ soundslist[k]=k
+ end
+end
+
+function module:SharedMedia_Registered(mediatype, name)
+ if mediatype == SOUND then
+ self:BuildSoundList()
+ end
+end
+
+do
+ local optionGroup_mt = {
+ type = "select",
+ get = "GetChanOptValue",
+ set = "SetChanOptValue",
+ dialogControl = 'LSM30_Sound',
+ values = AceGUIWidgetLSMlists.sound,
+ }
+
+ local optionGroup_mt = { __index = optionGroup_mt }
+
+ local function newOptionGroup(text, incoming)
+ local t= setmetatable({}, optionGroup_mt)
+ t.name = L[text.."_name"]
+ t.desc = (L[text.."_desc"]):format(incoming and L["incoming"] or L["outgoing"])
+ return t
+ end
+
+ Prat:SetModuleOptions(module.name, {
+ name = L["Sounds"],
+ desc = L["A module to play sounds on certain chat messages."],
+ type = "group",
+ childGroups = "tab",
+ args = {
+ cchan = {
+ type = "group",
+ name = L["Custom Channels"],
+ desc = L["Custom Channels"],
+ args = {
+ custom = {
+ type = "input",
+ name = L["Add a custom channel"],
+ desc = L["Play a sound for a certain channel name (can be a substring)"],
+ set = function(i,v) tinsert(module.db.profile.customlist, v) end,
+ get = function() return end,
+ usage = "",
+ order = 3,
+ },
+
+ removenick = {
+ name = L["Remove a custom channel"],
+ desc = L["Remove a custom channel"],
+ type = "select",
+ order = 4,
+ get = function() return "" end,
+ values =function() return module.db.profile.customlist end,
+ disabled = function() return #module.db.profile.customlist == 0 end,
+ set = function(info,v) tremove(module.db.profile.customlist, v) end,
+ },
+ reset = {
+ type = "execute",
+ name = L["Reset settings"],
+ desc = L["Restore default settings and resets custom channel list"],
+ func = function() module.db.profile.customlist = { } end,
+ order = 10,
+ },
+ }
+ },
+ incoming = {
+ type = "group",
+ name = L["Incoming Sounds"],
+ desc = L["Sound selection for incoming chat messages"],
+ order = 20,
+ args = {
+ party = newOptionGroup("party", true),
+ raid = newOptionGroup("raid", true),
+ guild = newOptionGroup("guild", true),
+ officer = newOptionGroup("officer", true),
+ whisper = newOptionGroup("whisper", true),
+ },
+ },
+ outgoing = {
+ type = "group",
+ name = L["Outgoing Sounds"],
+ desc = L["Sound selection for outgoing (from you) chat messages"],
+ order = 30,
+ args = {
+ party = newOptionGroup("party"),
+ raid = newOptionGroup("raid"),
+ guild = newOptionGroup("guild"),
+ officer = newOptionGroup("officer"),
+ whisper = newOptionGroup("whisper"),
+ },
+ },
+ },
+ }
+ )
+end
+
+function module:GetChanOptValue(info, ...)
+ return self.db.profile[info[#info-1]][info[#info]:upper()]
+end
+
+function module:SetChanOptValue(info, val, ...)
+ Prat:PlaySound(val)
+ self.db.profile[info[#info-1]][info[#info]:upper()] = val
+end
+
+
+
+
+
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+function module:Prat_PostAddMessage(info, message, frame, event, text, r, g, b, id)
+ if Prat.EVENT_ID and Prat.EVENT_ID == self.lastevent and self.lasteventtype == event then return end
+
+ local msgtype = string.sub(event, 10)
+ local plr, svr = strsplit("-", (message.PLAYERLINK or ""))
+ local outgoing = (plr == UnitName("player")) and true or false
+ local sndprof = outgoing and self.db.profile.outgoing or self.db.profile.incoming
+
+ if msgtype == "CHANNEL" then
+ local chan = string.lower(message.ORG.CHANNEL)
+ for _,value in pairs(self.db.profile.customlist) do
+ if strlen(value) > 0 and string.find(chan, string.lower(value)) then
+ self:PlaySound(sndprof["OFFICER"], event)
+ end
+ end
+ else
+ if msgtype == "WHISPER_INFORM" then
+ msgtype = "WHISPER"
+ sndprof = self.db.profile.outgoing
+ elseif msgtype == "WHISPER" then
+ sndprof = self.db.profile.incoming
+ end
+
+ if msgtype == "RAID_LEADER" or msgtype == "BATTLEGROUND" or msgtype == "BATTLEGROUND_LEADER" then
+ msgtype = "RAID"
+ end
+
+ self:PlaySound(sndprof[msgtype], event)
+ end
+end
+
+
+function module:PlaySound(sound, event)
+ self.lasteventtype = event
+ self.lastevent = Prat.EVENT_ID
+ Prat:PlaySound(sound)
+end
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Substitutions.lua b/modules/Substitutions.lua
new file mode 100644
index 00000000..4168a390
--- /dev/null
+++ b/modules/Substitutions.lua
@@ -0,0 +1,800 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: PratSubstitutions
+Revision: $Revision: 80784 $
+Author(s): Sylvanaar
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Substitutions
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Based on: CFE2 by Satrina. (http://www.wowinterface.com/downloads/info6885-ChatFrameExtender2.html
+Dependencies: Prat
+Description: A module to provide basic chat substitutions. (default=off).
+]]
+
+Prat:AddModuleToLoad(function()
+
+
+local PRAT_MODULE = Prat:RequestModuleName("Substitutions")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+-- define localized strings
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Substitutions"] = true,
+ ["A module to provide basic chat substitutions."] = true,
+ ['User defined substitutions'] = true,
+ ['Options for setting and removing user defined substitutions. (NB: users may define custom values for existing substitutions, but they will revert to the default value if the user definition is deleted.)'] = true,
+ ['Set substitution'] = true,
+ ['Set the value of a user defined substitution (NB: this may be the same as an existing default substitution; to reset it to the default, just remove the user created definition).'] = true,
+ ['subname = text after expansion -- NOTE: sub name without the prefix "%"'] = true,
+ ['List substitutions'] = true,
+ ['Lists all current subtitutions in the default chat frame'] = true,
+ ['Delete substitution'] = true,
+ ['Deletes a user defined substitution'] = true,
+ ['subname -- NOTE: sub name without the prefix \'%\''] = true,
+ ['Are you sure?'] = true,
+ ['Delete all'] = true,
+ ['Deletes all user defined substitutions'] = true,
+ ['Are you sure - this will delete all user defined substitutions and reset defaults?'] = true,
+ ['List of available substitutions'] = true,
+ ['List of available substitutions defined by this module. (NB: users may define custom values for existing substitutions, but they will revert to the default value if the user definition is deleted.)'] = true,
+ ["NO MATCHFUNC FOUND"] = true,
+ ["Current value: '%s'\nClick to paste into the chat."] = true,
+ ['no substitution name given'] = true,
+ ['no value given for subtitution "%s"'] = true,
+ ['|cffff0000warning:|r subtitution "%s" already defined as "%s", overwriting'] = true,
+ ['defined %s: expands to => %s'] = true,
+ ['no substitution name supplied for deletion'] = true,
+ ['no user defined subs found'] = true,
+ ['user defined substition "%s" not found'] = true,
+ ["user substitutions index (usersubs_idx) doesn't exist! oh dear."] = true,
+ ["can't find substitution index for a substitution named '%s'"] = true,
+ ['removing user defined substitution "%s"; previously expanded to => "%s"'] = true,
+ ['substitution: %s defined as => %s'] = true,
+ ['%d total user defined substitutions'] = true,
+ ['module:buildUserSubsIndex(): warning: module patterns not defined!'] = true,
+
+ [""] = true,
+ ["male"] = true,
+ ["female"] = true,
+ ["unknown sex"] = true,
+ [""] = true,
+ ["his"] = true,
+ ["hers"] = true,
+ ["its"] = true,
+ ["him"] = true,
+ ["her"] = true,
+ ["it"] = true,
+
+ ['usersub_'] = true,
+ ["TargetHealthDeficit"] = true,
+ ["TargetPercentHP"] = true,
+ ["TargetPronoun"] = true,
+ ["PlayerHP"] = true,
+ ["PlayerName"] = true,
+ ["PlayerMaxHP"] = true,
+ ["PlayerHealthDeficit"] = true,
+ ["PlayerPercentHP"] = true,
+ ["PlayerCurrentMana"] = true,
+ ["PlayerMaxMana"] = true,
+ ["PlayerPercentMana"] = true,
+ ["PlayerManaDeficit"] = true,
+ ["TargetName"] = true,
+ ["TargetTargetName"] = true,
+ ["TargetClass"] = true,
+ ["TargetHealth"] = true,
+ ["TargetRace"] = true,
+ ["TargetGender"] = true,
+ ["TargetLevel"] = true,
+ ["TargetPossesive"] = true,
+ ["TargetManaDeficit"] = true,
+ ["TargetGuild"] = true,
+ ["TargetIcon"] = true,
+ ["MapZone"] = true,
+ ["MapLoc"] = true,
+ ["MapPos"] = true,
+ ["MapYPos"] = true,
+ ["MapXPos"] = true,
+ ["RandNum"] = true,
+})
+
+----Chinese Translate by Ananhaid(NovaLOG)@CWDG
+----CWDG site: http://Cwowaddon.com
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Substitutions"] = "文字缩写",
+-- ["A module to provide basic chat substitutions."] = "提供基本的聊天输出文字缩写功能.",
+-- ['User defined substitutions'] = "玩家自定义文字缩写",
+-- ['Options for setting and removing user defined substitutions. (NB: users may define custom values for existing substitutions, but they will revert to the default value if the user definition is deleted.)'] = "设定或移除玩家自定义文字缩写选项。 (注意: 玩家可覆盖预置的文字缩写,但移除自定义文字缩写后预置的文字缩写后会还原回预设值。)",
+-- ['Set substitution'] = "设定文字缩写",
+-- ['Set the value of a user defined substitution (NB: this may be the same as an existing default substitution; to reset it to the default, just remove the user created definition).'] = "设定玩家自定义文字缩写。 (注意: 玩家可覆盖预置的文字缩写,但移除自定义文字缩写后预置的文字缩写会还原回预设值。)",
+-- ['subname = text after expansion -- NOTE: sub name without the prefix "%"'] = "文字缩写 = 实际输出文字 -- 注意: 文字缩写不包括「%」",
+-- ['List substitutions'] = "列出文字缩写",
+-- ['Lists all current subtitutions in the default chat frame'] = "在预设的聊天窗口列出全部玩家自定义文字缩写。",
+-- ['Delete substitution'] = "移除文字缩写",
+-- ['Deletes a user defined substitution'] = "移除玩家自定义文字缩写。",
+-- ['subname -- NOTE: sub name without the prefix \'%\''] = "文字缩写 -- 注意: 文字缩写不包括「%」",
+-- ['Are you sure?'] = "确定?",
+-- ['Delete all'] = "全部移除",
+-- ['Deletes all user defined substitutions'] = "移除全部玩家自定义文字缩写。",
+-- ['Are you sure - this will delete all user defined substitutions and reset defaults?'] = "确定移除全部玩家自定义文字缩写?",
+-- ['List of available substitutions'] = "可用的文字缩写列表",
+-- ['List of available substitutions defined by this module. (NB: users may define custom values for existing substitutions, but they will revert to the default value if the user definition is deleted.)'] = "此模块定义的可用文字缩写列表。 (注意: 玩家可覆盖预置的文字缩写,但移除自定义文字缩写后预置的文字缩写会还原回预设值。)",
+-- ["NO MATCHFUNC FOUND"] = "找不到 matchfunc()",
+-- ["Current value: '%s'\nClick to paste into the chat."] = "当前的值: 「%s」\n单击帖入输入框。",
+-- ['no substitution name given'] = "沒有提供文字缩写名称",
+-- ['no value given for subtitution "%s"'] = "文字缩写「%s」沒有实际输出文字",
+-- ['|cffff0000warning:|r subtitution "%s" already defined as "%s", overwriting'] = "|cffff0000警告:|r 文字缩写「%s」早已定义为「%s」,将会覆盖",
+-- ['defined %s: expands to => %s'] = "已定义%s: => %s",
+-- ['no substitution name supplied for deletion'] = "沒有提供要移除的文字缩写名称",
+-- ['no user defined subs found'] = "找不到玩家自定义文字缩写",
+-- ['user defined substition "%s" not found'] = "找不到玩家自定义文字缩写「%s」",
+-- ["user substitutions index (usersubs_idx) doesn't exist! oh dear."] = "找不到玩家自定义文字缩写索引 (usersubs_idx)!",
+-- ["can't find substitution index for a substitution named '%s'"] = "找不到「%s」的玩家自定义文字缩写索引",
+-- ['removing user defined substitution "%s"; previously expanded to => "%s"'] = "已移除玩家自定义文字缩写「%s」; 先前定义为 => 「%s」",
+-- ['substitution: %s defined as => %s'] = "文字缩写: %s => %s",
+-- ['%d total user defined substitutions'] = "%d个玩家自定义文字缩写",
+-- ['module:buildUserSubsIndex(): warning: module patterns not defined!'] = "module:buildUserSubsIndex(): 警告: modpats未定义!",
+--
+-- [""] = "<沒有目标>",
+-- ["male"] = "男",
+-- ["female"] = "女",
+-- ["unknown sex"] = "未知的性別",
+-- [""] = "<沒有公会>",
+-- ["his"] = "他的",
+-- ["hers"] = "她的",
+-- ["its"] = "它的",
+-- ["him"] = "他",
+-- ["her"] = "她",
+-- ["it"] = "它",
+--
+-- ['usersub_'] = "玩家自定义-",
+-- ["TargetHealthDeficit"] = "目标已损失生命力",
+-- ["TargetPercentHP"] = "目标生命力百分比",
+-- ["TargetPronoun"] = "目标代名词",
+-- ["PlayerHP"] = "玩家生命力",
+-- ["PlayerName"] = "玩家名字",
+-- ["PlayerMaxHP"] = "玩家最大生命力",
+-- ["PlayerHealthDeficit"] = "玩家已损失生命力",
+-- ["PlayerPercentHP"] = "玩家生命力百分比",
+-- ["PlayerCurrentMana"] = "玩家法力",
+-- ["PlayerMaxMana"] = "玩家最大法力",
+-- ["PlayerPercentMana"] = "玩家法力百分比",
+-- ["PlayerManaDeficit"] = "玩家已损失法力",
+-- ["TargetName"] = "目标名字",
+-- ["TargetTargetName"] = "目标的目标名字",
+-- ["TargetClass"] = "目标职业",
+-- ["TargetHealth"] = "目标生命力",
+-- ["TargetRace"] = "目标种族",
+-- ["TargetGender"] = "目标性別",
+-- ["TargetLevel"] = "目标等級",
+-- ["TargetPossesive"] = "目标所有格",
+-- ["TargetManaDeficit"] = "目标已损失法力",
+-- ["TargetGuild"] = "目标公会",
+-- ["MapZone"] = "地区",
+-- ["MapLoc"] = "子地区",
+-- ["MapPos"] = "坐标",
+-- ["MapYPos"] = "Y坐标",
+-- ["MapXPos"] = "X坐标",
+-- ["RandNum"] = "随机数字",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Substitutions"] = "文字縮寫",
+-- ["A module to provide basic chat substitutions."] = "提供基本的聊天輸出文字縮寫功能。",
+-- ['User defined substitutions'] = "玩家自訂文字縮寫",
+-- ['Options for setting and removing user defined substitutions. (NB: users may define custom values for existing substitutions, but they will revert to the default value if the user definition is deleted.)'] = "設定或移除玩家自訂文字縮寫的選項。 (注意: 玩家可覆寫預設的文字縮寫,但移除自訂文字縮寫後預設的文字縮寫會還原回預設值。)",
+-- ['Set substitution'] = "設定文字縮寫",
+-- ['Set the value of a user defined substitution (NB: this may be the same as an existing default substitution; to reset it to the default, just remove the user created definition).'] = "設定玩家自訂文字縮寫。 (注意: 玩家可覆寫預設的文字縮寫,但移除自訂文字縮寫後預設的文字縮寫會還原回預設值。)",
+-- ['subname = text after expansion -- NOTE: sub name without the prefix "%"'] = "文字縮寫 = 實際輸出文字 -- 注意: 文字縮寫不包括「%」",
+-- ['List substitutions'] = "列出文字縮寫",
+-- ['Lists all current subtitutions in the default chat frame'] = "在預設的聊天視窗列出全部玩家自訂文字縮寫。",
+-- ['Delete substitution'] = "移除文字縮寫",
+-- ['Deletes a user defined substitution'] = "移除玩家自訂文字縮寫。",
+-- ['subname -- NOTE: sub name without the prefix \'%\''] = "文字縮寫 -- 注意: 文字縮寫不包括「%」",
+-- ['Are you sure?'] = "確定?",
+-- ['Delete all'] = "移除全部",
+-- ['Deletes all user defined substitutions'] = "移除全部玩家自訂文字縮寫。",
+-- ['Are you sure - this will delete all user defined substitutions and reset defaults?'] = "確定移除全部玩家自訂文字縮寫?",
+-- ['List of available substitutions'] = "可用的文字縮寫列表",
+-- ['List of available substitutions defined by this module. (NB: users may define custom values for existing substitutions, but they will revert to the default value if the user definition is deleted.)'] = "此模組定義的可用文字縮寫列表。 (注意: 玩家可覆寫預設的文字縮寫,但移除自訂文字縮寫後預設的文字縮寫會還原回預設值。)",
+-- ["NO MATCHFUNC FOUND"] = "找不到 matchfunc()",
+-- ["Current value: '%s'\nClick to paste into the chat."] = "現在的值: 「%s」\n左擊貼入聊天輸入框。",
+-- ['no substitution name given'] = "沒有提供文字縮寫名稱",
+-- ['no value given for subtitution "%s"'] = "文字縮寫「%s」沒有實際輸出文字",
+-- ['|cffff0000warning:|r subtitution "%s" already defined as "%s", overwriting'] = "|cffff0000警告:|r 文字縮寫「%s」早已定義為「%s」,將會覆寫",
+-- ['defined %s: expands to => %s'] = "已定義%s: => %s",
+-- ['no substitution name supplied for deletion'] = "沒有提供要移除的文字縮寫名稱",
+-- ['no user defined subs found'] = "找不到玩家自訂文字縮寫",
+-- ['user defined substition "%s" not found'] = "找不到玩家自訂文字縮寫「%s」",
+-- ["user substitutions index (usersubs_idx) doesn't exist! oh dear."] = "找不到玩家自訂文字縮寫索引 (usersubs_idx)!",
+-- ["can't find substitution index for a substitution named '%s'"] = "找不到「%s」的玩家自訂文字縮寫索引",
+-- ['removing user defined substitution "%s"; previously expanded to => "%s"'] = "已移除玩家自訂文字縮寫「%s」; 先前定義為 => 「%s」",
+-- ['substitution: %s defined as => %s'] = "文字縮寫: %s => %s",
+-- ['%d total user defined substitutions'] = "%d個玩家自訂文字縮寫",
+-- ['module:buildUserSubsIndex(): warning: module patterns not defined!'] = "module:buildUserSubsIndex(): 警告: modpats未定義!",
+--
+-- [""] = "<沒有目標>",
+-- ["male"] = "男",
+-- ["female"] = "女",
+-- ["unknown sex"] = "未知的性別",
+-- [""] = "<沒有公會>",
+-- ["his"] = "他的",
+-- ["hers"] = "她的",
+-- ["its"] = "它的",
+-- ["him"] = "他",
+-- ["her"] = "她",
+-- ["it"] = "它",
+--
+-- ['usersub_'] = "玩家自訂-",
+-- ["TargetHealthDeficit"] = "目標已損失生命力",
+-- ["TargetPercentHP"] = "目標生命力百分比",
+-- ["TargetPronoun"] = "目標代名詞",
+-- ["PlayerHP"] = "玩家生命力",
+-- ["PlayerName"] = "玩家名字",
+-- ["PlayerMaxHP"] = "玩家最大生命力",
+-- ["PlayerHealthDeficit"] = "玩家已損失生命力",
+-- ["PlayerPercentHP"] = "玩家生命力百分比",
+-- ["PlayerCurrentMana"] = "玩家法力",
+-- ["PlayerMaxMana"] = "玩家最大法力",
+-- ["PlayerPercentMana"] = "玩家法力百分比",
+-- ["PlayerManaDeficit"] = "玩家已損失法力",
+-- ["TargetName"] = "目標名字",
+-- ["TargetTargetName"] = "目標的目標名字",
+-- ["TargetClass"] = "目標職業",
+-- ["TargetHealth"] = "目標生命力",
+-- ["TargetRace"] = "目標種族",
+-- ["TargetGender"] = "目標性別",
+-- ["TargetLevel"] = "目標等級",
+-- ["TargetPossesive"] = "目標所有格",
+-- ["TargetManaDeficit"] = "目標已損失法力",
+-- ["TargetGuild"] = "目標公會",
+-- ["TargetIcon"] = "目標圖示",
+-- ["MapZone"] = "地區",
+-- ["MapLoc"] = "子地區",
+-- ["MapPos"] = "座標",
+-- ["MapYPos"] = "y座標",
+-- ["MapXPos"] = "x座標",
+-- ["RandNum"] = "隨機數字",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Substitutions"] = "Ersetzungen",
+-- ["A module to provide basic chat substitutions."] = "Ein Modul, um grundlegende Chat-Ersetzungen zur Verf\195\188gung zu stellen.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Substitutions"] = "대체",
+-- ["A module to provide basic chat substitutions."] = "기본 대화 대체를 제공하는 모듈입니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Substitutions"] = "Sustituciones",
+-- ["A module to provide basic chat substitutions."] = "Un módulo que provee sustituciones de chat básicas.",
+--} end)
+--
+
+local module = Prat:NewModule(PRAT_MODULE)
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = false,
+ }
+})
+
+
+local patternPlugins = { patterns={} }
+
+Prat:SetModuleOptions(module.name, {
+ name = L["Substitutions"],
+ desc = L["A module to provide basic chat substitutions."],
+ type = 'group',
+ plugins = patternPlugins,
+ args = {}
+ }
+)
+
+local function subDesc(info) return info.handler:GetSubstDescription(info) end
+
+
+--[[------------------------------------------------
+Core Functions
+------------------------------------------------]]--
+function module:OnModuleEnable()
+ self:BuildModuleOptions(patternPlugins.patterns)
+end
+
+function module:BuildModuleOptions(args)
+ local modulePatterns = Prat.GetModulePatterns(self)
+
+ local order = 500
+
+ self.buildingMenu = true
+
+ for k,v in pairs(modulePatterns) do
+ local name = v.optname
+ local pat = v.pattern:gsub("%%%%", "%%")
+
+ order = order + 10
+
+ args[name] = args[name] or {}
+ local d = args[name]
+
+ d.name = name.." "..pat
+ d.desc = subDesc
+ d.type = "execute"
+ d.func = "DoPat"
+ d.order = order
+ end
+
+ self.buildingMenu = false
+end
+
+
+function module:GetSubstDescription(info)
+ local val = self:InfoToPattern(info)
+
+ self.buildingMenu = true
+
+ val = val and val.matchfunc and val.matchfunc() or L["NO MATCHFUNC FOUND"]
+ val = L["Current value: '%s'\nClick to paste into the chat."]:format("|cff80ff80"..tostring( val ).."|r"):gsub("%%%%", "%%")
+
+ self.buildingMenu = false
+
+ return val
+end
+
+function module:InfoToPattern(info)
+ local modulePatterns = Prat.GetModulePatterns(self)
+ local name = info[#info] or ""
+
+ if modulePatterns then
+ for k,v in pairs(modulePatterns) do
+ if v.optname == name then
+ return v
+ end
+ end
+ end
+end
+
+function module:DoPat(info)
+ local pat = self:InfoToPattern(info)
+ pat = pat and pat.pattern or ""
+ local e = ChatFrameEditBox
+ if not e:IsVisible() then
+ return
+ end
+
+ e:SetText((e:GetText() or "")..pat:gsub("[%(%)]", ""):gsub("%%%%", "%%"))
+end
+
+do
+ local function prat_match(text)
+ local text = text or ""
+
+ if module.buildingMenu then
+ return text
+ end
+
+ return Prat:RegisterMatch(text, "OUTBOUND")
+ end
+
+ local function Zone(...)
+ return prat_match(GetZoneText())
+ end
+
+ local function Loc(...)
+ return prat_match(GetMinimapZoneText())
+ end
+
+ local function Pos()
+ local x,y = GetPlayerMapPosition("player")
+ local str = "("..math.floor((x * 100) + 0.5)..","..math.floor((y * 100) + 0.5)..")"
+ return prat_match(str)
+ end
+
+ local function Ypos()
+ local x, y = GetPlayerMapPosition("player")
+ local y = tostring(math.floor((y * 100) + 0.5))
+ return prat_match(y)
+ end
+
+ local function Xpos()
+ local x, y = GetPlayerMapPosition("player")
+ local x = tostring(math.floor((x * 100) + 0.5))
+ return prat_match(x)
+ end
+
+ local function PlayerHP(...)
+ return prat_match(UnitHealth("player"))
+ end
+
+ local function PlayerMaxHP(...)
+ return prat_match(UnitHealthMax("player"))
+ end
+
+ local function PlayerPercentHP()
+ return prat_match(floor(100 * (UnitHealth("player") / UnitHealthMax("player"))))
+ end
+
+ local function PlayerHealthDeficit()
+ return prat_match(UnitHealthMax("player") - UnitHealth("player"))
+ end
+
+ local function PlayerCurrentMana()
+ return prat_match(UnitMana("player"))
+ end
+
+ local function PlayerMaxMana()
+ return prat_match(UnitManaMax("player"))
+ end
+
+ local function PlayerPercentMana()
+ return prat_match(string.format("%.0f%%%%",
+ floor(100 * (UnitMana("player")/UnitManaMax("player")))))
+ end
+
+ local function PlayerManaDeficit()
+ return prat_match(UnitManaMax("player") - UnitMana("player"))
+ end
+
+
+
+ local function TargetPercentHP()
+ local str = L[""]
+ if UnitExists("target") then
+ str = string.format("%.0f%%%%", floor(100 * (UnitHealth("target") / UnitHealthMax("target"))))
+ end
+
+ return prat_match(str)
+ end
+
+ local function TargetHealth()
+ local str = L[""]
+ if UnitExists("target") then
+ str = UnitHealth("target")
+ end
+
+ return prat_match(str)
+ end
+
+ local function TargetHealthDeficit()
+ local str = L[""]
+ if UnitExists("target") then
+ str = UnitHealthMax("target") - UnitHealth("target")
+ end
+
+ return prat_match(str)
+ end
+
+ local function TargetManaDeficit()
+ local str = L[""]
+ if UnitExists("target") then
+ str = UnitManaMax("target") - UnitMana("target")
+ end
+
+ return prat_match(str)
+ end
+
+
+ local function TargetClass()
+ local class = L[""]
+ if UnitExists("target") then
+ class = UnitClass("target")
+ end
+
+ return prat_match(class)
+ end
+
+ local raidiconpfx = ICON_TAG_RAID_TARGET_STAR1:sub(1,-2) or "rt"
+
+ local function TargetIcon()
+ local icon = ""
+ if UnitExists("target") then
+ local iconnum = GetRaidTargetIndex("target")
+
+ if type(iconnum) ~= "nil" then
+ icon = ("{%s%d}"):format(raidiconpfx, tostring(iconnum))
+ end
+ end
+
+ return prat_match(icon)
+ end
+
+
+ local function TargetRace()
+ local race = L[""]
+ if UnitExists("target") then
+ if UnitIsPlayer("target") then
+ race = UnitRace("target")
+ else
+ race = UnitCreatureFamily("target")
+ if not race then
+ race = UnitCreatureType("target")
+ end
+ end
+ end
+ return prat_match(race)
+ end
+ local function TargetGender()
+ local sex = L[""]
+ if UnitExists("target") then
+ s = UnitSex("target")
+ if(s == 2) then
+ sex = L["male"]
+ elseif (s == 3) then
+ sex = L["female"]
+ else
+ sex = L["unknown sex"]
+ end
+ end
+
+ return prat_match(sex)
+ end
+
+ local function TargetLevel()
+ local level = L[""]
+ if UnitExists("target") then
+ level = UnitLevel("target")
+ end
+ return prat_match(level)
+ end
+
+ local function TargetGuild()
+ local guild = L[""]
+ if UnitExists("target") then
+ guild = L[""]
+ if IsInGuild("target") then
+ guild = GetGuildInfo("target") or ""
+ end
+ end
+ return prat_match(guild)
+ end
+
+ -- %tps (possesive)
+ local function TargetPossesive()
+ local p = L[""]
+ if UnitExists("target") then
+ local s = UnitSex("target")
+ if(s == 2) then
+ p = L["his"]
+ elseif (s == 3) then
+ p = L["hers"]
+ else
+ p = L["its"]
+ end
+ end
+
+ return prat_match(p)
+ end
+
+ -- %tpn (pronoun)
+ local function TargetPronoun()
+ local p = L[""]
+ if UnitExists("target") then
+ local s = UnitSex("target")
+ if(s == 2) then
+ p = L["him"]
+ elseif (s == 3) then
+ p = L["her"]
+ else
+ p = L["it"]
+ end
+ end
+ return prat_match(p)
+ end
+
+ -- %tn (target)
+ local function TargetName()
+ local t = L['']
+
+ if UnitExists("target") then
+ t = UnitName("target")
+ end
+
+ return prat_match(t)
+ end
+
+ -- %tt (target)
+ local function TargetTargetName()
+ local t = L['']
+
+ if UnitExists("targettarget") then
+ t = UnitName("targettarget")
+ end
+
+ return prat_match(t)
+ end
+
+ -- %pn (player)
+ local function PlayerName()
+ local p = GetUnitName("player") or ""
+ return prat_match(p)
+ end
+
+ local function Rand()
+ return math.random(1, 100)
+ end
+
+ --[[
+ * %tn = current target
+ * %pn = player name
+ * %hc = your current health
+ * %hm = your max health
+ * %hp = your percentage health
+ * %hd = your current health deficit
+ * %mc = your current mana
+ * %mm = your max mana
+ * %mp = your percentage mana
+ * %md = your current mana deficit
+ * %thp = target's percentage health
+ * %th = target's current health
+ * %td = target's health deficit
+ * %tc = class of target
+ * %tr = race of target
+ * %ts = sex of target
+ * %tl = level of target
+ * %ti = raid icon of target
+ * %tps = possesive for target (his/hers/its)
+ * %tpn = pronoun for target (him/her/it)
+ * %fhp = focus's percentage health
+ * %fc = class of focus
+ * %fr = race of focus
+ * %fs = sex of focus
+ * %fl = level of focus
+ * %fps = possesive for focus (his/hers/its)
+ * %fpn = pronoun for focus (him/her/it)
+ * %tt = target of target
+ * %zon = your current zone (Dun Morogh, Hellfire Peninsula, etc.)
+ * %loc = your current subzone (as shown on the minimap)
+ * %pos = your current coordinates (x,y)
+ * %ypos = your current y coordinate
+ * %xpos = your current x coordinate
+ * %rnd = a random number between 1 and 100
+ --]]
+
+ Prat:SetModulePatterns(module, {
+ { pattern = "(%%thd)", matchfunc=TargetHealthDeficit, optname=L["TargetHealthDeficit"], type = "OUTBOUND"},
+ { pattern = "(%%thp)", matchfunc=TargetPercentHP, optname=L["TargetPercentHP"], type = "OUTBOUND"},
+ { pattern = "(%%tpn)", matchfunc=TargetPronoun, optname=L["TargetPronoun"], type = "OUTBOUND"},
+
+ { pattern = "(%%hc)", matchfunc=PlayerHP, optname=L["PlayerHP"], type = "OUTBOUND"},
+ { pattern = "(%%pn)", matchfunc=PlayerName, optname=L["PlayerName"], type = "OUTBOUND"},
+ { pattern = "(%%hm)", matchfunc=PlayerMaxHP, optname=L["PlayerMaxHP"], type = "OUTBOUND"},
+ { pattern = "(%%hd)", matchfunc=PlayerHealthDeficit, optname=L["PlayerHealthDeficit"], type = "OUTBOUND"},
+ { pattern = "(%%hp)", matchfunc=PlayerPercentHP, optname=L["PlayerPercentHP"], type = "OUTBOUND"},
+ { pattern = "(%%mc)", matchfunc=PlayerCurrentMana, optname=L["PlayerCurrentMana"], type = "OUTBOUND"},
+ { pattern = "(%%mm)", matchfunc=PlayerMaxMana, optname=L["PlayerMaxMana"], type = "OUTBOUND"},
+ { pattern = "(%%mp)", matchfunc=PlayerPercentMana, optname=L["PlayerPercentMana"], type = "OUTBOUND"},
+ { pattern = "(%%pmd)", matchfunc=PlayerManaDeficit, optname=L["PlayerManaDeficit"], type = "OUTBOUND"},
+
+ { pattern = "(%%tn)", matchfunc=TargetName, optname=L["TargetName"], type = "OUTBOUND"},
+ { pattern = "(%%tt)", matchfunc=TargetTargetName, optname=L["TargetTargetName"], type = "OUTBOUND"},
+ { pattern = "(%%tc)", matchfunc=TargetClass, optname=L["TargetClass"], type = "OUTBOUND"},
+ { pattern = "(%%th)", matchfunc=TargetHealth, optname=L["TargetHealth"], type = "OUTBOUND"},
+ { pattern = "(%%tr)", matchfunc=TargetRace, optname=L["TargetRace"], type = "OUTBOUND"},
+ { pattern = "(%%ts)", matchfunc=TargetGender, optname=L["TargetGender"], type = "OUTBOUND"},
+ { pattern = "(%%ti)", matchfunc=TargetIcon, optname=L["TargetIcon"], type = "OUTBOUND"},
+ { pattern = "(%%tl)", matchfunc=TargetLevel, optname=L["TargetLevel"], type = "OUTBOUND"},
+ { pattern = "(%%tps)", matchfunc=TargetPossesive, optname=L["TargetPossesive"], type = "OUTBOUND"},
+ { pattern = "(%%tmd)", matchfunc=TargetManaDeficit, optname=L["TargetManaDeficit"], type = "OUTBOUND"},
+ { pattern = "(%%tg)", matchfunc=TargetGuild, optname=L["TargetGuild"], type = "OUTBOUND"},
+
+
+ { pattern = "(%%zon)", matchfunc=Zone, optname=L["MapZone"], type = "OUTBOUND"},
+ { pattern = "(%%loc)", matchfunc=Loc, optname=L["MapLoc"], type = "OUTBOUND"},
+ { pattern = "(%%pos)", matchfunc=Pos, optname=L["MapPos"], type = "OUTBOUND"},
+ { pattern = "(%%ypos)", matchfunc=Ypos, optname=L["MapYPos"], type = "OUTBOUND"},
+ { pattern = "(%%xpos)", matchfunc=Xpos, optname=L["MapXPos"], type = "OUTBOUND"},
+ { pattern = "(%%rnd)", matchfunc=Rand, optname=L["RandNum"], type = "OUTBOUND"},
+
+ --~ { pattern = "(%%tn)", matchfunc=TargetName, optname="Target", type = "OUTBOUND"},
+ --~ { pattern = "(%%pn)", matchfunc=PlayerName, optname="Player", type = "OUTBOUND"}
+ }
+
+ --[[ TODO:
+ %%fhp - focus health
+ %%fr
+ %%fc
+ %%fs
+ %%fl
+ %%fvr
+ %%fvn
+ ]]
+
+ )
+end
+
+
+--function module:userSubIdx(subname)
+-- if not subname then return false end
+--
+-- local usersubs_idx = self.usersubs_idx or {}
+--
+-- if usersubs_idx[subname] then
+-- return usersubs_idx[subname]
+-- end
+--
+-- local tmpsubname
+--
+-- for idx, pattern in module.modulePatterns do
+-- tmpsubname = pattern.optname:gsub('^user_', '')
+--
+-- if usersubs[tmpsubname] then
+-- usersubs_idx[tmpsubname] = idx
+--
+-- return idx
+-- end
+-- end
+--
+-- return false
+--end
+--
+--
+--function module:addUserSubs()
+-- self.usersubs_idx = {}
+--
+-- for subname, expandsto in pairs(self.db.profile.usersubs) do
+-- local pattable = self:patternTable(subname, expandsto)
+--
+-- table.insert(self.modulePatterns, pattable)
+--
+-- self.usersubs_idx = pattable.idx
+-- end
+--end
+--
+--function module:buildUserSubsIndex()
+-- local usersubs = self.db.profile.usersubs
+-- local modpats = self.modulePatterns
+--
+-- self.usersubs_idx = {}
+--
+-- if not modpats then
+-- self:print(L['module:buildUserSubsIndex(): warning: module patterns not defined!'])
+-- return false
+-- end
+--
+-- for idx, pattern in ipairs(modpats) do
+-- local subname = pattern.optname:gsub('^user_', '')
+--
+-- if usersubs[subname] then
+-- usersubs_idx[subname] = idx
+-- module.usersubs_idx[subname] = idx
+-- end
+-- end
+--
+-- return usersubs_idx
+--end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/TellTarget.lua b/modules/TellTarget.lua
new file mode 100644
index 00000000..3444a059
--- /dev/null
+++ b/modules/TellTarget.lua
@@ -0,0 +1,202 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+
+
+
+--[[
+Name: module
+Revision: $Revision: 80703 $
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+Inspired by: idChat2_TellTarget by Industrial
+ ChatFrameExtender by Satrina
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#TellTarget
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that adds a slash command (/tt) to send a message to your target (default=on).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("TellTarget")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["TellTarget"] = true,
+ ["Adds telltarget slash command (/tt)."] = true,
+ ["Target does not exist."] = true,
+ ["Target is not a player."] = true,
+ ["No target selected."] = true,
+ ["NoTarget"] = true,
+ ["/tt"] = true,
+})
+
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 80703 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["TellTarget"] = "通知目标",
+-- ["Adds telltarget slash command (/tt)."] = "添加通知目标命令 (/tt).",
+-- ["Target does not exist."] = "目标不存在.",
+-- ["Target is not a player."] = "目标非玩家.",
+-- ["No target selected."] = "无目标选定.",
+-- ["NoTarget"] = "无目标",
+-- ["/tt"] = "/tt",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["TellTarget"] = "通知目標",
+-- ["Adds telltarget slash command (/tt)."] = "增加通知目標指令 (/tt)。",
+---- no use anymore ["Target does not exist."] = true,
+-- ["Target is not a player."] = "目標非玩家。",
+-- ["No target selected."] = "無選定目標。",
+-- ["NoTarget"] = "無目標",
+---- no need to translate ["/tt"] = true,
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["TellTarget"] = "대상대화",
+-- ["Adds telltarget slash command (/tt)."] = "대상대화를 위한 (/tt) 명령을 추가합니다.",
+-- ["Target does not exist."] = "대상이 없습니다.",
+-- ["Target is not a player."] = "올바른 대상이 아닙니다.",
+-- ["No target selected."] = "선택된 대상이 없습니다.",
+-- ["NoTarget"] = "대상없음",
+-- ["/tt"] = "/ㅅㅅ",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["TellTarget"] = "Susurrar a Objetivo",
+-- ["Adds telltarget slash command (/tt)."] = "A\195\177ade el comando susurrar a objetivo (/tt)",
+-- ["Target does not exist."] = "El objetivo no existe",
+-- ["Target is not a player."] = "El objetivo no es un jugador",
+-- ["No target selected."] = "No se a seleccionado un objetivo",
+-- ["NoTarget"] = "Sin Objetivo",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["TellTarget"] = "Sage Ziel",
+-- ["Adds telltarget slash command (/tt)."] = "F\195\188gt das Ziel Fl\195\188stern (TellTarget) Slash Kommando (/tt) hinzu.",
+-- ["Target does not exist."] = "Ziel existiert nicht.",
+-- ["Target is not a player."] = "Ziel ist kein Spieler.",
+-- ["No target selected."] = "Kein Ziel ausgew\195\164hlt.",
+-- ["NoTarget"] = "Kein Ziel",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["TellTarget"] = "Chuchoter à la cible",
+-- ["Adds telltarget slash command (/tt)."] = "Ajoute la commande Chuchoter à la cible (TellTarget) /tt",
+-- ["Target does not exist."] = "La cible n'existe pas.",
+-- ["Target is not a player."] = "La cible n'est pas un joueur.",
+-- ["No target selected."] = "Pas de cible sélectionnée.",
+-- ["NoTarget"] = "Pas de cible",
+--} end)
+
+
+
+-- create prat module
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ }
+} )
+
+Prat:SetModuleOptions(module.name, {
+ name = L["TellTarget"],
+ desc = L["Adds telltarget slash command (/tt)."],
+ type = "group",
+ args = {
+ info = {
+ name = L["Adds telltarget slash command (/tt)."],
+ type = "description",
+ }
+ }
+ }
+)
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+function module:OnModuleEnable()
+ self:HookScript(ChatFrameEditBox, "OnTextChanged")
+end
+
+function module:OnModuleDisable()
+ self:UnhookAll()
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+function module:OnTextChanged(editBox, ...)
+ local command, msg = editBox:GetText():match("^(/%S+)%s(.*)$")
+ if command == "/tt" or command == L["/tt"] then
+ self:SendTellToTarget(editBox.chatFrame, msg)
+ end
+ self.hooks[editBox].OnTextChanged(editBox, ...)
+end
+
+function module:SendTellToTarget(frame, text)
+ if frame == nil then frame = DEFAULT_CHAT_FRAME end
+
+ local unitname, realm, fullname
+ if UnitIsPlayer("target") then
+ unitname, realm = UnitName("target")
+ if unitname then
+ if realm and not UnitIsSameServer("player", "target") then
+ fullname = unitname.."-"..realm
+ else
+ fullname = unitname
+ end
+ end
+ end
+ ChatFrame_SendTell((fullname and fullname:gsub(" ", "") or L["NoTarget"]), frame)
+ ChatFrameEditBox:SetText(text)
+end
+
+local function TellTarget(msg)
+ module:SendTellToTarget(SELECTED_CHAT_FRAME, msg)
+end
+
+
+-- TODO: set slash command
+--SlashCmdList["module"] = TellTarget
+--SLASH_module1 = "/tt"
+--SLASH_module2 = L["/tt"]
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/Timestamps.lua b/modules/Timestamps.lua
new file mode 100644
index 00000000..d1dcd181
--- /dev/null
+++ b/modules/Timestamps.lua
@@ -0,0 +1,551 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2008 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: PratTimestamps
+Revision: $Revision: 80569 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Author(s): Curney (asml8ed@gmail.com)
+ Krtek (krtek4@gmail.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#Timestamps
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that adds configurable timestamps to chat windows (default=on).
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+
+local PRAT_MODULE = Prat:RequestModuleName("Timestamps")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+-- define localized strings
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["Timestamps"] = true,
+ ["Chat window timestamp options."] = true,
+ ["Show Timestamp"] = true,
+ ["Toggle showing timestamp for each window."] = true,
+ ["show_name"] = "Show Timestamp",
+ ["show_desc"] = "Toggle showing timestamp on and off for each window.",
+ ["Set timestamp format (strftime) for all chat windows. See here for more details: http://fin.instinct.org/prat/timestamps/"] = true,
+ ["Format All Timestamps"] = true,
+ ["colortimestamp_name"] = "Color Timestamp",
+ ["colortimestamp_desc"] = "Toggle coloring the timestamp on and off.",
+ ["Set Timestamp Color"] = true,
+ ["Sets the color of the timestamp."] = true,
+ ["localtime_name"] = "Use Local Time",
+ ["localtime_desc"] = "Toggle using local time on and off.",
+ ["space_name"] = "Show Space",
+ ["space_desc"] = "Toggle adding space after timestamp on and off.",
+})
+
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+-- $Rev: 80569 $
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["Timestamps"] = "时间标签",
+-- ["Chat window timestamp options."] = "聊天窗口时间标签选项",
+-- ["Set Separately"] = "独立设置",
+-- ["Toggle setting options separately for each chat window."] = "独立设置各聊天窗口的时间标签选项",
+-- ["Show Timestamp"] = "显示时间标签",
+-- ["Toggle showing timestamp for each window."] = "启用各窗口的时间标签显示",
+-- ["Show ChatFrame%d Timestamp"] = "显示聊天窗口 %d 时间标签",
+-- ["Toggle showing timestamp on and off."] = "切换时间标签显示",
+-- ["show_name"] = "设置",
+-- ["show_desc"] = "显示各窗口的时间标签设置",
+-- ["show_perframename"] = "聊天窗口 %s 时间标签",
+-- ["show_perframedesc"] = "在聊天窗口 %s 显示时间标签",
+-- ["Format Timestamp"] = "时间标签格式",
+-- ["Set timestamp format (strftime) for each chat window. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "设置各窗口的时间标签格式 (strftime 函数格式)。请参考 - http://fin.instinct.org/prat/timestamps/",
+-- ["Format ChatFrame%d Timestamp"] = "聊天窗口 %d 时间标签格式",
+-- ["Set format of timestamp (strftime). See here for more details: http://fin.instinct.org/prat/timestamps/"] = "设置聊天窗口 %d 的时间标签格式 (strftime 函数格式)。请参考 - http://fin.instinct.org/prat/timestamps/",
+-- ["Show All Timestamps"] = "全部显示时间标签",
+-- ["Toggle showing timestamp for all chat windows."] = "切换全部聊天窗口的时间标签显示",
+-- ["Format All Timestamps"] = "全部时间标签格式设置",
+-- ["Set timestamp format (strftime) for all chat windows. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "设置所有聊天窗口的时间标签格式 (strftime 函数格式)。请参考 - http://fin.instinct.org/prat/timestamps/",
+-- ["colortimestamp_name"] = "颜色",
+-- ["colortimestamp_desc"] = "时间标签颜色",
+-- ["Set Timestamp Color"] = "颜色设置",
+-- ["Sets the color of the timestamp."] = "设置时间标签的颜色",
+-- ["localtime_name"] = "本地时间",
+-- ["localtime_desc"] = "使用本地时间",
+-- ["space_name"] = "空格",
+-- ["space_desc"] = "在时间标签后显示空格",
+-- ["Help"] = "帮助",
+-- ["How to customize timestamps."] = "怎样自定义时间标签。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["Timestamps"] = "時間標籤",
+-- ["Chat window timestamp options."] = "聊天視窗時間標籤選項。",
+-- ["Set Separately"] = "個別設定",
+-- ["Toggle setting options separately for each chat window."] = "分別設定各聊天視窗。",
+-- ["Show Timestamp"] = "顯示時間標籤",
+-- ["Toggle showing timestamp for each window."] = "切換是否在各個聊天視窗顯示時間標籤。",
+-- ["Show ChatFrame%d Timestamp"] = "聊天視窗%d顯示時間標籤",
+-- ["Toggle showing timestamp on and off."] = "切換是否顯示時間標籤。",
+-- ["show_name"] = "顯示時間標籤",
+-- ["show_desc"] = "切換是否在各個聊天視窗顯示時間標籤。",
+-- ["show_perframename"] = "聊天視窗%d顯示時間標籤",
+-- ["show_perframedesc"] = "切換是否顯示時間標籤。",
+-- ["Format Timestamp"] = "時間標籤格式",
+-- ["Set timestamp format (strftime) for each chat window. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "設定各個聊天視窗的時間標籤格式 (依 strftime 函式格式)。請參考 - http://fin.instinct.org/prat/timestamps/",
+-- ["Format ChatFrame%d Timestamp"] = "聊天視窗%d時間標籤格式",
+-- ["Set format of timestamp (strftime). See here for more details: http://fin.instinct.org/prat/timestamps/"] = "設定時間標籤格式 (依 strftime 函式格式)。請參考 - http://fin.instinct.org/prat/timestamps/",
+-- ["Show All Timestamps"] = "顯示全部時間標籤",
+-- ["Toggle showing timestamp for all chat windows."] = "切換是否在全部的聊天視窗顯示時間標籤。",
+-- ["Format All Timestamps"] = "全部聊天視窗時間標籤格式",
+-- ["Set timestamp format (strftime) for all chat windows. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "設定全部聊天視窗時間標籤格式 (依 strftime 函式格式)。請參考 - http://fin.instinct.org/prat/timestamps/",
+-- ["colortimestamp_name"] = "時間標籤顏色",
+-- ["colortimestamp_desc"] = "切換是否替時間標籤著色。",
+-- ["Set Timestamp Color"] = "顏色設定",
+-- ["Sets the color of the timestamp."] = "設定時間標籤的顏色。",
+-- ["localtime_name"] = "使用本地時間",
+-- ["localtime_desc"] = "切換是否使用本地時間。",
+-- ["space_name"] = "顯示空格",
+-- ["space_desc"] = "切換是否在時間標籤後顯示空格。",
+-- ["Help"] = "幫助",
+-- ["How to customize timestamps."] = "怎樣自定時間標籤。",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["Timestamps"] = "Affichage de l'heure",
+-- ["Chat window timestamp options."] = "Options pour l'affichage de l'heure devant les messages",
+-- ["Set Separately"] = "Régler séparément",
+-- ["Toggle setting options separately for each chat window."] = "Active/désactive le réglage des options pour chaque fenêtre séparément.",
+-- ["Show Timestamp"] = "Afficher l'heure",
+-- ["Toggle showing timestamp for each window."] = "Affiche/masque l'heure devant chaque message pour chaque fenêtre.",
+-- ["Show ChatFrame%d Timestamp"] = "Fenêtre %d",
+-- ["Toggle showing timestamp on and off."] = "Affiche/masque l'heure devant les messages.",
+-- ["show_name"] = "Afficher",
+-- ["show_desc"] = "Affiche/masque les réglages de l'heure pour chaque fenêtre.",
+-- ["show_perframename"] = "Fenêtre %s ",
+-- ["show_perframedesc"] = "Affiche/masque l'heure devant les messages de la fenêtre %s .",
+-- ["Format Timestamp"] = "Format de l'heure",
+-- ["Set timestamp format (strftime) for each chat window. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "Règle le format de l'heure (strftime) pour chaque fenêtre de discussion. See here for more details: http://fin.instinct.org/prat/timestamps/",
+-- ["Format ChatFrame%d Timestamp"] = "Fenêtre %d",
+-- ["Set format of timestamp (strftime). See here for more details: http://fin.instinct.org/prat/timestamps/"] = "Règle le format de l'heure (strftime) pour la fenêtre %d. See here for more details: http://fin.instinct.org/prat/timestamps/",
+-- ["Show All Timestamps"] = "Afficher l'heure partout",
+-- ["Toggle showing timestamp for all chat windows."] = "Afficher l'heure devant les messages de chaque fenêtre",
+-- ["Format All Timestamps"] = "Format de toutes les heures",
+-- ["Set timestamp format (strftime) for all chat windows. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "Règle le format de l'heure (strftime) pour l'ensemble des fenêtres de discussion. See here for more details: http://fin.instinct.org/prat/timestamps/",
+-- ["colortimestamp_name"] = "Coloriser l'heure",
+-- ["colortimestamp_desc"] = "Active/désactive la colorisation de l'heure.",
+-- ["Set Timestamp Color"] = "Couleur",
+-- ["Sets the color of the timestamp."] = "Change la couleur de l'heure.",
+-- ["localtime_name"] = "Utiliser l'heure locale",
+-- ["localtime_desc"] = "Utilise ou non l'heure locale.",
+-- ["space_name"] = "Afficher une espace",
+-- ["space_desc"] = "Affiche/masque l'espace après l'heure..",
+-- ["Help"] = "Aide",
+-- ["How to customize timestamps."] = "La façon de personnaliser l'affichage de l'heure.",
+--} end)
+--
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["Timestamps"] = "타임스탬프",
+-- ["Chat window timestamp options."] = "대화창 타임스탬프 설정입니다.",
+-- ["Set Separately"] = "구분 설정",
+-- ["Toggle setting options separately for each chat window."] = "각 대화창에 대해 구분 설정을 사용합니다.",
+-- ["Show Timestamp"] = "타임스탬프 표시",
+-- ["Toggle showing timestamp for each window."] = "각 창에 대한 타임스탬프를 표시합니다.",
+-- ["Show ChatFrame%d Timestamp"] = "%d 대화창 타임스탬프 표시",
+-- ["Toggle showing timestamp on and off."] = "타임스탬프 표시를 켜거나 끕니다.",
+-- ["show_name"] = "타임스탬프 표시",
+-- ["show_desc"] = "각 창에 대한 타임스탬프 표시를 켜거나 끕니다.",
+-- ["show_perframename"] = "대화창%d 타임스탬프 표시",
+-- ["show_perframedesc"] = "타임스탬프 표시를 켜거나 끕니다.",
+-- ["Format Timestamp"] = "타임스탬프 형식",
+-- ["Set timestamp format (strftime) for each chat window. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "각 대화창에 대한 타임스탬프 형식을 설정합니다. 보다 자세한 정보 : http://fin.instinct.org/prat/timestamps/",
+-- ["Format ChatFrame%d Timestamp"] = "%d 대화창 타임스탬프 형식",
+-- ["Set format of timestamp (strftime). See here for more details: http://fin.instinct.org/prat/timestamps/"] = "타임스탬프의 형식을 설정합니다. 보다 자세한 정보 : http://fin.instinct.org/prat/timestamps/",
+-- ["Show All Timestamps"] = "모든 타임스탬프 표시",
+-- ["Toggle showing timestamp for all chat windows."] = "모든 대화창에 대한 타임스탬프를 표시합니다.",
+-- ["Format All Timestamps"] = "모든 타임스탬프 형식",
+-- ["Set timestamp format (strftime) for all chat windows. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "모든 대화창에 대한 타임스탬프 형식을 설정합니다. 보다 자세한 정보 : http://fin.instinct.org/prat/timestamps/",
+-- ["colortimestamp_name"] = "타임스탬프 색상",
+-- ["colortimestamp_desc"] = "타임스탬프 색상을 켜거나 끕니다.",
+-- ["Set Timestamp Color"] = "타임스탬프 색상 설정",
+-- ["Sets the color of the timestamp."] = "타임스탬프의 색상을 설정합니다.",
+-- ["localtime_name"] = "로컬 시간 사용",
+-- ["localtime_desc"] = "로컬 시간 사용을 켜거나 끕니다.",
+-- ["space_name"] = "공백 표시",
+-- ["space_desc"] = "타임스탬프 뒤에 공백 추가를 켜거나 끕니다.",
+-- ["Help"] = "도움말",
+-- ["How to customize timestamps."] = "사용자 지정 타임스탬프에 대한 사용법입니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["Timestamps"] = "Horas",
+-- ["Chat window timestamp options."] = "Opciones de hora para la ventana de chat",
+-- ["Set Separately"] = "Por Separado",
+-- ["Toggle setting options separately for each chat window."] = "Establecer opciones para cada ventana por separado",
+-- ["Show Timestamp"] = "Mostrar Hora",
+-- ["Toggle showing timestamp for each window."] = "Muestra la hora en cada ventana",
+-- ["Show ChatFrame%d Timestamp"] = "Mostrar hora en chat %d",
+-- ["Toggle showing timestamp on and off."] = "Muestra/Oculta la hora.",
+-- ["show_name"] = "Mostrar Hora",
+-- ["show_desc"] = "Muestra/Oculta la hora en cada ventana.",
+-- ["show_perframename"] = "Mostrar hora en %s.",
+-- ["show_perframedesc"] = "Muestra/Oculta la hora en la ventana de %s.",
+-- ["Format Timestamp"] = "Formatear Hora",
+-- ["Set timestamp format (strftime) for all chat windows. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "Establece el formato de hora (strftime) para todas las ventanas de chat. Mirar aqu\195\173 para m\195\161s detalles: http://fin.instinct.org/prat/timestamps/",
+-- ["Format ChatFrame%d Timestamp"] = "Formato de Hora en chat %d",
+-- ["Set format of timestamp (strftime). See here for more details: http://fin.instinct.org/prat/timestamps/"] = "Establece el formato de hora (strftime) para la ventana de chat %d. Mirar aqu\195\173 para m\195\161s detalles: http://fin.instinct.org/prat/timestamps/",
+-- ["Show All Timestamps"] = "Mostrar todas las Horas",
+-- ["Toggle showing timestamp for all chat windows."] = "Muestra la hora en todas las ventanas de chat",
+-- ["Format All Timestamps"] = "Formatear todas las Horas",
+-- ["Set timestamp format (strftime) for all chat windows. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "Establece el formato de hora (strftime) para todas las ventanas de chat. Mirar aqu\195\173 para m\195\161s detalles: http://fin.instinct.org/prat/timestamps/",
+-- ["colortimestamp_name"] = "Colorear Hora",
+-- ["colortimestamp_desc"] = "Colorea la Hora",
+-- ["Set Timestamp Color"] = "Color",
+-- ["Sets the color of the timestamp."] = "Cambia el color de la Hora",
+-- ["localtime_name"] = "Usar Hora Local",
+-- ["localtime_desc"] = "Usar Hora Local.",
+-- ["space_name"] = "Mostrar Espacio",
+-- ["space_desc"] = "Muestra un espacio tras la Hora.",
+-- ["Help"] = "Ayuda",
+-- ["How to customize timestamps."] = "Como personalizar la Hora.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["Timestamps"] = "Zeitstempel",
+-- ["Chat window timestamp options."] = "Chatfenster Zeitstempel Optionen",
+-- ["Set Separately"] = "Seperat einstellen",
+-- ["Toggle setting options separately for each chat window."] = "Schaltet die Einstellungsoptionen seperat f\195\188r jedes einzelne Fenster.",
+-- ["Show Timestamp"] = "Zeige Zeitstempel",
+-- ["Toggle showing timestamp for each window."] = "Justiere das Anzeigen der Zeitstempel f\195\188r jedes Fenster.",
+-- ["Show ChatFrame%d Timestamp"] = "Chat %d Zeitstempel Anzeigen",
+-- ["Toggle showing timestamp on and off."] = "Schaltet das Anzeigen des Zeitstempels an und aus.",
+-- ["show_name"] = "Zeige Zeitstempel",
+-- ["show_desc"] = "Schaltet das Anzeigen der Zeitstempel an und aus f\195\188r jedes Fenster.",
+-- ["show_perframename"] = "%s Zeitstempel Anzeigen",
+-- ["show_perframedesc"] = "Schaltet das Anzeigen des Zeitstempels an und aus f\195\188r das %s .",
+-- ["Format Timestamp"] = "Zeitformat Art",
+-- ["Set timestamp format (strftime) for each chat window. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "Stellt das Zeitstempelformat (strfzeit format) f\195\188r jedes Chatfenster ein. Nähere Details unter: http://fin.instinct.org/prat/timestamps/",
+-- ["Format ChatFrame%d Timestamp"] = "Chat %d Zeitstempelformat",
+-- ["Set format of timestamp (strftime). See here for more details: http://fin.instinct.org/prat/timestamps/"] = "Stellt das Zeitstempelformat (strfzeit format) f\195\188r das Chatfenster %d ein. Nähere Details unter: http://fin.instinct.org/prat/timestamps/",
+-- ["Show All Timestamps"] = "Zeige Alle Zeitstempel",
+-- ["Toggle showing timestamp for all chat windows."] = "Aktiviert das Anzeigen des Zeitstempels f\195\188r alle Chatfenster.",
+-- ["Format All Timestamps"] = "Formatiere Alle Zeitstempel",
+-- ["Set timestamp format (strftime) for all chat windows. See here for more details: http://fin.instinct.org/prat/timestamps/"] = "Stellt das Zeitstempelformat (strfzeit format) f\195\188r alle Chatfenster ein. Nähere Details unter: http://fin.instinct.org/prat/timestamps/",
+-- ["colortimestamp_name"] = "F\195\164rbe Zeitstempel",
+-- ["colortimestamp_desc"] = "Schaltet das einf\195\164rben des Zeitstempels ein und aus.",
+-- ["Set Timestamp Color"] = "Justiere Zeitstempel Farbe",
+-- ["Sets the color of the timestamp."] = "Justiere die Farbe des Zeitstempels.",
+-- ["localtime_name"] = "Benutze Lokale Zeit",
+-- ["localtime_desc"] = "Schaltet die Benutzung der Lokalen Zeit ein und aus.",
+-- ["space_name"] = "Zeige Leerstelle",
+-- ["space_desc"] = "Aktiviere eine Leerstelle nach dem Zeitstempel.",
+-- ["Help"] = "Hilfe",
+-- ["How to customize timestamps."] = "Wie man Zeitstempel personalisiert.",
+--} end)
+
+
+local module = Prat:NewModule(PRAT_MODULE, "AceHook-3.0")
+
+
+--module.moduleOptions = {}
+--module.toggleOptions = {
+-- sep115_sep = 115,
+-- show_handler = {},
+-- sep125_sep = 125,
+-- sep135_sep = 135,
+-- colortimestamp = 180,
+-- sep185_sep = 185,
+-- localtime = 200,
+-- space = 201,
+--}
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ show = {["*"]=true},
+ formatall = "%X",
+ colortimestamp = true,
+ timestampcolor = {
+ r = 1,
+ g = 1,
+ b = 1,
+ a = 1
+ },
+ space = true,
+ localtime = true,
+ }
+})
+
+Prat:SetModuleOptions(module.name, {
+ name = L["Timestamps"],
+ desc = L["Chat window timestamp options."],
+ type = "group",
+ args = {
+ show = {
+ name = L["Show Timestamp"],
+ desc = L["Toggle showing timestamp for each window."],
+ type = "multiselect",
+ order = 120,
+ values = Prat.HookedFrameList,
+ get = "GetSubValue",
+ set = "SetSubValue"
+ },
+ formatall = {
+ name = L["Format All Timestamps"],
+ desc = L["Set timestamp format (strftime) for all chat windows. See here for more details: http://fin.instinct.org/prat/timestamps/"],
+ type = "input",
+ order = 131,
+ usage = "", },
+ colortimestamp = {
+ name = L["colortimestamp_name"],
+ desc = L["colortimestamp_desc"],
+ type = "toggle", },
+ localtime = {
+ name = L["localtime_name"],
+ desc = L["localtime_desc"],
+ type = "toggle", },
+ space = {
+ name = L["space_name"],
+ desc = L["space_desc"],
+ type = "toggle", },
+ timestampcolor = {
+ name = L["Set Timestamp Color"],
+ desc = L["Sets the color of the timestamp."],
+ type = "color",
+ order = 181,
+ get = "GetColorValue",
+ set = "SetColorValue",
+ disabled = "IsTimestampPlain",
+ },
+ helpheader = {
+ name = "Timestamp Format String Arguments",
+ type = "header",
+ order = 190,
+ },
+ help = {
+ order = 191,
+ name = [[ %A is replaced by national representation of the full weekday name.
+
+ %a is replaced by national representation of the abbreviated weekday
+ name.
+
+ %B is replaced by national representation of the full month name.
+
+ %b is replaced by national representation of the abbreviated month
+ name.
+
+ %C is replaced by (year / 100) as decimal number; single digits are
+ preceded by a zero.
+
+ %c is replaced by national representation of time and date.
+
+ %D is equivalent to ``%m/%d/%y''.
+
+ %d is replaced by the day of the month as a decimal number (01-31).
+
+ %e is replaced by the day of month as a decimal number (1-31); single
+ digits are preceded by a blank.
+
+ %F is equivalent to ``%Y-%m-%d''.
+
+ %G is replaced by a year as a decimal number with century. This year
+ is the one that contains the greater part of the week (Monday as
+ the first day of the week).
+
+ %g is replaced by the same year as in ``%G'', but as a decimal number
+ without century (00-99).
+
+ %H is replaced by the hour (24-hour clock) as a decimal number
+ (00-23).
+
+ %h the same as %b.
+
+ %I is replaced by the hour (12-hour clock) as a decimal number
+ (01-12).
+
+ %j is replaced by the day of the year as a decimal number (001-366).
+
+ %k is replaced by the hour (24-hour clock) as a decimal number (0-23);
+ single digits are preceded by a blank.
+
+ %l is replaced by the hour (12-hour clock) as a decimal number (1-12);
+ single digits are preceded by a blank.
+
+ %M is replaced by the minute as a decimal number (00-59).
+
+ %m is replaced by the month as a decimal number (01-12).
+
+ %n is replaced by a newline.
+
+ %O* the same as %E*.
+
+ %p is replaced by national representation of either "ante meridiem" or
+ "post meridiem" as appropriate.
+
+ %R is equivalent to ``%H:%M''.
+
+ %r is equivalent to ``%I:%M:%S %p''.
+
+ %S is replaced by the second as a decimal number (00-60).
+
+ %s is replaced by the number of seconds since the Epoch, UTC (see
+ mktime(3)).
+
+ %T is equivalent to ``%H:%M:%S''.
+
+ %t is replaced by a tab.
+
+ %U is replaced by the week number of the year (Sunday as the first day
+ of the week) as a decimal number (00-53).
+
+ %u is replaced by the weekday (Monday as the first day of the week) as
+ a decimal number (1-7).
+
+ %V is replaced by the week number of the year (Monday as the first day
+ of the week) as a decimal number (01-53). If the week containing
+ January 1 has four or more days in the new year, then it is week 1;
+ otherwise it is the last week of the previous year, and the next
+ week is week 1.
+
+ %v is equivalent to ``%e-%b-%Y''.
+
+ %W is replaced by the week number of the year (Monday as the first day
+ of the week) as a decimal number (00-53).
+
+ %w is replaced by the weekday (Sunday as the first day of the week) as
+ a decimal number (0-6).
+
+ %X is replaced by national representation of the time.
+
+ %x is replaced by national representation of the date.
+
+ %Y is replaced by the year with century as a decimal number.
+
+ %y is replaced by the year without century as a decimal number
+ (00-99).
+
+ %Z is replaced by the time zone name.
+
+ %z is replaced by the time zone offset from UTC; a leading plus sign
+ stands for east of UTC, a minus sign for west of UTC, hours and
+ minutes follow with two digits each and no delimiter between them
+ (common form for RFC 822 date headers).
+
+ %+ is replaced by national representation of the date and time (the
+ format is similar to that produced by date(1)).
+
+ %% is replaced by `%'.]],
+
+ type = "description",
+
+
+
+ },
+ },
+})
+
+function module:OnModuleEnable()
+ if self.db.profile.show == nil then
+ self:Debug("DB CORRUPT: show is nil")
+ self.db.profile.show = {}
+ end
+
+ -- For this module to work, it must hook before Prat
+ for _,v in pairs(Prat.HookedFrames) do
+ self:RawHook(v, "AddMessage", true)
+ end
+
+ self.secondsDifference = 0
+ self.lastMinute = select(2, GetGameTime())
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+function module:AddMessage(frame, text, ...)
+ if self.db.profile.show[frame:GetName()] and not Prat.loading then
+ text = text and self:InsertTimeStamp(text, frame)
+ end
+ self.hooks[frame].AddMessage(frame, text, ...)
+end
+
+function module:IsTimestampPlain()
+ return not self.db.profile.colortimestamp
+end
+
+local function Timestamp(text)
+ if not module:IsTimestampPlain() then
+ return Prat.CLR:Colorize(module.db.profile.timestampcolor, text)
+ else
+ return text
+ end
+end
+
+function module:InsertTimeStamp(text, cf)
+ if type(text) == "string" then
+ local space = self.db.profile.space
+ local fmt = self.db.profile.formatall
+
+ if cf and cf:GetJustifyH() == "RIGHT" then
+ text = text..(space and " " or "")..Timestamp(self:GetTime(fmt))
+ else
+ text = Timestamp(self:GetTime(fmt))..(space and " " or "")..text
+ end
+ end
+
+ return text
+end
+
+function module:GetTime(format)
+ if self.db.profile.localtime then
+ return date(format)
+ else
+ local tempDate = date("*t")
+ tempDate["hour"], tempDate["min"] = GetGameTime()
+ -- taken from FuBar_ClockFu
+ if self.lastMinute ~= tempDate["min"] then
+ self.lastMinute = select(2, GetGameTime())
+ self.secondsDifference = mod(time(), 60)
+ end
+ tempDate["sec"] = mod(time() - self.secondsDifference, 60)
+ return date(format, time(tempDate))
+ end
+end
+
+
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/UrlCopy.lua b/modules/UrlCopy.lua
new file mode 100644
index 00000000..2c644203
--- /dev/null
+++ b/modules/UrlCopy.lua
@@ -0,0 +1,691 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2007 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: PratUrlCopy
+Revision: $Revision: 81859 $
+Author(s): Krtek (krtek4@gmail.com)
+Website: http://www.wowace.com/files/index.php?path=Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#UrlCopy
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Module for Prat that makes it easy to copy URLs in chat windows.
+Dependencies: Prat
+]]
+
+Prat:AddModuleToLoad(function()
+
+local PRAT_MODULE = Prat:RequestModuleName("UrlCopy")
+
+if PRAT_MODULE == nil then
+ return
+end
+
+local L = Prat:GetLocalizer({})
+
+L:AddLocale("enUS", {
+ ["UrlCopy"] = true,
+ ["URL formating options."] = true,
+ ["Show Brackets"] = true,
+ ["Toggle showing brackets on and off."] = true,
+ ["Use Popup"] = true,
+ ["Use popup window to show URL."] = true,
+ ["Color URL"] = true,
+ ["Toggle the URL color on and off."] = true,
+ ["Set Color"] = true,
+ ["Change the color of the URL."] = true,
+ ["Toggle"] = true,
+ ["Toggle the module on and off."] = true,
+})
+
+----[[
+-- Chinese Local : CWDG Translation Team 昏睡墨鱼 (Thomas Mo)
+-- CWDG site: http://Cwowaddon.com
+--]]
+--
+--L[LIB.NEWLOCALE](L, "zhCN", function() return {
+-- ["UrlCopy"] = "复制超链接",
+-- ["URL formating options."] = "超链接格式选项.",
+-- ["Show Brackets"] = "显示括号",
+-- ["Toggle showing brackets on and off."] = "切换显示括号功能打开与关闭.",
+-- ["Use Popup"] = "弹出",
+-- ["Use popup window to show URL."] = "用弹出窗口显示超链接.",
+-- ["Color URL"] = "颜色",
+-- ["Toggle the URL color on and off."] = "切换超链接颜色打开与关闭.",
+-- ["Set Color"] = "设置颜色",
+-- ["Change the color of the URL."] = "更改超链接颜色.",
+-- ["Toggle"] = "切换",
+-- ["Toggle the module on and off."] = "切换此模块的打开与关闭.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "zhTW", function() return {
+-- ["UrlCopy"] = "複製超連結",
+-- ["URL formating options."] = "超連結格式選項。",
+-- ["Show Brackets"] = "顯示括號",
+-- ["Toggle showing brackets on and off."] = "切換顯示括號功能。",
+-- ["Use Popup"] = "使用彈出視窗",
+-- ["Use popup window to show URL."] = "用彈出視窗顯示超連結。",
+-- ["Color URL"] = "顏色",
+-- ["Toggle the URL color on and off."] = "切換使用超連結顏色。",
+-- ["Set Color"] = "設定顏色",
+-- ["Change the color of the URL."] = "更改超連結顏色。",
+---- no use anymore ["Toggle"] = true,
+---- no use anymore ["Toggle the module on and off."] = true,
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "koKR", function() return {
+-- ["UrlCopy"] = "URL 복사",
+-- ["URL formating options."] = "URL 형식 설정입니다.",
+-- ["Show Brackets"] = "괄호 표시",
+-- ["Toggle showing brackets on and off."] = "괄호를 표시합니다.",
+-- ["Use Popup"] = "팝업 사용",
+-- ["Use popup window to show URL."] = "URL 표시를 위한 팝업창을 사용합니다.",
+-- ["Color URL"] = "URL 색상",
+-- ["Toggle the URL color on and off."] = "URL에 색상을 사용합니다.",
+-- ["Set Color"] = "색상 설정",
+-- ["Change the color of the URL."] = "URL의 색상을 변경합니다.",
+-- ["Toggle"] = "사용",
+-- ["Toggle the module on and off."] = "기능 사용 여부를 결정합니다.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "esES", function() return {
+-- ["UrlCopy"] = "Copia de URL",
+-- ["URL formating options."] = "Opciones de formato de URL",
+-- ["Show Brackets"] = "Mostrar Par\195\169ntesis",
+-- ["Toggle showing brackets on and off."] = "Determina si se muestran los par\195\169ntesis",
+-- ["Use Popup"] = "Usar Ventana Emergente",
+-- ["Use popup window to show URL."] = "Usa una ventana emergente para mostrar la URL",
+-- ["Color URL"] = "Color del URL",
+-- ["Toggle the URL color on and off."] = "Determina si se colorea la URL",
+-- ["Set Color"] = "Establecer Color",
+-- ["Change the color of the URL."] = "Cambia el color del URL",
+-- ["Toggle"] = "Activar",
+-- ["Toggle the module on and off."] = "Activa y desactiva este m\195\179dulo.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "deDE", function() return {
+-- ["UrlCopy"] = "URL Kopieren",
+-- ["URL formating options."] = "URL Format Optionen",
+-- ["Show Brackets"] = "Zeige Klammern",
+-- ["Toggle showing brackets on and off."] = "Schaltet das Anzeigen von Klammern an und aus.",
+-- ["Use Popup"] = "Benutze Popup",
+-- ["Use popup window to show URL."] = "Benutze Popup Fenster um die URL anzuzeigen.",
+-- ["Color URL"] = "F\195\164rbe URL",
+-- ["Toggle the URL color on and off."] = "Schaltet das einf\195\164rben der URL ein und aus.",
+-- ["Set Color"] = "W\195\164hle Farbe",
+-- ["Change the color of the URL."] = "Farbe der URL \195\164ndern.",
+-- ["Toggle"] = "Einschalten",
+-- ["Toggle the module on and off."] = "Schaltet das Modul an und aus.",
+--} end)
+--
+--L[LIB.NEWLOCALE](L, "frFR", function() return {
+-- ["UrlCopy"] = "Copie des URL",
+-- ["URL formating options."] = "Options d'affichage des URL.",
+-- ["Show Brackets"] = "Crochets",
+-- ["Toggle showing brackets on and off."] = "Affiche/masque les crochets autour de l'URL",
+-- ["Use Popup"] = "Fen\195\170tre flottante",
+-- ["Use popup window to show URL."] = "Affiche l'URL dans une fen\195\170tre flottante.",
+-- ["Color URL"] = "Colorer l'URL",
+-- ["Toggle the URL color on and off."] = "Affiche ou non l'URL en couleur.",
+-- ["Set Color"] = "Couleur",
+-- ["Change the color of the URL."] = "Change la couleur de l'URL.",
+--} end)
+
+
+local module = Prat:NewModule(PRAT_MODULE)
+
+Prat:SetModuleDefaults(module.name, {
+ profile = {
+ on = true,
+ bracket = true,
+ popup = true,
+ colorurl = true,
+ color = {
+ r = 1,
+ g = 1,
+ b = 1,
+ a = 1
+ },
+ }
+})
+
+do
+ local function Link(...)
+ return module:Link(...)
+ end
+ local function LinkwTLD(...)
+ return module:LinkwTLD(...)
+ end
+ local function Skip(...)
+ return module:Skip(...)
+ end
+
+ Prat:SetModulePatterns(module, {
+ -- X://Y url
+ { pattern = "^(%a[%w+.-]+://%S+)", matchfunc=Link},
+ { pattern = "%f[%S](%a[%w+.-]+://%S+)", matchfunc=Link},
+ -- www.X.Y url
+ { pattern = "^(www%.[%w_-%%]+%.%S+)", matchfunc=Link},
+ { pattern = "%f[%S](www%.[%w_-%%]+%.%S+)", matchfunc=Link},
+ -- "W X"@Y.Z email (this is seriously a valid email)
+ { pattern = '^(%"[^%"]+%"@[%w_.-%%]+%.(%a%a+))', matchfunc=LinkwTLD},
+ { pattern = '%f[%S](%"[^%"]+%"@[%w_.-%%]+%.(%a%a+))', matchfunc=LinkwTLD},
+ -- X@Y.Z email
+ { pattern = "(%S+@[%w_.-%%]+%.(%a%a+))", matchfunc=LinkwTLD},
+ -- XXX.YYY.ZZZ.WWW:VVVV/UUUUU IPv4 address with port and path
+ { pattern = "^([0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d:[0-6]?%d?%d?%d?%d/%S+)", matchfunc=Link},
+ { pattern = "%f[%S]([0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d:[0-6]?%d?%d?%d?%d/%S+)", matchfunc=Link},
+ -- XXX.YYY.ZZZ.WWW:VVVV IPv4 address with port (IP of ts server for example)
+ { pattern = "^([0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d:[0-6]?%d?%d?%d?%d)%f[%D]", matchfunc=Link},
+ { pattern = "%f[%S]([0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d:[0-6]?%d?%d?%d?%d)%f[%D]", matchfunc=Link},
+ -- XXX.YYY.ZZZ.WWW/VVVVV IPv4 address with path
+ { pattern = "^([0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%/%S+)", matchfunc=Link},
+ { pattern = "%f[%S]([0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%/%S+)", matchfunc=Link},
+ -- XXX.YYY.ZZZ.WWW IPv4 address
+ { pattern = "^([0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%)%f[%D]", matchfunc=Link},
+ { pattern = "%f[%S]([0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%.[0-2]?%d?%d%)%f[%D]", matchfunc=Link},
+ -- X.Y.Z:WWWW/VVVVV url with port and path
+ { pattern = "^([%w_.-%%]+[%w_-%%]%.(%a%a+):[0-6]?%d?%d?%d?%d/%S+)", matchfunc=LinkwTLD},
+ { pattern = "%f[%S]([%w_.-%%]+[%w_-%%]%.(%a%a+):[0-6]?%d?%d?%d?%d/%S+)", matchfunc=LinkwTLD},
+ -- X.Y.Z:WWWW url with port (ts server for example)
+ { pattern = "^([%w_.-%%]+[%w_-%%]%.(%a%a+):[0-6]?%d?%d?%d?%d)%f[%D]", matchfunc=LinkwTLD},
+ { pattern = "%f[%S]([%w_.-%%]+[%w_-%%]%.(%a%a+):[0-6]?%d?%d?%d?%d)%f[%D]", matchfunc=LinkwTLD},
+ -- X.Y.Z/WWWWW url with path
+ { pattern = "^([%w_.-%%]+[%w_-%%]%.(%a%a+)/%S+)", matchfunc=LinkwTLD},
+ { pattern = "%f[%S]([%w_.-%%]+[%w_-%%]%.(%a%a+)/%S+)", matchfunc=LinkwTLD},
+ -- X.Y.Z url
+ { pattern = "^([%w_.-%%]+[%w_-%%]%.(%a%a+))", matchfunc=LinkwTLD},
+ { pattern = "%f[%S]([%w_.-%%]+[%w_-%%]%.(%a%a+))", matchfunc=LinkwTLD},
+ })
+end
+
+module.tlds = {
+ONION = true,
+-- Copied from http://data.iana.org/TLD/tlds-alpha-by-domain.txt
+--# Version 2008020401, Last Updated Tue Feb 5 09:07:01 2008 UTC
+AC = true,
+AD = true,
+AE = true,
+AERO = true,
+AF = true,
+AG = true,
+AI = true,
+AL = true,
+AM = true,
+AN = true,
+AO = true,
+AQ = true,
+AR = true,
+ARPA = true,
+AS = true,
+ASIA = true,
+AT = true,
+AU = true,
+AW = true,
+AX = true,
+AZ = true,
+BA = true,
+BB = true,
+BD = true,
+BE = true,
+BF = true,
+BG = true,
+BH = true,
+BI = true,
+BIZ = true,
+BJ = true,
+BM = true,
+BN = true,
+BO = true,
+BR = true,
+BS = true,
+BT = true,
+BV = true,
+BW = true,
+BY = true,
+BZ = true,
+CA = true,
+CAT = true,
+CC = true,
+CD = true,
+CF = true,
+CG = true,
+CH = true,
+CI = true,
+CK = true,
+CL = true,
+CM = true,
+CN = true,
+CO = true,
+COM = true,
+COOP = true,
+CR = true,
+CU = true,
+CV = true,
+CX = true,
+CY = true,
+CZ = true,
+DE = true,
+DJ = true,
+DK = true,
+DM = true,
+DO = true,
+DZ = true,
+EC = true,
+EDU = true,
+EE = true,
+EG = true,
+ER = true,
+ES = true,
+ET = true,
+EU = true,
+FI = true,
+FJ = true,
+FK = true,
+FM = true,
+FO = true,
+FR = true,
+GA = true,
+GB = true,
+GD = true,
+GE = true,
+GF = true,
+GG = true,
+GH = true,
+GI = true,
+GL = true,
+GM = true,
+GN = true,
+GOV = true,
+GP = true,
+GQ = true,
+GR = true,
+GS = true,
+GT = true,
+GU = true,
+GW = true,
+GY = true,
+HK = true,
+HM = true,
+HN = true,
+HR = true,
+HT = true,
+HU = true,
+ID = true,
+IE = true,
+IL = true,
+IM = true,
+IN = true,
+INFO = true,
+INT = true,
+IO = true,
+IQ = true,
+IR = true,
+IS = true,
+IT = true,
+JE = true,
+JM = true,
+JO = true,
+JOBS = true,
+JP = true,
+KE = true,
+KG = true,
+KH = true,
+KI = true,
+KM = true,
+KN = true,
+KP = true,
+KR = true,
+KW = true,
+KY = true,
+KZ = true,
+LA = true,
+LB = true,
+LC = true,
+LI = true,
+LK = true,
+LR = true,
+LS = true,
+LT = true,
+LU = true,
+LV = true,
+LY = true,
+MA = true,
+MC = true,
+MD = true,
+ME = true,
+MG = true,
+MH = true,
+MIL = true,
+MK = true,
+ML = true,
+MM = true,
+MN = true,
+MO = true,
+MOBI = true,
+MP = true,
+MQ = true,
+MR = true,
+MS = true,
+MT = true,
+MU = true,
+MUSEUM = true,
+MV = true,
+MW = true,
+MX = true,
+MY = true,
+MZ = true,
+NA = true,
+NAME = true,
+NC = true,
+NE = true,
+NET = true,
+NF = true,
+NG = true,
+NI = true,
+NL = true,
+NO = true,
+NP = true,
+NR = true,
+NU = true,
+NZ = true,
+OM = true,
+ORG = true,
+PA = true,
+PE = true,
+PF = true,
+PG = true,
+PH = true,
+PK = true,
+PL = true,
+PM = true,
+PN = true,
+PR = true,
+PRO = true,
+PS = true,
+PT = true,
+PW = true,
+PY = true,
+QA = true,
+RE = true,
+RO = true,
+RS = true,
+RU = true,
+RW = true,
+SA = true,
+SB = true,
+SC = true,
+SD = true,
+SE = true,
+SG = true,
+SH = true,
+SI = true,
+SJ = true,
+SK = true,
+SL = true,
+SM = true,
+SN = true,
+SO = true,
+SR = true,
+ST = true,
+SU = true,
+SV = true,
+SY = true,
+SZ = true,
+TC = true,
+TD = true,
+TEL = true,
+TF = true,
+TG = true,
+TH = true,
+TJ = true,
+TK = true,
+TL = true,
+TM = true,
+TN = true,
+TO = true,
+TP = true,
+TR = true,
+TRAVEL = true,
+TT = true,
+TV = true,
+TW = true,
+TZ = true,
+UA = true,
+UG = true,
+UK = true,
+UM = true,
+US = true,
+UY = true,
+UZ = true,
+VA = true,
+VC = true,
+VE = true,
+VG = true,
+VI = true,
+VN = true,
+VU = true,
+WF = true,
+WS = true,
+YE = true,
+YT = true,
+YU = true,
+ZA = true,
+ZM = true,
+ZW = true,
+}
+
+--[[
+XN--0ZWM56D = true,
+XN--11B5BS3A9AJ6G = true,
+XN--80AKHBYKNJ4F = true,
+XN--9T4B11YI5A = true,
+XN--DEBA0AD = true,
+XN--G6W251D = true,
+XN--HGBK6AJ7F53BBA = true,
+XN--HLCJ6AYA9ESC7A = true,
+XN--JXALPDLP = true,
+XN--KGBECHTV = true,
+XN--ZCKZAH = true,
+]]
+
+Prat:SetModuleOptions(module, {
+ name = L["UrlCopy"],
+ desc = L["URL formating options."],
+ type = "group",
+ args = {
+ bracket = {
+ name = L["Show Brackets"],
+ desc = L["Toggle showing brackets on and off."],
+ type = "toggle",
+ order = 160, },
+ popup = {
+ name = L["Use Popup"],
+ desc = L["Use popup window to show URL."],
+ type = "toggle",
+ order = 170, },
+ colorurl = {
+ name = L["Color URL"],
+ desc = L["Toggle the URL color on and off."],
+ type = "toggle",
+ order = 180, },
+ color = {
+ name = L["Set Color"],
+ desc = L["Change the color of the URL."],
+ type = "color",
+ order = 190,
+ get = "GetColorValue",
+ set = "SetColorValue",
+ disabled = "IsSetColorDisabled",
+ },
+ }
+ }
+)
+
+function module:IsSetColorDisabled()
+ if not self.db.profile.colorurl then
+ return true
+ end
+ return false
+end
+
+function module:OnModuleEnable()
+ Prat.RegisterLinkType( { linkid="url", linkfunc=module.Url_Link, handler=module }, module.name)
+end
+
+function module:OnModuleDisable()
+ Prat.UnregisterAllLinkTypes(self)
+end
+
+--module.IWIN = "|cff9d9d9d|Hitem:18230:0:0:0:0:0:0:1763172530|h[Broken I.W.I.N. Button]|h|r"
+
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+
+function module:Url_Link(link, text, button, ...)
+ self:ShowUrl(link)
+ return false
+end
+
+do
+ local function NOP() return end
+
+ function module:StaticPopupUrl(link)
+ StaticPopupDialogs["SHOW_URL"] = StaticPopupDialogs["SHOW_URL"] or {
+ text = "URL : %s",
+ button2 = ACCEPT,
+ hasEditBox = 1,
+ hasWideEditBox = 1,
+
+ OnShow = function(...)
+ this:SetWidth(420)
+
+ local editBox = getglobal(this:GetName().."WideEditBox")
+ editBox:SetText(StaticPopupDialogs["SHOW_URL"].urltext)
+ editBox:SetFocus()
+ editBox:HighlightText(0)
+
+ local button = getglobal(this:GetName().."Button2")
+ button:ClearAllPoints()
+ button:SetWidth(200)
+ button:SetPoint("CENTER", editBox, "CENTER", 0, -30)
+ end,
+
+ OnHide = NOP,
+ OnAccept = NOP,
+ OnCancel = NOP,
+ EditBoxOnEscapePressed = function(...) this:GetParent():Hide() end,
+ timeout = 0,
+ whileDead = 1,
+ hideOnEscape = 1
+ }
+
+ StaticPopupDialogs["SHOW_URL"].urltext = link
+ StaticPopup_Show("SHOW_URL", link)
+ end
+end
+
+
+function module:EditBoxUrl(link)
+ if (not ChatFrameEditBox:IsShown()) then
+ ChatFrame_OpenChat(link, DEFAULT_CHAT_FRAME)
+ else
+ ChatFrameEditBox:Insert(link)
+ end
+end
+
+function module:ShowUrl(link)
+ link = strsub(link, 5)
+ if ( self.db.profile.popup ) then
+ self:StaticPopupUrl(link)
+ else
+ self:EditBoxUrl(link)
+ end
+end
+
+
+-- Utility Function (called by gsub)
+function module:RawLink(link)
+ local returnedLink = ""
+
+ if self.db.profile.colorurl then
+ local c = self.db.profile.color
+ local color = string.format("%02x%02x%02x", c.r*255, c.g*255, c.b*255)
+ returnedLink = "|cff" .. color
+ end
+
+ link = link:gsub('%%', '%%%%')
+
+ returnedLink = returnedLink .. "|Hurl:" .. link .. "|h"
+
+ if ( self.db.profile.bracket ) then
+ returnedLink = returnedLink .. "[" .. link .. "]"
+ else
+ returnedLink = returnedLink .. link
+ end
+
+ returnedLink = returnedLink .. "|h|r"
+
+ return returnedLink
+end
+
+function module:Link(link, ...)
+ if link == nil then
+ return ""
+ end
+
+ return self:AddLink(self:RawLink(link))
+end
+
+function module:LinkwTLD(link, tld, ...)
+ if link == nil or tld == nil then
+ return ""
+ end
+
+ if self.tlds[tld:upper()] then
+ link = self:RawLink(link)
+ end
+
+ return self:AddLink(link)
+end
+
+function module:Skip(link, ...)
+ if link == nil then
+ return ""
+ end
+
+ return self:AddLink(link)
+end
+
+
+function module:AddLink(link)
+ return Prat:RegisterMatch(link)
+end
+
+
+ return
+end ) -- Prat:AddModuleToLoad
\ No newline at end of file
diff --git a/modules/highcpu.xml b/modules/highcpu.xml
new file mode 100644
index 00000000..f93e3926
--- /dev/null
+++ b/modules/highcpu.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
diff --git a/modules/includes.xml b/modules/includes.xml
new file mode 100644
index 00000000..03d5dcfe
--- /dev/null
+++ b/modules/includes.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/ldb.lua b/modules/ldb.lua
new file mode 100644
index 00000000..9f69c063
--- /dev/null
+++ b/modules/ldb.lua
@@ -0,0 +1,13 @@
+tinsert(Prat.EnableTasks, function(self)
+ if not LibStub:GetLibrary("LibDataBroker-1.1", true) then return end
+ LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("Prat", {
+ type = "launcher",
+ icon = "Interface\\Addons\\"..Prat.FolderLocation.."\\textures\\chat-bubble",
+ OnClick = function(frame, button)
+ LibStub("AceConfigDialog-3.0"):Open("Prat")
+ end,
+ OnTooltipShow = function(tooltip)
+ tooltip:AddLine("Prat 3.0 (Alpha)")
+ end,
+ })
+end)
diff --git a/pullouts/Prat-3.0_Debug/Prat-3.0_Debug.toc b/pullouts/Prat-3.0_Debug/Prat-3.0_Debug.toc
new file mode 100644
index 00000000..4a6a7ab3
--- /dev/null
+++ b/pullouts/Prat-3.0_Debug/Prat-3.0_Debug.toc
@@ -0,0 +1,8 @@
+## Interface: 30000
+## Title: Prat |cff8080ff3.0|r |r[|cffeda55fDebug|r]
+## RequiredDeps: Prat-3.0
+## Author: Prat Development Team
+## X-License: GPLv2
+## DefaultState: enabled
+
+..\Prat-3.0\debug\includes.xml
\ No newline at end of file
diff --git a/pullouts/Prat-3.0_HighCPUUsageModules/Prat-3.0_HighCPUUsageModules.toc b/pullouts/Prat-3.0_HighCPUUsageModules/Prat-3.0_HighCPUUsageModules.toc
new file mode 100644
index 00000000..e3625385
--- /dev/null
+++ b/pullouts/Prat-3.0_HighCPUUsageModules/Prat-3.0_HighCPUUsageModules.toc
@@ -0,0 +1,8 @@
+## Interface: 30000
+## Title: Prat |cff8080ff3.0|r |r[|cffeda55fHighCPUUsageModules|r]
+## RequiredDeps: Prat-3.0
+## Author: Prat Development Team
+## X-License: GPLv2
+## DefaultState: enabled
+
+includes.xml
\ No newline at end of file
diff --git a/pullouts/Prat-3.0_HighCPUUsageModules/includes.xml b/pullouts/Prat-3.0_HighCPUUsageModules/includes.xml
new file mode 100644
index 00000000..c751b49a
--- /dev/null
+++ b/pullouts/Prat-3.0_HighCPUUsageModules/includes.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
diff --git a/samples/blank-module.lua b/samples/blank-module.lua
new file mode 100644
index 00000000..b26493bb
--- /dev/null
+++ b/samples/blank-module.lua
@@ -0,0 +1,212 @@
+--[[ blank-module.lua
+ ----------------
+
+This file is meant to be a skeleton containing the most basic elements
+required for all Prat 2 modules which can be used as a template.
+
+The following strings are used through the file and should be replaced
+with the relevant information:
+
+ @@ = ModuleName -- eg, ExampleModule or AddonMsgs or Whatever
+ ## = Description -- eg, "An blank example module file for Prat 2.0."
+ %% = revision number -- eg, 22222
+
+Other variables that need to be set have been marked by the following
+on a line by itself:
+
+-- !!
+
+For more resources on Prat, its modules, and Acey type stuff, have a
+look at some of this page:
+
+ - http://groups.google.com/group/wow-prat/web/prat-resources
+
+Cheers!
+
+ - Fin // fin@instinct.org
+]]
+
+-- !!
+--[[
+Name: Prat_@@
+Revision: $Revision: %%$
+-- !!
+Your Name (youremail@example.com)
+Author(s): (..@..)
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat/Integrated_Modules#@@
+Subversion: http://svn.wowace.com/wowace/trunk/Prat/
+Discussions: http://groups.google.com/group/wow-prat
+Issues and feature requests: http://code.google.com/p/prat/issues/list
+Description: ## (default=off).
+Dependencies: Prat
+]]
+
+-- Get Utility Libraries
+local util, DBG, CLR = GetPratUtils()
+
+-- set prat module name
+local PRAT_MODULE = Prat:RequestModuleName("@@")
+
+-- define localized strings
+local L = PRAT_LIBRARY(PRATLIB.LOCALIZATION):new(PRAT_MODULE)
+
+L:RegisterTranslations("enUS", function() return {
+ ["@@"] = true,
+ ["##"] = true,
+
+ --[[
+ text strings used by the toggleOptions' show{} handler
+ NB: other handlers may also generate text needing translations added
+ ]]
+-- ["show_name"] = "Show @@", -- example with defaultDB entries below
+-- ["show_desc"] = "Toggle Prat_@@.", -- commented out
+
+ --[[
+ text strings used by the toggleOptions' show{} handler
+ NB: %d replaced with the Frame Name
+ ]]
+-- ["show_perframename"] = "Chat%d@@MsgsShow",
+-- ["show_perframedesc"] = "Toggle showing addon messages for chat window %d.",
+ } end)
+
+--[[
+ translations for various locales here - typically including
+ deDE, frFR, esES, koKR, zhCN, zhTW; must include an entry for each
+ text string listed for enUS, eg:
+
+L:RegisterTranslations("deDE", function() return {
+ -- !!
+ ["@@"] = true,
+ ["##"] = true,
+ } end)
+]]
+L:RegisterTranslations("zhCN", function() return {
+ ["@@"] = "@@",
+ ["##"] = "##",
+ } end)
+
+
+
+-- create Prat module
+Prat_@@ = Prat:NewModule(PRAT_MODULE)
+Prat_@@.revision = tonumber(string.sub("$Revision: 79217 $", 12, -3))
+
+-- define key module values
+Prat_@@.moduleName = L["@@"] -- module name, eg "ExampleMod"
+-- !!
+Prat_@@.moduleDesc = L["##"] -- module description, eg "An example of a Prat 2 mod"
+
+Prat_@@.consoleName = string.lower(Prat_@@.moduleName)
+Prat_@@.guiName = Prat_@@.moduleName
+
+-- categories the module is related to, eg "{ cat.TEXT, cat.INFO }"
+-- list here: http://groups-beta.google.com/group/wow-prat/web/prat-categories
+-- !!
+Prat_@@.Categories = { }
+
+-- init moduleOoptions (populated by the other various options tables below)
+Prat_@@.moduleOptions = {}
+
+-- default values for any settings that need them
+-- !!
+Prat_@@.defaultDB = {
+ on = false, -- this value tracks if the module should be on or off,
+ -- an option 'toggle' is automatically created so you can
+ -- set this value
+ }
+
+
+-- any boolean options
+Prat_@@.toggleOptions = {
+ --[[
+ NB: for each key name, you must have two corresponding local
+ entries for the key name and description:
+
+ key_name
+ key_desc
+
+ eg, with an entry of:
+
+ cheesy = true,
+
+ You would then need to add the two entries shown below:
+
+ L:RegisterTranslations("enUS", function() return {
+ ...
+ ["cheesy_name"] = "Cheesy",
+ ["cheesy_desc"] = "Whether the addon exudes an aura of cheese, or not.",
+ ...
+ } end)
+ ]]
+ }
+
+function Prat_@@:GetModuleOptions()
+ self.moduleOptions = {
+ name = self.moduleName,
+ desc = self.moduleDesc,
+ type = "group",
+ args = {
+ --[[
+ table of possible arguments to the slash command and for the FuBar menu;
+ see here for more details on valid entries:
+
+ - http://www.wowace.com/wiki/AceConsole-2.0
+ - http://www.wowace.com/wiki/AceOptions_data_table
+ ]]
+
+ --[[ eg:
+
+ test = {
+ name = L["Test setting"], -- used in tooltip and generated help
+ desc = L["To test assigning a value to an option."], -- used in tooltip and generated help
+ type = "text", -- type of argument (eg, group, toggle
+ order = 99, -- order when displaying list of args
+ usage = L["test "], -- text to to display if no values given
+
+ get = function() return self.db.profile.test end, -- function to return the current value
+ set = function(v) self.db.profile.test = v end, -- function to set this argument's value
+ },
+ ]]
+ }
+ }
+
+ return self.moduleOptions
+end
+
+--[[------------------------------------------------
+ Module Event Functions
+------------------------------------------------]]--
+
+-- things to do when the module is enabled
+function Prat_@@:OnModuleEnable()
+ -- register events
+ -- !!
+ self:RegisterEvent("")
+
+ -- hook functions
+ -- !!
+ self:SecureHook("")
+
+ -- !!
+ -- register slash commands if wanted
+ local slashcmds = {
+ -- eg: "/testmodule", "/testm"
+ }
+
+ if slashcmds then
+ Prat:RegisterChatCommand(slashcmds, self.moduleOptions, string.upper(self.moduleName))
+ end
+end
+
+-- things to do when the module is disabled
+function Prat_@@:OnModuleDisable()
+ -- unregister events
+ self:UnregisterAllEvents()
+end
+
+--[[------------------------------------------------
+ Core Functions
+------------------------------------------------]]--
+
+-- things do stuff here
diff --git a/samples/no-dependency.lua b/samples/no-dependency.lua
new file mode 100644
index 00000000..0b841661
--- /dev/null
+++ b/samples/no-dependency.lua
@@ -0,0 +1,26 @@
+--
+-- How to handle a Prat event without a dependency on Prat, or anything else.
+--
+
+local eventLibrary
+local NoDepAddon = {}
+
+function NoDepAddon:RegisterForAPratEvent()
+ if not eventLibrary then
+ eventLibrary = AceLibrary and AceLibrary:HasInstance("AceEvent-2.0") and AceLibrary("AceEvent-2.0") or nil
+ end
+
+ if eventLibrary then
+ eventLibrary:RegisterEvent("Prat_FrameMessage", function(...) NoDepAddon:Prat_FrameMessage(...) end )
+ eventLibrary:RegisterEvent("Prat_PreAddMessage", function(...) NoDepAddon:Prat_PreAddMessage(...) end )
+ end
+end
+
+function NoDepAddon:Prat_FrameMessage(message, frame, event)
+
+end
+
+
+function NoDepAddon:Prat_PreAddMessage(message, frame, event, text, r, g, b, id)
+
+end
\ No newline at end of file
diff --git a/services/chatsections.lua b/services/chatsections.lua
new file mode 100644
index 00000000..ab80af2e
--- /dev/null
+++ b/services/chatsections.lua
@@ -0,0 +1,429 @@
+--[[
+Name: Prat 3.0 (chatsections.lua)
+Revision: $Revision: 79217 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Implements the chat string sectioning service
+]]
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local LibStub = LibStub
+
+local setmetatable = setmetatable
+local pairs, ipairs = pairs, ipairs
+local tinsert, tremove, tconcat = table.insert, table.remove, table.concat
+local string = string
+local strsub = string.sub
+local strsplit = strsplit
+local tonumber, tostring = tonumber, tostring
+local strlower = strlower
+local strlen = strlen
+local type = type
+local next = next
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+
+-- This is the structure of the chat message once it is split
+-- section delimiters are uppercase inside and lower case outside
+-- ie. cC CHANNEL Cc = [ channame ]
+SplitMessageSrc = { -- todo, incidicate which module uses which field, and remove unused fields
+ PRE = "",
+
+ nN = "",
+ CHANLINK = "",
+ NN = "",
+
+ cC = "",
+ CHANNELNUM = "",
+ CC = "",
+ CHANNEL = "",
+ zZ = "",
+ ZONE = "",
+ Zz = "",
+ Cc = "",
+
+ TYPEPREFIX = "",
+
+ Nn = "",
+
+ fF = "",
+ FLAG = "",
+ Ff = "",
+
+ pP = "",
+ lL = "", -- link start
+ PLAYERLINK= "",
+ PLAYERLINKDATA = "",
+ LL = "", -- link text start
+ PLAYER = "",
+
+ sS = "",
+ SERVER = "",
+ Ss = "",
+ Ll = "", -- link text end
+ Pp = "",
+
+ TYPEPOSTFIX = "",
+
+ mM = "",
+ gG = "",
+ LANGUAGE = "",
+ Gg = "",
+ MESSAGE = "",
+ Mm = "",
+
+ POST = "",
+}
+
+SplitMessageIdx = {
+ "PRE",
+ "nN",
+ "CHANLINK",
+ "NN",
+ "cC",
+ "CHANNELNUM",
+ "CC",
+ "CHANNEL",
+-- Zone is not usually included
+-- "zZ",
+-- "ZONE",
+-- "Zz",
+
+ "Cc",
+ "TYPEPREFIX",
+ "Nn",
+
+ "fF",
+ "FLAG",
+ "Ff",
+ "pP",
+ "lL",
+ "PLAYERLINK",
+ "PLAYERLINKDATA",
+ "LL",
+ "PLAYER",
+ "sS",
+ "SERVER",
+ "Ss",
+ "Ll",
+ "Pp",
+ "TYPEPOSTFIX",
+ "mM",
+ "gG",
+ "LANGUAGE",
+ "Gg",
+ "MESSAGE",
+ "Mm",
+ "POST",
+}
+
+SplitMessage = {}
+SplitMessageOrg = {}
+
+SplitMessageOut = {
+ MESSAGE = "",
+ TYPE = "",
+ TARGET = "",
+ CHANNEL = "",
+ LANGUAGE = "",
+}
+
+setmetatable(SplitMessageOrg, { __index="" })
+setmetatable(SplitMessageOut, { __index="" })
+
+setmetatable(SplitMessage, { __index=SplitMessageOrg })
+
+
+do
+ local t = {}
+ function BuildChatText(message, index)
+ local index = index or SplitMessageIdx --todo
+ local s = message
+
+ for k in pairs(t) do
+ t[k] = nil
+ end
+
+ for i,v in ipairs(index) do
+ tinsert(t, s[v])
+ end
+
+ return tconcat(t, "")
+ end
+end
+
+function RegisterMessageItem(itemname, anchorvar, relativepos)
+ --[[ RegisterMessageItem:
+
+ API to allow other modules to inject new items into the components
+ making up a chat message. Primarily intended to help resolve
+ conflicts between modules.
+
+ - itemname = name of the variable to be injected
+
+ - aftervar = the position in the chat message after which the item
+ will be displayed
+
+ - relativepos = "before" or "after"
+ Leave aftervar blank to position the item at the beginning of the list.
+
+ If you would like to change the item's position in the chat message,
+ call :RegisterMessageItem() again with a different value for aftervar.
+
+ Example:
+ --------
+
+ The mod Prat_ExampleMod counts the number of times people
+ say the word "Example" and you would like to display the count
+ for a player before their name in a chat message. Default chat
+ message structure contains:
+
+ ... cC CHANNEL Cc .. pP PLAYER Pp ...
+
+ This means that the module should use the following:
+
+ RegisterMessageItem('NUMEXAMPLES', 'Cc')
+
+ Which would then alter the structure of chat messages to be:
+
+ .. CHANNEL Cc .. NUMEXAMPLES .. pP PLAYER ...
+
+]]
+
+ local pos = 1
+
+ if SplitMessageSrc[itemname] then
+-- ResetSeparators(itemname)
+
+ local oldpos = GetMessageItemIdx(itemname)
+
+ if oldpos ~= 0 then
+ tremove(SplitMessageIdx, oldpos)
+ end
+ end
+
+ if anchorvar then
+ pos = GetMessageItemIdx(anchorvar) + (relativepos == "before" and 0 or 1)
+ end
+
+ tinsert(SplitMessageIdx, pos, itemname)
+ SplitMessageSrc[itemname] = ""
+end
+
+
+function GetMessageItemIdx(itemname)
+ for i, v in ipairs(SplitMessageIdx) do
+ if v == itemname then
+ return i
+ end
+ end
+
+ return 0
+end
+
+
+function ClearChatSections(message)
+ for k,v in pairs(message) do
+ message[k] = SplitMessageSrc[k] and nil
+ end
+end
+
+local function safestr(s) return s or "" end
+
+function SplitChatMessage(frame, event, ...)
+ local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12 = ...
+
+ ClearChatSections(SplitMessageOrg)
+ ClearChatSections(SplitMessage)
+
+ if ( strsub((event or ""), 1, 8) == "CHAT_MSG" ) then
+ local type = strsub(event, 10)
+ local info = _G.ChatTypeInfo[type]
+
+ local filter, newarg1 = false
+ local chatFilters = _G.ChatFrame_GetMessageEventFilters and _G.ChatFrame_GetMessageEventFilters(event)
+ local newarg1
+
+ if chatFilters then
+ for _, filterFunc in next, chatFilters do
+ filter, newarg1 = filterFunc(arg1)
+ arg1 = newarg1 or arg1
+ if filter then
+ return true
+ end
+ end
+ end
+
+ local s = SplitMessageOrg
+
+ s.CHATTYPE = type
+
+ s.MESSAGE = safestr(arg1)
+
+ local chatget = _G["CHAT_"..type.."_GET"]
+ if chatget then
+ s.TYPEPREFIX, s.TYPEPOSTFIX = string.match(_G.TEXT(chatget), "(.*)%%s(.*)")
+ end
+
+ s.TYPEPOSTFIX = safestr(s.TYPEPOSTFIX)
+ s.TYPEPREFIX = safestr(s.TYPEPREFIX)
+
+ local arg2 = safestr(arg2)
+ if strlen(arg2) > 0 then
+
+ if ( strsub(type, 1, 7) == "MONSTER" or type == "RAID_BOSS_EMOTE" ) then
+ -- no link
+ else
+ local plr, svr = strsplit("-", arg2)
+
+ s.pP = "["
+ s.lL = "|Hplayer:"
+ s.PLAYERLINK = arg2
+ s.LL = "|h"
+ s.PLAYER = plr
+
+ if svr and strlen(svr) > 0 then
+ s.sS = "-"
+ s.SERVER = svr
+ end
+
+ if arg11 then
+ s.PLAYERLINKDATA = ":"..safestr(arg11)
+ end
+
+ s.Ll = "|h"
+ s.Pp = "]"
+ end
+ end
+
+ local arg6 = safestr(arg6)
+ if strlen(arg6) > 0 then
+ s.fF = ""
+
+ -- 2.4 Change
+ if arg6 == "GM" then
+ s.FLAG = "|TInterface\\ChatFrame\\UI-ChatIcon-Blizz.blp:18:12:0:-1|t "
+ else
+ s.FLAG = _G["CHAT_FLAG_"..arg6]
+ end
+
+ s.Ff = ""
+ end
+
+ local arg3 = safestr(arg3)
+ if ( (strlen(arg3) > 0) and (arg3 ~= "Universal") and (arg3 ~= frame.defaultLanguage) ) then
+ s.gG = "["
+ s.LANGUAGE = arg3
+ s.Gg = "] "
+ else
+ s.LANGUAGE_NOSHOW = arg3
+ end
+
+ local arg9 = safestr(arg9)
+ if strlen(arg9) > 0 then
+ local bracket, post_bracket = string.match(s.TYPEPREFIX, "%[(.*)%](.*)")
+ bracket = safestr(bracket)
+ if strlen(bracket) > 0 then
+ s.cC = "["
+ s.Cc = "]"
+ s.CHANNEL = bracket
+ s.TYPEPREFIX = safestr(post_bracket)
+ end
+
+ if strlen(safestr(arg8)) > 0 and arg8 > 0 then
+ s.CHANNELNUM = tostring(arg8)
+ s.CC = ". "
+ end
+
+ if arg7 > 0 then
+ s.cC = "["
+ s.Cc = "] "
+ s.CHANNEL, s.zZ, s.ZONE = string.match(arg9, "(.*)(%s%-%s)(.*)")
+
+ if s.CHANNEL == nil then
+ s.CHANNEL = arg9
+ end
+
+ s.CHANNEL = safestr(s.CHANNEL)
+ s.zZ = safestr(s.zZ)
+ s.ZONE = safestr(s.ZONE)
+ s.Zz = ""
+ else
+ if strlen(arg9) > 0 then
+ s.CHANNEL = arg9
+ s.cC = "["
+ s.Cc = "] "
+ end
+ end
+ end
+
+ local _, fontHeight = _G.GetChatWindowInfo(frame:GetID());
+
+ if ( fontHeight == 0 ) then
+ --fontHeight will be 0 if it's still at the default (14)
+ fontHeight = 14;
+ end
+
+ local arg7 = tonumber(arg7)
+ -- 2.4
+ -- Search for icon links and replace them with texture links.
+ if arg7 and ( (arg7 < 1) or ( arg7 >= 1 and showChatIcons ) ) then
+ local term;
+ for tag in string.gmatch(arg1, "%b{}") do
+ term = strlower(string.gsub(tag, "[{}]", ""));
+ if ( _G.ICON_TAG_LIST[term] and _G.ICON_LIST[_G.ICON_TAG_LIST[term]] ) then
+ s.MESSAGE = string.gsub(s.MESSAGE , tag, _G.ICON_LIST[_G.ICON_TAG_LIST[term]] .. "0|t");
+--
+-- This would allow for ignoring unknown icon tags
+--
+-- else
+-- s.MESSAGE = string.gsub(s.MESSAGE, tag, "");
+ end
+ end
+ end
+
+ if type == "SYSTEM" or strsub(type,1,11) == "ACHIEVEMENT" or strsub(type,1,18) == "GUILD_ACHIEVEMENT" then
+ local pl, p, rest = string.match(s.MESSAGE, "|Hplayer:(.-)|h%[(.-)%]|h(.+)")
+ if pl and p then
+ local plr, svr = strsplit("-", pl)
+ s.pP = "["
+ s.lL = "|Hplayer:"
+ s.PLAYERLINK = pl
+ s.LL = "|h"
+ s.PLAYER = plr
+ s.Ll = "|h"
+ s.Pp = "]"
+ s.MESSAGE = rest
+
+ if svr and strlen(svr) > 0 then
+ s.sS = "-"
+ s.SERVER = svr
+ end
+
+ if arg11 then
+ s.PLAYERLINKDATA = ":"..safestr(arg11)
+ end
+ end
+ end
+
+ s.ORG = SplitMessageOrg
+
+ return SplitMessage, info
+ end
+end
+
+local NULL_INFO = {r = 1.0, g = 1.0, b = 1.0, id = 0 }
+
+
+
diff --git a/services/classcolor.lua b/services/classcolor.lua
new file mode 100644
index 00000000..60ab6632
--- /dev/null
+++ b/services/classcolor.lua
@@ -0,0 +1,35 @@
+--[[
+Name: Prat 3.0 (classcolor.lua)
+Revision: $Revision: 79217 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Fixes class data lookups against babble 3.0
+]]
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local LibStub = LibStub
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+function GetClassGetColor(class)
+ if GetGenderNeutralClass then
+ class = GetGenderNeutralClass(class)
+ end
+
+ class = class:upper()
+
+ if _G.RAID_CLASS_COLORS and _G.RAID_CLASS_COLORS[class] then
+ return _G.RAID_CLASS_COLORS[class].r, _G.RAID_CLASS_COLORS[class].g, _G.RAID_CLASS_COLORS[class].b
+ end
+ return 0.63, 0.63, 0.63
+end
\ No newline at end of file
diff --git a/services/classgenderfix.lua b/services/classgenderfix.lua
new file mode 100644
index 00000000..ded4b78a
--- /dev/null
+++ b/services/classgenderfix.lua
@@ -0,0 +1,41 @@
+--[[
+Name: Prat 3.0 (classgenderfix.lua)
+Revision: $Revision: 79217 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Fixes class data lookups against babble 3.0
+]]
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local LibStub = LibStub
+local setmetatable = setmetatable
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+
+
+
+local BR = setmetatable({}, {
+ __index = function(t, k)
+ _G.EnableAddOn("LibBabble-Class-3.0")
+ _G.LoadAddOn("LibBabble-Class-3.0")
+ setmetatable(t, LibStub("LibBabble-Class-3.0"):GetReverseLookupTable())
+ return t[k]
+end })
+
+function GetGenderNeutralClass(ns, class)
+ class = class or ns
+ return class and (BR[class:upper()] or class)
+end
+
+-- /print Prat.GetGenderNeutralClass("Shaman")
\ No newline at end of file
diff --git a/services/events.lua b/services/events.lua
new file mode 100644
index 00000000..ce5c42bc
--- /dev/null
+++ b/services/events.lua
@@ -0,0 +1,96 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2008 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: Prat 3.0 (events.lua)
+Revision: $Revision: 80213 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: The chat event service
+]]
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local type = type
+local strsub = strsub
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+local eventMap = {
+ CHAT_MSG_CHANNEL = true,
+ CHAT_MSG_SAY = true,
+ CHAT_MSG_GUILD = true,
+ CHAT_MSG_WHISPER = true,
+ CHAT_MSG_WHISPER_INFORM = true,
+ CHAT_MSG_YELL = true,
+ CHAT_MSG_PARTY = true,
+ CHAT_MSG_OFFICER = true,
+ CHAT_MSG_RAID = true,
+ CHAT_MSG_RAID_LEADER = true,
+ CHAT_MSG_RAID_WARNING = true,
+ CHAT_MSG_BATTLEGROUND = true,
+ CHAT_MSG_BATTLEGROUND_LEADER = true,
+ CHAT_MSG_SYSTEM = true,
+ CHAT_MSG_DND = true,
+ CHAT_MSG_AFK = true,
+}
+
+function EnableProcessingForEvent(event, flag)
+ if flag == nil or flag == true then
+ eventMap[event] = true
+ else
+ eventMap[event] = nil
+ end
+end
+
+function EventIsProcessed(event)
+ return eventMap[event] or false
+end
+
+EVENT_ID = 0
+
+local frame = _G.CreateFrame("Frame", "Prat30EventUIDFrame")
+frame:RegisterAllEvents()
+frame:SetScript("OnEvent",
+ function(self, event, ...)
+ -- for CHAT_MSG we will wrap the hook chain to provide a unique EVENT_ID
+ if type(event) == "string" and event ~= "CHAT_MSG_ADDON" and strsub(event, 1, 8) == "CHAT_MSG" then
+ EVENT_ID = EVENT_ID + 1
+ else
+ self:UnregisterEvent(event)
+ end
+ end
+)
+frame:Show()
+
diff --git a/services/folderlocation.lua b/services/folderlocation.lua
new file mode 100644
index 00000000..a8a4b300
--- /dev/null
+++ b/services/folderlocation.lua
@@ -0,0 +1,13 @@
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local SVC_NAMESPACE = SVC_NAMESPACE
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+FolderLocation = _G.debugstack():match("ns\\(.-)\\")
+
diff --git a/services/hooks.lua b/services/hooks.lua
new file mode 100644
index 00000000..b41f5468
--- /dev/null
+++ b/services/hooks.lua
@@ -0,0 +1,22 @@
+--[[
+Name: Prat 3.0 (hooks.lua)
+Revision: $Revision: 79217 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Implements the core addon hooks
+]]
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local LibStub = LibStub
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
\ No newline at end of file
diff --git a/services/includes.xml b/services/includes.xml
new file mode 100644
index 00000000..06f2f612
--- /dev/null
+++ b/services/includes.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/services/links.lua b/services/links.lua
new file mode 100644
index 00000000..197b2e27
--- /dev/null
+++ b/services/links.lua
@@ -0,0 +1,207 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2008 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: Prat 3.0 (links.lua)
+Revision: $Revision: 81600 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: The chat link registry service
+]]
+
+
+
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local LibStub = LibStub
+
+local pairs, ipairs = pairs, ipairs
+local tinsert, tremove, tconcat = table.insert, table.remove, table.concat
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+
+local function debug() end
+
+function BuildLink(linktype, data, text, color, link_start, link_end)
+ return "|cff"..(color or "ffffff").."|H"..linktype..":"..data.."|h"..(link_start or "[")..text..(link_end or "]").."|h|r"
+end
+
+
+do
+ LinkRegistry = {}
+ local LinkOwners = {}
+
+ -- linktype = { linkid, linkfunc, handler }
+ function RegisterLinkType(linktype, who)
+ if linktype and linktype.linkid and linktype.linkfunc then
+ tinsert(LinkRegistry, linktype)
+
+ local idx = #LinkRegistry
+
+ debug([[DBG_LINK("RegisterLinkType", who, linktype.linkid, idx)]])
+
+ if idx then
+ LinkOwners[idx] = who
+ end
+
+ return idx
+ end
+ end
+
+ function UnregisterAllLinkTypes(who)
+ debug([[DBG_LINK("UnregisterAllLinkTypes", who)]])
+
+ for k, owner in pairs(LinkOwners) do
+ if owner == who then
+ UnregisterLinkType(k)
+ end
+ end
+ end
+
+ function UnregisterLinkType(idx)
+ tremove(LinkRegistry, idx)
+ end
+
+ function SetItemRefHook(orgfunc, link, ...)
+ debug([[DUMP_LINK("SetItemRef ", link, ...)]])
+ for i,reg_link in ipairs(LinkRegistry) do
+ if reg_link.linkid == link:sub(1, (reg_link.linkid):len()) then
+ if (reg_link.linkfunc(reg_link.handler, link, ...) == false) then
+ debug([[DUMP_LINK("SetItemRef ", "Link Handled Internally")]])
+ return false
+ end
+ end
+ end
+
+ if WOTLK then
+ SetItemRef(link, ...)
+ else
+ orgfunc(link, ...)
+ end
+ end
+end
+
+
+function SetItemRef(link, text, button)
+ if ( _G.strsub(link, 1, 6) == "player" ) then
+ local namelink = _G.strsub(link, 8);
+ local name, lineid = _G.strsplit(":", namelink);
+ if ( name and (_G.strlen(name) > 0) ) then
+ if ( _G.IsModifiedClick("CHATLINK") ) then
+ local staticPopup;
+ staticPopup = _G.StaticPopup_Visible("ADD_IGNORE");
+ if ( staticPopup ) then
+ -- If add ignore dialog is up then enter the name into the editbox
+ _G.getglobal(staticPopup.."EditBox"):SetText(name);
+ return;
+ end
+ staticPopup = _G.StaticPopup_Visible("ADD_MUTE");
+ if ( staticPopup ) then
+ -- If add ignore dialog is up then enter the name into the editbox
+ _G.getglobal(staticPopup.."EditBox"):SetText(name);
+ return;
+ end
+ staticPopup = _G.StaticPopup_Visible("ADD_FRIEND");
+ if ( staticPopup ) then
+ -- If add ignore dialog is up then enter the name into the editbox
+ _G.getglobal(staticPopup.."EditBox"):SetText(name);
+ return;
+ end
+ staticPopup = _G.StaticPopup_Visible("ADD_GUILDMEMBER");
+ if ( staticPopup ) then
+ -- If add ignore dialog is up then enter the name into the editbox
+ _G.getglobal(staticPopup.."EditBox"):SetText(name);
+ return;
+ end
+ staticPopup = _G.StaticPopup_Visible("ADD_TEAMMEMBER");
+ if ( staticPopup ) then
+ -- If add ignore dialog is up then enter the name into the editbox
+ _G.getglobal(staticPopup.."EditBox"):SetText(name);
+ return;
+ end
+ staticPopup = _G.StaticPopup_Visible("ADD_RAIDMEMBER");
+ if ( staticPopup ) then
+ -- If add ignore dialog is up then enter the name into the editbox
+ _G.getglobal(staticPopup.."EditBox"):SetText(name);
+ return;
+ end
+ staticPopup = _G.StaticPopup_Visible("CHANNEL_INVITE");
+ if ( staticPopup ) then
+ _G.getglobal(staticPopup.."EditBox"):SetText(name);
+ return;
+ end
+ if ( _G.ChatFrameEditBox:IsVisible() ) then
+ _G.ChatFrameEditBox:Insert(name);
+ elseif ( _G.HelpFrameOpenTicketText:IsVisible() ) then
+ _G.HelpFrameOpenTicketText:Insert(name);
+ else
+ _G.SendWho(_G.WHO_TAG_NAME..name);
+ end
+
+ elseif ( button == "RightButton" ) then
+ _G.FriendsFrame_ShowDropdown(name, 1, lineid);
+ else
+ _G.ChatFrame_SendTell(name);
+ end
+ end
+ return;
+ elseif ( _G.strsub(link, 1, 7) == "channel" ) then
+ if ( _G.IsModifiedClick("CHATLINK") ) then
+ _G.FriendsFrame:Show();
+ _G.FriendsFrameTab4:Click();
+ elseif ( button == "LeftButton" ) then
+ local chan = _G.strsub(link, 9);
+ local channum = _G.tonumber(chan)
+ if ( (not channum) or _G.GetChannelName(channum)~=0 ) then
+ --Open chat for channel
+ _G.ChatFrame_OpenChat("/"..chan, _G.DEFAULT_CHAT_FRAME);
+ end
+ end
+ return;
+ end
+
+ if ( _G.IsModifiedClick() ) then
+ _G.HandleModifiedItemClick(text);
+ else
+ _G.ShowUIPanel(_G.ItemRefTooltip);
+ if ( not _G.ItemRefTooltip:IsShown() ) then
+ _G.ItemRefTooltip:SetOwner(_G.UIParent, "ANCHOR_PRESERVE");
+ end
+ _G.ItemRefTooltip:SetHyperlink(link);
+ end
+end
+
+
diff --git a/services/patterns.lua b/services/patterns.lua
new file mode 100644
index 00000000..ca51380f
--- /dev/null
+++ b/services/patterns.lua
@@ -0,0 +1,178 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2008 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: Prat 3.0 (patterns.lua)
+Revision: $Revision: 80213 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: The pattern registry service
+]]
+
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+
+local pairs, ipairs = pairs, ipairs
+local tinsert, tremove, tconcat = table.insert, table.remove, table.concat
+local type = type
+local setmetatable = setmetatable
+local rawset, rawget = rawset, rawget
+local tostring = tostring
+
+local LibStub = LibStub
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+
+local PatternRegistry = {}
+
+
+
+local debug = debug or function() end
+
+-- Register a pattern with the pattern matching engine
+-- You can supply a priority 1 - 100. Default is 50
+-- 1 = highest, 100 = lowest.
+-- pattern = { pattern, matchfunc, priority, type}
+--
+-- Priorities arent used currently, they are to help with
+-- collisions later on if there are alot of patterns
+--
+do
+ local PatternOwners = {}
+
+ function RegisterPattern(pattern, who)
+ tinsert(PatternRegistry, pattern)
+ local idx = #PatternRegistry
+ pattern.idx = idx
+
+ debug([[DUMP_PATTERN("RegisterPattern", who, pattern)]])
+
+ PatternOwners[#PatternRegistry] = who
+
+ return idx
+ end
+
+ function UnregisterAllPatterns(who)
+ debug([[DBG_PATTERN("UnregisterAllPatterns", who)]])
+
+ local owner
+ for k, owner in pairs(PatternOwners) do
+ if owner == who then
+ UnregisterPattern(k)
+ end
+ end
+ end
+end
+
+function GetPattern(idx)
+ return PatternRegistry[idx]
+end
+
+function UnregisterPattern(idx)
+ tremove(PatternRegistry, idx)
+end
+
+do
+ local tokennum = 1
+
+ local MatchTable = setmetatable({}, { __index=function(self, key)
+ if type(rawget(self,key)) ~= "table" then
+ rawset(self,key,{})
+ end
+ return rawget(self,key)
+ end })
+
+
+ function RegisterMatch(self, text, ptype)
+ local token = "@##"..tokennum.."##@"
+
+ debug([[DBG_PATTERN("RegisterMatch", text, token)]])
+
+ local mt = MatchTable[ptype or "FRAME"]
+ mt[token] = text
+ tokennum = tokennum + 1
+ return token
+ end
+
+
+ function MatchPatterns(text, ptype)
+ ptype = ptype or "FRAME"
+
+ tokennum = 1
+
+ debug([[DBG_PATTERN("MatchPatterns -->", text, tokennum)]])
+
+ -- Match and remove strings
+ for _, v in ipairs(PatternRegistry) do
+ if text and ptype == (v.type or "FRAME") then
+ if type(v.pattern) == "string" and (v.pattern):len() > 0 then
+ if v.deformat then
+ text = v.matchfunc(text)
+ else
+ text = text:gsub(v.pattern, v.matchfunc)
+ end
+ end
+ end
+ end
+
+ debug([[DBG_PATTERN("MatchPatterns <--", text, tokennum)]])
+
+ return text
+ end
+
+ function ReplaceMatches(text, ptype)
+ -- Substitute them (or something else) back in
+ local mt = MatchTable[ptype or "FRAME"]
+
+ debug([[DBG_PATTERN("ReplaceMatches -->", text)]])
+
+ for k,v in pairs(mt) do
+ text = text:gsub(k, v)
+ mt[k] = nil
+ end
+
+ debug([[DBG_PATTERN("ReplaceMatches <--", text)]])
+
+ return text
+ end
+end
+
+
+
+
+
+
+
diff --git a/services/print.lua b/services/print.lua
new file mode 100644
index 00000000..21e932ad
--- /dev/null
+++ b/services/print.lua
@@ -0,0 +1,50 @@
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local LibStub = LibStub
+local tostring = tostring
+local select = select
+local type = type
+
+local SVC_NAMESPACE = SVC_NAMESPACE
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+
+--[[ from AceConsole-3.0 ]]--
+function Print(...)
+ local text = ""
+ local first = 1
+
+ local frame = select(first, ...)
+ if frame == SVC_NAMESPACE then
+ first = first + 1
+ frame = select(first, ...)
+ end
+
+ if not ( type(frame) == "table" and frame.AddMessage ) then -- Is first argument something with an .AddMessage member?
+ frame=nil
+ else
+ first = first + 1
+ end
+
+ for i=first, select("#", ...) do
+ text = text .. tostring( select( i, ...) ) .." "
+ end
+ (frame or _G.DEFAULT_CHAT_FRAME):AddMessage( text )
+end
+
+
+-- TODO - this is debug really
+function PrintLiteral(...)
+ if SVC_NAMESPACE == ... then
+ LibStub("AceConsole-2.0"):PrintLiteral(select(2, ...))
+ else
+ LibStub("AceConsole-2.0"):PrintLiteral(...)
+ end
+end
\ No newline at end of file
diff --git a/services/textcolor.lua b/services/textcolor.lua
new file mode 100644
index 00000000..b2949831
--- /dev/null
+++ b/services/textcolor.lua
@@ -0,0 +1,236 @@
+---------------------------------------------------------------------------------
+--
+-- Prat - A framework for World of Warcraft chat mods
+--
+-- Copyright (C) 2006-2008 Prat Development Team
+--
+-- This program is free software; you can redistribute it and/or
+-- modify it under the terms of the GNU General Public License
+-- as published by the Free Software Foundation; either version 2
+-- of the License, or (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to:
+--
+-- Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor,
+-- Boston, MA 02110-1301, USA.
+--
+--
+-------------------------------------------------------------------------------
+--[[
+Name: Prat 3.0 (textcolor.lua)
+Revision: $Revision: 79446 $
+Author(s): Sylvaanar (sylvanaar@mindspring.com)
+Inspired By: Prat 2.0, Prat, and idChat2 by Industrial
+Website: http://files.wowace.com/Prat/
+Documentation: http://www.wowace.com/wiki/Prat
+Forum: http://www.wowace.com/forums/index.php?topic=6243.0
+SVN: http://svn.wowace.com/wowace/trunk/Prat/
+Description: Text coloring functions (similar to crayon)
+]]
+
+--[[ BEGIN STANDARD HEADER ]]--
+
+-- Imports
+local _G = _G
+local tostring = tostring
+local select = select
+local type = type
+local table = table
+local math = math
+local string = string
+
+-- Isolate the environment
+setfenv(1, SVC_NAMESPACE)
+
+--[[ END STANDARD HEADER ]]--
+
+
+CLR = {}
+
+CLR.DEFAULT = "ffffff" -- default to white
+CLR.LINK = { "|cff", CLR.DEFAULT, "", "|r" }
+
+CLR.COLOR_NONE = nil
+
+local function get_default_color()
+ return 1.0, 1.0, 1.0, 1.0
+end
+
+local function get_color(c)
+ if type(c.r) == "number" and type(c.g) == "number" and type(c.b) == "number" and type(c.a) == "number" then
+ return c.r, c.g, c.b, c.a
+ end
+ if type(c.r) == "number" and type(c.g) == "number" and type(c.b) == "number" then
+ return c.r, c.g, c.b, 1.0
+ end
+ return get_default_color()
+end
+
+local function get_var_color(a1, a2, a3, a4)
+ local r, g, b, a
+
+ if type(a1) == "table" then
+ r, g, b, a = get_color(a1)
+ elseif type(a1) == "number" and type(a2) == "number" and type(a3) == "number" and type(a4) == "number" then
+ r, g, b, a = a1, a2, a3, a4
+ elseif type(a1) == "number" and type(a2) == "number" and type(a3) == "number" and type(a4) == "nil" then
+ r, g, b, a = a1, a2, a3, 1.0
+ else
+ r, g, b, a = get_default_color()
+ end
+
+ return r, g, b, a
+end
+
+-- CLR:GetHexColor(color or cr, cg, cb)
+local function mult_255(r,g,b,a)
+ return r*255, g*255, b*255, a
+end
+
+function CLR:GetHexColor(a1, a2, a3, a4)
+ return string.format("%02x%02x%02x", mult_255(get_var_color(a1, a2, a3, a4)))
+end
+
+
+function CLR:GetHashColor(text)
+ local hash = 17
+
+ for i=1, text:len() do
+ hash = hash * 37 * text:byte(i)
+ end
+
+ local r = math.floor(math.fmod(hash / 97, 255));
+ local g = math.floor(math.fmod(hash / 17, 255));
+ local b = math.floor(math.fmod(hash / 227, 255));
+
+ if ((r * 299 + g * 587 + b * 114) / 1000) < 105 then
+ r = math.abs(r - 255);
+ g = math.abs(g - 255);
+ b = math.abs(b - 255);
+ end
+
+ return ("%02x%02x%02x"):format(r, g, b)
+end
+
+function CLR:Random(text)
+ return CLR:Colorize(self:GetHashColor(text), text)
+end
+
+function CLR:Colorize(hexColor, text)
+ if text == nil or text == "" then
+ return ""
+ end
+
+ local color = hexColor
+ if type(hexColor) == "table" then
+ color = self:GetHexColor(hexColor)
+ end
+
+ if color == CLR.COLOR_NONE then
+ return text
+ end
+
+ local link = CLR.LINK
+
+ link[2] = tostring(color or 'ffffff')
+ link[3] = text
+
+ return table.concat(link, "")
+end
+
+local function desat_chan(c) return ((c or 1.0)*192*0.8+63) / 255 end
+
+function CLR:Desaturate(a1, a2, a3, a4)
+ local r, g, b, a = get_var_color(a1, a2, a3, a4)
+
+ r = desat_chan(r)
+ g = desat_chan(g)
+ b = desat_chan(b)
+
+ return r, g, b, a
+end
+
+
+-- Not sure if the follow are used, i got them from either rock or crayon.
+
+function CLR:RGBtoHSL(red, green, blue)
+ local hue, saturation, luminance
+ local minimum = math.min( red, green, blue )
+ local maximum = math.max( red, green, blue )
+ local difference = maximum - minimum
+
+ luminance = ( maximum + minimum ) / 2
+
+ if difference == 0 then --Greyscale
+ hue = 0
+ saturation = 0
+ else --Colour
+ if luminance < 0.5 then
+ saturation = difference / ( maximum + minimum )
+ else
+ saturation = difference / ( 2 - maximum- minimum )
+ end
+
+ local tmpRed = ( ( ( maximum - red ) / 6 ) + ( difference / 2 ) ) / difference
+ local tmpGreen = ( ( ( maximum - green ) / 6 ) + ( difference / 2 ) ) / difference
+ local tmpBlue = ( ( ( maximum - blue ) / 6 ) + ( difference / 2 ) ) / difference
+
+ if red == maximum then
+ hue = tmpBlue - tmpGreen
+ elseif green == maximum then
+ hue = ( 1 / 3 ) + tmpRed - tmpBlue
+ elseif blue == maximum then
+ hue = ( 2 / 3 ) + tmpGreen - tmpRed
+ end
+
+ hue = hue % 1
+ if hue < 0 then hue = hue + 1 end
+ end
+
+ return hue, saturation, luminance
+end
+
+function CLR:HSLtoRGB(hue, saturation, luminance)
+ local red, green, blue
+
+ if ( S == 0 ) then
+ red, green, blue = luminance, luminance, luminance
+ else
+ if luminance < 0.5 then
+ var2 = luminance * ( 1 + saturation )
+ else
+ var2 = ( luminance + saturation ) - ( saturation * luminance )
+ end
+
+ var1 = 2 * luminance - var2
+
+ red = self:HueToColor( var1, var2, hue + ( 1 / 3 ) )
+ green = self:HueToColor( var1, var2, hue )
+ blue = self:HueToColor( var1, var2, hue - ( 1 / 3 ) )
+ end
+
+ return red, green, blue
+end
+
+function CLR:HueToColor(var1, var2, hue)
+ hue = hue % 1
+ if hue < 0 then hue = hue + 1 end
+
+ if ( 6 * hue ) < 1 then
+ return hue + ( var2 - var1 ) * 6 * hue
+ elseif ( 2 * hue ) < 1 then
+ return var2
+ elseif ( 3 * hue ) < 2 then
+ return var1 + ( var2 - var1 ) * ( ( 2 / 3 ) - hue ) * 6
+ else
+ return var1
+ end
+end
+
diff --git a/sounds/Bell.mp3 b/sounds/Bell.mp3
new file mode 100644
index 00000000..61b919bc
Binary files /dev/null and b/sounds/Bell.mp3 differ
diff --git a/sounds/Chime.mp3 b/sounds/Chime.mp3
new file mode 100644
index 00000000..35e50f18
Binary files /dev/null and b/sounds/Chime.mp3 differ
diff --git a/sounds/Heart.wav b/sounds/Heart.wav
new file mode 100644
index 00000000..00e77542
Binary files /dev/null and b/sounds/Heart.wav differ
diff --git a/sounds/IM.mp3 b/sounds/IM.mp3
new file mode 100644
index 00000000..5dffdf6e
Binary files /dev/null and b/sounds/IM.mp3 differ
diff --git a/sounds/Info.mp3 b/sounds/Info.mp3
new file mode 100644
index 00000000..80483b37
Binary files /dev/null and b/sounds/Info.mp3 differ
diff --git a/sounds/Kachink.wav b/sounds/Kachink.wav
new file mode 100644
index 00000000..adade188
Binary files /dev/null and b/sounds/Kachink.wav differ
diff --git a/sounds/Link.wav b/sounds/Link.wav
new file mode 100644
index 00000000..c1f1a096
Binary files /dev/null and b/sounds/Link.wav differ
diff --git a/sounds/Text1.wav b/sounds/Text1.wav
new file mode 100644
index 00000000..421f2f61
Binary files /dev/null and b/sounds/Text1.wav differ
diff --git a/sounds/Text2.wav b/sounds/Text2.wav
new file mode 100644
index 00000000..3334f7cc
Binary files /dev/null and b/sounds/Text2.wav differ
diff --git a/sounds/Xylo.mp3 b/sounds/Xylo.mp3
new file mode 100644
index 00000000..77894007
Binary files /dev/null and b/sounds/Xylo.mp3 differ
diff --git a/textures/chat-bubble.tga b/textures/chat-bubble.tga
new file mode 100644
index 00000000..c0a13a9b
Binary files /dev/null and b/textures/chat-bubble.tga differ
diff --git a/textures/old.prat.tga b/textures/old.prat.tga
new file mode 100644
index 00000000..7617401c
Binary files /dev/null and b/textures/old.prat.tga differ
diff --git a/textures/prat-chatcopy.tga b/textures/prat-chatcopy.tga
new file mode 100644
index 00000000..91862638
Binary files /dev/null and b/textures/prat-chatcopy.tga differ
diff --git a/textures/prat-chatcopy2.tga b/textures/prat-chatcopy2.tga
new file mode 100644
index 00000000..79f04921
Binary files /dev/null and b/textures/prat-chatcopy2.tga differ
diff --git a/textures/prat-editnotexture.tga b/textures/prat-editnotexture.tga
new file mode 100644
index 00000000..59a5aeae
Binary files /dev/null and b/textures/prat-editnotexture.tga differ
diff --git a/textures/prat.tga b/textures/prat.tga
new file mode 100644
index 00000000..8c0c0ebd
Binary files /dev/null and b/textures/prat.tga differ