ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/MSVC/Daodan_Utility.c
(Generate patch)

Comparing Daodan/MSVC/Daodan_Utility.c (file contents):
Revision 572 by gumby, Sun Aug 29 19:13:47 2010 UTC vs.
Revision 573 by gumby, Thu Sep 9 09:27:04 2010 UTC

# Line 126 | Line 126 | void ONICALL DDrMake_Weapon_Message(char
126          }
127          
128   }
129 <        typedef struct
130 <        {
131 <                uint16_t x;
132 <                uint16_t y;
133 <                
134 <        } IMtPoint2D;
135 <                IMtPoint2D Point = {256, 250};
136 <                extern void* TSrTest;
129 >
130 > typedef struct
131 > {
132 >        uint16_t x;
133 >        uint16_t y;
134 >
135 > } IMtPoint2D;
136 > IMtPoint2D Point = {256, 250};
137 > extern void* TSrTest;
138 > extern void* TSrScores;
139 > unsigned int lastPasteTime;
140 >
141 > void DDrPasteHack()
142 > {
143 >        COtTextArea* cons = *(COtTextArea**)0x00571B74;
144 >        char* clipboardText = 0;
145 >        if(GetAsyncKeyState(0x56) && GetAsyncKeyState(VK_CONTROL) )
146 >        {
147 >                if(cons && cons->text_entries && cons->num_text_entries)
148 >                {
149 >                        //why abs()? so we dont have to reset the timer after a level load.
150 >                        if( abs(ONgGameState->GameTime - lastPasteTime) > 60) {
151 >                                //DDrConsole_Print(cons->text_entries[0].text);
152 >                                if(OpenClipboard(ONgPlatformData.Window))
153 >                                {
154 >                                        unsigned short charsUsed = strlen(cons->text_entries[0].text);
155 >                                        //get rid of the v character
156 >                                        if(charsUsed) charsUsed--;
157 >                                        clipboardText = GetClipboardData(CF_TEXT);
158 >                                        if(clipboardText && strlen(clipboardText) + charsUsed < 502)
159 >                                        {
160 >                                                strcpy_s( cons->text_entries[0].text + charsUsed, 502 - charsUsed - 1, clipboardText);
161 >                                                lastPasteTime = ONgGameState->GameTime;
162 >                                        }
163 >                                }
164 >                        }
165 >                        else
166 >                        {
167 >                                //need to hook whatever controls however often you can repeat characters...i guess.
168 >                                //cons->text_entries[0].text[strlen(cons->text_entries[0].text) - 1] = 0;
169 >                        }
170 >                }
171 >        }
172 > }
173   void ONICALL DDrText_Hook()
174   {
175 +
176          if(TSrTest)
177          {
178                  TSrContext_DrawText(TSrTest, "FINALLY THIS BLOODY TEXT THING WORKS\n Gotta call it at the right point...", 128, 0, &Point);    
179 +
180          }
181 < COrConsole_StatusLine_Display();
181 >        FLrRun_Scores();
182 >        DDrPasteHack();
183 >        
184 >        COrConsole_StatusLine_Display();
185  
186   }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)