Changeset 476
- Timestamp:
- Nov 3, 2009, 11:38:47 AM (15 years ago)
- Location:
- Daodan/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/BFW_Utility.h
r446 r476 24 24 void* TestContext; 25 25 void ONICALL COrTextArea_Print(uint32_t area, uint32_t priority, uint32_t textshade, uint32_t textshadowshade, const char* text, uint32_t unk_alwaws_0, uint32_t fadetime); 26 int ONICALL COrMessage_Print(char* Message, char* Key, void* noidea); 27 void ONICALL COrMessage_Remove(char* Key); 26 28 int16_t ONICALL TSrContext_DrawText(uint32_t TSrContext, char* Text, int alpha, uint32_t usuallyzero, OniRectangle* pRect); 27 29 int16_t ONICALL TSrContext_New( void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext); //int16_t TSrContext_New( TSFF*, size 7, ??? 1, ??? 1, ??? 0, TSrContext*); -
Daodan/src/Daodan.c
r474 r476 8 8 #include "Daodan_Persistence.h" 9 9 #include "Daodan_BSL.h" 10 #include "Daodan_Console.h" 10 11 11 12 #include "Daodan_WindowHack.h" … … 179 180 //Test newweap patch 180 181 // if (patch_newweapon) { 181 // DDrPatch_NOOP( OniExe + 0x000E4DF8, 2); 182 183 //Makes it always say "Recieved weapon_name." 184 //Needs check for loc_4DFC66 185 DDrPatch_NOOP( OniExe + 0x000E4DF8,2); 186 187 //Adds Weapon name and ammo meter to pickup autoprompt 188 DDrPatch_NOOP( OniExe + 0x000FAC73, 9); 189 DDrPatch_NOOP( OniExe + 0x000FAC80, 5); 190 DDrPatch_MakeCall( OniExe + 0xFAC85, DDrWeapon2Message); 191 192 //Moves location of colors 193 DDrPatch_Int32( OniExe + 0x0002E3D5, (int)&DDrDSayColors[0].Char ); 194 DDrPatch_Int32( OniExe + 0x0002E3DA, (int)&DDrDSayColors[0].Char ); 182 195 // } 183 196 -
Daodan/src/Daodan_BSL.c
r474 r476 673 673 } 674 674 675 uint16_t ONICALL bsl_findmsg(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) 676 { 677 //DDrMake_Weapon_Message(args[0].value_str32); 678 return false; 679 } 675 680 void SLrDaodan_Initalize() 676 681 { … … 684 689 685 690 SLrConfig(); 686 691 SLrScript_Command_Register_ReturnType("d_wp", "Shows weapon message", "wpn:string", sl_void, bsl_findmsg); 687 692 688 693 SLrScript_Command_Register_ReturnType("int32mul", "Multiplies two numbers", "n1:int n2:int", sl_int32, bsl_int32mul); -
Daodan/src/Daodan_Cheater.c
r474 r476 44 44 }; 45 45 46 47 46 48 // Just copied all these defines from the old daodan, they were originaly from SFeLi's code. 47 49 -
Daodan/src/Daodan_Console.c
r446 r476 31 31 return; 32 32 } 33 34 TStColorFormattingCharacter DDrDSayColors[] = { 35 {'r', 0, 0, 0xFFEB5050}, 36 {'z', 0, 0, 0xFFFFFFFF}, 37 {0} 38 }; 39 40 -
Daodan/src/Daodan_Console.h
r446 r476 14 14 } RGBA; 15 15 16 17 typedef struct { 18 char A; 19 char R; 20 char G; 21 char B; 22 } ARGB; 23 24 typedef struct { 25 char Char; 26 char ignored; 27 char alsoignored; 28 int Color; //ARGB Color; 29 } TStColorFormattingCharacter; 30 31 extern TStColorFormattingCharacter* TStColorFormattingCharacters; 32 extern TStColorFormattingCharacter DDrDSayColors[]; 16 33 void DDrConsole_Print(const char* text); 17 34 void DDrConsole_PrintColored(const char* text, int priority, RGBA color, RGBA shade); -
Daodan/src/Daodan_Utility.c
r380 r476 7 7 #include "Daodan_Utility.h" 8 8 #include "BFW_Utility.h" 9 #include "Oni.h" 9 10 10 11 const double fps = 60.0; … … 80 81 // if (!QueryPerformanceFrequency(&Frequency)) 81 82 return 1000.0; 82 83 83 84 // return Frequency.QuadPart; 84 85 } 86 87 void ONICALL DDrWeapon2Message(int* weapon, void* output_ptr) { 88 char buffer[128] = {0}; 89 char* weapon_string = (char*)(*(weapon + 1)+0x5C); 90 int16_t ammo = *(int16_t *)((int)weapon + 0x56); 91 int16_t maxammo = *(int16_t *)(*(weapon + 1)+0xC0); 92 float ratio = (float)ammo / (float)maxammo; 93 char ammocolor = ' '; 94 if(ratio >= .9) ammocolor = 'g'; 95 else if (ratio >= .5) ammocolor = 'y'; 96 else if (ratio >= .2) ammocolor = 'o'; 97 else ammocolor = 'r'; 98 DDrMake_Weapon_Message( weapon_string, buffer); //gets the name of the weapon and formats it...probably doesn't need to be in seperate func. 99 sprintf(SSrMessage_Find("autoprompt_weapon"), "%s |[%s.%i/%i]|", buffer, &ammocolor, ammo, maxammo); //copies the new string to ONGS 100 ONiGameState_FindAutoPromptMessage("weapon", output_ptr); //does what the code i replaced does. Basically tells the game to show the msg. 101 } 102 103 104 void ONICALL DDrMake_Weapon_Message(char* weapon_string, char* output_ptr) { 105 char* weapon_msg = NULL; //The normal "You have recieved X" message. 106 char weapon_name[64] = {'\0'}; //The stripped weapon name 107 //TODO, someday: dynamically detect different keybindings. 108 char default_msg[] = "Press [c.Q] to pick up weapon."; //default return 109 110 //Find the recieved message string 111 weapon_msg = SSrMessage_Find(weapon_string); 112 //this probably could be reorganized 113 if(weapon_msg) { //SSrMsgblah returns NULL if it can't find the message key 114 memcpy(weapon_name, weapon_msg, (strstr(weapon_msg," received.") - weapon_msg )); //strips uneeded characters 115 sprintf(output_ptr, "Press [c.Q] to pick up %s", weapon_name); 116 } 117 else { 118 memcpy(output_ptr, default_msg, sizeof(default_msg)); 119 } 120 121 } -
Daodan/src/Daodan_Utility.h
r276 r476 10 10 double ONICALL DDrMachineTime_High_Frequency(); 11 11 int64_t ONICALL DDrMachineTime_Sixtieths(); 12 12 void ONICALL DDrMake_Weapon_Message(char* weapon_string, char* output_ptr); 13 void ONICALL DDrWeapon2Message(int* weapon, void* output_ptr); 13 14 #endif -
Daodan/src/Daodan_Win32.c
r326 r476 35 35 Rect.right = Rect.left + Width; 36 36 Rect.bottom = Rect.top + Height; 37 AdjustWindowRect(&Rect, WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP , FALSE);37 AdjustWindowRect(&Rect, WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP | WS_TILEDWINDOW , FALSE); 38 38 39 PlatformData->Window = CreateWindowEx(0, "ONI ", "ONI ", WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP , Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, NULL, NULL, PlatformData->Instance, NULL);39 PlatformData->Window = CreateWindowEx(0, "ONI ", "ONI ", WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP | WS_TILEDWINDOW , Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, NULL, NULL, PlatformData->Instance, NULL); 40 40 ShowWindow(PlatformData->Window, SW_SHOWNORMAL); 41 41 UpdateWindow(PlatformData->Window); -
Daodan/src/Oni.h
r473 r476 22 22 uint8_t ONICALL ONrCheater(uint32_t cheat); 23 23 24 char* ONICALL SSrMessage_Find(char* message_key); //Returns a prompt message from a message key 25 void ONICALL ONiGameState_FindAutoPromptMessage(char* Note, void* ptr); 26 27 // 28 void ONICALL TMrInstance_GetDataPtr_List( 29 char Tag[4], //as in 'ONWC' 30 int MaxCount, //# of elements in PointerList 31 void** PointerList, //Where the found pointers go 32 int* FoundCount //Where the number of pointers found go. 33 ); 34 24 35 extern HINSTANCE g_Instance; 25 36 extern ONtPlatformData ONgPlatformData; … … 37 48 extern char SSgSearchOnDisk; 38 49 50 39 51 #endif -
Daodan/src/Oni_Symbols.S
r473 r476 73 73 symbol ( _COgDefaultTextShadow , 0x00133f74 ) 74 74 75 symbol ( _TStColorFormattingCharacter , 0x00133DA0 ) 76 77 symbol ( @COrMessage_Print@12 , 0x000304B0 ) 78 symbol ( @COrMessage_Remove@4 , 0x00030640 ) 79 75 80 // ScriptingLanguage 76 81 symbol ( @SLrScript_Command_Register_ReturnType@20 , 0x00077b20 ) … … 79 84 symbol ( @SLrGlobalVariable_Register_Float@12 , 0x00077ec0 ) 80 85 86 // Messages 87 symbol ( @SSrMessage_Find@4 , 0x0007F550 ) 88 symbol ( @ONiGameState_FindAutoPromptMessage@8 , 0x000FDBE0 ) 89 90 // Data 91 symbol ( @TMrInstance_GetDataPtr_List@16 , 0x00023540 ) -
Daodan/src/daodan_gl.c
r474 r476 242 242 Rect.right = Rect.left + gl->DisplayMode.Width; 243 243 Rect.bottom = Rect.top + gl->DisplayMode.Height; 244 AdjustWindowRect(&Rect, WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_CAPTION , TRUE);244 AdjustWindowRect(&Rect, WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_CAPTION |WS_TILEDWINDOW , FALSE); 245 245 246 246 SetWindowPos(ONgPlatformData.Window, NULL, Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, SWP_NOACTIVATE | SWP_NOZORDER);
Note:
See TracChangeset
for help on using the changeset viewer.