Blamite Game Engine - blam!  00263.10.17.20.0001.blamite
The core library for the Blamite Game Engine.
fields.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <d2d1.h>
5 
6 #include "tags.h"
7 #include "components/3rdparty/imgui/imgui.h"
9 #include "components/3rdparty/imgui/extensions/imgui_extensions.h"
12 
13 #ifndef BLAM
14 #define BLAM
15 #endif
16 
17 typedef bool bitfield8[8];
18 typedef bool bitfield16[16];
19 typedef bool bitfield32[32];
20 typedef char ascii[32];
21 
22 namespace Blam::Content::Tags
23 {
33  class TagField
34  {
35  public:
36  std::string display_name;
37  std::string extra_info;
38 
39  void* read_address;
41 
47  virtual void ShowImPropertyControl()
48  {
49  ImGui::TextColored(ImVec4(1.0, 0.0, 0.0, 1.0), std::string("<field '" + display_name + "' has no imgui control available>").c_str());
50  }
51 
55  virtual void SetMemoryLocation(void* new_address)
56  {
57  read_address = new_address;
58  }
59 
70  virtual std::string GetFieldXMLString(int offset)
71  {
72  std::string field_id = Blam::Utils::String::ToLower(display_name);
73  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
74 
75  std::string field_string = "<unknown id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" visible=\"false\" />";
76 
77  return field_string;
78  }
79  };
80 
87  class AsciiField : public TagField
88  {
89  public:
90  AsciiField(std::string _display_name, std::string _extra_info)
91  {
92  display_name = _display_name;
93  extra_info = _extra_info;
94 
95  read_length = sizeof(ascii);
96  }
97 
99  {
100  ImGui::InputText(display_name.c_str(), (char*)read_address, read_length);
101 
102  if (extra_info.length() > 0)
103  {
104  ImGui::SameLine();
106  }
107  }
108 
109  std::string GetFieldXMLString(int offset)
110  {
111  std::string field_id = Blam::Utils::String::ToLower(display_name);
112  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
113 
114  std::string field_string = "<ascii id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" length=\"" + std::to_string(read_length) + "\" visible=\"true\" />";
115 
116  return field_string;
117  }
118  };
119 
125  class Int32Field : public TagField
126  {
127  public:
128  Int32Field(std::string _display_name, std::string _extra_info)
129  {
130  display_name = _display_name;
131  extra_info = _extra_info;
132 
133  read_length = sizeof(int);
134  }
135 
137  {
138  ImGui::DragInt(display_name.c_str(), (int*)read_address, 1.0f);
139 
140  if (extra_info.length() > 0)
141  {
142  ImGui::SameLine();
144  }
145  }
146 
147  std::string GetFieldXMLString(int offset)
148  {
149  std::string field_id = Blam::Utils::String::ToLower(display_name);
150  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
151 
152  std::string field_string = "<int32 id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" visible=\"true\" />";
153 
154  return field_string;
155  }
156  };
157 
163  class Int16Field : public TagField
164  {
165  public:
166  Int16Field(std::string _display_name, std::string _extra_info)
167  {
168  display_name = _display_name;
169  extra_info = _extra_info;
170 
171  read_length = sizeof(short);
172  }
173 
175  {
176  int value_expand = *(short*)read_address;
177 
178  ImGui::DragInt(display_name.c_str(), &value_expand, 1.0f, -32768, 32767);
179 
180  *(short*)read_address = value_expand;
181 
182  if (extra_info.length() > 0)
183  {
184  ImGui::SameLine();
186  }
187  }
188 
189  std::string GetFieldXMLString(int offset)
190  {
191  std::string field_id = Blam::Utils::String::ToLower(display_name);
192  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
193 
194  std::string field_string = "<int16 id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" visible=\"true\" />";
195 
196  return field_string;
197  }
198  };
199 
205  class Int8Field : public TagField
206  {
207  public:
208  Int8Field(std::string _display_name, std::string _extra_info)
209  {
210  display_name = _display_name;
211  extra_info = _extra_info;
212 
213  read_length = sizeof(byte);
214  }
215 
217  {
218  int value_expand = *(byte*)read_address;
219 
220  ImGui::DragInt(display_name.c_str(), &value_expand, 1.0f, 0, 255);
221 
222  *(byte*)read_address = value_expand;
223 
224  if (extra_info.length() > 0)
225  {
226  ImGui::SameLine();
228  }
229  }
230 
231  std::string GetFieldXMLString(int offset)
232  {
233  std::string field_id = Blam::Utils::String::ToLower(display_name);
234  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
235 
236  std::string field_string = "<int8 id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" visible=\"true\" />";
237 
238  return field_id;
239  }
240  };
241 
248  class BooleanField : public TagField
249  {
250  public:
251  BooleanField(std::string _display_name, std::string _extra_info)
252  {
253  display_name = _display_name;
254  extra_info = _extra_info;
255 
256  read_length = sizeof(bool);
257  }
258 
260  {
261  ImGui::Checkbox(display_name.c_str(), (bool*)read_address);
262 
263  if (extra_info.length() > 0)
264  {
265  ImGui::SameLine();
267  }
268  }
269 
270  std::string GetFieldXMLString(int offset)
271  {
272  std::string field_id = Blam::Utils::String::ToLower(display_name);
273  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
274 
275  std::string field_string = "<boolean id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" visible=\"true\" />";
276 
277  return field_string;
278  }
279  };
280 
287  class ColorFloatField : public TagField
288  {
289  public:
290  ColorFloatField(std::string _display_name, std::string _extra_info)
291  {
292  display_name = _display_name;
293  extra_info = _extra_info;
294 
295  read_length = sizeof(D2D1_COLOR_F);
296  }
297 
299  {
300  ImGui::ColorEdit4(display_name.c_str(), (float*)read_address);
301 
302  if (extra_info.length() > 0)
303  {
304  ImGui::SameLine();
306  }
307  }
308 
309  std::string GetFieldXMLString(int offset)
310  {
311  std::string field_id = Blam::Utils::String::ToLower(display_name);
312  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
313 
314  std::string field_string = "<colorf id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" visible=\"true\" format=\"rgba\" />";
315 
316  return field_string;
317  }
318  };
319 
326  class EnumField : public TagField
327  {
328  private:
329  std::vector<std::string> options;
330  int* active_item = 0;
331 
332  public:
333  EnumField(std::string _display_name, std::string _extra_info, std::vector<std::string> _options)
334  {
335  display_name = _display_name;
336  extra_info = _extra_info;
337  options = _options;
338 
339  read_length = sizeof(int);
340  }
341 
343  {
344  active_item = (int*)read_address;
345 
346  if (ImGui::BeginCombo(display_name.c_str(), options.at(*active_item).c_str()))
347  {
348  for (int i = 0; i < options.size(); i++)
349  {
350  if (ImGui::Selectable(options.at(i).c_str()))
351  {
352  *active_item = i;
353  }
354  }
355 
356  ImGui::EndCombo();
357  }
358 
359  if (extra_info.length() > 0)
360  {
361  ImGui::SameLine();
363  }
364  }
365 
366  std::string GetFieldXMLString(int offset)
367  {
368  std::string field_id = Blam::Utils::String::ToLower(display_name);
369  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
370 
371  std::string field_string = "<enum id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" visible=\"true\">";
372 
373  for (int i = 0; i < options.size(); i++)
374  {
375  field_string += "<option id=\"" + field_id + "\" name=\"" + display_name + "\" value=\"" + std::to_string(i) + "\" visible=\"true\"/>";
376  }
377 
378  field_string += "</enum>";
379 
380  return field_string;
381  }
382  };
383 
389  class Bitfield8Field : public TagField
390  {
391  public:
392  std::vector<std::string> options;
394 
395  Bitfield8Field(std::string _display_name, std::string _extra_info, std::vector<std::string> _options)
396  {
397  display_name = _display_name;
398  extra_info = _extra_info;
399 
400  read_length = sizeof(bitfield8);
401 
402  options = _options;
403  }
404 
406  {
407  int region_height = (ImGui::GetStyle().WindowPadding.y * 2) + (max_items_to_show * 21) + ((max_items_to_show - 1) * ImGui::GetStyle().ItemSpacing.y);
408  int region_width = ImGui::CalcItemWidth();
409 
410 
411  ImGui::BeginChild(display_name.c_str(), ImVec2(region_width, region_height), true, ImGuiWindowFlags_HorizontalScrollbar);
412 
413  int max_bits_available = 0;
414 
415  if (options.size() > max_items_to_show)
416  {
417  max_bits_available = max_items_to_show;
418  }
419  else
420  {
421  max_bits_available = options.size();
422  }
423 
424  for (int i = 0; i < options.size(); i++)
425  {
426  void* prop_address = (char*)read_address + i;
427 
428  ImGui::Checkbox(options.at(i).c_str(), (bool*)prop_address);
429  }
430 
431  if (options.size() < max_items_to_show)
432  {
433  int unused_options = max_items_to_show - options.size();
434 
435  for (int i = 0; i < unused_options; i++)
436  {
437  bool helper_value = false;
438 
439  ImGui::Checkbox("", &helper_value);
440  ImGui::SameLine();
441  ImGui::TextDisabled("unused bit");
442  }
443  }
444 
445  ImGui::EndChild();
446 
447  ImGui::SameLine();
448  ImGui::Text(display_name.c_str());
449 
450  if (extra_info.length() > 0)
451  {
452  ImGui::SameLine();
454  }
455  }
456 
457  std::string GetFieldXMLString(int offset)
458  {
459  std::string field_id = Blam::Utils::String::ToLower(display_name);
460  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
461 
462  std::string field_string = "<bitfield8 id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" visible=\"true\">";
463 
464  for (int i = 0; i < options.size(); i++)
465  {
466  field_string += "<bit id=\"" + field_id + "\" name=\"" + display_name + "\" index=\"" + std::to_string(i) + "\" visible=\"true\"/>";
467  }
468 
469  field_string += "</bitfield8>";
470 
471  return field_string;
472  }
473  };
474 
480  class Bitfield16Field : public TagField
481  {
482  public:
483  std::vector<std::string> options;
484  int max_items_to_show = 16;
485 
486  Bitfield16Field(std::string _display_name, std::string _extra_info, std::vector<std::string> _options)
487  {
488  display_name = _display_name;
489  extra_info = _extra_info;
490 
491  read_length = sizeof(bitfield16);
492 
493  options = _options;
494  }
495 
497  {
498  int region_height = (ImGui::GetStyle().WindowPadding.y * 2) + (max_items_to_show * 21) + ((max_items_to_show - 1) * ImGui::GetStyle().ItemSpacing.y);
499  int region_width = ImGui::CalcItemWidth();
500 
501 
502  ImGui::BeginChild(display_name.c_str(), ImVec2(region_width, region_height), true, ImGuiWindowFlags_HorizontalScrollbar);
503 
504  int max_bits_available = 0;
505 
506  if (options.size() > max_items_to_show)
507  {
508  max_bits_available = max_items_to_show;
509  }
510  else
511  {
512  max_bits_available = options.size();
513  }
514 
515  for (int i = 0; i < options.size(); i++)
516  {
517  void* prop_address = (char*)read_address + i;
518 
519  ImGui::Checkbox(options.at(i).c_str(), (bool*)prop_address);
520  }
521 
522  if (options.size() < max_items_to_show)
523  {
524  int unused_options = max_items_to_show - options.size();
525 
526  for (int i = 0; i < unused_options; i++)
527  {
528  bool helper_value = false;
529 
530  ImGui::Checkbox("", &helper_value);
531  ImGui::SameLine();
532  ImGui::TextDisabled("unused bit");
533  }
534  }
535 
536  ImGui::EndChild();
537 
538  ImGui::SameLine();
539  ImGui::Text(display_name.c_str());
540 
541  if (extra_info.length() > 0)
542  {
543  ImGui::SameLine();
545  }
546  }
547 
548  std::string GetFieldXMLString(int offset)
549  {
550  std::string field_id = Blam::Utils::String::ToLower(display_name);
551  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
552 
553  std::string field_string = "<bitfield16 id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" visible=\"true\">";
554 
555  for (int i = 0; i < options.size(); i++)
556  {
557  field_string += "<bit id=\"" + field_id + "\" name=\"" + display_name + "\" index=\"" + std::to_string(i) + "\" visible=\"true\"/>";
558  }
559 
560  field_string += "</bitfield16>";
561 
562  return field_string;
563  }
564  };
565 
571  class Bitfield32Field : public TagField
572  {
573  public:
574  std::vector<std::string> options;
575  int max_items_to_show = 32;
576 
577  Bitfield32Field(std::string _display_name, std::string _extra_info, std::vector<std::string> _options)
578  {
579  display_name = _display_name;
580  extra_info = _extra_info;
581 
582  read_length = sizeof(bitfield32);
583 
584  options = _options;
585  }
586 
588  {
589  int region_height = (ImGui::GetStyle().WindowPadding.y * 2) + (max_items_to_show * 21) + ((max_items_to_show - 1) * ImGui::GetStyle().ItemSpacing.y);
590  int region_width = ImGui::CalcItemWidth();
591 
592 
593  ImGui::BeginChild(display_name.c_str(), ImVec2(region_width, region_height), true, ImGuiWindowFlags_HorizontalScrollbar);
594 
595  int max_bits_available = 0;
596 
597  if (options.size() > max_items_to_show)
598  {
599  max_bits_available = max_items_to_show;
600  }
601  else
602  {
603  max_bits_available = options.size();
604  }
605 
606  for (int i = 0; i < options.size(); i++)
607  {
608  void* prop_address = (char*)read_address + i;
609 
610  ImGui::Checkbox(options.at(i).c_str(), (bool*)prop_address);
611  }
612 
613  if (options.size() < max_items_to_show)
614  {
615  int unused_options = max_items_to_show - options.size();
616 
617  for (int i = 0; i < unused_options; i++)
618  {
619  bool helper_value = false;
620 
621  ImGui::Checkbox("", &helper_value);
622  ImGui::SameLine();
623  ImGui::TextDisabled("unused bit");
624  }
625  }
626 
627  ImGui::EndChild();
628 
629  ImGui::SameLine();
630  ImGui::Text(display_name.c_str());
631 
632  if (extra_info.length() > 0)
633  {
634  ImGui::SameLine();
636  }
637  }
638 
639  std::string GetFieldXMLString(int offset)
640  {
641  std::string field_id = Blam::Utils::String::ToLower(display_name);
642  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
643 
644  std::string field_string = "<bitfield32 id=\"" + field_id + "\" name=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" visible=\"true\">";
645 
646  for (int i = 0; i < options.size(); i++)
647  {
648  field_string += "<bit id=\"" + field_id + "\" name=\"" + display_name + "\" index=\"" + std::to_string(i) + "\" visible=\"true\"/>";
649  }
650 
651  field_string += "</bitfield32>";
652 
653  return field_string;
654  }
655  };
656 
664  class CommentField : public TagField
665  {
666  public:
667  CommentField(std::string _display_name)
668  {
669  display_name = _display_name;
670  extra_info = "";
671 
672  read_length = 0;
673  }
674 
675  CommentField(std::string _display_name, std::string _extra_info)
676  {
677  display_name = _display_name;
678  extra_info = _extra_info;
679 
680  read_length = 0;
681  }
682 
684  {
685  ImGui::Text(display_name.c_str());
686  ImGui::NewLine();
687 
688  if (extra_info.length() > 0)
689  {
690  ImGui::Text(extra_info.c_str());
691  }
692  }
693 
694  std::string GetFieldXMLString(int offset)
695  {
696  std::string field_id = Blam::Utils::String::ToLower(display_name);
697  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
698 
699  std::string field_string = "<comment title=\"" + display_name + "\" visible=\"true\">";
700 
701  field_string += extra_info;
702 
703  field_string += "</comment>";
704 
705  return field_string;
706  }
707  };
708 
715  class TagReference : public TagField
716  {
717  private:
718  std::vector<std::string> valid_classes;
719  int active_class_index = 0;
720  std::string active_tag_class_label;
721 
722  std::vector<tag_memory_data> filtered_tag_list;
723  int active_tag_index = 0;
724  public:
725  TagReference(std::string _display_name, std::string _extra_info, std::vector<std::string> _valid_classes)
726  {
727  display_name = _display_name;
728  extra_info = _extra_info;
729  valid_classes = _valid_classes;
730 
731  read_length = sizeof(tag_reference);
732  }
733 
734  std::string GetFieldXMLString(int offset);
735  void ShowImPropertyControl();
736  };
737 
743  class Block : public TagField
744  {
745  private:
746  float indent = 22.0f;
747 
748  public:
749  std::vector<TagField*> block_template;
750  int active_entry = 0;
752 
753  int entry_size = 0;
754 
755  Block(int _entry_size, std::string _display_name, std::string _extra_info, std::vector<TagField*> _block_template)
756  {
757  display_name = _display_name;
758  extra_info = _extra_info;
759  block_template = _block_template;
760  entry_size = _entry_size;
761 
762  read_length = sizeof(tag_block);
763  }
764 
765  void SetMemoryLocation(void* new_address)
766  {
767  read_address = (char*)new_address/* + 1*/;
768  }
769 
770  std::string GetFieldXMLString(int offset)
771  {
772  std::string field_id = Blam::Utils::String::ToLower(display_name);
773  field_id = Blam::Utils::String::Replace(field_id, " ", "_");
774 
775  std::string field_string = "<reflexive id=\"" + field_id + "\" title=\"" + display_name + "\" offset=\"" + std::to_string(offset) + "\" entrySize=\"" + std::to_string(entry_size) + "\" visible=\"true\">";
776 
777  int field_offset = 0;
778 
779  for (int i = 0; i < block_template.size(); i++)
780  {
781  field_string += block_template.at(i)->GetFieldXMLString(field_offset);
782  field_offset += block_template.at(i)->read_length;
783  }
784 
785  field_string += "</reflexive>";
786 
787  return field_string;
788  }
789 
791  {
794  block_info->block_identifier[0] = 't';
795  block_info->block_identifier[1] = 'b';
796  block_info->block_identifier[2] = 'f';
797  block_info->block_identifier[3] = 'd';
798  block_info->block_identifier[4] = NULL;
799 
801  {
803  }
804  else if (active_entry < 0)
805  {
806  active_entry = 0;
807  }
808 
809 
810  if (ImGui::CollapsingHeader(display_name.c_str()))
811  {
812  ImGui::Indent(indent);
813 
814  std::string block_id = "block_" + display_name;
815 
816  ImGui::PushID(block_id.c_str());
817  if (ImGui::Button("Add"))
818  {
819  if (block_info->entry_count == 0)
820  {
821  // For the first entry, we can simply allocate a new block without having to free
822  // anything beforehand.
823 
824  void* new_entry_address = calloc(1, entry_size * (block_info->entry_count + 1));
825 
826  block_info->entry_data_address = new_entry_address;
827 
829  }
830  else
831  {
832  // If we already have existing entries, we need to allocate a new block of memory and
833  // copy the original data to it - then free the old memory block.
834 
835  void* new_data_address = calloc(1, entry_size * (block_info->entry_count + 1));
836 
837  void* old_address = block_info->entry_data_address;
838 
839  memcpy(new_data_address, block_info->entry_data_address, (entry_size * block_info->entry_count));
840 
841  block_info->entry_data_address = new_data_address;
842 
843  free(old_address);
844 
846  }
847  }
848 
849  ImGui::SameLine();
850 
851  if (ImGui::Button("Insert"))
852  {
853  Blam::Logger::LogEvent("not yet implemented");
854  }
855 
856  ImGui::SameLine();
857 
858  if (ImGui::Button("Duplicate"))
859  {
860  Blam::Logger::LogEvent("not yet implemented");
861  }
862 
863  ImGui::SameLine();
864 
865  if (ImGui::Button("Delete"))
866  {
867  Blam::Logger::LogEvent("not yet implemented");
868  }
869 
870  ImGui::SameLine();
871 
872  if (ImGui::Button("Delete All"))
873  {
874  Blam::Logger::LogEvent("not yet implemented");
875  }
876 
877  ImGui::SameLine();
878 
879  ImGui::PushItemWidth(70.0f);
880  if (ImGui::BeginCombo("entry", std::to_string(active_entry).c_str()))
881  {
882  for (int i = 0; i < block_info->entry_count; i++)
883  {
884  std::string label = "entry " + std::to_string(i);
885 
886  if (ImGui::Selectable(label.c_str()))
887  {
888  active_entry = i;
889  }
890  }
891 
892  ImGui::EndCombo();
893  }
894  ImGui::PopItemWidth();
895 
896  if (block_info->entry_count != 0)
897  {
898  void* entry_start_address = (char*)block_info->entry_data_address + (entry_size * active_entry);
899 
900  void* next_field_address = entry_start_address;
901 
902  for (int i = 0; i < block_template.size(); i++)
903  {
904  block_template[i]->SetMemoryLocation(next_field_address);
905 
906  block_template[i]->ShowImPropertyControl();
907 
908  next_field_address = (char*)block_template[i]->read_address + block_template[i]->read_length;
909  }
910  }
911  else
912  {
913  ImGui::Text("no entries found");
914  }
915 
916  ImGui::Unindent(indent);
917 
918  ImGui::PopID();
919  }
920  }
921  };
922 }
Blam::Content::Tags::TagReference
Class representing a tag reference, or tagref for short.
Definition: fields.h:715
Blam::Utils::String::Replace
BLAM std::string Replace(std::string orig, std::string to_replace, std::string replace_with)
Replaces part of a string with another string.
Definition: string.cpp:67
Blam::DebugUI::Widgets::ShowHelpMarker
BLAM void ShowHelpMarker(const char *desc)
Shows a help indicator.
Definition: widgets.cpp:5
Blam::Content::Tags
Namespace containing things related to tag data.
Definition: bitmap.h:9
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:33
Blam::Content::Tags::CommentField::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:683
Blam::Content::Tags::TagReference::TagReference
TagReference(std::string _display_name, std::string _extra_info, std::vector< std::string > _valid_classes)
Definition: fields.h:725
tag_block
Definition: tags.h:78
Blam::Content::Tags::EnumField::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:366
Blam::Utils::String::ToLower
BLAM std::string ToLower(std::string string)
Transforms a string to all-lowercase.
Definition: string.cpp:49
Blam::Content::Tags::Block::active_entry
int active_entry
The index of the active entry.
Definition: fields.h:750
logger.h
Blam::Content::Tags::Int8Field::Int8Field
Int8Field(std::string _display_name, std::string _extra_info)
Definition: fields.h:208
Blam::Content::Tags::Bitfield8Field::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:405
ascii
char ascii[32]
Typedef for an ascii field, used in tag data definitions.
Definition: fields.h:20
string.h
Blam::Content::Tags::Int8Field::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:216
tag_block::entry_data_address
void * entry_data_address
The address of the blocks' entry data.
Definition: tags.h:82
tags.h
Blam::Content::Tags::Bitfield32Field::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:587
Blam::Content::Tags::TagField::GetFieldXMLString
virtual std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:70
Blam::Content::Tags::CommentField::CommentField
CommentField(std::string _display_name)
Definition: fields.h:667
Blam::Content::Tags::Bitfield8Field::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:457
Blam::Content::Tags::AsciiField::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:98
tag_block::block_identifier
char block_identifier[6]
Special variable that is used for saving tag data to a file from within the engine....
Definition: tags.h:80
Blam::Content::Tags::Bitfield16Field::Bitfield16Field
Bitfield16Field(std::string _display_name, std::string _extra_info, std::vector< std::string > _options)
Definition: fields.h:486
Blam::Content::Tags::AsciiField::AsciiField
AsciiField(std::string _display_name, std::string _extra_info)
Definition: fields.h:90
Blam::Content::Tags::Bitfield8Field
Class representing a bitfield8 tag field.
Definition: fields.h:389
Blam::Content::Tags::Block
Class representing a tag block, also referred to as a struct or reflexive in the modding community.
Definition: fields.h:743
Blam::Content::Tags::Bitfield16Field::max_items_to_show
int max_items_to_show
Maximum number of bitfield options to show.
Definition: fields.h:484
Blam::Content::Tags::Bitfield8Field::Bitfield8Field
Bitfield8Field(std::string _display_name, std::string _extra_info, std::vector< std::string > _options)
Definition: fields.h:395
Blam::Content::Tags::Bitfield8Field::options
std::vector< std::string > options
List of options available in the bitfield.
Definition: fields.h:392
Blam::Content::Tags::Block::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:770
Blam::Content::Tags::Bitfield16Field::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:548
Blam::Content::Tags::EnumField::EnumField
EnumField(std::string _display_name, std::string _extra_info, std::vector< std::string > _options)
Definition: fields.h:333
Blam::Content::Tags::Block::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:790
Blam::Content::Tags::Int8Field::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:231
tag_block::entry_size
int entry_size
The size of each block entry.
Definition: tags.h:81
bitfield8
bool bitfield8[8]
Typedef for a bitfield8 field, used in tag data definitions.
Definition: fields.h:17
Blam::Content::Tags::Int32Field::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:136
Blam::Content::Tags::EnumField
Class representing an enum tag field.
Definition: fields.h:326
Blam::Content::Tags::CommentField::CommentField
CommentField(std::string _display_name, std::string _extra_info)
Definition: fields.h:675
Blam::Content::Tags::AsciiField::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:109
Blam::Content::Tags::Int32Field::Int32Field
Int32Field(std::string _display_name, std::string _extra_info)
Definition: fields.h:128
Blam::Content::Tags::Int16Field::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:189
Blam::Content::Tags::ColorFloatField::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:309
Blam::Content::Tags::ColorFloatField
Class representing a color tag field.
Definition: fields.h:287
Blam::Content::Tags::TagReference::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.cpp:45
Blam::Content::Tags::ColorFloatField::ColorFloatField
ColorFloatField(std::string _display_name, std::string _extra_info)
Definition: fields.h:290
Blam::Content::Tags::BooleanField::BooleanField
BooleanField(std::string _display_name, std::string _extra_info)
Definition: fields.h:251
Blam::Content::Tags::Bitfield16Field::options
std::vector< std::string > options
List of options available in the bitfield.
Definition: fields.h:483
widgets.h
Blam::Content::Tags::TagField::read_address
void * read_address
The address of the data the field is currently representing.
Definition: fields.h:39
Blam::Content::Tags::Bitfield32Field::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:639
Blam::Content::Tags::ColorFloatField::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:298
tag_reference
Structure representing a tag reference.
Definition: tags.h:89
Blam::Content::Tags::Block::block_template
std::vector< TagField * > block_template
The list of block entries in this block.
Definition: fields.h:749
Blam::Content::Tags::Int8Field
Class representing an int8 tag field.
Definition: fields.h:205
Blam::Content::Tags::Block::entry_size
int entry_size
The size of each block entry.
Definition: fields.h:753
Blam::Content::Tags::CommentField
Class representing a comment field.
Definition: fields.h:664
Blam::Content::Tags::Int16Field::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:174
Blam::Content::Tags::TagField
Base class representing a tag field.
Definition: fields.h:33
Blam::Content::Tags::TagField::read_length
int read_length
How many bytes to read from the start of the address.
Definition: fields.h:40
Blam::Content::Tags::TagField::extra_info
std::string extra_info
Additional information to show alongside the field.
Definition: fields.h:37
Blam::Content::Tags::Bitfield32Field
Class representing a bitfield32 tag field.
Definition: fields.h:571
Blam::Content::Tags::Int32Field
Class representing an int32 tag field.
Definition: fields.h:125
bitfield16
bool bitfield16[16]
Typedef for a bitfield16 field, used in tag data definitions.
Definition: fields.h:18
Blam::Content::Tags::Block::SetMemoryLocation
void SetMemoryLocation(void *new_address)
Sets the read location of the tag field.
Definition: fields.h:765
Blam::Content::Tags::Bitfield32Field::max_items_to_show
int max_items_to_show
Maximum number of bitfield options to show.
Definition: fields.h:575
Blam::Content::Tags::BooleanField::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:270
Blam::Content::Tags::Int16Field::Int16Field
Int16Field(std::string _display_name, std::string _extra_info)
Definition: fields.h:166
bitfield32
bool bitfield32[32]
Typedef for a bitfield32 field, used in tag data definitions.
Definition: fields.h:19
Blam::Content::Tags::Bitfield32Field::options
std::vector< std::string > options
List of options available in the bitfield.
Definition: fields.h:574
Blam::Content::Tags::AsciiField
Class representing an ascii tag field.
Definition: fields.h:87
Blam::Content::Tags::Bitfield8Field::max_items_to_show
int max_items_to_show
Maximum number of bitfield options to show.
Definition: fields.h:393
Blam::Content::Tags::TagField::SetMemoryLocation
virtual void SetMemoryLocation(void *new_address)
Sets the read location of the tag field.
Definition: fields.h:55
Blam::Content::Tags::TagField::display_name
std::string display_name
The display name of the tag field.
Definition: fields.h:36
Blam::Content::Tags::Bitfield16Field::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:496
Blam::Content::Tags::Block::Block
Block(int _entry_size, std::string _display_name, std::string _extra_info, std::vector< TagField * > _block_template)
Definition: fields.h:755
Blam::Content::Tags::Block::block_info
tag_block * block_info
Pointer to the current block info being represented.
Definition: fields.h:751
Blam::Content::Tags::EnumField::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:342
Blam::Content::Tags::TagReference::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.cpp:5
Blam::Content::Tags::BooleanField
Class representing a boolean tag field.
Definition: fields.h:248
Blam::Content::Tags::Int16Field
Class representing an int16 tag field.
Definition: fields.h:163
Blam::Content::Tags::Int32Field::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:147
Text
@ Text
Master text object that wraps around both BitmapText and DWText.
Definition: render_stack.h:73
Blam::Content::Tags::CommentField::GetFieldXMLString
std::string GetFieldXMLString(int offset)
Generates a string representing an XML node associated with this tag field, used for generating plugi...
Definition: fields.h:694
Blam::Content::Tags::TagField::ShowImPropertyControl
virtual void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:47
Blam::Content::Tags::Bitfield32Field::Bitfield32Field
Bitfield32Field(std::string _display_name, std::string _extra_info, std::vector< std::string > _options)
Definition: fields.h:577
Blam::Content::Tags::Bitfield16Field
Class representing a bitfield16 tag field.
Definition: fields.h:480
Blam::Content::Tags::BooleanField::ShowImPropertyControl
void ShowImPropertyControl()
Shows a set of ImGUI controls representing the tag field.
Definition: fields.h:259
tag_block::entry_count
int entry_count
The number of entries within the tag block.
Definition: tags.h:83