~parasiteofchar/s25rttr/AIpoc2

« back to all changes in this revision

Viewing changes to src/iwMilitaryBuilding.cpp

  • Committer: poc
  • Date: 2015-02-14 18:27:20 UTC
  • Revision ID: parasiteofchar@googlemail.com-20150214182720-9p884ms594wgs1j1
new addon: Individual Custom Military
allows players to set the requested_soldier count for each individual military building

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
        //addon military control active? -> show button
81
81
        if(GameClient::inst().GetGGS().isEnabled(ADDON_MILITARY_CONTROL))
82
82
                AddImageButton( 10, 124, 147, 30, 32, TC_GREY, LOADER.GetImageN("io_new", 4), _("Send max rank soldiers to a warehouse"));
 
83
        //addon individual custom military
 
84
        if(GameClient::inst().GetGGS().isEnabled(ADDON_INDIVIDUAL_CUSTOM_MILITARY))
 
85
        {
 
86
                AddImageButton(11, 68, 40, 24, 18, TC_GREY, LOADER.GetImageN("io", 139), _("Less"));
 
87
                building->CalcTroopsCount();
 
88
                AddVarText(12, 96, 42, _("%d"), 0xFFFFFF00, glArchivItem_Font::DF_CENTER, NormalFont, 1,&building->requested_soldiers_by_milSettings);          
 
89
                AddImageButton(13, 100, 40, 24, 18, TC_GREY, LOADER.GetImageN("io", 138), _("More"));
 
90
                AddImageButton(14, 138, 40, 24, 18, TC_GREY, LOADER.GetImageN("io", 191), _("restore default"));
 
91
                AddText(15, 112, 20, _("Requested Troops"), 0xFFFFFF00, glArchivItem_Font::DF_CENTER, NormalFont);
 
92
        }
 
93
        
83
94
}
84
95
 
85
96
void iwMilitaryBuilding::Msg_PaintAfter()
95
106
 
96
107
    // Schwarzer Untergrund f�r Soldatenanzeige
97
108
    DrawRectangle(GetX() + width / 2 - 22 * TROOPS_COUNT[building->nation][building->size] / 2, GetY() + 98 , 22 * TROOPS_COUNT[building->nation][building->size], 24, 0x96000000);
 
109
    
98
110
 
99
111
    // Sammeln aus der Rausgeh-Liste und denen, die wirklich noch drinne sind
100
112
    list<unsigned> soldiers;
189
201
                case 10: //send home button (addon)
190
202
                {
191
203
                        GAMECLIENT.AddGC(new gc::SendSoldiersHome(building->GetX(),building->GetY()));
192
 
                }
193
 
                break;
 
204
                }break;
 
205
                case 11: //"less" button (individual custom military addon)
 
206
                {
 
207
                        GAMECLIENT.AddGC(new gc::RequestedSoldiersDec(building->GetX(),building->GetY()));
 
208
                }break;
 
209
                case 13: //"more" button (individual custom military addon)
 
210
                {
 
211
                        GAMECLIENT.AddGC(new gc::RequestedSoldiersInc(building->GetX(),building->GetY()));
 
212
                }break;
 
213
                case 14: //"default" button (individual custom military addon)
 
214
                {
 
215
                        GAMECLIENT.AddGC(new gc::RequestedSoldiersRes(building->GetX(),building->GetY()));
 
216
                }break;
194
217
    }
195
218
}
196
219