msg.hide = true;
recurse = true;
break;
+ case "/allies":
+ var player = g_Players[Engine.GetPlayerID()];
+
+ if (player && player.isAlly[sender])
+ msg.context = translate("Ally");
+ else
+ msg.hide = true;
+
+ recurse = true;
+ break;
case "/enemy":
// Check if we are in a team.
if (g_Players[Engine.GetPlayerID()] && g_Players[Engine.GetPlayerID()].team != -1)
|
|
|
42 | 42 | |
43 | 43 | extern int g_yres; |
44 | 44 | |
| 45 | #define UpdateBufferPositionSetting int* bufferPos = (int*)m_Settings["buffer_position"].m_pSetting; *bufferPos = m_iBufferPos; |
| 46 | |
45 | 47 | //------------------------------------------------------------------- |
46 | 48 | // Constructor / Destructor |
47 | 49 | //------------------------------------------------------------------- |
… |
… |
|
52 | 54 | { |
53 | 55 | AddSetting(GUIST_float, "buffer_zone"); |
54 | 56 | AddSetting(GUIST_CStrW, "caption"); |
| 57 | AddSetting(GUIST_int, "buffer_position"); |
55 | 58 | AddSetting(GUIST_int, "cell_id"); |
56 | 59 | AddSetting(GUIST_CStrW, "font"); |
57 | 60 | AddSetting(GUIST_CStrW, "mask_char"); |
… |
… |
|
84 | 87 | CStrW *pCaption = (CStrW*)m_Settings["caption"].m_pSetting; |
85 | 88 | pCaption->erase(m_iInsertPos, m_iComposedLength); |
86 | 89 | m_iBufferPos = m_iInsertPos; |
| 90 | UpdateBufferPositionSetting; |
87 | 91 | m_iComposedLength = 0; |
88 | 92 | m_iComposedPos = 0; |
89 | 93 | } |
… |
… |
|
126 | 130 | UpdateText(m_iBufferPos, m_iBufferPos, m_iBufferPos+1); |
127 | 131 | |
128 | 132 | m_iBufferPos += text.length(); |
| 133 | UpdateBufferPositionSetting; |
129 | 134 | m_iBufferPos_Tail = -1; |
130 | 135 | |
131 | 136 | UpdateAutoScroll(); |
… |
… |
|
171 | 176 | m_iBufferPos_Tail = -1; |
172 | 177 | } |
173 | 178 | |
| 179 | UpdateBufferPositionSetting; |
174 | 180 | UpdateText(m_iBufferPos, m_iBufferPos, m_iBufferPos+1); |
175 | 181 | |
176 | 182 | UpdateAutoScroll(); |
… |
… |
|
551 | 557 | break; |
552 | 558 | } |
553 | 559 | |
| 560 | UpdateBufferPositionSetting; |
554 | 561 | return IN_HANDLED; |
555 | 562 | } |
556 | 563 | |
… |
… |
|
585 | 592 | UpdateText(m_iBufferPos, m_iBufferPos, m_iBufferPos+1); |
586 | 593 | |
587 | 594 | m_iBufferPos += (int)wcslen(text); |
| 595 | UpdateBufferPositionSetting; |
588 | 596 | |
589 | 597 | sys_clipboard_free(text); |
590 | 598 | } |
… |
… |
|
660 | 668 | } |
661 | 669 | } |
662 | 670 | |
| 671 | UpdateBufferPositionSetting; |
663 | 672 | DeleteCurSelection(); |
664 | 673 | } |
665 | 674 | return IN_HANDLED; |
… |
… |
|
692 | 701 | |
693 | 702 | m_iBufferPos++; |
694 | 703 | } |
| 704 | UpdateBufferPositionSetting; |
695 | 705 | DeleteCurSelection(); |
696 | 706 | } |
697 | 707 | return IN_HANDLED; |
… |
… |
|
748 | 758 | m_iBufferPos_Tail = -1; |
749 | 759 | } |
750 | 760 | |
| 761 | UpdateBufferPositionSetting; |
751 | 762 | UpdateAutoScroll(); |
752 | 763 | |
753 | 764 | return IN_HANDLED; |
… |
… |
|
796 | 807 | m_iBufferPos_Tail = -1; |
797 | 808 | } |
798 | 809 | |
| 810 | UpdateBufferPositionSetting; |
799 | 811 | UpdateAutoScroll(); |
800 | 812 | |
801 | 813 | return IN_HANDLED; |
… |
… |
|
841 | 853 | GetScrollBar(0).SetScrollBarStyle(scrollbar_style); |
842 | 854 | } |
843 | 855 | |
| 856 | if (Message.value == CStr("buffer_position")) |
| 857 | { |
| 858 | GUI<int>::GetSetting(this, Message.value, m_iBufferPos); |
| 859 | } |
| 860 | |
844 | 861 | if (Message.value == CStr("size") || |
845 | 862 | Message.value == CStr("z") || |
846 | 863 | Message.value == CStr("font") || |
… |
… |
|
1098 | 1115 | default: |
1099 | 1116 | break; |
1100 | 1117 | } |
| 1118 | UpdateBufferPositionSetting; |
1101 | 1119 | } |
1102 | 1120 | |
1103 | 1121 | void CInput::UpdateCachedSize() |
… |
… |
|
1552 | 1570 | // Ensure positions are valid after caption changes |
1553 | 1571 | m_iBufferPos = std::min(m_iBufferPos, (int)caption.size()); |
1554 | 1572 | m_iBufferPos_Tail = std::min(m_iBufferPos_Tail, (int)caption.size()); |
| 1573 | UpdateBufferPositionSetting; |
1555 | 1574 | |
1556 | 1575 | if (font_name.empty()) |
1557 | 1576 | { |
… |
… |
|
2053 | 2072 | // Remove selection |
2054 | 2073 | m_iBufferPos_Tail = -1; |
2055 | 2074 | m_iBufferPos = virtualFrom; |
| 2075 | UpdateBufferPositionSetting; |
2056 | 2076 | } |
2057 | 2077 | |
2058 | 2078 | bool CInput::SelectingText() const |