Skip to content

Commit

Permalink
1.0.4
Browse files Browse the repository at this point in the history
Added 2 more rings of adjacent counties and a directional filter for them.
Added holders of adjacent counties.
Added a toggle to not auto-close adjacent rulers.
Added a sound when someone joins your multiplayer game.
Added debug info in the character interactions menu.
For dead characters, added the debug tooltip to the word dead.
  • Loading branch information
Agamidae committed Jan 10, 2024
1 parent d8cdb26 commit 9260a67
Show file tree
Hide file tree
Showing 18 changed files with 534 additions and 100 deletions.
13 changes: 12 additions & 1 deletion OCR-Support/common/script_values/sval_distance_OCR.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ y_difference_margin = {
direction_svalue_temp = {
value = 0

# final direction_svalue multiplies by -1 so the order becomes clockwise, from north:
# -1 north
# -2 northeast
# -3 east
# -4 southeast
# -5 south
# -6 southwest
# -7 west
# -8 northwest


if = {
# east
limit = {
Expand Down Expand Up @@ -264,4 +275,4 @@ distance_to_prev = {
}
add = scope:tmp
}
}
}
26 changes: 23 additions & 3 deletions OCR-Support/common/scripted_guis/ocr_error_suppression.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
save_scope_as = saved_distance
set_variable = closest_counties
save_scope_as = third
set_variable = { name = x value = flag:in_faction }
set_variable = { name = x value = flag:activity_tour }
set_variable = { name = x value = flag:richest }
set_variable = { name = x value = flag:hate_you }
set_variable = { name = x value = flag:dislike_you }
set_variable = { name = x value = flag:not_intimidated }
set_variable = { name = x value = flag:like_you }
set_variable = { name = x value = flag:activity_tournament }
set_variable = { name = x value = flag:activity_feast }
set_variable = { name = x value = flag:intimidated }
set_variable = { name = x value = flag:can_join_faction }
set_variable = { name = x value = flag:powerful }
set_variable = {
name = page
value = flag:rules_page
Expand Down Expand Up @@ -47,8 +59,16 @@
has_variable_list = river_mouths
has_variable_list = river_parts
has_variable_list = river_sources
has_variable = mgr_is_active
has_variable = mgr_is_active
has_variable = page

has_variable = in_faction
has_variable = activity_tour
has_variable = richest
has_variable = cultures_list
has_variable = console_used
has_variable = visited_points_of_interest
has_variable = x
has_variable = faiths_list
has_variable = tutorial_chance_map_mode_complete_1
}
}
}
93 changes: 92 additions & 1 deletion OCR-Support/common/scripted_guis/sgui_adjacencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,32 @@
save_scope_as = origin
}
clear_variable_list = adjacent_counties
clear_variable_list = adjacent_counties_2
clear_variable_list = adjacent_counties_3
clear_variable_list = adjacent_counties_across_water
clear_variable_list = adjacent_seas
clear_variable_list = adjacent_rivers

if = {
limit = {
exists = scope:direction
}
scope:player = {
set_variable = {
name = county_direction
value = scope:direction
}
}
}
if = {
limit = {
exists = scope:clear_direction
}
scope:player = {
remove_variable = county_direction
}
}

# every_county_province
# scope:target
every_county_province = {
Expand Down Expand Up @@ -69,13 +91,81 @@
ordered_neighboring_county = {
order_by = title_province.direction_svalue
min = 0
add_to_list = adjacent_counties # easier to check later
limit = {
direction_filter = yes
}
root = {
add_to_variable_list = {
name = adjacent_counties
target = prev
}
}
}

every_in_list = {
list = adjacent_counties

every_neighboring_county = {
limit = {
NOR = {
is_in_list = adjacent_counties
this = root
}
}
add_to_list = adjacent_counties_2
}
}

every_in_list = {
list = adjacent_counties_2

every_neighboring_county = {
limit = {
NOR = {
is_in_list = adjacent_counties
is_in_list = adjacent_counties_2
this = root
}
}
add_to_list = adjacent_counties_3
}
}

ordered_in_list = {
list = adjacent_counties_2
order_by = title_province.direction_svalue
min = 0

limit = {
direction_filter = yes
}

root = {
add_to_variable_list = {
name = adjacent_counties_2
target = prev
}
}
}

ordered_in_list = {
list = adjacent_counties_3
order_by = title_province.direction_svalue
min = 0

limit = {
direction_filter = yes
}

root = {
add_to_variable_list = {
name = adjacent_counties_3
target = prev
}
}
}

ordered_title_to_title_neighboring_and_across_water_county = {
order_by = title_province.direction_svalue
limit = {
Expand All @@ -87,6 +177,7 @@
}
}
}
direction_filter = yes
}
min = 0
root = {
Expand Down Expand Up @@ -631,4 +722,4 @@ clear_last_view = {
effect = {
remove_variable = last_view
}
}
}
10 changes: 10 additions & 0 deletions OCR-Support/common/scripted_guis/sgui_ocr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2413,3 +2413,13 @@ pause_event = {
has_variable = pause_event
}
}


close_adjacent_rulers = {
effect = {
toggle_var = { VAR = dont_close_adjacent_rulers }
}
is_shown = {
has_variable = dont_close_adjacent_rulers
}
}
46 changes: 45 additions & 1 deletion OCR-Support/common/scripted_triggers/triggers_distance.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,48 @@ rf_distance_to_prev = {
title = prev.primary_title
value >= trigger_to_script_bitsum
}
}
}

direction_filter = {
trigger_if = {
limit = {
scope:player.var:county_direction ?= flag:north
}
OR = {
title_province.direction_svalue = -1
title_province.direction_svalue = -2
title_province.direction_svalue = -8
}
}
trigger_else_if = {
limit = {
scope:player.var:county_direction ?= flag:east
}
OR = {
title_province.direction_svalue = -2
title_province.direction_svalue = -3
title_province.direction_svalue = -4
}
}
trigger_else_if = {
limit = {
scope:player.var:county_direction ?= flag:south
}
OR = {
title_province.direction_svalue = -4
title_province.direction_svalue = -5
title_province.direction_svalue = -6
}
}
trigger_else_if = {
limit = {
scope:player.var:county_direction ?= flag:west
}
OR = {
title_province.direction_svalue = -6
title_province.direction_svalue = -7
title_province.direction_svalue = -8
}
}
trigger_else = {}
}
2 changes: 1 addition & 1 deletion OCR-Support/gui/_OCR_WIDGET.gui
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ window = {

button = {
onclick = "[ClearErrorLog]"
visible = "[Not(InReleaseMode)]"
visible = "[And(Not(InReleaseMode), HasErrors)]"
shortcut = undo
}

Expand Down
2 changes: 1 addition & 1 deletion OCR-Support/gui/interaction_menu_window.gui
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ window = {
position = { 0 -21 }
}

visible = "[And(InDebugMode, ReleaseMode)]"
visible = "[InDebugMode]"
}

button_text = {
Expand Down
48 changes: 26 additions & 22 deletions OCR-Support/gui/multiplayer_types.gui
Original file line number Diff line number Diff line change
Expand Up @@ -563,17 +563,17 @@ types JominiMultiplayerIngame {
layer = confirmation

size = { 800 300 }
widgetanchor = center
parentanchor = center

state = {
name = _show
using = Animation_FadeIn_Quick
using = Sound_WindowShow_Standard
}

state = {
name = _hide
using = Animation_FadeOut_Quick
using = Sound_WindowHide_Standard
}

using = Window_Background_Popup
Expand Down Expand Up @@ -607,31 +607,34 @@ types JominiMultiplayerIngame {
datamodel = "[JominiAccessPlayerJoinRequests]"

item = {
hbox = {
vbox = {
layoutpolicy_horizontal = expanding
layoutpolicy_vertical = fixed
spacing = 5
margin = { 0 2 }

text_single = {
text = "[PlayerJoinRequest.GetPlayerName]"
autoresize = yes
button_primary_text = {
layoutpolicy_horizontal = expanding
onclick = "[PlayerJoinRequest.Accept]"
blockoverride "pre" {
text_single = {
raw_text = "JOMINI_MULTIPLAYER_GUI_PLAYER_JOIN_REQUEST_ACCEPT"
}
}
blockoverride "text" {
raw_text = "[PlayerJoinRequest.GetPlayerName],"
}
}

expand = { }

button_standard = {
name = "reject_button"
text = "JOMINI_MULTIPLAYER_GUI_PLAYER_JOIN_REQUEST_REJECT"
button_text = {
layoutpolicy_horizontal = expanding
onclick = "[PlayerJoinRequest.Reject]"
layoutpolicy_horizontal = fixed
}

button_primary = {
name = "accept_button"
text = "JOMINI_MULTIPLAYER_GUI_PLAYER_JOIN_REQUEST_ACCEPT"
onclick = "[PlayerJoinRequest.Accept]"
shortcut = increase_speed_2
blockoverride "text" {
text = "JOMINI_MULTIPLAYER_GUI_PLAYER_JOIN_REQUEST_REJECT"
}
blockoverride "extra" {
text_single = {
raw_text = "[PlayerJoinRequest.GetPlayerName], X."
}
}
}
}
}
Expand Down Expand Up @@ -1887,7 +1890,7 @@ types JominiMultiplayerLobby
type JominiMultiplayerLobby = widget {
background = {
using = Background_Area_Border_Solid
alpha = 0.3
alpha = 0.8
visible = "[Not(GetVariableSystem.Exists('ocr'))]"
}
alwaystransparent = no
Expand Down Expand Up @@ -2145,6 +2148,7 @@ types JominiMultiplayerLobby
widget = {
size = { 700 100% }
using = Window_Background_No_Edge
background = { using = Background_Area_Border_Solid }
alwaystransparent = no

#TODO
Expand Down
Loading

0 comments on commit 9260a67

Please sign in to comment.