CString CX11Window::GetProperty( const CString& propertyName ) const {GUCEF_TRACE; if ( ( propertyName == "WINDOW" || propertyName == "HWND" ) || ( propertyName == "WINDOWINT" || propertyName == "HWNDINT" ) ) { Int64 windowAsInt = (Int64) GetWindow(); return Int64ToString( windowAsInt ); } return CString(); }
//nPlotFlag comes from CONV file and is 0-512 range, so needs conversion when looking for plot int32 HandlePlotFlag(int32 nPlotEventType /*get/set*/, FString nPlotGUID, int64 nPlotFlag, int32 nPlotValue) { int32 handled = FALSE_; FPlot plot; int32 plotIndex = -1; //position in plot array, so we keep track in one place and don't search multiple times for (int32 i = 0; i < GetParty()->Plots.Num(); i++) { if (GetParty()->Plots[i].GUID == nPlotGUID) { plot = GetParty()->Plots[i]; plotIndex = i; break; } } if (plot.ResRefID == 0) return FALSE_;//not found //int32 convertedFlag = PlotFlagConversion(plot.ResRefID, nPlotFlag); nPlotFlag = PlotFlagConversion(plot.ResRefID, nPlotFlag); //not needed int64 _hash = GetNewHash(nPlotGUID, TRUE_); switch (_hash) { case PLT_DEMO000PL_MAIN: { switch (nPlotEventType) { case EVENT_TYPE_GET_PLOT://only defined flags { //plot less than but bigger than int64 lessThan = FCString::Atoi64(*(IntToString(plot.ResRefID) + TEXT("000") + IntToString(255))); int64 biggerThan = FCString::Atoi64(*(IntToString(plot.ResRefID) + TEXT("000") + IntToString(0))); if (nPlotFlag <= lessThan && nPlotFlag >= biggerThan) //starting main flag in our plot range { #ifdef DEBUG LogError("Get Flags need to be > 255 in their respective plot, got " + IntToString(nPlotFlag)); #endif return FALSE_; } switch (nPlotFlag) { case DEMO_DECLINED_QUEST: { //This is a "defined" plot flag. When the plot is checked //to see whether the flag is true or false, its status is //determined using the following code. if (WR_GetPlotFlag(PLT_DEMO000PL_MAIN, DEMO_TALKED_TO_BARKEEP) == TRUE_ && WR_GetPlotFlag(PLT_DEMO000PL_MAIN, DEMO_QUEST_ACCEPTED) == FALSE_) { return TRUE_; } else { return FALSE_; } break; } default: { #ifdef DEBUG LogError(Int64ToString(_hash) + " GET Unknown flag: " + IntToString(nPlotFlag)); #endif // DEBUG break; } } break; } case EVENT_TYPE_SET_PLOT: { switch (nPlotFlag) { case DEMO_TALKED_TO_BARKEEP: { if (nPlotValue == -1) return FALSE_; //error, needs to be 0/1 return SetPlotFlag(plotIndex, nPlotFlag, TRUE_); } case DEMO_QUEST_ACCEPTED: { //TODO UT_AddItemToInventory(DEMO_INKEEPER_KEY_R); LogWarning("DEMO_QUEST_ACCEPTED: UT_AddItemToInventory(DEMO_INKEEPER_KEY_R)"); if (nPlotValue == -1) return FALSE_; //error, needs to be 0/1 return SetPlotFlag(plotIndex, nPlotFlag, TRUE_); } case DEMO_BANDIT_HOSTILE: { //This causes all members of the bandit's "team" (the bandit and //the other bar patrons) to turn hostile. Since they're in the presence //of the player already, they'll immediately perceive him and initiate //combat. UT_TeamGoesHostile(BANDIT_TEAM); //During debug manually add the player to the bandits threat target // for (int32 nIndex = 0; nIndex < GetArraySize(arTeam); nIndex++) // { // GameObject _member = arTeam[nIndex]; // SetEnemy(_member, GetHero()); // } WR_SetGameMode(static_cast<uint8>(EGameMode::GM_COMBAT)); break; } default: { #ifdef DEBUG LogError(Int64ToString(_hash) + " SET Unknown flag: " + IntToString(nPlotFlag)); #endif // DEBUG break; } } break; } default: { #ifdef DEBUG LogError("Unknown plot event type!!!"); #endif break; } } break; } default: { LogError("Plot not found, needed " + Int64ToString(_hash)); break; } } return handled; }