Advertisement
Guest User

highlight patch

a guest
Oct 23rd, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 73.41 KB | None | 0 0
  1. Index: data/gui/windowsnames.xml
  2. ===================================================================
  3. --- data/gui/windowsnames.xml   (revision 0)
  4. +++ data/gui/windowsnames.xml   (working copy)
  5. @@ -0,0 +1,119 @@
  6. +<!-- data/gui/windowsnames.xml
  7. +     Definition file for windows controlled by pawsControlWindow
  8. +     Author: Fabian Stock (AiwendilH@googlemail.com)
  9. +     License: GPL
  10. +    
  11. +     This program is free software; you can redistribute it and/or
  12. +     modify it under the terms of the GNU General Public License
  13. +     as published by the Free Software Foundation; either version 2
  14. +     of the License, or (at your option) any later version.
  15. +
  16. +     This program is distributed in the hope that it will be useful,
  17. +     but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. +     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. +     GNU General Public License for more details.
  20. +
  21. +     You should have received a copy of the GNU General Public License
  22. +     along with this program; if not, write to the Free Software
  23. +     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  24. +-->
  25. +<windows>
  26. +    <window name="ConfigWindow">
  27. +   <alternativeName name="options"/>
  28. +    </window>
  29. +    <window name="SkillWindow">
  30. +   <alternativeName name="stats"/>
  31. +   <alternativeName name="skills"/>
  32. +    </window>
  33. +    <window name="SpellBookWindow">
  34. +   <alternativeName name="spell book"/>
  35. +   <alternativeName name="spells"/>
  36. +    </window>
  37. +    <window name="InventoryWindow">
  38. +   <alternativeName name="inventory"/>
  39. +   <alternativeName name="inv"/>
  40. +    </window>
  41. +    <window name="HelpWindow">
  42. +   <alternativeName name="help"/>
  43. +    </window>
  44. +    <window name="BuddyWindow">
  45. +   <alternativeName name="buddy"/>
  46. +    </window>
  47. +    <window name="InfoWindow">
  48. +   <alternativeName name="info"/>
  49. +    </window>
  50. +    <window name="PetitionWindow">
  51. +   <alternativeName name="petition"/>
  52. +   <alternativeName name="petitions"/>
  53. +    </window>
  54. +    <window name="QuestNotebook">
  55. +   <alternativeName name="quest"/>
  56. +    </window>
  57. +    <window name="GmGUI">
  58. +   <alternativeName name="gm"/>
  59. +    </window>
  60. +    <window name="ShortcutWindow">
  61. +   <alternativeName name="shortcut"/>
  62. +   <alternativeName name="shortcuts"/>
  63. +    </window>
  64. +    <window name="GroupWindow">
  65. +   <alternativeName name="group"/>
  66. +    </window>
  67. +    <window name="GuildWindow">
  68. +   <alternativeName name="guild"/>
  69. +    </window>
  70. +    <window name="GlyphWindow">
  71. +   <alternativeName name="glyph"/>
  72. +    </window>
  73. +    <window name="SketchWindow">
  74. +   <alternativeName name="sketch"/>
  75. +    </window>
  76. +    <window name="MerchantWindow">
  77. +   <alternativeName name="merchant"/>
  78. +    </window>
  79. +    <window name="LootWindow">
  80. +   <alternativeName name="loot"/>
  81. +    </window>
  82. +    <window name="DetailWindow">
  83. +   <alternativeName name="detail"/>
  84. +    </window>
  85. +    <window name="ExchangeWindow">
  86. +   <alternativeName name="exchange"/>
  87. +    </window>
  88. +    <window name="WritingWindow">
  89. +   <alternativeName name="write"/>
  90. +    </window>
  91. +    <window name="BookReadingWindow">
  92. +   <alternativeName name="read"/>
  93. +    </window>
  94. +    <window name="QuestRewardWindow">
  95. +   <alternativeName name="questreward"/>
  96. +    </window>
  97. +    <window name="CraftWindow">
  98. +   <alternativeName name="craft"/>
  99. +    </window>
  100. +    <window name="IgnoreWindow">
  101. +   <alternativeName name="ignore"/>
  102. +    </window>
  103. +    <window name="SmallInventoryWindow">
  104. +   <alternativeName name="bag"/>
  105. +   <alternativeName name="smallinventory"/>
  106. +    </window>
  107. +    <window name="ChatWindow">
  108. +   <alternativeName name="talk"/>
  109. +   <alternativeName name="chat"/>
  110. +   <alternativeName name="communications"/>
  111. +    </window>
  112. +    <window name="ActiveMagicWindow">
  113. +   <alternativeName name="activemagic"/>
  114. +    </window>
  115. +    <window name="PetitionGMWindow">
  116. +   <alternativeName name="managepetitions"/>
  117. +    </window>
  118. +    <window name="HotBar">
  119. +   <alternativeName name="quickspell"/>
  120. +    </window>
  121. +    <window name="MusicWindow">
  122. +   <alternativeName name="music"/>
  123. +    </window>
  124. +</windows>
  125. Index: data/help.xml
  126. ===================================================================
  127. --- data/help.xml   (revision 8473)
  128. +++ data/help.xml   (working copy)
  129. @@ -176,7 +176,7 @@
  130.        </Contents>
  131.        <branch name="Chat Window">
  132.          <Contents>
  133. -          <content type="text">The chat windows is probably the most important windows of PlaneShift. Good part of the interaction between players is done with this window. Commands can be executed by typing them in this window. You can configure which which tabs are shown in the in-game options: Options->Interface->Chat Tabs. You can also configure which messages are sent in the main tab. The currently selected chat tab is highlighted, and the tab will "flash" in case of a new, unread message arrives.</content>
  134. +          <content type="text">The chat windows is probably the most important windows of PlaneShift. Good part of the interaction between players is done with this window. Commands can be executed by typing them in this window. You can configure which which tabs are shown in the in-game options: Options-&gt;Interface-&gt;Chat Tabs. You can also configure which messages are sent in the main tab. The currently selected chat tab is highlighted, and the tab will "flash" in case of a new, unread message arrives.</content>
  135.          </Contents>
  136.          <topic name="Tab Completion">
  137.            <Contents>
  138. @@ -194,7 +194,7 @@
  139.            </Contents>
  140.            <topic name="Main">
  141.              <Contents>
  142. -              <content type="text">As the name already says this is the main chat tab. It's intended for interaction between characters. Everything typed here has a limited saying-range and only people within that range can see what you typed. This tab is In-Character (IC), meaning this is the voice of your character, not you. Your character has no clue about what music you listen to at the moment or even that PlaneShift is just a game. For short Out-of-character (OOC) announcements like "afk" please use brackets: "[afk]" or "[brb, phone]". You can filter the information displayed in this tab by going to Options->Interface->Chat Tabs and check/uncheck the "Main Tab" options.</content>
  143. +              <content type="text">As the name already says this is the main chat tab. It's intended for interaction between characters. Everything typed here has a limited saying-range and only people within that range can see what you typed. This tab is In-Character (IC), meaning this is the voice of your character, not you. Your character has no clue about what music you listen to at the moment or even that PlaneShift is just a game. For short Out-of-character (OOC) announcements like "afk" please use brackets: "[afk]" or "[brb, phone]". You can filter the information displayed in this tab by going to Options-&gt;Interface-&gt;Chat Tabs and check/uncheck the "Main Tab" options.</content>
  144.              </Contents>
  145.            </topic>
  146.            <topic name="Chat">
  147. @@ -214,7 +214,7 @@
  148.            </topic>
  149.            <topic name="Guild">
  150.              <Contents>
  151. -              <content type="text">If you are in a guild you can use this chat tab to communicate with your guild mates. In-Character chat is preferred but not enforced. There is no range limit and all people in your guild can read your messages. If you don't see this tab, enable it from Options->Interface->Chat Tabs</content>
  152. +              <content type="text">If you are in a guild you can use this chat tab to communicate with your guild mates. In-Character chat is preferred but not enforced. There is no range limit and all people in your guild can read your messages. If you don't see this tab, enable it from Options-&gt;Interface-&gt;Chat Tabs</content>
  153.              </Contents>
  154.            </topic>
  155.            <topic name="Group">
  156. @@ -914,9 +914,9 @@
  157.            <Contents>
  158.              <content type="text">With this command you can send messages to the alliance chat channel. Your current guild must be member of an alliance to use this command.
  159.    
  160. -  Usage;
  161. -  /alliance [message]
  162. -  (Sends {message] to the alliance chat channel. Can be combined with /me or /my.)</content>
  163. +Usage;
  164. +/alliance [message]
  165. +(Sends {message] to the alliance chat channel. Can be combined with /me or /my.)</content>
  166.            </Contents>
  167.          </topic>
  168.          <topic name="/away">
  169. @@ -943,7 +943,7 @@
  170.            <Contents>
  171.              <content type="text">Command to clear the history of the chat window. This will clear the history of all chat tabs.
  172.    
  173. -  Usage: /clear</content>
  174. +Usage: /clear</content>
  175.            </Contents>
  176.          </topic>
  177.          <branch name="/emote">
  178. @@ -1503,9 +1503,9 @@
  179.            <Contents>
  180.              <content type="text">With this command you can send messages to your guild mates in the guild chat.
  181.    
  182. -  Usage:
  183. -  /guild [message]
  184. -  (Writes [message] to the guild chat tab. Can be combined with /me or /my.)</content>
  185. +Usage:
  186. +/guild [message]
  187. +(Writes [message] to the guild chat tab. Can be combined with /me or /my.)</content>
  188.            </Contents>
  189.          </topic>
  190.          <topic name="/ignore">
  191. @@ -1549,9 +1549,9 @@
  192.            <Contents>
  193.              <content type="text">With this command you can leave chat-channels again.
  194.    
  195. -  Usage:
  196. -  /leave [channel-number]
  197. -  (Leaves the channel specified by the number [channel-number].)</content>
  198. +Usage:
  199. +/leave [channel-number]
  200. +(Leaves the channel specified by the number [channel-number].)</content>
  201.            </Contents>
  202.          </topic>
  203.          <topic name="/me">
  204. @@ -1576,8 +1576,8 @@
  205.            <Contents>
  206.              <content type="text">With this command you can describe actions of your pet. The /mypet is replaced with the name of your pet.
  207.    
  208. -  Usage:/mypet [message]
  209. -  (Sends a message to the main chat tab starting with the name of your pet.)</content>
  210. +Usage:/mypet [message]
  211. +(Sends a message to the main chat tab starting with the name of your pet.)</content>
  212.            </Contents>
  213.          </topic>
  214.          <topic name="/say">
  215. @@ -1600,18 +1600,18 @@
  216.            <Contents>
  217.              <content type="text">This command allows you to send tells to another player in the whisper chat tab.
  218.    
  219. -  Usage:
  220. -  /tell [char-name] [message]
  221. -  (Sends [char-name] the text [message]. Can be combines with /me or /my.)</content>
  222. +Usage:
  223. +/tell [char-name] [message]
  224. +(Sends [char-name] the text [message]. Can be combines with /me or /my.)</content>
  225.            </Contents>
  226.          </topic>
  227.          <topic name="/tellnpc">
  228.            <Contents>
  229.              <content type="text">With this command you can communicate with NPCs in the NPC chat tab.
  230.    
  231. -  Usage:
  232. -  /tellnpc [message]
  233. -  (Sends the currently selected NPC the text [message] in the NPC chat tab.)</content>
  234. +Usage:
  235. +/tellnpc [message]
  236. +(Sends the currently selected NPC the text [message] in the NPC chat tab.)</content>
  237.            </Contents>
  238.          </topic>
  239.        </branch>
  240. @@ -1653,9 +1653,9 @@
  241.            <Contents>
  242.              <content type="text">With this command you can loot corpses of NPCs. You can't loot other players after a duel.
  243.    
  244. -  Usage:
  245. -  /loot
  246. -  (Opens the loot window of the current target. You can only loot NPCs slayed by you or one of your current group) </content>
  247. +Usage:
  248. +/loot
  249. +(Opens the loot window of the current target. You can only loot NPCs slayed by you or one of your current group) </content>
  250.            </Contents>
  251.          </topic>
  252.          <topic name="/stopattack">
  253. @@ -1700,7 +1700,7 @@
  254.            <Contents>
  255.              <content type="text">This command allows you to combine items in an container. The items must be already places in the container and the container must be targeted. Depending on what you want to combine it might be necessary to have an appropriate tool equipped.
  256.    
  257. -  Usage: /combine</content>
  258. +Usage: /combine</content>
  259.            </Contents>
  260.          </topic>
  261.          <topic name="/construct">
  262. @@ -1722,9 +1722,9 @@
  263.            <Contents>
  264.              <content type="text">With this command you can fish in rivers and lakes.
  265.    
  266. -  Usage:
  267. -  /fish
  268. -  (This fishes at your current position. After a successful try you have to move a bit to be able to use the command again.)</content>
  269. +Usage:
  270. +/fish
  271. +(This fishes at your current position. After a successful try you have to move a bit to be able to use the command again.)</content>
  272.            </Contents>
  273.          </topic>
  274.          <topic name="/harvest">
  275. @@ -1876,41 +1876,41 @@
  276.            <Contents>
  277.              <content type="text">This command shows the karma points of your guild. Guild karma increases if an enemy guild surrenders to your guild (Though it's not clear if this already works properly in game)
  278.    
  279. -  Usage:
  280. -  /guildkarma
  281. -  (Prints your guild's karma points to the system chat tab.)</content>
  282. +Usage:
  283. +/guildkarma
  284. +(Prints your guild's karma points to the system chat tab.)</content>
  285.            </Contents>
  286.          </topic>
  287.          <topic name="/guildpromote">
  288.            <Contents>
  289.              <content type="text">With this command you can promote guiild members. Your guild rank must allows you to promote others for this to work and you can only promote others to a rank lower than yours.
  290.    
  291. -  Usage:
  292. -  /guildpromote [char-name] [rank]
  293. -  (Promotes the character [char-name] to the rank [rank]. [rank] is a number from 1 to 9.)</content>
  294. +Usage:
  295. +/guildpromote [char-name] [rank]
  296. +(Promotes the character [char-name] to the rank [rank]. [rank] is a number from 1 to 9.)</content>
  297.            </Contents>
  298.          </topic>
  299.          <topic name="/guildremove">
  300.            <Contents>
  301.              <content type="text">This command allows you to remove characters from the guild. Your guild rank must allow you to remove members for this to work.
  302.                  
  303. -  Usage:
  304. -  /guildremove [char-name]
  305. -  (Removes the character with the name [char-name] from the guild.)</content>
  306. +Usage:
  307. +/guildremove [char-name]
  308. +(Removes the character with the name [char-name] from the guild.)</content>
  309.            </Contents>
  310.          </topic>
  311.          <topic name="/guildsecret">
  312.            <Contents><content type="text">With this command you can toggle set your guild is secret or not. Your rank must allow you to edit the guild for this to work.
  313.    
  314. -  Usage:
  315. -  /guildsecret
  316. -  (Without any arguments the current status is printed to the system chat tab.)</content>
  317. -  
  318. -  /guildsecret on
  319. -  (Makes your guild a secret guild.)
  320. -  
  321. -  /guildsecret off
  322. -  (Makes your guild a public guild.)
  323. +Usage:
  324. +/guildsecret
  325. +(Without any arguments the current status is printed to the system chat tab.)</content>
  326. +
  327. +/guildsecret on
  328. +(Makes your guild a secret guild.)
  329. +
  330. +/guildsecret off
  331. +(Makes your guild a public guild.)
  332.                </Contents>
  333.          </topic>
  334.          <topic name="/guildwar">
  335. @@ -1966,12 +1966,12 @@
  336.            <Contents>
  337.              <content type="text">This command allows you to check the current status of the help channel as well as to change your own advisor settings.
  338.    
  339. -  Usage: /advisor list
  340. -  (Lists the amount of current advisors in the help channel. You don't have to be an advisor yourself to see how many there are)
  341. +Usage: /advisor list
  342. +(Lists the amount of current advisors in the help channel. You don't have to be an advisor yourself to see how many there are)
  343. +
  344. +/advisor requests
  345. +(Repeats the last question in the help channel. This can be useful to not miss any help request or right after becoming an advisor to see if there was a help request before. Only usable if you are an advisor.)
  346.    
  347. -  /advisor requests
  348. -  (Repeats the last question in the help channel. This can be useful to not miss any help request or right after becoming an advisor to see if there was a help request before. Only usable if you are an advisor.)
  349. -  
  350.  /advisor sessions
  351.  (Lists all help-sessions currently assigned to you. You need to be an advisor to be able to use this.)
  352.  
  353. @@ -1987,9 +1987,9 @@
  354.            <Contents>
  355.              <content type="text">With this command you can ask questions in the help channel.
  356.    
  357. -  Usage:
  358. -  /help [question]
  359. -  (Asks [question] in the help channel. In case no advisor is currently available you are notified in the system chat tab.)</content>
  360. +Usage:
  361. +/help [question]
  362. +(Asks [question] in the help channel. In case no advisor is currently available you are notified in the system chat tab.)</content>
  363.            </Contents>
  364.          </topic>
  365.        </branch>
  366. @@ -2018,9 +2018,9 @@
  367.            <Contents>
  368.              <content type="text">With this command you can give items to other players or NPCs. Containers (like sacks) cannot be traded at the moment.
  369.    
  370. -  Usage:
  371. -  /give
  372. -  (Opens the trading window for the selected player or NPC.)
  373. +Usage:
  374. +/give
  375. +(Opens the trading window for the selected player or NPC.)
  376.    
  377.    </content>
  378.            </Contents>
  379. @@ -2029,12 +2029,12 @@
  380.            <Contents>
  381.              <content type="text">This command allows your character to marry or divorce other characters. It's only possible to marry someone with a different gender than the on of your character.
  382.    
  383. -  Usage:
  384. -  /marriage propose
  385. -  (Proposes your currently selected target.)
  386. -  
  387. -  /marrriage divorce
  388. -  (Divorces from your currently selected target. Of course you must be married to the target for this to work.)</content>
  389. +Usage:
  390. +/marriage propose
  391. +(Proposes your currently selected target.)
  392. +
  393. +/marrriage divorce
  394. +(Divorces from your currently selected target. Of course you must be married to the target for this to work.)</content>
  395.            </Contents>
  396.          </topic>
  397.          <topic name="/npcmenu">
  398. @@ -2058,27 +2058,27 @@
  399.            <Contents>
  400.              <content type="text">Opens the storage window for the currently targetted NPC. Works only with NPCs that act as storage managers.
  401.    
  402. -  Usage:
  403. -  /storage
  404. -  (Opens the storage window for the selected NPC)</content>
  405. +Usage:
  406. +/storage
  407. +(Opens the storage window for the selected NPC)</content>
  408.            </Contents>
  409.          </topic>
  410.          <topic name="/trade">
  411.            <Contents>
  412.              <content type="text">This command allows you to start a trade with another player.
  413.    
  414. -  Usage:
  415. -  /trade
  416. -  (Asks the currently selected players for a trade and opens the trading window if the other player accepts.)</content>
  417. +Usage:
  418. +/trade
  419. +(Asks the currently selected players for a trade and opens the trading window if the other player accepts.)</content>
  420.            </Contents>
  421.          </topic>
  422.          <topic name="/train">
  423.            <Contents>
  424.              <content type="text">With this command you can open the training window with a trainer.
  425.    
  426. -  Usage:
  427. -  /train
  428. -  (Opens the training window for the currently selected NPC. Only works if the NPC offers some training.)</content>
  429. +Usage:
  430. +/train
  431. +(Opens the training window for the currently selected NPC. Only works if the NPC offers some training.)</content>
  432.            </Contents>
  433.          </topic>
  434.        </branch>
  435. @@ -2087,28 +2087,28 @@
  436.            <Contents>
  437.              <content type="text">This command allows you to unequip items.
  438.    
  439. -  Usage:/dequip [item-name]
  440. -  (Unequips the specified item. The item will be places back in your inventory. I there are more than one item with this name equipped the first found will be unequiped.)
  441. -  
  442. -  /dequip [slot]
  443. -  (Unequips and items for the specified slot. Possible values for [slot] are: righthand, lefthand, helm, legs, boots, bracers, torso, gloves, neck, rightfinger, leftfinger, belt, arms, back. The items will be places back in your inventory.</content>
  444. +Usage:/dequip [item-name]
  445. +(Unequips the specified item. The item will be places back in your inventory. I there are more than one item with this name equipped the first found will be unequiped.)
  446. +
  447. +/dequip [slot]
  448. +(Unequips and items for the specified slot. Possible values for [slot] are: righthand, lefthand, helm, legs, boots, bracers, torso, gloves, neck, rightfinger, leftfinger, belt, arms, back. The items will be places back in your inventory.</content>
  449.            </Contents>
  450.          </topic>
  451.          <topic name="/drop">
  452.            <Contents>
  453.              <content type="text">This command allows you to drop an item (or a stack of items of the same kind)
  454.    
  455. -  Usage: /drop [quantity] any noguard inplace [item-name]
  456. -  (This drops [quantity] amounts of the specified item. If no [quantity] is gives one item will be dropped. If [quantity] is "any" as many items as possible, up to a max of 65, are dropped. If "any" is added after the [quantity] items from containers like sacks are dropped also. By adding "noguard" everyone around can pickup the item again (otherwise only you are able to take them again). With "inplace" the items are dropped at your character position. Without "inplace" you must specify the position with the mouse.</content>
  457. +Usage: /drop [quantity] any noguard inplace [item-name]
  458. +(This drops [quantity] amounts of the specified item. If no [quantity] is gives one item will be dropped. If [quantity] is "any" as many items as possible, up to a max of 65, are dropped. If "any" is added after the [quantity] items from containers like sacks are dropped also. By adding "noguard" everyone around can pickup the item again (otherwise only you are able to take them again). With "inplace" the items are dropped at your character position. Without "inplace" you must specify the position with the mouse.</content>
  459.            </Contents>
  460.          </topic>
  461.          <topic name="/equip">
  462.            <Contents>
  463.              <content type="text">This command allows you to equip items from your inventory.
  464.    
  465. -  Usage:
  466. -  /equip [quantity] [item-name]
  467. -  (Equips [quantity] amounts of an item with the name [item-name]. If no [quantity] is given one item will be equipped. If you have several items with the name [item-name] in your inventory the first found will be equipped. Items that can be eqiped in the hand-slots will be first equipped to the right hand and only to the left hand if the right hand is already full.)
  468. +Usage:
  469. +/equip [quantity] [item-name]
  470. +(Equips [quantity] amounts of an item with the name [item-name]. If no [quantity] is given one item will be equipped. If you have several items with the name [item-name] in your inventory the first found will be equipped. Items that can be eqiped in the hand-slots will be first equipped to the right hand and only to the left hand if the right hand is already full.)
  471.    </content>
  472.            </Contents>
  473.          </topic>
  474. @@ -2116,12 +2116,12 @@
  475.            <Contents>
  476.              <content type="text">With this command you can unguard items dropped by you. Once an item is unguarded it's not possible anymore to guard it without taking the item again so be careful with this command.
  477.    
  478. -  Usage:
  479. -  /guard
  480. -  (Unguards the selected item)
  481. -  
  482. -  Additional info:
  483. -  Even if the name of the command implies it's possible to guard items with it this it's not possible for ordinary players to do this. The GM/dev version of this command has some extended functionality with which the name of the command actually makes sense.</content>
  484. +Usage:
  485. +/guard
  486. +(Unguards the selected item)
  487. +
  488. +Additional info:
  489. +Even if the name of the command implies it's possible to guard items with it this it's not possible for ordinary players to do this. The GM/dev version of this command has some extended functionality with which the name of the command actually makes sense.</content>
  490.            </Contents>
  491.          </topic>
  492.          <topic name="/pickup">
  493. @@ -2207,9 +2207,9 @@
  494.            <Contents>
  495.              <content type="text">This command allows you to play on the gameboards in PS. You need to have the gameboard selected you want to play on.
  496.    
  497. -  Usage:
  498. -  /game
  499. -  (Starts a game session on the selected gameboard. Two players can use one board at the same time.)</content>
  500. +Usage:
  501. +/game
  502. +(Starts a game session on the selected gameboard. Two players can use one board at the same time.)</content>
  503.            </Contents>
  504.          </topic>
  505.          <topic name="/graphicbug">
  506. @@ -2221,6 +2221,24 @@
  507.  (Writes a bug report to your harddisk.)</content>
  508.            </Contents>
  509.          </topic>
  510. +   <topic name="/getwindowpos">
  511. +          <Contents>
  512. +            <content type="text">With this commandyou can get the current position and size of a window.
  513. +
  514. +Usage:
  515. +/getwindowpos [windowname]
  516. +(Prints the current position and size of the window with the name [windowname] to the system chat tab. To get a list of possible window names use /listWindows. The position of the window includes two numbers, a positive and a negative one. The positive numbers are relative to the upper left corner of the screen while the neagtive ones are relative to the lower right corner.)</content>
  517. +          </Contents>
  518. +        </topic>
  519. +   <topic name="/listwindows">
  520. +          <Contents>
  521. +            <content type="text">With this command you can get the names of all windows that can be modified with chat commands.
  522. +
  523. +Usage:
  524. +/listwindows
  525. +(Prints a list of names of windows to the system chat tab. If there is more than one name in a line all these names can be used synonymously for the same window.)</content>
  526. +          </Contents>
  527. +        </topic>
  528.          <topic name="/loadDesc">
  529.            <Contents>
  530.              <content type="text">With this command you can load a new description for your character from a file. The text files for the descriptions must be in the [config-directory]/descriptions folder but don't have to follow the [char-name]_description.txt format. Any filename will do here.
  531. @@ -2248,16 +2266,25 @@
  532.  (This will request the server's MOTD and write it to the system chat tab.)</content>
  533.            </Contents>
  534.          </topic>
  535. +   <topic name="/petition">
  536. +          <Contents>
  537. +            <content type="text">This command creates a petition.
  538. +
  539. +Usage;
  540. +/petition [message]
  541. +(submits a petition with the text [message].)</content>
  542. +          </Contents>
  543. +        </topic>
  544.          <topic name="/picklock">
  545.            <Contents>
  546.              <content type="text">This command allows you to pick locks of doors and chests. At the moment there are no pickable locks in PS at all so this command is pretty useless for now.
  547.    
  548. -  Usage:
  549. -  /picklock
  550. -  (Picks the lock of your current target.)
  551. -  
  552. -  Additional Info:
  553. -  Okay, it's not true that there are no pickable locks in PS. There is one in the NPCroom map which is only available to GMs and devs. So for players this command is in fact pretty useless.</content>
  554. +Usage:
  555. +/picklock
  556. +(Picks the lock of your current target.)
  557. +
  558. +Additional Info:
  559. +Okay, it's not true that there are no pickable locks in PS. There is one in the NPCroom map which is only available to GMs and devs. So for players this command is in fact pretty useless.</content>
  560.            </Contents>
  561.          </topic>
  562.          <topic name="/ping">
  563. @@ -2332,31 +2359,55 @@
  564.  (Overwrites your old OOC description and sets it to [new-desc]. Every "\n" in [new-desc] is replaced with a newline.)</content>
  565.            </Contents>
  566.          </topic>
  567. +   <topic name="/setWindowPos">
  568. +          <Contents>
  569. +            <content type="text">With this command you can adjust the positions of windows.
  570. +
  571. +Usage:
  572. +/setWindowPos [windowname] [x] [y]
  573. +(Set the window with the name [windowname] to the positions [x]/[y]. Positive values of [x] and [y] are relative to the upper left corner of the screen while negative values are relative to the lower right corner. To get a list of possible window names use /listWindows. Be careful, it is possible to move windows outside the visible screen area with this (what can be used to disable unwanted pop-up windows like the group window for example. Just move it off the screen). To get the current positions of windows use /getWindowPos). It is not necessary that the window is currently visible you can move it around while it's invisible as well with this command.</content>
  574. +          </Contents>
  575. +        </topic>
  576. +   <topic name="/setWindowSize">
  577. +          <Contents>
  578. +            <content type="text">With this command you can adjust the size of windows.
  579. +
  580. +Usage:
  581. +/setWindowSize [windowname] [width] [height]
  582. +(Set the size of the window with the name [windowname]. To get a list of possible window names use /listWindows. To get the current size of windows use /getWindowPos). It is not necessary that the window is currently visible. You can resize it while it's invisible as well with this command. You can only resize windows that allow resizing in general with this command for other windows this command does nothing. You also can't make windows smaller than the minimum size allowed for them. If you try to make them smaller they will only resize to the minimum size.</content>
  583. +          </Contents>
  584. +        </topic>
  585.          <topic name="/show">
  586.            <Contents>
  587.              <content type="text">With this command you can open and close specific windows.
  588.    
  589. -  Usage:
  590. -  /show [windowname]
  591. -  (Opens the window with the name [windowname]. If the window was already openend it is closed again. Possible names are: activemagic, bag, buddy, chat, glyph, group, guild, help, info, inv, petition, quest, shortcut, skills, spells</content>
  592. +Usage:
  593. +/show [windowname]
  594. +(Shows the window with the name [windowname]. If the window was already openend it is closed again. To get a list of possible window names use /listWindows
  595. +
  596. +/show [windowname] show
  597. +(Always shows the window with the name [windowname]. If the window was already visible nothing happens.
  598. +
  599. +/show [windowname] hide
  600. +(Always hides the window with the name [windowname]. If the window was already hidden nothing happens.</content>
  601.            </Contents>
  602.          </topic>
  603.          <topic name="/sit">
  604.            <Contents>
  605.              <content type="text">This command allows your character to sit down.
  606.    
  607. -  Usage:
  608. -  /sit
  609. -  (Your character sits at his current position.)</content>
  610. +Usage:
  611. +/sit
  612. +(Your character sits at his current position.)</content>
  613.            </Contents>
  614.          </topic>
  615.          <topic name="/stand">
  616.            <Contents>
  617.              <content type="text">This command allows your character to stand up again. (Not possible if your character if overloaded)
  618.    
  619. -  Usage:
  620. -  /stand
  621. -  (Your character stands up again.)</content>
  622. +Usage:
  623. +/stand
  624. +(Your character stands up again.)</content>
  625.            </Contents>
  626.          </topic>
  627.          <topic name="/starttrading">
  628. @@ -2381,18 +2432,18 @@
  629.            <Contents>
  630.              <content type="text">This command opens the context-menu for the selected target.
  631.    
  632. -  Usage:
  633. -  /targetcontext
  634. -  (Opens the context menu for the selected target. This is the same menu you would get if your right-click the target)</content>
  635. +Usage:
  636. +/targetcontext
  637. +(Opens the context menu for the selected target. This is the same menu you would get if your right-click the target)</content>
  638.            </Contents>
  639.          </topic>
  640.          <topic name="/targetinfo">
  641.            <Contents>
  642.              <content type="text">This command opens the details-window for the selected target.
  643.    
  644. -  Usage:
  645. -  /targetinfo
  646. -  (Opens the details-window with information about the selected player or NPC.)</content>
  647. +Usage:
  648. +/targetinfo
  649. +(Opens the details-window with information about the selected player or NPC.)</content>
  650.            </Contents>
  651.          </topic>
  652.          <topic name="/testanim">
  653. @@ -2411,15 +2462,30 @@
  654.  Usage:
  655.  /tip
  656.  (Gets a tip from the server and writes it to the system chat tab.)</content>
  657. +     </Contents>
  658. +   </topic>  
  659. +        <topic name="/togglerun">
  660. +          <Contents>
  661. +            <content type="text">With this command you can change the current movement state of your character.
  662. +                
  663. +Usage:
  664. +/togglerun
  665. +(Toggles your current movement state. If you were running you are now walking and the other way around.)
  666. +
  667. +/togglerun run
  668. +(Puts you in the run state. If your character was already running nothing happens.
  669. +
  670. +/togglerun walk
  671. +(Puts you in the walk state. If your character was already walking nothing happens.</content>
  672.            </Contents>
  673.          </topic>
  674.          <topic name="/unstick">
  675.            <Contents>
  676.              <content type="text">This command might help you in case your character is stuck in the 3d environment. In some cases it can move your character back to a valid location.
  677.    
  678. -  Usage:
  679. -  /unstick
  680. -  (If possible moves your character back to a valid location. To use this command your character must be really stuck and not able to move anymore. Also this command needs you to not move at all for some seconds before you can use it.)</content>
  681. +Usage:
  682. +/unstick
  683. +(If possible moves your character back to a valid location. To use this command your character must be really stuck and not able to move anymore. Also this command needs you to not move at all for some seconds before you can use it.)</content>
  684.            </Contents>
  685.          </topic>
  686.          <topic name="/version">
  687. @@ -2435,9 +2501,9 @@
  688.            <Contents>
  689.              <content type="text">This command allows you to list characters that are currently online.
  690.    
  691. -  Usage:
  692. -  /who [filter]
  693. -  (Lists characters whose name or whose guild contain the expression specified by [filter]. If no [filter] is given all online characters are listed up to a limit of 40 names.</content>
  694. +Usage:
  695. +/who [filter]
  696. +(Lists characters whose name or whose guild contain the expression specified by [filter]. If no [filter] is given all online characters are listed up to a limit of 40 names.</content>
  697.            </Contents>
  698.          </topic>
  699.        </branch>
  700. @@ -2452,12 +2518,13 @@
  701.            </Contents>
  702.          </topic>
  703.          <topic name="/pet">
  704. -          <Contents><content type="text">This is the main command to interact with your pets.
  705. +          <Contents>
  706. +       <content type="text">This is the main command to interact with your pets.
  707.    
  708. -  For all the following commands [pet-name,] is either the name of your pet or it's number. If no [petname,] is given the first found pet of the ones you have currently summoned is used. Do not forget to add the "," after the name or number of your pet.
  709. +For all the following commands [pet-name,] is either the name of your pet or it's number. If no [petname,] is given the first found pet of the ones you have currently summoned is used. Do not forget to add the "," after the name or number of your pet.
  710.  
  711.  Usage:
  712. -/pet [pet-name,] assist</content>
  713. +/pet [pet-name,] assist
  714.  (This makes your pet assist you in combat by attacking your current target.)
  715.    
  716.  /pet [pet-name,] attack
  717. @@ -2482,18 +2549,9 @@
  718.  (Summons your pet. You need to have the necessary item equipped for this to work.)
  719.  
  720.  /pet [pet-name,] target [target]
  721. -(Sets the target of your pet. If no target is given the target of your character will be uses. If [target] is "me" you pet wil target your character. Otherwise [target] is interpreted as the name of the target you want to set.
  722. -              </Contents>
  723. -        </topic>
  724. -        <topic name="/petition">
  725. -          <Contents>
  726. -            <content type="text">This command creates a petition.
  727. -
  728. -Usage;
  729. -/petition [message]
  730. -(submits a petition with the text [message].)</content>
  731. -          </Contents>
  732. -        </topic>
  733. +(Sets the target of your pet. If no target is given the target of your character will be uses. If [target] is "me" you pet wil target your character. Otherwise [target] is interpreted as the name of the target you want to set.</content>
  734. +     </Contents>
  735. +        </topic>        
  736.        </branch>
  737.      </branch>
  738.  
  739. @@ -3590,15 +3648,15 @@
  740.      </Contents>
  741.      <topic name="Context Menu Icons">
  742.        <Contents>
  743. -        <content type="pic" src="ButtonLook;" padding="100" width="64" height="64" />
  744. +        <content type="pic" src="ButtonLook;" padding="100" width="64" height="64"/>
  745.          <content type="text">Use this button to examine objects or characters more closely.</content>
  746. -        <content type="pic" src="ButtonOpen;" padding="100" width="64" height="64" />
  747. +        <content type="pic" src="ButtonOpen;" padding="100" width="64" height="64"/>
  748.          <content type="text">Use this button to open chest or doors (In case of doors you also enter the buildings with it).</content>
  749. -        <content type="pic" src="ButtonPickup;" padding="100" width="64" height="64" />
  750. +        <content type="pic" src="ButtonPickup;" padding="100" width="64" height="64"/>
  751.          <content type="text">Use this button to pickup objects.</content>
  752. -        <content type="pic" src="ButtonLoot;" padding="100" width="64" height="64" />
  753. +        <content type="pic" src="ButtonLoot;" padding="100" width="64" height="64"/>
  754.          <content type="text">Use this button to loot items for fallen enemies.</content>
  755. -        <content type="pic" src="ButtonAttack;" padding="100" width="64" height="64" />
  756. +        <content type="pic" src="ButtonAttack;" padding="100" width="64" height="64"/>
  757.          <content type="text">Use this button to attack your enemies.</content>
  758.        </Contents>
  759.      </topic>
  760. @@ -3608,5 +3666,4 @@
  761.       study
  762.       tellnpcinternal
  763.       write -->
  764. -
  765.  <!--- example to use for icons: <content type="pic" src="ButtonLook;ButtonOpen;ButtonPush" align="0" width="200" height="200" padding="20"/> -->
  766. Index: src/client/cmdusers.cpp
  767. ===================================================================
  768. --- src/client/cmdusers.cpp (revision 8473)
  769. +++ src/client/cmdusers.cpp (working copy)
  770. @@ -111,7 +111,7 @@
  771.      cmdsource->Subscribe("/repair",        this);
  772.      cmdsource->Subscribe("/roll",          this);
  773.      cmdsource->Subscribe("/rotate",        this);
  774. -    cmdsource->Subscribe("/sell",          this);
  775. +    cmdsource->Subscribe("/sell",          this);    
  776.      cmdsource->Subscribe("/show",          this);
  777.      cmdsource->Subscribe("/sit",           this);
  778.      //cmdsource->Subscribe("/spawn",       this);
  779. @@ -138,6 +138,15 @@
  780.      cmdsource->Subscribe("/setoocdesc",    this); // set the ooc description of a char
  781.      cmdsource->Subscribe("/loaddesc",      this); // load a description for this char from a file
  782.      cmdsource->Subscribe("/loadoocdesc",   this); // load a ooc description for this char from a file
  783. +    cmdsource->Subscribe("/togglerun",     this); // changes the run status of the character
  784. +    cmdsource->Subscribe("/setwindowpos",  this); // set the position of a window
  785. +    cmdsource->Subscribe("/setwindowsize", this); // set the size of a window
  786. +    cmdsource->Subscribe("/listwindows",   this); // gets a list of all avialable windows
  787. +    cmdsource->Subscribe("/getwindowpos",  this); // gets the current position of window(s)
  788. +    cmdsource->Subscribe("/addhighlightname",      this);
  789. +    cmdsource->Subscribe("/delhighlightname",      this);
  790. +    cmdsource->Subscribe("/printhighlightnames",   this);
  791. +    cmdsource->Subscribe("/clearhighlightnames",   this);
  792.  }
  793.  
  794.  psUserCommands::~psUserCommands()
  795. @@ -189,7 +198,7 @@
  796.      cmdsource->Unsubscribe("/repair",                this);
  797.      cmdsource->Unsubscribe("/roll",                  this);
  798.      cmdsource->Unsubscribe("/rotate",                this);
  799. -    cmdsource->Unsubscribe("/sell",                  this);
  800. +    cmdsource->Unsubscribe("/sell",                  this);    
  801.      cmdsource->Unsubscribe("/show",                  this);
  802.      cmdsource->Unsubscribe("/sit",                   this);
  803.      //cmdsource->Unsubscribe("/spawn",               this);
  804. @@ -216,9 +225,16 @@
  805.      cmdsource->Unsubscribe("/setoocdesc",            this);
  806.      cmdsource->Unsubscribe("/loaddesc",              this);
  807.      cmdsource->Unsubscribe("/loadoocdesc",           this);
  808. +    cmdsource->Unsubscribe("/togglerun",             this);
  809. +    cmdsource->Unsubscribe("/setwindowpos",          this);
  810. +    cmdsource->Unsubscribe("/setwindowsize",         this);
  811. +    cmdsource->Unsubscribe("/listwindows",           this);
  812. +    cmdsource->Unsubscribe("/getwindowpos",          this);
  813. +    cmdsource->Unsubscribe("/addhighlightname",      this);
  814. +    cmdsource->Unsubscribe("/delhighlightname",      this);
  815. +    cmdsource->Unsubscribe("/printhighlightnames",   this);
  816. +    cmdsource->Unsubscribe("/clearhighlightnames",   this);
  817.  
  818. -
  819. -
  820.      // Unsubscribe emotes.
  821.      for(unsigned int i=0; i < emoteList.GetSize(); i++)
  822.      {
  823. @@ -311,7 +327,7 @@
  824.  
  825.      if (  words[0] == "/show")
  826.      {
  827. -        if (words.GetCount() > 1)
  828. +        if (words.GetCount() == 2)
  829.          {
  830.              pawsControlWindow* ctrlWindow = dynamic_cast<pawsControlWindow*>(PawsManager::GetSingleton().FindWidget("ControlWindow"));
  831.              if(!ctrlWindow || ctrlWindow->HandleWindowName(words[1]))
  832. @@ -319,8 +335,226 @@
  833.  
  834.              else return "That window cannot be found.";
  835.          }
  836. -        return "You need to specify a window to show";
  837. +        else if (words.GetCount() == 3)
  838. +   {
  839. +       if (words[2] == "show")
  840. +       {
  841. +       pawsControlWindow* ctrlWindow = dynamic_cast<pawsControlWindow*>(PawsManager::GetSingleton().FindWidget("ControlWindow"));
  842. +       if(!ctrlWindow || ctrlWindow->showWindowName(words[1]))
  843. +       {
  844. +           return NULL;
  845. +       }
  846. +       else
  847. +       {
  848. +           return "That window cannot be found.";
  849. +       }
  850. +       }
  851. +       if (words[2] == "hide")
  852. +       {
  853. +       pawsControlWindow* ctrlWindow = dynamic_cast<pawsControlWindow*>(PawsManager::GetSingleton().FindWidget("ControlWindow"));
  854. +       if(!ctrlWindow || ctrlWindow->hideWindowName(words[1]))
  855. +       {
  856. +           return NULL;
  857. +       }
  858. +       else
  859. +       {
  860. +           return "That window cannot be found.";
  861. +       }
  862. +       }
  863. +   }
  864. +        return "Usage: /show [windowname] [hide|show]";
  865.      }
  866. +    else if ( words[0] == "/setwindowpos" )
  867. +    {
  868. +   if (words.GetCount() == 4)
  869. +   {
  870. +       pawsControlWindow* ctrlWindow = dynamic_cast<pawsControlWindow*>(PawsManager::GetSingleton().FindWidget("ControlWindow"));
  871. +       // negative coordinates are relative to the lower right corner
  872. +       int x = atoi(words[2]);
  873. +       int y = atoi(words[3]);
  874. +       if (x < 0)
  875. +       {
  876. +       x = psengine->GetG2D()->GetWidth() + x;
  877. +       }
  878. +       if (y < 0)
  879. +       {
  880. +       y = psengine->GetG2D()->GetHeight() + y;
  881. +       }
  882. +       if(!ctrlWindow || ctrlWindow->setWindowPositionName(words[1], x, y))
  883. +       {
  884. +       return NULL;
  885. +       }
  886. +       else
  887. +       {
  888. +       return "That window cannot be found.";
  889. +       }
  890. +   }
  891. +   return "Usage: /setwindowpos [windowname] [x] [y]";
  892. +    }
  893. +    else if ( words[0] == "/setwindowsize" )
  894. +    {
  895. +   if (words.GetCount() == 4)
  896. +   {
  897. +       pawsControlWindow* ctrlWindow = dynamic_cast<pawsControlWindow*>(PawsManager::GetSingleton().FindWidget("ControlWindow"));
  898. +       if(!ctrlWindow || ctrlWindow->setWindowSizeName(words[1], atoi(words[2]), atoi(words[3])))
  899. +       {
  900. +       return NULL;
  901. +       }
  902. +       else
  903. +       {
  904. +       return "That window cannot be found.";
  905. +       }      
  906. +   }
  907. +   return "Usage: /setwindowpos [windowname] [x] [y]";
  908. +    }
  909. +    else if ( words[0] == "/listwindows" )
  910. +    {
  911. +   pawsControlWindow* ctrlWindow = dynamic_cast<pawsControlWindow*>(PawsManager::GetSingleton().FindWidget("ControlWindow"));
  912. +   if (ctrlWindow)
  913. +   {
  914. +       pawsChatWindow* chatWindow = (pawsChatWindow*)PawsManager::GetSingleton().FindWidget("ChatWindow");
  915. +            if(chatWindow)
  916. +       {  
  917. +                chatWindow->ChatOutput(ctrlWindow->getWindowNames());
  918. +       return NULL;
  919. +       }
  920. +       else
  921. +       {
  922. +       return "Could not find chat window...what brings up the question where I write this to.";
  923. +       }
  924. +   }
  925. +   else
  926. +   {
  927. +       return "Control window could not be found.";
  928. +   }
  929. +    }
  930. +    else if ( words[0] == "/getwindowpos" )
  931. +    {
  932. +   if (words.GetCount() == 2)
  933. +   {
  934. +       pawsControlWindow* ctrlWindow = dynamic_cast<pawsControlWindow*>(PawsManager::GetSingleton().FindWidget("ControlWindow"));
  935. +       if (ctrlWindow)
  936. +       {
  937. +       pawsChatWindow* chatWindow = (pawsChatWindow*)PawsManager::GetSingleton().FindWidget("ChatWindow");
  938. +       if(chatWindow)
  939. +       {  
  940. +           chatWindow->ChatOutput(ctrlWindow->getWindowPosition(words[1]));
  941. +           return NULL;
  942. +       }
  943. +       else
  944. +       {
  945. +           return "Could not find chat window...what brings up the question where I write this to.";
  946. +       }
  947. +       }
  948. +       else
  949. +       {
  950. +       return "Control window could not be found.";
  951. +       }
  952. +   }
  953. +   else
  954. +   {
  955. +       return "Usage: /getwindowpos [windowname]|all";
  956. +   }
  957. +    }
  958. +    else if ( words[0] == "/addhighlightname" )
  959. +    {
  960. +   if (words.GetCount() == 2)
  961. +   {
  962. +       pawsChatWindow* chatWindow = (pawsChatWindow*)PawsManager::GetSingleton().FindWidget("ChatWindow");
  963. +       if(chatWindow)
  964. +       {  
  965. +                if (chatWindow->addHighlightName(words[1]))
  966. +       {
  967. +           return NULL;
  968. +       }
  969. +       else
  970. +       {
  971. +           return "Name already highlighted.";
  972. +       }
  973. +       }
  974. +       else
  975. +       {
  976. +       return "Could not find chat window...what brings up the question where I write this to.";
  977. +       }
  978. +   }
  979. +   else
  980. +   {
  981. +       return "Usage: /addhighlightname [name]";
  982. +   }
  983. +    }
  984. +    else if ( words[0] == "/delhighlightname" )
  985. +    {
  986. +   if (words.GetCount() == 2)
  987. +   {
  988. +       pawsChatWindow* chatWindow = (pawsChatWindow*)PawsManager::GetSingleton().FindWidget("ChatWindow");
  989. +       if(chatWindow)
  990. +       {  
  991. +                if (chatWindow->delHighlightName(words[1]))
  992. +       {
  993. +           return NULL;
  994. +       }
  995. +       else
  996. +       {
  997. +           return "Name not found on the highlight list.";
  998. +       }
  999. +       }
  1000. +       else
  1001. +       {
  1002. +       return "Could not find chat window...what brings up the question where I write this to.";
  1003. +       }
  1004. +   }
  1005. +   else
  1006. +   {
  1007. +       return "Usage: /delhighlightname [name]";
  1008. +   }
  1009. +    }
  1010. +    else if ( words[0] == "/printhighlightnames" )
  1011. +    {
  1012. +   if (words.GetCount() == 1)
  1013. +   {
  1014. +       pawsChatWindow* chatWindow = (pawsChatWindow*)PawsManager::GetSingleton().FindWidget("ChatWindow");
  1015. +       if(chatWindow)
  1016. +       {  
  1017. +       csString highlightedNames = chatWindow->getHighlightName();
  1018. +       if (highlightedNames == "")
  1019. +       {
  1020. +           return "Your list of highlighted names is empty.";
  1021. +       }
  1022. +       else
  1023. +       {
  1024. +           return highlightedNames;
  1025. +       }
  1026. +       }
  1027. +       else
  1028. +       {
  1029. +       return "Could not find chat window...what brings up the question where I write this to.";
  1030. +       }
  1031. +   }
  1032. +   else
  1033. +   {
  1034. +       return "Usage: /printhighlightnames";
  1035. +   }
  1036. +    }
  1037. +    else if ( words[0] == "/clearhighlightnames" )
  1038. +    {
  1039. +   if (words.GetCount() == 1)
  1040. +   {
  1041. +       pawsChatWindow* chatWindow = (pawsChatWindow*)PawsManager::GetSingleton().FindWidget("ChatWindow");
  1042. +       if(chatWindow)
  1043. +       {  
  1044. +       chatWindow->clearHighlightList();
  1045. +       return "Removed all names from the highlight list.";
  1046. +       }
  1047. +       else
  1048. +       {
  1049. +       return "Could not find chat window...what brings up the question where I write this to.";
  1050. +       }
  1051. +   }
  1052. +   else
  1053. +   {
  1054. +       return "Usage: /clearhighlightnames";
  1055. +   }
  1056. +    }
  1057.      else if ( words[0] == "/study" )
  1058.      {
  1059.          pawsWidget * widget = PawsManager::GetSingleton().FindWidget("CraftWindow");
  1060. @@ -1121,6 +1355,41 @@
  1061.  
  1062.          }
  1063.      }
  1064. +    else if (words[0] == "/togglerun")
  1065. +    {
  1066. +   if ((psengine) && (psengine->GetCharControl()) && (psengine->GetCharControl()->GetMovementManager()))
  1067. +   {
  1068. +       if (words.GetCount() < 2)
  1069. +       {
  1070. +       // No parameter so just toggle the current running status of the character
  1071. +           psengine->GetCharControl()->GetMovementManager()->ToggleRun();
  1072. +       return "Run mode toggled";
  1073. +       }
  1074. +       else if (words.GetCount() == 2)
  1075. +       {
  1076. +       // Oh...we have one parameter. Lets see if it's a valid one...and then act accordingly
  1077. +       if (words[1] == "run")
  1078. +       {
  1079. +           // So we should run now? Fine master...whatever you want
  1080. +           psengine->GetCharControl()->GetMovementManager()->setRun(true);
  1081. +           return "Run mode enabled";
  1082. +       }
  1083. +       else if (words[1] == "walk")
  1084. +       {
  1085. +           // time for some relaxing walking for a change
  1086. +           psengine->GetCharControl()->GetMovementManager()->setRun(false);
  1087. +           return "Run mode disabled";
  1088. +       }
  1089. +       }
  1090. +       // well...if we didn't return yet the syntax was invalid so lets give a hint about the correct usage
  1091. +       return "Usage: /togglerun [run/walk]";
  1092. +   }
  1093. +   else
  1094. +   {
  1095. +       // if this ever happens a useful error-message is the least of our worries
  1096. +       return "Something went really wrong. Couldn't find a valid movement manager...how do you play this game at the moment at all?";
  1097. +   }
  1098. +    }
  1099.      else
  1100.      {
  1101.          psUserCmdMessage cmdmsg(cmd);
  1102. Index: src/client/gui/chatwindow.cpp
  1103. ===================================================================
  1104. --- src/client/gui/chatwindow.cpp   (revision 8473)
  1105. +++ src/client/gui/chatwindow.cpp   (working copy)
  1106. @@ -142,6 +142,7 @@
  1107.      settings.groupColor = white;
  1108.      settings.auctionColor = white;
  1109.      settings.helpColor = white;
  1110. +    settings.highlightColor = white;
  1111.      settings.mainBrackets = true;
  1112.      settings.yourColorMix = true;
  1113.      settings.joindefaultchannel = true;
  1114. @@ -466,6 +467,7 @@
  1115.              if ( nodeName == "grouptext") settings.groupColor = col;
  1116.              if ( nodeName == "auctiontext") settings.auctionColor = col;
  1117.              if ( nodeName == "helptext") settings.helpColor = col;
  1118. +       if ( nodeName == "highlight") settings.highlightColor = col;
  1119.          }
  1120.      }
  1121.  
  1122. @@ -1257,6 +1259,7 @@
  1123.      CreateSettingNode(colorNode,settings.playerColor,"playernametext");
  1124.      CreateSettingNode(colorNode,settings.auctionColor,"auctiontext");
  1125.      CreateSettingNode(colorNode,settings.helpColor,"helptext");
  1126. +    CreateSettingNode(colorNode,settings.highlightColor,"highlight");
  1127.      CreateSettingNode(colorNode,settings.groupColor,"grouptext");
  1128.      CreateSettingNode(colorNode,settings.yourColor,"yourtext");
  1129.      CreateSettingNode(colorNode,settings.guildColor,"guildtext");
  1130. @@ -1834,6 +1837,22 @@
  1131.              colour = settings.playerColor;
  1132.          }
  1133.      }
  1134. +    
  1135. +    // mix with the highlight color if the messahge is from a preson on the list (only for main chat)
  1136. +    if ((msg.iChatType == CHAT_SAY) || (msg.iChatType == CHAT_SHOUT))
  1137. +    {
  1138. +   // is the sender of this message in the list?
  1139. +   for (size_t i = 0; i < highlightList.GetSize(); i++)
  1140. +   {
  1141. +       // we don't really care about upper- and lowercase for the name
  1142. +       if (highlightList[i].CompareNoCase(noCasePerson))
  1143. +       {
  1144. +       // look like it's on the list so lets mix in the highlight color
  1145. +       colour = mixColours(colour, settings.highlightColor);
  1146. +       }
  1147. +   }
  1148. +    }
  1149. +    
  1150.  
  1151.      if (!buff.IsEmpty())
  1152.      {
  1153. @@ -2619,6 +2638,51 @@
  1154.      }
  1155.  }
  1156.  
  1157. +bool pawsChatWindow::addHighlightName(csString newName)
  1158. +{
  1159. +    // is the name already on the list?
  1160. +    for (size_t i = 0; i < highlightList.GetSize(); i++)
  1161. +    {
  1162. +   // we don't really care about upper- and lowercase for the name
  1163. +   if (highlightList[i].CompareNoCase(newName))
  1164. +        {
  1165. +       // look like it's already on the list..so just leave
  1166. +            return false;
  1167. +        }
  1168. +    }
  1169. +    // okay, not on the list yet...lets change that
  1170. +    highlightList.Push(newName);
  1171. +    return true;
  1172. +}
  1173. +
  1174. +bool pawsChatWindow::delHighlightName(csString removeName)
  1175. +{
  1176. +    // is the name on the list?
  1177. +    for (size_t i = 0; i < highlightList.GetSize(); i++)
  1178. +    {
  1179. +   // we don't really care about upper- and lowercase for the name
  1180. +   if (highlightList[i].CompareNoCase(removeName))
  1181. +        {
  1182. +       // Ha...found it. Too bad for it..lets remove it.
  1183. +       highlightList.DeleteIndex(i);
  1184. +            return true;
  1185. +        }
  1186. +    }
  1187. +    // not found
  1188. +    return false;
  1189. +}
  1190. +
  1191. +csString pawsChatWindow::getHighlightName()
  1192. +{
  1193. +    // pretty straight forward...interate through all names and add them to a string
  1194. +    csString returnString = "";
  1195. +    for (size_t i=0; i < highlightList.GetSize(); i++)
  1196. +    {
  1197. +   returnString.Append(highlightList[i]).Append("\n");
  1198. +    }
  1199. +    return returnString;
  1200. +}
  1201. +
  1202.  int pawsChatWindow::mixColours(int colour1, int colour2)
  1203.  {
  1204.      int r,g,b;
  1205. Index: src/client/gui/chatwindow.h
  1206. ===================================================================
  1207. --- src/client/gui/chatwindow.h (revision 8473)
  1208. +++ src/client/gui/chatwindow.h (working copy)
  1209. @@ -82,6 +82,7 @@
  1210.      int groupColor;
  1211.      int auctionColor;
  1212.      int helpColor;
  1213. +    int highlightColor;
  1214.      bool joindefaultchannel;
  1215.      bool defaultlastchat;
  1216.      bool looseFocusOnSend;
  1217. @@ -218,6 +219,26 @@
  1218.      pawsEditTextBox* getInputTextBox() {return inputText;};
  1219.      
  1220.      void writeChatHistory();
  1221. +    
  1222. +    /** Adds a new name to the highlight list
  1223. +     *
  1224. +     *  @param newName: The name to add to the list
  1225. +     *  @return "True" if the name was added, "false" if the name was already on the list
  1226. +     */
  1227. +    bool addHighlightName(csString newName);
  1228. +    /** Removes a name form the highlight list
  1229. +     *
  1230. +     *  @param removeName: The name to delete from the list
  1231. +     *  @return "True" if the name was removed, "false" if the name was not on the list
  1232. +     */
  1233. +    bool delHighlightName(csString removeName);
  1234. +    /** Removes all entries from the highlight list
  1235. +     */
  1236. +    void clearHighlightList() {highlightList.DeleteAll();};
  1237. +    /** returns all names on the highlight list
  1238. +     *  @return A string containing all names on the highlight list separated by newlines
  1239. +     */
  1240. +    csString getHighlightName();
  1241.  
  1242.      /// Reload Chat Window
  1243.      void ReloadChatWindow();
  1244. @@ -260,6 +281,9 @@
  1245.      csArray<csString> autoCompleteNames;
  1246.      ///Contains pointers to all the autocompletion lists (excluding command lists)
  1247.      csArray<csArray<csString> *> autoCompleteLists;
  1248. +    
  1249. +    /// list of names whose chat lines should be highlighted
  1250. +    csArray<csString> highlightList;
  1251.  
  1252.      /// list of last commands
  1253.      csRedBlackTree<psString> commandList;
  1254. Index: src/client/gui/pawscontrolwindow.cpp
  1255. ===================================================================
  1256. --- src/client/gui/pawscontrolwindow.cpp    (revision 8473)
  1257. +++ src/client/gui/pawscontrolwindow.cpp    (working copy)
  1258. @@ -59,7 +59,10 @@
  1259.  #define ICONS 14
  1260.  //////////////////////////////////////////////////////////////////////
  1261.  
  1262. +// consts
  1263. +const char* WINDOWSNAMESFILE ="/planeshift/data/gui/windowsnames.xml";
  1264.  
  1265. +
  1266.  //////////////////////////////////////////////////////////////////////
  1267.  // Construction/Destruction
  1268.  //////////////////////////////////////////////////////////////////////
  1269. @@ -119,6 +122,94 @@
  1270.  
  1271.      buttonUp = FindWidget("ShowButtonUp");
  1272.      buttonDown = FindWidget("ShowButtonDown");
  1273. +    
  1274. +    //get a list of all controlled windows and their alternative names
  1275. +    // first we clean the old array, who knows what was in there before or if this is the second time PostSetup runs
  1276. +    controlledWindows.Empty();
  1277. +    // then we crate a XML document reader...  
  1278. +    csRef<iDocumentSystem> xml = psengine->GetXMLParser ();
  1279. +    csRef<iDocument> doc = xml->CreateDocument();
  1280. +    csRef<iVFS> vfs =  csQueryRegistry<iVFS > ( PawsManager::GetSingleton().GetObjectRegistry());
  1281. +    if (!vfs)
  1282. +    {
  1283. +   // well, if we got here the question is probably how we got this far at all.
  1284. +   Error1("interresting...couldn't load the virtual file system plugin. Something is definitively fishy");
  1285. +   return false;
  1286. +    }
  1287. +    // ...and read the file with the names and alternative names with it...
  1288. +    csRef<iDataBuffer> buf(vfs->ReadFile (WINDOWSNAMESFILE));
  1289. +    if (!buf || !buf->GetSize ())
  1290. +    {
  1291. +   Error2("Error reading windows name file %s", WINDOWSNAMESFILE);
  1292. +        return false;
  1293. +    }
  1294. +    // ..just to hand it over to the XML parser
  1295. +    const char* error = doc->Parse( buf );
  1296. +    if ( error )
  1297. +    {
  1298. +        Error2("Error loading windows names file: %s", error);
  1299. +        return false;
  1300. +    }
  1301. +    // now the real work starts...making sense out of the xml file and storing it for later use
  1302. +    csRef<iDocumentNode> rootNode = doc->GetRoot();
  1303. +    if(!rootNode)
  1304. +    {
  1305. +        Error2("No XML root in %s", WINDOWSNAMESFILE);
  1306. +        return false;
  1307. +    }
  1308. +    csRef<iDocumentNodeIterator> windowsIt = rootNode->GetNodes();
  1309. +    // iterate through all nodes
  1310. +    while(windowsIt->HasNext())
  1311. +    {
  1312. +   csRef<iDocumentNode> baseNode = windowsIt->Next();
  1313. +   csString baseNodeName (baseNode->GetValue());
  1314. +   if (baseNodeName == "windows")
  1315. +   {
  1316. +       csRef<iDocumentNodeIterator> winIt = baseNode->GetNodes();
  1317. +       while(winIt->HasNext())
  1318. +       {
  1319. +       csRef<iDocumentNode> curNode = winIt->Next();
  1320. +       // check if it's a <window> node
  1321. +       csString nodeName (curNode->GetValue());
  1322. +       if (nodeName == "window")
  1323. +       {
  1324. +           // found a <windows> node, lets store it's content
  1325. +           WindowNames windowName;
  1326. +           windowName.name = curNode->GetAttributeValue("name");
  1327. +           if(!windowName.name.Length())
  1328. +           {
  1329. +           // no name given for this window, not good
  1330. +           Error2("Missing window name in  %s", WINDOWSNAMESFILE);
  1331. +           return false;
  1332. +           }
  1333. +           // now we also store the alternative names of this window
  1334. +           csRef<iDocumentNodeIterator> altNamesIt = curNode->GetNodes();
  1335. +           while (altNamesIt->HasNext())
  1336. +           {
  1337. +           csRef<iDocumentNode> altNameNode = altNamesIt->Next();
  1338. +           csString nodeAltName (altNameNode->GetValue());
  1339. +           // check if we found a <alternativeName> node
  1340. +           if (nodeAltName == "alternativeName")
  1341. +           {
  1342. +                 csString altName = altNameNode->GetAttributeValue("name");
  1343. +                 if(!altName.Length())
  1344. +                 {              
  1345. +                 // we got a alternative name node but no "name" attribute...bad
  1346. +                 Error2("Missing alternative window name in  %s", WINDOWSNAMESFILE);
  1347. +                 return false;
  1348. +                 }
  1349. +                 // for alt names we only want lowercase versions
  1350. +                 altName.Downcase();
  1351. +                 // store all found alternative names
  1352. +                 windowName.alternativeNames.Push(altName);
  1353. +           }
  1354. +           }
  1355. +           // last but no least we save the struct for later use
  1356. +           controlledWindows.Push(windowName);
  1357. +       }
  1358. +       }
  1359. +   }    
  1360. +    }    
  1361.      return true;
  1362.  }
  1363.  
  1364. @@ -295,86 +386,285 @@
  1365.  
  1366.  bool pawsControlWindow::HandleWindowName(csString widgetStr)
  1367.  {
  1368. -    csString widget;
  1369. -    widgetStr.Downcase();
  1370. -    if(widgetStr == "options" )
  1371. -        widget = "ConfigWindow";
  1372. -    else if(widgetStr == "stats" || widgetStr =="skills")
  1373. -        widget = "SkillWindow";
  1374. -    else if(widgetStr == "spell book" || widgetStr == "spells")
  1375. -        widget = "SpellBookWindow";
  1376. -    else if(widgetStr == "inventory" || widgetStr == "inv")
  1377. -        widget = "InventoryWindow";
  1378. -    else if(widgetStr == "help")
  1379. -        widget = "HelpWindow";
  1380. -    else if(widgetStr == "buddy")
  1381. -        widget = "BuddyWindow";
  1382. -    else if(widgetStr == "info")
  1383. -        widget = "InfoWindow";
  1384. -    else if(widgetStr == "petition" || widgetStr == "petitions")
  1385. -        widget = "PetitionWindow";
  1386. -    else if(widgetStr == "quest")
  1387. -        widget = "QuestNotebook";
  1388. -    else if(widgetStr == "gm")
  1389. -        widget = "GmGUI";
  1390. -    else if(widgetStr == "shortcut")
  1391. -        widget = "ShortcutWindow";
  1392. -    else if(widgetStr == "group")
  1393. -        widget = "GroupWindow";
  1394. -    else if(widgetStr == "guild")
  1395. -        widget = "GuildWindow";
  1396. -    else if(widgetStr == "glyph")
  1397. -        widget = "GlyphWindow";
  1398. -    else if(widgetStr == "sketch")
  1399. -        widget = "SketchWindow";
  1400. -    else if(widgetStr == "merchant")
  1401. -        widget = "MerchantWindow";
  1402. -    else if(widgetStr == "loot")
  1403. -        widget = "LootWindow";
  1404. -    else if(widgetStr == "detail")
  1405. -        widget = "DetailWindow";
  1406. -    else if(widgetStr == "exchange")
  1407. -        widget = "ExchangeWindow";
  1408. -    else if(widgetStr == "write")
  1409. -        widget = "WritingWindow";
  1410. -    else if(widgetStr == "read")
  1411. -        widget = "BookReadingWindow";
  1412. -    else if(widgetStr == "questreward")
  1413. -        widget = "QuestRewardWindow";
  1414. -    else if(widgetStr == "craft")
  1415. -        widget = "CraftWindow";
  1416. -    else if(widgetStr == "ignore")
  1417. -        widget = "IgnoreWindow";
  1418. -    else if(widgetStr == "bag" || widgetStr == "smallinventory")
  1419. -        widget = "SmallInventoryWindow";
  1420. -    else if(widgetStr == "talk" || widgetStr == "chat" || widgetStr == "communications")
  1421. -        widget = "ChatWindow";
  1422. -    else if(widgetStr == "activemagic")
  1423. -        widget = "ActiveMagicWindow";
  1424. -    else if(widgetStr == "managepetitions")
  1425. -        widget = "PetitionGMWindow";
  1426. -    else if(widgetStr == "quickspell")
  1427. -        widget = "HotBar";
  1428. -    else if(widgetStr == "music")
  1429. -        widget = "MusicWindow";
  1430. -    else if(widgetStr == "quit")
  1431. +    // first some special cases
  1432. +    csString widget = widgetStr;
  1433. +    widget.Downcase();
  1434. +    if(widget == "quit")
  1435.      {
  1436.          HandleQuit();
  1437.          return true;
  1438.      }
  1439. -    else if(widgetStr == "buy")
  1440. +    if(widget == "buy")
  1441.      {
  1442.          psengine->GetCmdHandler()->Execute("/buy");
  1443.          return true;
  1444.      }
  1445. -    if(widget)
  1446. +    // now the general window handling
  1447. +    // first we translate the given name to the real window name
  1448. +    widget = translateWidgetName(widgetStr);
  1449. +    // if the translation was successful we "handle" the window
  1450. +    if(widget != "")
  1451.      {
  1452.          HandleWindow(widget);
  1453.          return true;
  1454.      }
  1455. +    // otherwise we return with an error
  1456.      else return false;
  1457.  }
  1458.  
  1459. +bool pawsControlWindow::showWindow(csString widgetStr)
  1460. +{
  1461. +    // lets see if we can find the specified window
  1462. +    pawsWidget* widget = PawsManager::GetSingleton().FindWidget(widgetStr.GetData());
  1463. +    if (!widget)
  1464. +    {
  1465. +        // doesn't look like it, log and return with an error
  1466. +        Error2("%s isn't loaded", widgetStr.GetData());
  1467. +        return false;
  1468. +    }
  1469. +    // if the window was not visible before we show it now.
  1470. +    if ( !widget->IsVisible() )
  1471. +    {
  1472. +   widget->Show();
  1473. +    }
  1474. +    return true;
  1475. +}
  1476. +
  1477. +bool pawsControlWindow::hideWindow(csString widgetStr)
  1478. +{
  1479. +    // lets see if we can find the specified window
  1480. +    pawsWidget* widget = PawsManager::GetSingleton().FindWidget(widgetStr.GetData());
  1481. +    if (!widget)
  1482. +    {
  1483. +        // doesn't look like it, log and return with an error
  1484. +        Error2("%s isn't loaded", widgetStr.GetData());
  1485. +        return false;
  1486. +    }
  1487. +    // if the window was not visible before we show it now.
  1488. +    if ( widget->IsVisible() )
  1489. +    {
  1490. +   widget->Hide();
  1491. +   // Don't leave focus on us after hiding
  1492. +        if ( this->Includes(PawsManager::GetSingleton().GetCurrentFocusedWidget()) )
  1493. +   {
  1494. +            PawsManager::GetSingleton().SetCurrentFocusedWidget(NULL);
  1495. +   }
  1496. +    }
  1497. +    return true;
  1498. +}
  1499. +
  1500. +bool pawsControlWindow::showWindowName(csString widgetStr)
  1501. +{
  1502. +    // special window handling
  1503. +    csString widget = widgetStr;
  1504. +    widget.Downcase();
  1505. +    if(widget == "quit")
  1506. +    {
  1507. +        HandleQuit();
  1508. +        return true;
  1509. +    }
  1510. +    if(widget == "buy")
  1511. +    {
  1512. +        psengine->GetCmdHandler()->Execute("/buy");
  1513. +        return true;
  1514. +    }
  1515. +    // and the "normal" windows
  1516. +    widget = translateWidgetName(widgetStr);
  1517. +    if(widget != "")
  1518. +    {
  1519. +   // if the window was found show it
  1520. +        return showWindow(widget);
  1521. +    }
  1522. +    else return false;
  1523. +}
  1524. +
  1525. +bool pawsControlWindow::hideWindowName(csString widgetStr)
  1526. +{
  1527. +    // special window handling
  1528. +    csString widget = widgetStr;
  1529. +    widget.Downcase();
  1530. +    if(widget == "quit")
  1531. +    {
  1532. +        // well, hiding of quit is not supported (and doesn't really make sense)
  1533. +        return false;
  1534. +    }
  1535. +    if(widget == "buy")
  1536. +    {
  1537. +   // hiding of /buy isn't supported either at the moment
  1538. +        return false;
  1539. +    }
  1540. +    // translate the given name and hide the window if found
  1541. +    widget = translateWidgetName(widgetStr);
  1542. +    if(widget != "")
  1543. +    {
  1544. +        return hideWindow(widget);
  1545. +    }
  1546. +    else return false;
  1547. +}
  1548. +
  1549. +bool pawsControlWindow::setWindowPositionName(csString widgetStr, int x, int y)
  1550. +{
  1551. +    csString widget = translateWidgetName(widgetStr);
  1552. +    
  1553. +    // set the new position of the window
  1554. +    if(widget != "")
  1555. +    {
  1556. +   pawsWidget* w = PawsManager::GetSingleton().FindWidget(widget.GetData());
  1557. +   if (!w)
  1558. +   {
  1559. +       Error2("%s isn't loaded", widget.GetData());
  1560. +       return false;
  1561. +   }
  1562. +   w->SetRelativeFramePos(x,y);
  1563. +   return true;
  1564. +    }
  1565. +    return false;
  1566. +}
  1567. +
  1568. +bool pawsControlWindow::setWindowSizeName(csString widgetStr, int width, int height)
  1569. +{
  1570. +    csString widget = translateWidgetName(widgetStr);
  1571. +    
  1572. +    // set the new size of the window
  1573. +    if(widget != "")
  1574. +    {
  1575. +   pawsWidget* w = PawsManager::GetSingleton().FindWidget(widget.GetData());
  1576. +   if (!w)
  1577. +   {
  1578. +       Error2("%s isn't loaded", widget.GetData());
  1579. +       return false;
  1580. +   }
  1581. +   // first check if the window is resizeable at all, if not do nothing
  1582. +   if (w->IsResizable())
  1583. +   {
  1584. +       // then we check for the allowed minimum size
  1585. +       int minWidth, minHeight;
  1586. +       w->GetMinSize(minWidth, minHeight);
  1587. +       // if the given size is smaller than that set it to the minimum size
  1588. +       if (width < minWidth)
  1589. +       {
  1590. +       width = minWidth;
  1591. +       }
  1592. +       if (height < minHeight)
  1593. +       {
  1594. +       height = minHeight;
  1595. +       }
  1596. +       // and last but not least set the size
  1597. +       w->SetSize(width,height);
  1598. +       // needed to prevent some drawing errors...PAWS calls resize for all child widgets but not the parent itself.
  1599. +       w->Resize();
  1600. +   }
  1601. +   return true;
  1602. +    }
  1603. +    return false;
  1604. +}
  1605. +
  1606. +csString pawsControlWindow::getWindowNames()
  1607. +{
  1608. +    csString returnNames = "";
  1609. +    for (unsigned int i=0; i < controlledWindows.GetSize(); i++)
  1610. +    {
  1611. +   // add the real window name
  1612. +   returnNames.Append(controlledWindows[i].name);
  1613. +   for (unsigned int j=0; j<controlledWindows[i].alternativeNames.GetSize(); j++)
  1614. +   {
  1615. +       // add every found alternative name
  1616. +       returnNames.Append(" | ").Append(controlledWindows[i].alternativeNames[j]);
  1617. +   }
  1618. +   // add a newline after every window type
  1619. +   returnNames.Append("\n");
  1620. +    }
  1621. +    return returnNames;
  1622. +}
  1623. +
  1624. +csString pawsControlWindow::getWindowPosition(csString widgetStr)
  1625. +{
  1626. +    csString returnPositions = "";
  1627. +    // check if all positions are requested or only a specific window
  1628. +    csString window = widgetStr;
  1629. +    window.Downcase();
  1630. +    if (window == "all")
  1631. +    {
  1632. +    // so we want the positiosn of all windows
  1633. +   for (unsigned int i = 0; i < controlledWindows.GetSize(); i++)
  1634. +   {
  1635. +       pawsWidget* widget = PawsManager::GetSingleton().FindWidget(controlledWindows[i].name.GetData());
  1636. +       // error checking...this should only fail if someone messed up the definition file WINDOWSNAMESFILE
  1637. +       if (!widget)
  1638. +       {
  1639. +       // window could not be found
  1640. +       Error2("%s isn't loaded", widgetStr.GetData());
  1641. +       csString errMsg = "Could not find window ";
  1642. +       errMsg.Append(controlledWindows[i].name);
  1643. +       return errMsg;
  1644. +       }
  1645. +       else
  1646. +       {
  1647. +       // get the postion and add it to the string
  1648. +       csRect rect = widget->GetScreenFrame();
  1649. +       returnPositions.Append(controlledWindows[i].name).Append(" x:").Append(rect.xmin).Append("|").Append(rect.xmin-graphics2D->GetWidth())
  1650. +                      .Append(" y:").Append(rect.ymin).Append("|").Append(rect.ymin-graphics2D->GetHeight())
  1651. +                  .Append(" width:").Append(rect.Width()).Append(" height:").Append(rect.Height()).Append("\n");
  1652. +       }
  1653. +   }
  1654. +    }
  1655. +    else
  1656. +    {
  1657. +   // specific window
  1658. +        window = translateWidgetName(widgetStr);
  1659. +   pawsWidget* widget = PawsManager::GetSingleton().FindWidget(window.GetData());
  1660. +   if (!widget)
  1661. +   {
  1662. +       // window could not be found
  1663. +       Error2("%s isn't loaded", widgetStr.GetData());
  1664. +       csString errMsg = "Could not find window ";
  1665. +       errMsg.Append(window);
  1666. +       return errMsg;
  1667. +   }
  1668. +   else
  1669. +   {
  1670. +       // put the position in the string
  1671. +       csRect rect = widget->GetScreenFrame();
  1672. +       returnPositions.Append(window).Append(" x:").Append(rect.xmin).Append("|").Append(rect.xmin-graphics2D->GetWidth())
  1673. +                      .Append(" y:").Append(rect.ymin).Append("|").Append(rect.ymin-graphics2D->GetHeight())
  1674. +                  .Append(" width:").Append(rect.Width()).Append(" height:").Append(rect.Height());
  1675. +   }
  1676. +    }
  1677. +    return returnPositions;
  1678. +}
  1679. +
  1680. +csString pawsControlWindow::translateWidgetName(csString widgetStr)
  1681. +{
  1682. +    // first we convert to lowercase to be case-insensitive
  1683. +    widgetStr.Downcase();
  1684. +    csString compareName;
  1685. +    // lets check all names and alternative names if the requested window and be found
  1686. +    for (unsigned int i=0; i < controlledWindows.GetSize(); i++)
  1687. +    {
  1688. +   // again, convert to lowercase
  1689. +   compareName = controlledWindows[i].name;
  1690. +   compareName.Downcase();
  1691. +   if (widgetStr == compareName)
  1692. +   {
  1693. +       // that was simple, real window name was used
  1694. +       // of course we return the case sensitve version of the name
  1695. +       return controlledWindows[i].name;
  1696. +   }
  1697. +   // now we check the alternative names of this window..these should be all lowercase already from ::PostSetup()
  1698. +   for (unsigned int j=0; j<controlledWindows[i].alternativeNames.GetSize(); j++)
  1699. +   {
  1700. +       if (widgetStr == controlledWindows[i].alternativeNames[j])
  1701. +       {
  1702. +       // bingo...lets return the real window name
  1703. +       return controlledWindows[i].name;
  1704. +       }
  1705. +   }
  1706. +    }
  1707. +    // too bad, no window with that name found
  1708. +    return "";
  1709. +}
  1710. +
  1711. +
  1712.  void pawsControlWindow::HandleQuit()
  1713.  {
  1714.      PawsManager::GetSingleton().CreateYesNoBox( "\nDo you really wish to leave Yliakum?", this );
  1715. Index: src/client/gui/pawscontrolwindow.h
  1716. ===================================================================
  1717. --- src/client/gui/pawscontrolwindow.h  (revision 8473)
  1718. +++ src/client/gui/pawscontrolwindow.h  (working copy)
  1719. @@ -85,6 +85,58 @@
  1720.       * @return TRUE if the toggle was possible, returns FALSE if it was not found.
  1721.       */
  1722.      bool HandleWindowName(csString widgetStr);
  1723. +    
  1724. +    /** Used to show a window.
  1725. +     * If the window was already shown nothing happens.
  1726. +     * @param widgetStr: The window to show
  1727. +     * @return FALSE in case of an error otherwise TRUE
  1728. +     */
  1729. +    bool showWindow(csString widgetStr);
  1730. +    /** Used to hide a window.
  1731. +     * If the window was already hidden nothing happens.
  1732. +     * @param widgetStr: The window to show
  1733. +     * @return FALSE in case of an error otherwise TRUE
  1734. +     */
  1735. +    bool hideWindow(csString widgetStr);
  1736. +    /** Used to show a window from a command.
  1737. +     * If the window was already shown nothing happens.
  1738. +     * @param widgetStr: The window to hide (command form, translated to the actual window name by the function)
  1739. +     * @return FALSE in case of an error otherwise TRUE
  1740. +     */
  1741. +    bool showWindowName(csString widgetStr);
  1742. +    /** Used to hide a window from a command.
  1743. +     * If the window was already hidden nothing happens.
  1744. +     * @param widgetStr: The window to hide (command form, translated to the actual window name by the function)
  1745. +     * @return FALSE in case of an error otherwise TRUE
  1746. +     */
  1747. +    bool hideWindowName(csString widgetStr);
  1748. +    
  1749. +    /** Used to set the position of windows from a command.
  1750. +     *  @param widgetStr: The window to hide (command form, translated to the actual window name by the function)
  1751. +     *  @param x: New x postion ofthe window
  1752. +     *  @param y: New y postion ofthe window
  1753. +     *  @return FALSE in case of an error otherwise TRUE
  1754. +     */
  1755. +    bool setWindowPositionName(csString widgetStr, int x, int y);
  1756. +    
  1757. +    /** Used to set the size of windows from a command.
  1758. +     *  @param widgetStr: The window to resizehide (command form, translated to the actual window name by the function)
  1759. +     *  @param width: New width of the window
  1760. +     *  @param height: New height of the window
  1761. +     *  @return FALSE in case of an error otherwise TRUE
  1762. +     */
  1763. +    bool setWindowSizeName(csString widgetStr, int width, int height);
  1764. +    
  1765. +    /** Used to get all names and alternative names of windows from a command.
  1766. +     * @return a string containing all the window names
  1767. +     */
  1768. +    csString getWindowNames();
  1769. +    
  1770. +    /** Used to get the positions of windows from a command.
  1771. +     * @param widgetStr: The window that should return it's position. If "all" then all windows return their positions
  1772. +     * @return a string containing the requested position(s)
  1773. +     */
  1774. +    csString getWindowPosition(csString widgetStr);
  1775.  
  1776.      /** When the quit button is pressed this method displays the yes/no dialog
  1777.       * box to confirm that a user really wants to quit.
  1778. @@ -146,6 +198,19 @@
  1779.      bool Contains( int x, int y );
  1780.  
  1781.  private:
  1782. +    /** helper function for commands to translate to widget names from a more readable form
  1783. +     *  This takes the windows names and the alternative names from a file (standard: /planeshift/data/gui/windowsnames.xml)
  1784. +     *  and then returns the "offical" window name for the given parameter
  1785. +     *  @param widgetStr: The widget name to be translated
  1786. +     *  @return The actual widget name used by the system or an empty string if this widget is unknown to this function
  1787. +     */  
  1788. +    csString translateWidgetName(csString widgetStr);
  1789. +    struct WindowNames
  1790. +    {
  1791. +   csString name;
  1792. +   csArray<csString> alternativeNames;
  1793. +    }; // struct to contain the window names and their alternatives
  1794. +    csArray<WindowNames> controlledWindows;  // array of all window names that are controllable by commands
  1795.      unsigned short int style;
  1796.      bool hidden;
  1797.      csArray<WBName> wbs;
  1798. Index: src/client/psmovement.cpp
  1799. ===================================================================
  1800. --- src/client/psmovement.cpp   (revision 8473)
  1801. +++ src/client/psmovement.cpp   (working copy)
  1802. @@ -1000,3 +1000,19 @@
  1803.          toggleRun = true;
  1804.      }
  1805.  }
  1806. +
  1807. +void psMovementManager::setRun(bool runState)
  1808. +{
  1809. +    if (runState)
  1810. +    {
  1811. +   defaultmode = run;
  1812. +        Start(run);
  1813. +        toggleRun = true;
  1814. +    }
  1815. +    else
  1816. +    {
  1817. +   defaultmode = walk;
  1818. +        Stop(run);
  1819. +        toggleRun = false;
  1820. +    }
  1821. +}
  1822. Index: src/client/psmovement.h
  1823. ===================================================================
  1824. --- src/client/psmovement.h (revision 8473)
  1825. +++ src/client/psmovement.h (working copy)
  1826. @@ -194,6 +194,11 @@
  1827.      
  1828.      void ToggleAutoMove();
  1829.      void ToggleRun();
  1830. +    /**
  1831. +     * Changes the run state of the actor
  1832. +     * @param runState true sets the actor to running mode while false makes the actor walk
  1833. +     */
  1834. +    void setRun(bool runState);
  1835.  
  1836.      void SetSneaking(bool v) { sneaking = v; }
  1837.      bool Sneaking() { return sneaking; }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement