-
Notifications
You must be signed in to change notification settings - Fork 44
feat: Mostly under-the-hood changes to battle columns #651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
EttyKitty
merged 5 commits into
Adeptus-Dominus:main
from
EttyKitty:feat/battle-column-edits
Apr 1, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ea2e004
feat: A bunch of changes to battle columns
EttyKitty 499284c
Optimize some minor stuff
EttyKitty f26fd22
A little bit of DRY
EttyKitty d348051
Use planet colors for columns
EttyKitty 509eb58
Stop using the weird coord struct and add a hit method
EttyKitty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
|
|
||
| /* | ||
| if (instance_exists(obj_pnunit)){ | ||
| var _nearest = instance_nearest(-100,240,obj_pnunit); | ||
| if (instance_exists(_nearest)){ | ||
| x = _nearest.x; | ||
| } | ||
| } | ||
| } */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,78 @@ | ||
| draw_size = min(400, column_size); | ||
EttyKitty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if (instance_exists(obj_pnunit)){ | ||
| diff=0;pos=880; | ||
| siz=min(400,(men*0.5)+(medi)+(veh*2.5)+(dreads*2)); | ||
| } | ||
| if (draw_size > 0){ | ||
| draw_set_alpha(1); | ||
| draw_set_color(global.star_name_colors[obj_ncombat.enemy]); | ||
|
|
||
| if (instance_exists(obj_centerline)){ | ||
| centerline_offset=x-obj_centerline.x; | ||
| } | ||
|
|
||
| draw_set_color(c_white); | ||
| if (instance_exists(obj_centerline)) and (instance_exists(obj_pnunit)){ | ||
| diff=x-obj_centerline.x; | ||
| } | ||
| x1 = pos + (centerline_offset * 2); | ||
| y1 = 450 - (draw_size / 2); | ||
| x2 = pos + (centerline_offset * 2) + 10; | ||
| y2 = 450 + (draw_size / 2); | ||
|
|
||
| draw_set_color(c_maroon); | ||
| if (obj_ncombat.enemy=2) then draw_set_color(8307806); | ||
| if (obj_ncombat.enemy=3) then draw_set_color(16512); | ||
| if (obj_ncombat.enemy=5) then draw_set_color(c_silver); | ||
| if (obj_ncombat.enemy=6) then draw_set_color(33023); | ||
| if (obj_ncombat.enemy=7) then draw_set_color(38144); | ||
| if (obj_ncombat.enemy=8) then draw_set_color(117758); | ||
| if (obj_ncombat.enemy=9) then draw_set_color(7492269); | ||
| if (obj_ncombat.enemy=10) then draw_set_color(c_purple); | ||
| if (obj_ncombat.enemy=13) then draw_set_color(65408); | ||
|
|
||
| if (siz>0){ | ||
| draw_set_alpha(1); | ||
| if (highlight>0) then draw_set_alpha(0.8); | ||
| if ((pos+(diff*2))>817) and ((pos+(diff*2))<1575){ | ||
| draw_rectangle(pos+(diff*2),450-(siz/2),pos+(diff*2)+10,450+(siz/2),0); | ||
| if (hit()) { | ||
| draw_set_alpha(0.8); | ||
| } | ||
| draw_set_alpha(1); | ||
| } | ||
|
|
||
| if (highlight>0) and (obj_ncombat.fadein<=0){ | ||
| draw_set_color(38144); | ||
| draw_line(pos+(diff*2)+5,450,817,685); | ||
| draw_set_font(fnt_40k_14b); | ||
| draw_text(817,688,string_hash_to_newline("Row Composition:")); | ||
| draw_set_font(fnt_40k_14); | ||
| draw_text_ext(817,706,string_hash_to_newline(string(highlight3)),-1,758); | ||
| } | ||
| draw_rectangle(x1, y1, x2, y2, 0); | ||
|
|
||
| if (hit()) { | ||
| if (unit_count != unit_count_old) { | ||
| unit_count_old = unit_count; | ||
| if (obj_ncombat.enemy!=1){ | ||
| composition_string += block_composition_string(); | ||
| } else { | ||
| var variety, variety_num, stop, sofar, compl, vas; | ||
| stop = 0; | ||
| variety = []; | ||
| variety_num = []; | ||
| sofar = 0; | ||
| compl = ""; | ||
| vas = ""; | ||
|
|
||
| var variety_len = array_length(variety); | ||
| for (var q = 0; q < variety_len; q++) { | ||
| variety[q] = ""; | ||
| variety_num[q] = 0; | ||
| } | ||
| var dudes_len = array_length(dudes); | ||
| for (var q = 0; q < dudes_len; q++) { | ||
| if (dudes[q] != "") and(string_count(string(dudes[q]) + "|", compl) = 0) { | ||
| compl += string(dudes[q]) + "|"; | ||
| variety[sofar] = dudes[q]; | ||
| variety_num[sofar] = 0; | ||
| sofar += 1; | ||
| } | ||
| } | ||
| var dudes_len = array_length(dudes); | ||
| for (var q = 0; q < dudes_len; q++) { | ||
| if (dudes[q] != "") { | ||
| var variety_len = array_length(variety); | ||
| for (var i = 0; i < variety_len; i++) { | ||
| if (dudes[q] = variety[i]) then variety_num[i] += dudes_num[q]; | ||
| } | ||
| } | ||
|
|
||
| } | ||
| stop = 0; | ||
| var variety_num_len = array_length(variety_num); | ||
| for (var i = 0; i < variety_num_len; i++) { | ||
| if (stop = 0) { | ||
| if (variety_num[i] > 0) and(variety_num[i + 1] > 0) then composition_string += string(variety_num[i]) + "x " + string(variety[i]) + ", "; | ||
| if (variety_num[i] > 0) and(variety_num[i + 1] <= 0) { | ||
| composition_string += string(variety_num[i]) + "x " + string(variety[i]) + ". "; | ||
| stop = 1; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| draw_block_composition(x1, composition_string); | ||
| } | ||
|
|
||
| draw_block_fadein(); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,76 +1,2 @@ | ||
|
|
||
| highlight=0; | ||
| var diff,siz,pos; | ||
| diff=0;pos=880;siz=min(400,(men*0.5)+(medi)+(veh*2.5)+(dreads*2)); | ||
| if (instance_exists(obj_centerline)){ | ||
| diff=x-obj_centerline.x; | ||
| } | ||
| if (siz>0){ | ||
| if ((pos+(diff*2))>817) and ((pos+(diff*2))<1575){ | ||
| if (mouse_x>=pos+(diff*2)) and (mouse_y>=450-(siz/2)) | ||
| and (mouse_x<pos+(diff*2)+10) and (mouse_y<450+(siz/2)) then highlight=men+medi+veh; | ||
| } | ||
| } | ||
|
|
||
| if (highlight2!=highlight){ | ||
| highlight2=highlight;highlight3=""; | ||
|
|
||
| if (obj_ncombat.enemy!=1){ | ||
| var stop;stop=0; | ||
| var dudes_len = array_length(dudes_num); | ||
| for(var i = 0; i < dudes_len; i++) { | ||
| if (stop=0){ | ||
| if (dudes_num[i]>0) and (dudes_num[i+1]>0) then highlight3+=string(dudes_num[i])+"x "+string(dudes[i])+", "; | ||
| if (dudes_num[i]>0) and (dudes_num[i+1]<=0){highlight3+=string(dudes_num[i])+"x "+string(dudes[i])+". ";stop=1;} | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (obj_ncombat.enemy = 1) { | ||
| var variety, variety_num, stop, sofar, compl, vas; | ||
| stop = 0; | ||
| variety = []; | ||
| variety_num = []; | ||
| sofar = 0; | ||
| compl = ""; | ||
| vas = ""; | ||
|
|
||
| var variety_len = array_length(variety); | ||
| for (var q = 0; q < variety_len; q++) { | ||
| variety[q] = ""; | ||
| variety_num[q] = 0; | ||
| } | ||
| var dudes_len = array_length(dudes); | ||
| for (var q = 0; q < dudes_len; q++) { | ||
| if (dudes[q] != "") and(string_count(string(dudes[q]) + "|", compl) = 0) { | ||
| compl += string(dudes[q]) + "|"; | ||
| variety[sofar] = dudes[q]; | ||
| variety_num[sofar] = 0; | ||
| sofar += 1; | ||
| } | ||
| } | ||
| var dudes_len = array_length(dudes); | ||
| for (var q = 0; q < dudes_len; q++) { | ||
| if (dudes[q] != "") { | ||
| var variety_len = array_length(variety); | ||
| for (var i = 0; i < variety_len; i++) { | ||
| if (dudes[q] = variety[i]) then variety_num[i] += dudes_num[q]; | ||
| } | ||
| } | ||
|
|
||
| } | ||
| stop = 0; | ||
| var variety_num_len = array_length(variety_num); | ||
| for (var i = 0; i < variety_num_len; i++) { | ||
| if (stop = 0) { | ||
| if (variety_num[i] > 0) and(variety_num[i + 1] > 0) then highlight3 += string(variety_num[i]) + "x " + string(variety[i]) + ", "; | ||
| if (variety_num[i] > 0) and(variety_num[i + 1] <= 0) { | ||
| highlight3 += string(variety_num[i]) + "x " + string(variety[i]) + ". "; | ||
| stop = 1; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| update_block_size(); | ||
| update_block_unit_count(); | ||
EttyKitty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,60 +1,38 @@ | ||
| draw_size = min(400, column_size); | ||
|
|
||
| /*if (engaged=1) then image_index=1; | ||
| if (engaged=0) then image_index=0; | ||
| draw_self();*/ | ||
|
|
||
| var diff=0,pos=880; | ||
| if (veh_type[1]="Defenses"){ | ||
| siz=0; | ||
| if (instance_exists(obj_nfort)) then siz=400; | ||
| } | ||
| draw_set_color(c_white); | ||
| if (instance_exists(obj_centerline)){ | ||
| diff=x-obj_centerline.x; | ||
| if (draw_size > 0){ | ||
| draw_set_alpha(1); | ||
| draw_set_color(c_red); | ||
|
|
||
| if (instance_exists(obj_centerline)){ | ||
| centerline_offset=x-obj_centerline.x; | ||
| } | ||
|
|
||
| if (veh_type[1]=="Defenses"){ | ||
| diff=135; | ||
| draw_size=0; | ||
| if (instance_exists(obj_nfort)) then draw_size=400; | ||
| centerline_offset=135; | ||
| draw_set_color(c_gray); | ||
| } | ||
| } | ||
| siz=min(400,(men*0.5)+(veh*2.5)+(dreads*2)); | ||
| x_offset = pos+(diff*2); | ||
| if (siz>0){ | ||
| draw_set_alpha(1); | ||
| if (highlight>0) then draw_set_alpha(0.8); | ||
| if (x_offset>817) and (x_offset<1575){ | ||
| draw_rectangle(x_offset,450-(siz/2),x_offset+10,450+(siz/2),0); | ||
| } | ||
| draw_set_alpha(1); | ||
| } | ||
|
|
||
| if (highlight>0) and (obj_ncombat.fadein<=0){ | ||
| draw_set_color(38144); | ||
| draw_line(x_offset+5,450,817,685); | ||
| draw_set_font(fnt_40k_14b); | ||
| draw_text(817,688,"Row Composition:"); | ||
| draw_set_font(fnt_40k_14); | ||
| draw_text_ext(817,706,string_hash_to_newline(string(highlight3)),-1,758); | ||
| } | ||
|
|
||
| // draw_text(800,(x*18)-400,string(diff)); | ||
| x1 = pos + (centerline_offset * 2); | ||
| y1 = 450 - (draw_size / 2); | ||
| x2 = pos + (centerline_offset * 2) + 10; | ||
| y2 = 450 + (draw_size / 2); | ||
|
|
||
| if (hit()) { | ||
| draw_set_alpha(0.8); | ||
| } | ||
|
|
||
| draw_rectangle(x1, y1, x2, y2, 0); | ||
|
|
||
| draw_set_color(c_black); | ||
| draw_set_alpha(obj_ncombat.fadein/30); | ||
| draw_rectangle(822,239,1574,662,0); | ||
| draw_set_alpha(1); | ||
|
|
||
|
|
||
|
|
||
| exit; | ||
|
|
||
| draw_set_color(255); | ||
| draw_text((x*18)-400,300,string_hash_to_newline(string(men)+"|"+string(veh)+"#"+string(dudes_num[1])+"x "+string(dudes[1])+"#"+string(dudes_num[2])+"x "+string(dudes[2])+"#"+string(dudes_num[3])+"x "+string(dudes[3])+"#"+string(dudes_num[4])+"x "+string(dudes[4])+"#"+string(dudes_num[5])+"x "+string(dudes[5]))); | ||
|
|
||
|
|
||
| draw_text((x*18)-400,420,string_hash_to_newline("1: "+string(veh_type[1])+"#2: "+string(veh_type[2])+"#3: "+string(veh_type[3])+"#4: "+string(veh_type[4])+"#5: "+string(veh_type[5])+"#6: "+string(veh_type[6]))); | ||
| if (hit()) { | ||
| if (unit_count != unit_count_old) { | ||
| unit_count_old = unit_count; | ||
| composition_string = block_composition_string(); | ||
| } | ||
| draw_block_composition(x1, composition_string); | ||
| } | ||
|
|
||
| /* */ | ||
| /* */ | ||
| draw_block_fadein() | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.