RadioButton::Ptr RadioButton::Create( const sf::String& label, RadioButton::RadioButtonGroup::Ptr group ) { auto widget = std::make_shared<RadioButton>(); widget->SetLabel( label ); if( group ) { widget->SetGroup( group ); } else { widget->SetGroup( RadioButtonGroup::Create() ); } return widget; }
void AMech_RPGCharacter::SetUpGroup() { if (group == nullptr) { TArray<AMech_RPGCharacter*> charactersFound = UMiscLibrary::GetCharactersInRange(700, this); for (AMech_RPGCharacter* character : charactersFound) { if (character != this && character->GetTeam() == GetTeam() && character->GetGroup() != nullptr) { SetGroup(character->GetGroup()); break; } } } if (group == nullptr) { SetGroup(UGroup::CreateGroup(GetTeam())); } }
DCM_ATTRIBUTE_CLASS::DCM_ATTRIBUTE_CLASS() // DESCRIPTION : Constructor. // PRECONDITIONS : // POSTCONDITIONS : // EXCEPTIONS : // NOTES : //<<=========================================================================== { // constructor activities SetGroup(TAG_UNDEFINED_GROUP); SetElement(TAG_UNDEFINED_ELEMENT); SetType(ATTR_TYPE_3); SetVR(ATTR_VR_UN); mappedGroupM = TAG_UNDEFINED_GROUP; mappedElementM = TAG_UNDEFINED_ELEMENT; receivedLengthM = 0; transferVrM = TRANSFER_ATTR_VR_IMPLICIT; nestingDepthM = 0; definedLengthM = false; unVrDefinitionLookUpM = true; ensureEvenAttributeValueLengthM = true; loggerM_ptr = NULL; parentM_ptr = NULL; pahM_ptr = NULL; }
Widget* TeamBox::ClickUp(const Point2i &mousePosition, uint button) { if (associated_team) { if (!associated_team->IsLocal()) return NULL; // it's not a local team, we can't configure it !! Widget* w = WidgetList::ClickUp(mousePosition, button); if (w == nb_characters) { if (Network::GetInstance()->IsConnected()) { ValidOptions(); } return w; } if (w == player_name) { return w; } if (w == nullw) { if (button == Mouse::BUTTON_LEFT()) { if (group == MAX_TEAM_GROUPS-1) group = 0; else group++; } else { if (group == 0) group = MAX_TEAM_GROUPS-1; else group--; } SetGroup(group); UpdateTeam(associated_team->GetId()); } if (!w) { return w; } if (!custom_team_list.empty()) { if (w == next_custom_team) { player_name->SetText(custom_team_list[custom_team_current_id]->GetName()); if (custom_team_current_id == custom_team_list.size()-1) { custom_team_current_id = 0; } else { custom_team_current_id++; } } if (w == previous_custom_team) { player_name->SetText(custom_team_list[custom_team_current_id]->GetName()); if (custom_team_current_id == 0) { custom_team_current_id = custom_team_list.size()-1; } else { custom_team_current_id--; } } } } return NULL; }
void ARadioButton::ESSet(const AString& sPath,AUI_ES_VALUE_INTF* pValue) { if( pValue == NULL ) return; base_class::ESSet(sPath,pValue); if( sPath == _T("Checked") ) SetChecked( pValue->GetString()==_T("1") ? true : false ); else if( sPath == _T("Group") ) SetGroup( pValue->GetInt() ); }
Student::Student(Student &student) { SetName(student.GetName()); SetSurname(student.GetSurname()); SetGroup(student.GetGroup()); SetAge(student.GetAge()); }
Student::Student(const char* name, const char* surname, const char* group, int age) { SetName(name); SetSurname(surname); SetGroup(group); SetAge(age); }
DCM_ATTRIBUTE_CLASS::DCM_ATTRIBUTE_CLASS(UINT16 group, UINT16 element, ATTR_VR_ENUM vr) // DESCRIPTION : Constructor. // PRECONDITIONS : // POSTCONDITIONS : // EXCEPTIONS : // NOTES : //<<=========================================================================== { // constructor activities SetGroup(group); SetElement(element); SetType(ATTR_TYPE_3); SetVR(vr); mappedGroupM = group; mappedElementM = element; receivedLengthM = 0; transferVrM = TRANSFER_ATTR_VR_IMPLICIT; nestingDepthM = 0; definedLengthM = false; unVrDefinitionLookUpM = true; ensureEvenAttributeValueLengthM = true; loggerM_ptr = NULL; parentM_ptr = NULL; pahM_ptr = NULL; }
void COptionUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if( _tcsicmp(pstrName, _T("group")) == 0 ) SetGroup(pstrValue); else if( _tcsicmp(pstrName, _T("selected")) == 0 ) Selected(_tcsicmp(pstrValue, _T("true")) == 0); else if( _tcsicmp(pstrName, _T("selectedimage")) == 0 ) SetSelectedImage(pstrValue); else if( _tcsicmp(pstrName, _T("selectedhotimage")) == 0 ) SetSelectedHotImage(pstrValue); else if( _tcsicmp(pstrName, _T("selectedpushedimage")) == 0 ) SetSelectedPushedImage(pstrValue); else if( _tcsicmp(pstrName, _T("selectedforeimage")) == 0 ) SetSelectedForedImage(pstrValue); else if( _tcsicmp(pstrName, _T("selectedstateimage")) == 0 ) SetSelectedStateImage(pstrValue); else if( _tcsicmp(pstrName, _T("selectedstatecount")) == 0 ) SetSelectedStateCount(_ttoi(pstrValue)); else if( _tcsicmp(pstrName, _T("selectedbkcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetSelectedBkColor(clrColor); } else if( _tcsicmp(pstrName, _T("selectedtextcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetSelectedTextColor(clrColor); } else if( _tcsicmp(pstrName, _T("selectedfont")) == 0 ) SetSelectedFont(_ttoi(pstrValue)); else CButtonUI::SetAttribute(pstrName, pstrValue); }
HANDLE AddToListByName(const CString& sName, WPARAM flags, LPCTSTR about, bool bInteractive, bool bGroup) { ip addr = INADDR_NONE; CString sShortName( sName ); if ( ! bGroup ) { // Попытка получить IP из имени if ( addr == INADDR_NONE ) addr = ResolveToIP( sShortName ); // Поиск NetBIOS-имени if ( addr == INADDR_NONE ) addr = pluginNetBIOS.FindNameIP( sName ); // Неизвестный контакт if ( addr == INADDR_NONE && bInteractive ) { if ( MessageBox( NULL, TranslateT("Cannot resolve contacts IP-address. Add it anyway?"), modname_t, MB_YESNO | MB_ICONQUESTION ) != IDYES ) { return NULL; } } } // Поиск существующего контакта HANDLE hContact = GetContact( sShortName ); if ( ! hContact ) { // Добавление контакта hContact = (HANDLE)CallService( MS_DB_CONTACT_ADD, 0, 0 ); if ( hContact ) { CallService( MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)modname ); SetNick( hContact, sShortName ); SetGroup( hContact, bGroup ); db_set_ts( hContact, "CList", "MyHandle", sShortName ); db_set_b( hContact, "CList", "NotOnList", 1 ); db_set_b( hContact, "CList", "Hidden", 1 ); SetContactIP( hContact, addr ); SetElapsed( hContact, "IPTime" ); if ( about ) db_set_ts( hContact, modname, "About", about ); contact_scanner::ScanContact( hContact ); } } if ( hContact && ! ( flags & PALF_TEMPORARY ) && db_get_b( hContact, "CList", "NotOnList", 1 ) ) { // Оставляем контакт db_unset( hContact, "CList", "NotOnList" ); db_unset( hContact, "CList", "Hidden" ); } return hContact; }
/** ** Define a group. The current selected units become a new group. ** ** @param group Group number to create. */ static void UiDefineGroup(unsigned group) { for (size_t i = 0; i != Selected.size(); ++i) { if (Selected[i]->Player == ThisPlayer && Selected[i]->GroupId) { RemoveUnitFromGroups(*Selected[i]); } } SetGroup(&Selected[0], Selected.size(), group); }
/** ** Define a group. The current selected units become a new group. ** ** @param group Group number to create. */ static void UiDefineGroup(unsigned group) { for (int i = 0; i < NumSelected; ++i) { if (Selected[i]->Player == ThisPlayer && Selected[i]->GroupId) { RemoveUnitFromGroups(*Selected[i]); } } SetGroup(Selected, NumSelected, group); }
void TeamBox::SetTeam(Team& _team, bool read_team_values) { Team* old_team = associated_team; associated_team = &_team; if (_team.IsRemote()) { team_name->SetFont(dark_gray_color, Font::FONT_MEDIUM, Font::FONT_BOLD, false); // translators: this is the team listing and will expand in a context like "OOo team - Remote" team_name->SetText(Format(_("%s Team - Remote"), _team.GetName().c_str())); if (previous_custom_team) { previous_custom_team->SetVisible(false); next_custom_team->SetVisible(false); } } else { team_name->SetFont(primary_red_color, Font::FONT_MEDIUM, Font::FONT_BOLD, true); team_name->SetText(Format(_("%s Team"), _team.GetName().c_str())); if (previous_custom_team) { previous_custom_team->SetVisible(true); next_custom_team->SetVisible(true); } } UpdatePlayerType(); team_logo->SetSurface(_team.GetFlag()); // Update group SetGroup(_team.GetGroup()); if (read_team_values) { player_name->SetText(_team.GetPlayerName()); nb_characters->SetValue(_team.GetNbCharacters()); for (uint i=0; i<4; i++) { if (ai_names[i] == _team.GetAIName()) { SetAILevel(i); break; } } } else if (old_team) { UpdateTeam(old_team->GetId()); } previous_player_name = player_name->GetText(); NeedRedrawing(); }
void C_Slider::Setup(long ID,short Type) { SetReady(0); SetID(ID); SetType(Type); SetDefaultFlags(); SetGroup(0); BGX_=0; BGY_=0; SX_=0; SY_=0; Steps_=0; BgImage_=NULL; Slider_=NULL; MinPos_=0; MaxPos_=1; Callback_=NULL; }
HRESULT COpcSecurity::InitializeFromProcessToken(BOOL bDefaulted) { PSID pUserSid = NULL; PSID pGroupSid = NULL; HRESULT hr; Initialize(); hr = GetProcessSids(&pUserSid, &pGroupSid); if (SUCCEEDED(hr)) { hr = SetOwner(pUserSid, bDefaulted); if (SUCCEEDED(hr)) hr = SetGroup(pGroupSid, bDefaulted); } if (pUserSid != NULL) free(pUserSid); if (pGroupSid != NULL) free(pGroupSid); return hr; }
HRESULT COpcSecurity::InitializeFromThreadToken(BOOL bDefaulted, BOOL bRevertToProcessToken) { PSID pUserSid = NULL; PSID pGroupSid = NULL; HRESULT hr; Initialize(); hr = GetThreadSids(&pUserSid, &pGroupSid); if (HRESULT_CODE(hr) == ERROR_NO_TOKEN && bRevertToProcessToken) hr = GetProcessSids(&pUserSid, &pGroupSid); if (SUCCEEDED(hr)) { hr = SetOwner(pUserSid, bDefaulted); if (SUCCEEDED(hr)) hr = SetGroup(pGroupSid, bDefaulted); } if (pUserSid != NULL) free(pUserSid); if (pGroupSid != NULL) free(pGroupSid); return hr; }
void MpButton::Initialize (MpWindow *parent) { SetFrameStyle(Panel|Raised|Enhanced); state = first_expired; // initialize state (first_expired = true) // automatically change shape of button if it is in a pulldown menu if (parent->type == MpGlobal::PulldownMenuType) state |= in_pulldown; // get default for button highlighting if (Mp.GetButtonHighlighting()) state |= highlight; // possible default events for buttons AddEventMask(ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask); // horizontal padding - additional offset from frame SetPadding(4,0); // initially there is no pixmap or bitmap pixmap = 0; bitmap = 0; icon_width = icon_height = 0; // no bitmap mask mask = 0; // auto repeat is disabled // auto-repeat delay is given by MpGlobal::AutoRepeatDelay [ms] // auto-repeat interval is given by MpGlobal::AutoRepeatInterval [ms] // icon alignment: neuther left nor right is set, which means centered // save backgrund color when highlighting saveBackground = 0; // button group link SetGroup(0); }
BehaviorMetadata::BehaviorMetadata(const gd::String & extensionNamespace_, const gd::String & name_, const gd::String & fullname_, const gd::String & defaultName_, const gd::String & description_, const gd::String & group_, const gd::String & icon24x24, const gd::String & className_, std::shared_ptr<gd::Behavior> instance_, std::shared_ptr<gd::BehaviorsSharedData> sharedDatasInstance_) : extensionNamespace(extensionNamespace_), instance(instance_), sharedDatasInstance(sharedDatasInstance_) { #if defined(GD_IDE_ONLY) SetFullName(gd::String(fullname_)); SetDescription(gd::String(description_)); SetDefaultName(gd::String(defaultName_)); SetGroup(group_); className = className_; iconFilename = icon24x24; #if !defined(GD_NO_WX_GUI) if ( gd::SkinHelper::IconExists(iconFilename, 24) ) SetBitmapIcon(gd::SkinHelper::GetIcon(iconFilename, 24)); else if ( wxFile::Exists(iconFilename) ) SetBitmapIcon(wxBitmap(iconFilename, wxBITMAP_TYPE_ANY)); else { std::cout << "Warning: The icon file for behavior \"" << name_ << " was not found in the current skin icons" << " and the specified name is not an existing filename."; SetBitmapIcon(wxBitmap(24,24)); } #endif #endif if ( instance ) instance->SetTypeName(name_); if ( sharedDatasInstance ) sharedDatasInstance->SetTypeName(name_); }
void GroupCmd::Execute () { Clipboard* cb = GetClipboard(); if (cb == nil) { SetClipboard(cb = new Clipboard); Editor* ed = GetEditor(); Selection* s = ed->GetSelection(); if (s->Number() > 1) { Iterator i; GraphicView* views = ed->GetViewer()->GetGraphicView(); s->Sort(views); for (s->First(i); !s->Done(i); s->Next(i)) { s->GetView(i)->Interpret(this); } } } else { Clipboard* oldcb = cb; SetClipboard(cb = new Clipboard); Iterator i; for (oldcb->First(i); !oldcb->Done(i); oldcb->Next(i)) { oldcb->GetComp(i)->Interpret(this); } delete oldcb; } if (!cb->IsEmpty()) { if (_group == nil) { SetGroup(new GraphicComps); } _group->Interpret(this); _executed = true; } }
HRESULT COpcSecurity::Attach(PSECURITY_DESCRIPTOR pSelfRelativeSD) { PACL pDACL = NULL; PACL pSACL = NULL; BOOL bDACLPresent, bSACLPresent; BOOL bDefaulted; PACL m_pDACL = NULL; ACCESS_ALLOWED_ACE* pACE; HRESULT hr; PSID pUserSid; PSID pGroupSid; hr = Initialize(); if(FAILED(hr)) return hr; // get the existing DACL. if (!GetSecurityDescriptorDacl(pSelfRelativeSD, &bDACLPresent, &pDACL, &bDefaulted)) goto failed; if (bDACLPresent) { if (pDACL) { // allocate new DACL. m_pDACL = (PACL) malloc(pDACL->AclSize); if (m_pDACL == NULL) { hr = E_OUTOFMEMORY; goto failedMemory; } // initialize the DACL if (!InitializeAcl(m_pDACL, pDACL->AclSize, ACL_REVISION)) goto failed; // copy the ACES for (int i = 0; i < pDACL->AceCount; i++) { if (!GetAce(pDACL, i, (void **)&pACE)) goto failed; if (!AddAccessAllowedAce(m_pDACL, ACL_REVISION, pACE->Mask, (PSID)&(pACE->SidStart))) goto failed; } if (!IsValidAcl(m_pDACL)) goto failed; } // set the DACL if (!SetSecurityDescriptorDacl(m_pSD, m_pDACL ? TRUE : FALSE, m_pDACL, bDefaulted)) goto failed; } // get the existing SACL. if (!GetSecurityDescriptorSacl(pSelfRelativeSD, &bSACLPresent, &pSACL, &bDefaulted)) goto failed; if (bSACLPresent) { if (pSACL) { // allocate new SACL. m_pSACL = (PACL) malloc(pSACL->AclSize); if (m_pSACL == NULL) { hr = E_OUTOFMEMORY; goto failedMemory; } // initialize the SACL if (!InitializeAcl(m_pSACL, pSACL->AclSize, ACL_REVISION)) goto failed; // copy the ACES for (int i = 0; i < pSACL->AceCount; i++) { if (!GetAce(pSACL, i, (void **)&pACE)) goto failed; if (!AddAccessAllowedAce(m_pSACL, ACL_REVISION, pACE->Mask, (PSID)&(pACE->SidStart))) goto failed; } if (!IsValidAcl(m_pSACL)) goto failed; } // set the SACL if (!SetSecurityDescriptorSacl(m_pSD, m_pSACL ? TRUE : FALSE, m_pSACL, bDefaulted)) goto failed; } if (!GetSecurityDescriptorOwner(m_pSD, &pUserSid, &bDefaulted)) goto failed; if (FAILED(SetOwner(pUserSid, bDefaulted))) goto failed; if (!GetSecurityDescriptorGroup(m_pSD, &pGroupSid, &bDefaulted)) goto failed; if (FAILED(SetGroup(pGroupSid, bDefaulted))) goto failed; if (!IsValidSecurityDescriptor(m_pSD)) goto failed; return hr; failed: hr = HRESULT_FROM_WIN32(hr); failedMemory: if (m_pDACL) { free(m_pDACL); m_pDACL = NULL; } if (m_pSD) { free(m_pSD); m_pSD = NULL; } return hr; }
void UiPropertyGrid::AddElement( SceneManager::Property* property, const std::string& group ) { AddPropertyMapping(property, this); //don't touch! if ( group.size() != 0 ) SetGroup(property,group); if( property->GetType() == SceneManager::PROPERTY_INT ) { TwAddVarCB(m_panel, property->GetName().c_str(), TW_TYPE_INT32, SetCallbackPropertyInt, GetCallbackPropertyInt, property, property->GetParameters().c_str() ); } else if ( property->GetType() == SceneManager::PROPERTY_FLOAT ) { TwAddVarCB(m_panel, property->GetName().c_str(), TW_TYPE_FLOAT, SetCallbackPropertyFloat, GetCallbackPropertyFloat, property, property->GetParameters().c_str() ); } else if ( property->GetType() == SceneManager::PROPERTY_DOUBLE ) { TwAddVarCB(m_panel, property->GetName().c_str(), TW_TYPE_DOUBLE, SetCallbackPropertyDouble, GetCallbackPropertyDouble, property, property->GetParameters().c_str() ); } else if ( property->GetType() == SceneManager::PROPERTY_BOOL ) { TwAddVarCB(m_panel, property->GetName().c_str(), TW_TYPE_BOOLCPP, SetCallbackPropertyBool, GetCallbackPropertyBool, property, property->GetParameters().c_str() ); } else if ( property->GetType() == SceneManager::PROPERTY_STRING ) { TwAddVarCB(m_panel, property->GetName().c_str(), TW_TYPE_STDSTRING, SetCallbackPropertyString, GetCallbackPropertyString, property, property->GetParameters().c_str() ); } else if ( property->GetType() == SceneManager::PROPERTY_VECTOR3F ) { TwAddVarCB(m_panel, property->GetName().c_str(), TW_TYPE_DIR3F, SetCallbackPropertyVector3f, GetCallbackPropertyVector3f, property, property->GetParameters().c_str() ); } else if ( property->GetType() == SceneManager::PROPERTY_VECTOR4F ) { TwAddVarCB(m_panel, property->GetName().c_str(), TW_TYPE_COLOR4F, SetCallbackPropertyVector4f, GetCallbackPropertyVector4f, property, property->GetParameters().c_str() ); } else if ( property->GetType() == SceneManager::PROPERTY_QUATERNION ) { TwAddVarCB(m_panel, property->GetName().c_str(), TW_TYPE_QUAT4F, SetCallbackPropertyQuat, GetCallbackPropertyQuat, property, property->GetParameters().c_str() ); } else if ( property->GetType() == SceneManager::PROPERTY_COLOR ) { TwAddVarCB(m_panel, property->GetName().c_str(), TW_TYPE_COLOR3F, SetCallbackPropertyVector3f, GetCallbackPropertyVector3f, property, property->GetParameters().c_str() ); } else if ( property->GetType() == SceneManager::PROPERTY_TEXTURE ) { AddTextureElement(property,group); } else if ( property->GetType() == SceneManager::PROPERTY_SELECTION_LIST ) { AddDropDownElement(property,group); } }
void scion02::Execute(void) { /* Here is where you put what happens every frame. */ // paths // spawn_scout1 >> strike1 // spawn_scout2 >> strike2 // SetCurAmmo(player,1500);//TEMP // SetCurHealth(player,2000);//TEMP //STARTING PARAMETERS char tempstr[128]; if ((!been_detected) && (mission_state<5)) // 5= ambush is set { /* Handle foe=GetWhoShotMe(player); if ((foe!=NULL) && (foe!=oldscout) && (IsAlive(oldscout)) && // I just added this.. probably unness if HandleScout worked (GetTeamNum(oldscout)==comp_team)) */ if ((GetDistance(enemytank1,player)<75.0f) || (GetDistance(enemytank2,player)<75.0f) || (GetDistance(enemyscout1,player)<75.0f) || (GetDistance(enemyscout2,player)<75.0f)) { been_detected=true; mission_state=101; AudioMessage("scion0220.wav"); // oh no we've been detected been_detected=true; } HandleScout(); } switch (mission_state) { case 0: { // HACK to fix bug Handle shab=GetHandle("shabayev"); // what is she doing here anyway? RemoveObject(shab); // play message talk1 = AudioMessage("scion0201.wav"); // take over base SetScrap(1,40); // Your starting base int grp=GetFirstEmptyGroup(); recycler=BuildObject("fvrec2",1,"recycler"); SetGroup(recycler,grp); grp++; scav1=BuildObject("fvscav",1,"scav_1"); SetGroup(scav1,grp); grp++; scav2=BuildObject("fvscav",1,"scav_2"); SetGroup(scav2,grp); grp++; turret1=BuildObject("fvturr",1,"turret_1"); SetGroup(turret1,grp); turret2=BuildObject("fvturr",1,"turret_2"); SetGroup(turret2,grp); grp++; sent1=BuildObject("fvtank",1,"tank_1"); SetGroup(sent1,grp); sent2=BuildObject("fvtank",1,"tank_2"); SetGroup(sent2,grp); grp++; constructor=BuildObject("fvcos2",1,"cons_1"); SetGroup(constructor,grp); objective=BuildObject("ibnav",1,"jammer"); // These units have smaller engage ranges enemytank1=BuildObject("ivtas2",2,"etank_1"); enemyscout1=BuildObject("ivscos2",2,"escout_1"); enemytank2=BuildObject("ivtas2",2,"etank_2"); enemyscout2=BuildObject("ivscos2",2,"escout_2"); Patrol(enemytank1,"isdf_patrol1",0); Patrol(enemyscout1,"isdf_patrol1",0); Patrol(enemytank2,"isdf_patrol2",0); Patrol(enemyscout2,"isdf_patrol2",0); BuildObject("ibgtow",comp_team,"egtow_1"); BuildObject("ibgtow",comp_team,"egtow_2"); power1=BuildObject("ibpgen",comp_team,"epgen_1"); power2=BuildObject("ibpgen",comp_team,"epgen_2"); BuildObject("ibsbay",comp_team,"esbay"); BuildObject("ibfact",comp_team,"efact"); enemybase=BuildObject("ibrecy",comp_team,"erecy"); BuildObject("ibarmo",comp_team,"earmo"); base_unit_1=BuildObject("ivtank",comp_team,"base_unit_1"); base_unit_2=BuildObject("ivmisl",comp_team,"base_unit_2"); base_unit_3=BuildObject("ivtank",comp_team,"base_unit_3"); base_unit_4=BuildObject("ivmisl",comp_team,"base_unit_4"); mission_state++; } break; case 1: // further instruction if ((IsAudioMessageDone(talk1))) { ClearObjectives(); AudioMessage("scion0202.wav"); AddObjective("scion0201.otf",WHITE,20.0f); SetObjectiveOn(objective); TranslateString2(tempstr, sizeof(tempstr), "MissionS0201"); // Ambush SetObjectiveName(objective,tempstr); mission_state++; } break; case 2: // player arrives at ambush site if (GetDistance(player,objective)<75.0f) { AudioMessage("scion0203.wav"); // good now set up ClearObjectives(); AddObjective("scion0202.otf",WHITE,20.0f); AddObjective("scion0203.otf",WHITE,20.0f); mission_state++; } break; case 3: // wait for the constructor to show up if (GetDistance(constructor,objective)<75.0f) { AudioMessage("scion0204.wav"); // Good, now build a jammer ClearObjectives(); AddObjective("scion0202.otf",GREEN,5.0f); AddObjective("scion0203.otf",WHITE,5.0f); mission_state++; } break; case 4: if (jammer_exists) { AudioMessage("scion0205.wav"); // now drive into the enemy base and lead them to // your ambush. ClearObjectives(); AddObjective("scion0204.otf",WHITE,10.0f); mission_state++; SetIndependence(enemytank1,1); SetIndependence(enemytank2,1); SetIndependence(enemyscout1,1); SetIndependence(enemyscout2,1); been_detected=true; // doesn't matter now } break; case 5: if ((GetDistance(player,base_unit_1)<200.0f) || (GetDistance(player,base_unit_2)<200.0f) || (GetDistance(player,enemytank1)<75.0f) || (GetDistance(player,enemyscout1)<75.0f)) { AudioMessage("scion0206.wav"); // Here they come! Goto(base_unit_1,"go_jammer"); Goto(base_unit_2,"go_jammer"); Goto(base_unit_3,"go_jammer"); Goto(base_unit_4,"go_jammer"); Attack(enemyscout1,player); Attack(enemytank1,player); // the ambush has begun mission_state++; } break; case 6: // wait for ambush to end if (!IsAlive(player)) { if (IsAlive(base_unit_1)) Attack(base_unit_1,jammer); if (IsAlive(base_unit_2)) Attack(base_unit_2,jammer); if (IsAlive(base_unit_3)) Attack(base_unit_3,jammer); if (IsAlive(base_unit_4)) Attack(base_unit_4,jammer); if (IsAlive(enemyscout1)) Attack(enemyscout1,player); if (IsAlive(enemytank1)) Attack(enemytank1,player); } if ((!IsAlive(base_unit_1)) && (!IsAlive(base_unit_2)) && (!IsAlive(base_unit_3)) && (!IsAlive(base_unit_4))) { AudioMessage("scion0207.wav"); ArtilleryObjective(); /* Now we will use artillery to finish off the base surgically */ // set where the artillery goes as an objective, // wait for the player to build it SetObjectiveOff(objective); objective2=BuildObject("ibnav",1,"escout_1"); SetObjectiveOn(objective2); TranslateString2(tempstr, sizeof(tempstr), "MissionS0202"); // Artillery SetObjectiveName(objective2,tempstr); mission_state++; } break; case 7: // wait for artillery if ((IsAlive(artillery)) || (IsAlive(artillery2))) { AudioMessage("scion0208.wav"); art_objective1=true; ArtilleryObjective(); mission_state++; } break; case 8: // wait for it to get there if ( ((IsAlive(artillery2)) && (GetDistance(artillery,objective2)<50.0f)) || ((IsAlive(artillery2)) && (GetDistance(artillery2,objective2)<50.0f)) ) { art_objective2=true; ArtilleryObjective(); AudioMessage("scion0209.wav"); SetObjectiveOn(power1); SetObjectiveOn(power2); mission_state++; } break; case 9: increment++; if (increment%300==0) { if (!last_objective) { ClearObjectives(); AddObjective("scion0206.otf",WHITE,5.0f); last_objective=true; } Handle atk1=BuildObject("ivscout",2,"base_unit_2"); Attack(atk1,artillery); } if ((!IsAlive(power1)) || (!IsAlive(power2))) { AudioMessage("scion0210.wav"); if (IsAlive(power1)) SetObjectiveOff(power1); if (IsAlive(power2)) SetObjectiveOff(power2); mission_state++; } break; case 10: if (GetDistance(player,"erecy")<75.0f) { AudioMessage("scion0211.wav"); SucceedMission(GetTime()+10.0f,"scion02w1.txt"); mission_state++; } break; case 101: // player is detected too soon { increment++; if (increment%300==0) { Handle atk=BuildObject("ivtank",comp_team,"efact"); Attack(atk,recycler); atk=BuildObject("ivmbike",comp_team,"efact"); Attack(atk,recycler); atk=BuildObject("ivrckt",comp_team,"spawn_scout1"); Goto(atk,"strike1"); } } break; case 102: /* You lose, movie etc. */ { FailMission(GetTime()+15.0f,"scion0201.otf"); mission_state++; } break; } //making sure isdf base guardians stay in the area /* if ((!tank1toofar) && (GetDistance(basetank1,"goback") > 250)) { Retreat(basetank1,"goback"); tank1toofar = true; } if ((!tank2toofar) && (GetDistance(basetank2,"goback") > 250)) { Retreat(basetank2,"goback"); tank2toofar = true; } if ((!scout1toofar) && (GetDistance(scout1,"goback") > 250)) { Retreat(scout1,"goback"); scout1toofar = true; } /// if ((tank1toofar) && (GetDistance(basetank1,"goback") <100)) { Attack(basetank1,player); tank1toofar = false; } if ((tank2toofar) && (GetDistance(basetank2,"goback") <100)) { Attack(basetank2,player); tank2toofar = false; } if ((scout1toofar) && (GetDistance(scout1,"goback") <100)) { Attack(scout1,player); scout1toofar = false; } */ if ((mission_state<102) && (!IsAlive(recycler))) { mission_state=102; } player = GetPlayerHandle(); }
GroupLayout::GroupLayout( VspScreen* screen, Fl_Group* group ) { Init(); m_Screen = screen; SetGroup( group ); }
void ARadioButton::SetPropFromNode(AMLBody* pNode) { base_class::SetPropFromNode(pNode); if( pNode->HasProp(_T("gr")) ) SetGroup( AIntVal(pNode->GetProp(_T("gr")))); if( pNode->HasProp(_T("chk")) ) SetChecked( AIntVal(pNode->GetProp(_T("chk"))) == 1 ? true : false ); }
void CSysOptionUI::SetAttribute( LPCTSTR pstrName, LPCTSTR pstrValue ) { if(_tcscmp(pstrName, _T("group")) == 0) SetGroup(pstrValue); else if(_tcscmp(pstrName, _T("selected")) == 0) m_bSelected = _tcscmp(pstrValue, _T("true"))==0; else return __super::SetAttribute(pstrName, pstrValue); }
VOID CDUIIconTextItem::SetAttribute(const CDUIString& strName, const CDUIString& strValue) { BOOL bHandled(FALSE); if(strName.compare(_T("normal_icon")) == 0) { m_uiData.m_pNormalIcon = GetSkinMgr()->GetImage(strValue); bHandled = TRUE; } else if(strName.compare(_T("expand_icon")) == 0) { m_uiData.m_pExpandIcon = GetSkinMgr()->GetImage(strValue); bHandled = TRUE; } else if(strName.compare(_T("hover_frame")) == 0) { SetHoverFrameBK(GetSkinMgr()->GetFrameBK(strValue)); bHandled = TRUE; } else if(strName.compare(_T("select_frame")) == 0) { SetSelectFrameBK(GetSkinMgr()->GetFrameBK(strValue)); bHandled = TRUE; } else if(strName.compare(_T("normal_height")) == 0) { SetHeight(FALSE, _ttol(strValue.c_str())); bHandled = TRUE; } else if(strName.compare(_T("expand_height")) == 0) { SetHeight(TRUE, _ttol(strValue.c_str())); bHandled = TRUE; } else if(strName.compare(_T("group")) == 0) { if(strValue.compare(DUI_STR_TRUE) == 0) { SetGroup(TRUE); } else { SetGroup(FALSE); } bHandled = TRUE; } else if(strName.compare(_T("expand")) == 0) { if(strValue.compare(DUI_STR_TRUE) == 0) { SetExpand(TRUE); } else { SetExpand(FALSE); } bHandled = TRUE; } if(!bHandled) { theBase::SetAttribute(strName, strValue); } }
void MAS::RadioButton::Setup(int x, int y, int w, int h, int key, int flags, const char *t, int g) { Label::Setup(x, y, w, h, key, flags, t, 0); SetGroup(g); }
/** ** Handle keys in command mode. ** ** @param key Key scancode. ** @return True, if key is handles; otherwise false. */ local int CommandKey(int key) { switch( key ) { case '\r': KeyState=KeyStateInput; Input[0]='\0'; InputIndex=0; ShowInput(); return 1; case '^': UnSelectAll(); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if( KeyModifiers&ModifierControl ) { // dirty atoi version :) SetGroup(Selected,NumSelected,key-48); } else { SelectGroup(key-48); } UpdateBottomPanel(); MustRedraw|=RedrawCursor|RedrawMap|RedrawPanels; break; #if 0 IfDebug( case '0': ++ThisPlayer; if( ThisPlayer==&Players[PlayerMax] ) { ThisPlayer=&Players[0]; } MustRedraw=RedrawEverything; break; case '1': --ThisPlayer; if( ThisPlayer<&Players[0] ) { ThisPlayer=&Players[PlayerMax-1]; } MustRedraw=RedrawEverything; break; ); #endif case KeyCodePause: case 'P': // If pause-key didn't work if(GamePaused) { GamePaused=0; SetStatusLine("Game Resumed"); } else { GamePaused=1; SetStatusLine("Game Paused"); } break; case KeyCodeF10: InterfaceState=IfaceStateMenu; GamePaused=1; SetStatusLine("Game Paused"); ProcessMenu(MENU_GAME); break; case '+': VideoSyncSpeed+=10; InitVideoSync(); SetStatusLine("Faster"); break; case '-': VideoSyncSpeed-=10; InitVideoSync(); SetStatusLine("Slower"); break; case 'S': // SMALL s is needed for panel SaveAll(); break; case 'c': if( NumSelected==1 ) { MapCenter(Selected[0]->X,Selected[0]->Y); } break; // TAB toggles minimap. // FIXME: more... case '\t': DebugLevel1("TAB\n"); MinimapWithTerrain^=1; MustRedraw|=RedrawMinimap; break; // FIXME: shift+TAB case 'q': Exit(0); case KeyCodeUp: if( MapY ) { if( KeyModifiers&ModifierControl ) { if( MapY<MapHeight/2 ) { MapY=0; } else { MapY-=MapHeight/2; } } else { --MapY; } MustRedraw|=RedrawMaps|RedrawMinimapCursor; } break; case KeyCodeDown: if( MapY<TheMap.Height-MapHeight ) { if( KeyModifiers&ModifierControl ) { if( MapY<TheMap.Height-MapHeight-MapHeight/2 ) { MapY+=MapHeight/2; } else { MapY=TheMap.Height-MapHeight; } } else { ++MapY; } MustRedraw|=RedrawMaps|RedrawMinimapCursor; } break; case KeyCodeLeft: if( MapX ) { if( KeyModifiers&ModifierControl ) { if( MapX<MapWidth/2 ) { MapX=0; } else { MapX-=MapWidth/2; } } else { --MapX; } MustRedraw|=RedrawMaps|RedrawMinimapCursor; } break; case KeyCodeRight: if( MapX<TheMap.Width-MapWidth ) { if( KeyModifiers&ModifierControl ) { if( MapX<TheMap.Width-MapWidth-MapWidth/2 ) { MapX+=MapWidth/2; } else { MapX=TheMap.Width-MapWidth; } } else { ++MapX; } MustRedraw|=RedrawMaps|RedrawMinimapCursor; } break; default: DebugLevel3("Key %d\n",key); return 0; }
void isdf20Mission::Execute(void) { /* Here is where you put what happens every frame. */ /* LANDSLIDE INFO - .bzn has file reslida1.odf - Don't forget to delete bin data before you try this - Run animation on reslid01.odf - Replace it with reslidea1.odf */ player = GetPlayerHandle(); char tempstr[128]; Ally(1,3); switch (mission_state) { case 0: // build this stuff at start /* Handle recy=BuildObject("ivrecy",1,"Recycler"); int grp=GetFirstEmptyGroup(); SetGroup(recy,grp); SetScrap(1,30); */ // deleted for Nathan /* mbike_1=BuildObject("ivmbike",3,"mbike1"); mbike_2=BuildObject("ivmbike",3,"mbike2"); mbike_3=BuildObject("ivmbike",3,"mbike3"); */ tank_1=BuildObject("ivatank",1,"tank1"); // was atank SetGroup(tank_1,0); tank_2=BuildObject("ivrckt",1,"tank2"); // was atank SetGroup(tank_2,1); // serv= BuildObject("ivserv",1,"serv"); // Set // scav_1=BuildObject("ivscav",1,"scav1"); // scav_2=BuildObject("ivscav",1,"scav2"); // rckt_1=BuildObject("ivrckt",1,"rckt1"); // rckt_2=BuildObject("ivrckt",1,"rckt2"); SetGroup(rckt_1,1); SetGroup(rckt_2,1); serv_1=BuildObject("ivserv",1,"scav1"); SetGroup(serv_1,2); espir_2=BuildObject("ibgtow",comp_team,"base_here"); esent_1=BuildObject("ivmisl",comp_team,"esentpath1"); esent_2=BuildObject("ivmisl",comp_team,"esentpath1"); espir_1=BuildObject("ibgtow",comp_team,"espir1"); base_1=BuildObject("ibfact",comp_team,"estro1"); base_2=BuildObject("ibpgen",comp_team,"ekiln1"); base_3=BuildObject("ibpgen",comp_team,"power_x"); // was eforg1 base_4=BuildObject("ibcbun",comp_team,"bunker_x"); espir_3=BuildObject("ibgtow",comp_team,"espir3"); esent_3=BuildObject("ivscout",comp_team,"esent3"); esent_4=BuildObject("ivscout",comp_team,"esent4"); ClearObjectives(); AddObjective("isdf20a.otf",WHITE,10.0f); Patrol(esent_1,"esentpath1"); Follow(esent_2,esent_1); after_briefing= GetTime()+20.0f; slide1=GetHandle("unnamed_reslida1"); //Vector temp=GetPosition(slide1); RemoveObject(slide1); nav=BuildObject("ibnav",1,"lung2"); SetObjectiveOn(nav); TranslateString2(tempstr, sizeof(tempstr), "Mission2002"); // Rebel Base SetObjectiveName(nav,tempstr); // SetPosition(slide2?? /* So the mission isn't too slow. */ AddHealth(espir_1,-3000); AddHealth(espir_2,-3000); mission_state++; audio=AudioMessage("isdf2021.wav"); CameraReady(); break; case 1: CameraPath("camera1",200,200,player); // CameraObject(espir_1,30,20,20,espir_1); if (IsAudioMessageDone(audio)) { audio=AudioMessage("isdf2022.wav"); mission_state++; } break; case 2 : CameraPath("camera2",200,200,espir_2); if (IsAudioMessageDone(audio)) { AudioMessage("isdf2001.wav"); CameraFinish(); mission_state++; } break; case 3: //the attack begins // after the opening briefing, AI squadron drives to fight sentry units on their own if (GetTime() > after_briefing) { // Goto(mbike_1,"front_ambush"); // Goto(mbike_2,"front_ambush"); // Goto(mbike_3,"front_ambush"); // Goto(rckt_1,"front_ambush"); // Goto(rckt_2,"front_ambush"); Handle temp=BuildObject("ivscout",comp_team,"lung2"); Attack(temp,player); mission_state++; } break; case 4: // Kill the sentries // AI squadron engages sentry units if ((GetDistance(tank_1,"front_ambush")<200.0f) || (GetDistance(tank_2,"front_ambush")<200.0f) || (GetDistance(rckt_1,"front_ambush")<200.0f) || (GetDistance(rckt_2,"front_ambush")<200.0f) || (GetDistance(player,"front_ambush")<200.0f) ) { /* Attack(mbike_1,esent_1); Attack(mbike_2,esent_2); Attack(mbike_3,esent_1); */ SetObjectiveOn(esent_1); TranslateString2(tempstr, sizeof(tempstr), "Mission2001"); // Rebel SetObjectiveName(esent_1,tempstr); SetObjectiveOn(esent_2); SetObjectiveName(esent_2,tempstr); // Attack(rckt_1,esent_2); // Attack(rckt_2,esent_1); } // once the sentrys are destroyed, AI squadron heads to enemy gun tower and stops if ((!IsAlive(esent_1)) && (!IsAlive(esent_2))) { /* Goto(mbike_1,"front_ambush"); Goto(mbike_2,"front_ambush"); Goto(mbike_3,"front_ambush"); */ // Goto(rckt_1,"front_ambush"); // Goto(rckt_2,"front_ambush"); // temp=BuildObject("ivscout",2,"lung2"); // Attack(temp,serv_1); mission_state++; } break; case 5: // wait till they get to the tower if (( (GetDistance(tank_1,"front_ambush")<75.0f) || (GetDistance(rckt_2,"front_ambush")<75.0f) || (GetDistance(player,"front_ambush")<75.0f))) { Handle temp=BuildObject("ivscout",comp_team,"lung2"); Attack(temp,player); AudioMessage("isdf2002.wav"); // use your assault tanks ClearObjectives(); AddObjective("isdf2002.otf",WHITE,20.0f); SetObjectiveOn(espir_1); TranslateString2(tempstr, sizeof(tempstr), "Mission2003"); // Gun Tower SetObjectiveName(espir_1,tempstr); //temp=BuildObject("ivscout",2,"lung2"); //Attack(temp,player); mission_state++; } break; case 6: // destroy the tower // once you destroy the gun tower, AI squadron heads to next gun tower and stops if (!IsAlive(espir_1)) { Goto(mbike_1,"exit1"); Goto(mbike_2,"exit1"); Goto(mbike_3,"exit1"); // AudioMessage("isdf2003.wav"); // now let's press on to the base // Goto(rckt_1,"exit1"); // Goto(rckt_2,"exit1"); // temp=BuildObject("ivscout",2,"lung2"); // Attack(temp,serv_1); mission_state++; } break; case 7: // now go to the next tower if (((GetDistance(tank_1,"exit1")<50.0f) || (GetDistance(rckt_1,"exit1")<50.0f) || (GetDistance(player,"exit1")<50.0f))) { ClearObjectives(); AddObjective("isdf2003.otf",WHITE,20.0f); AudioMessage("isdf2003.wav"); mission_state++; } break; case 8: // until enemy spire is dead if (!IsAlive(espir_2)) { // Attack(mbike_1,base_1); // Attack(mbike_2,base_1); // Attack(mbike_3,base_1); Attack(rckt_1,base_1,0); Attack(rckt_2,base_1,0); mission_state++; } break; case 9: if (!IsAlive(base_1)) { // Attack(mbike_1,base_2); // Attack(mbike_2,base_2); // Attack(mbike_3,base_2); AudioMessage("isdf2004.wav"); Attack(rckt_1,base_2,0); Attack(rckt_2,base_2,0); mission_state++; } break; case 10: if (!IsAlive(base_2)) { // Attack(mbike_1,base_3); // Attack(mbike_2,base_3); // Attack(mbike_3,base_3); Attack(rckt_1,base_3,0); Attack(rckt_2,base_3,0); mission_state++; } break; case 11:// is the third base dead? if (!IsAlive(base_3)) { /* Goto(mbike_1,"homebase"); Goto(mbike_2,"homebase"); Goto(mbike_3,"homebase"); */ Goto(rckt_1,"homebase",0); Goto(rckt_2,"homebase",0); // keep the player bunched up Follow(tank_1,player,0); Follow(tank_2,player,0); ClearObjectives(); AddObjective("isdf2004.otf",WHITE,20.0f); SetObjectiveOff(nav); nav=BuildObject("ibnav",1,"scav2"); TranslateString2(tempstr, sizeof(tempstr), "Mission2004"); // Rencezvous SetObjectiveName(nav,tempstr); SetObjectiveOn(nav); AudioMessage("isdf2005.wav"); mission_state++; } break; case 12: // first ambush launches as soon as you exit enemy base after destroying it // second ambush comes in from behind if (GetDistance(player,"exit1")<125.0f) { ambush_delay=GetTime()+15.0f; mission_state++; } break; case 13: if (GetTime()>ambush_delay) { eatank_1=BuildObject("ivtank",comp_team,"eatank1"); eatank_2=BuildObject("ivtank",comp_team,"eatank2"); eatank_3=BuildObject("ivmbike",comp_team,"eatank3"); SetSkill(eatank_1,2); SetSkill(eatank_2,2); SetSkill(eatank_3,2); Attack(eatank_1,player); Attack(eatank_2,player); Attack(eatank_3,player); etank_1=BuildObject("ivtank",comp_team,"etank1"); etank_2=BuildObject("ivtank",comp_team,"etank2"); etank_3=BuildObject("ivmbike",comp_team,"etank3"); earch_1=BuildObject("ivtank",comp_team,"earch1"); earch_2=BuildObject("ivtank",comp_team,"earch2"); earch_3=BuildObject("ivmisl",comp_team,"earch3"); manson= BuildObject("ivatank",comp_team,"manson"); Attack(etank_1,player); Attack(etank_2,player); Attack(etank_3,player); Attack(earch_1,player); Attack(earch_2,player); Attack(earch_3,player); Attack(manson,player); uhoh= GetTime()+20.0f; mission_state++; } break; case 14: if (GetTime() > uhoh) { AudioMessage("isdf2006.wav"); AudioMessage("isdf2007.wav"); ClearObjectives(); AddObjective("isdf2005.otf",WHITE,20.0f); Handle temp=BuildObject("ivapc",comp_team,"lung2"); // now you are screwed Attack(temp,player); // temp=BuildObject("ivapc",2,"lung2"); // Attack(temp,player); mission_state++; } break; case 15: // how do you win?? if ((!seen_manson) && (GetDistance(player,manson)<200.0f)) { seen_manson=true; SetObjectiveOn(manson); } if (!IsAlive(manson)) { AudioMessage("isdf2010.wav"); SucceedMission(GetTime()+10.0f,"isdf20w1.txt"); mission_state++; } break; } // switch (mission_state) PeriodicAttack(); // once you destroy the second gun tower, AI squadron enters enemy base and levels it // infinite health and ammo // SetCurAmmo(player, 1200); // SetCurHealth(player, 3000); // tells player to head back to base // if ((!IsAlive(enemybase)) && (!go_home)) // { // AudioMessage("wahoo.wav"); // go_home=true; // } }
//==== Set Group And Screen ====// void GroupLayout::SetGroupAndScreen( Fl_Group* group, VspScreen* screen ) { SetGroup( group ); SetScreen( screen ); }