Skip to content

Commit

Permalink
icons, starting gui
Browse files Browse the repository at this point in the history
helloruhe committed Dec 18, 2023
1 parent 6425ef6 commit f4ad2d8
Showing 24 changed files with 401 additions and 85 deletions.
1 change: 1 addition & 0 deletions common/customizable_localization/wc_profession_loc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

13 changes: 13 additions & 0 deletions common/game_concepts/wc_professions_concepts.txt
Original file line number Diff line number Diff line change
@@ -2,4 +2,17 @@
parent = wc_mod
texture = "gfx/interface/icons/activities/activity_adult_education.dds"
alias = { professions }
}

profession_type = {
parent = profession
texture = "gfx/interface/icons/activities/activity_adult_education.dds"
}

profession_foraging = {
parent = profession_type
}

profession_craft = {
parent = profession_type
}
1 change: 1 addition & 0 deletions common/script_values/wc_professions_values.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

44 changes: 39 additions & 5 deletions common/scripted_effects/wc_professions_effects.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
create_professions_list_effect = {
add_to_variable_list = { name = all_professions target = flag:blacksmithing }
add_to_variable_list = { name = all_professions target = flag:mining }
add_to_variable_list = { name = all_professions target = flag:herbalism }
}
# REAGENTS AND INVENTORY
# ALL CHARACTER SCOPE
discover_reagent_effect = {
add_to_variable_list = {
name = known_reagents
target = flag:$REAGENT$
}
custom_tooltip = discover_reagent_tt
}

add_reagent_to_inventory_effect = {
change_variable = {
name = $REAGENT$_amount
add = 1
}
add_to_variable_list = {
name = inventory
target = flag:$REAGENT$
}
}

remove_reagent_from_inventory_effect = {
change_variable = {
name = $REAGENT$_amount
add = -1
}
add_to_variable_list = {
name = inventory
target = flag:$REAGENT$
}
}

discover_recipe_effect = {
add_to_variable_list = {
name = known_recipes
target = flag:$RECIPE$
}
custom_tooltip = discover_recipe_tt
}
79 changes: 75 additions & 4 deletions common/scripted_guis/wc_professions_sgui.txt
Original file line number Diff line number Diff line change
@@ -2,15 +2,86 @@
scope = character

effect = {
hidden_effect = {
if = { limit = { NOT = { has_global_variable_list = all_professions } }
create_professions_list_effect = yes
if = {
limit = { NOT = { has_variable = profession_1 }}
set_variable = {
name = profession_1
value = flag:none
}
}
if = {
limit = { NOT = { has_variable = profession_2 }}
set_variable = {
name = profession_2
value = flag:none
}
}

}
}

close_professions_sgui = {
effect = {
if = {
limit = { has_variable = profession_1_oncd }
remove_variable = profession_1_oncd
}
if = {
limit = { has_variable = profession_2_oncd }
remove_variable = profession_2_oncd
}
}
}

save_profession_sgui = {
scope = character
}
saved_scopes = { profession }
effect = {
hidden_effect = {
if = {
limit = { has_trait_with_flag = profession_trait }
set_variable = {
name = profession_2
value = scope:profession
}
add_character_flag = {
flag = profession_2_cd
years = 1
}
}
else = {
set_variable = {
name = profession_1
value = scope:profession
}
add_character_flag = {
flag = profession_1_cd
years = 1
}
}
}
add_trait = scope:profession
}
}

check_cd_sgui = {
scope = character
effect = {
if = {
limit = { has_character_flag = profession_1_cd }
set_variable = {
name = profession_1_oncd
value = yes
}
}
if = {
limit = { has_character_flag = profession_2_cd }
set_variable = {
name = profession_2_oncd
value = yes
}
}
}
}

buy_reagent_sgui = {}
18 changes: 18 additions & 0 deletions common/scripted_triggers/wc_professions_triggers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
is_known_reagent = {
is_target_in_variable_list = {
name = known_reagents
target = flag:$REAGENT$
}
}

is_known_recipe = {
is_target_in_variable_list = {
name = known_recipes
target = flag:$RECIPE$
}
}

has_sufficient_reagent = {
var:$REAGENT$_amount >= $REQUIRED_AMOUNT$
}

52 changes: 13 additions & 39 deletions common/traits/wc_professions_traits.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
profession_mining = {
name = {
first_valid = {
triggered_desc = {
trigger = {
NOT = { exists = this }
}
desc = trait_profession_mining
}
desc = trait_profession_mining_character
}
}
icon = profession_mining
desc = {
first_valid = {
@@ -18,6 +29,7 @@
level = 1
flag = profession_trait
flag = profession_mining
flag = profession_type_foraging
category = lifestyle

same_opinion = 10
@@ -57,6 +69,7 @@ profession_blacksmithing = {
level = 1
flag = profession_trait
flag = profession_blacksmithing
flag = profession_type_craft
category = lifestyle

same_opinion = 10
@@ -193,45 +206,6 @@ profession_alchemy = {
}
}

profession_first_aid = {
icon = profession_first_aid
desc = {
first_valid = {
triggered_desc = {
trigger = {
NOT = { exists = this }
}
desc = trait_profession_first_aid_desc
}
desc = trait_profession_first_aid_character_desc
}
}
shown_in_ruler_designer = no
minimum_age = 14

group = profession
level = 1
flag = profession_trait
flag = profession_skinning
category = lifestyle

same_opinion = 10



track = {
20 = { }
40 = { }
60 = { }
80 = { }
100 = { }
}

compatibility = {
profession_cooking = @pos_compat_high
}
}

profession_enchanting = {
icon = profession_enchanting
desc = {
5 changes: 5 additions & 0 deletions data_binding/professions_databinding.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
macro = {
description = "Gets icon for profession"
definition = "GetProfessionIcon(profession)"
replace_with = "Concatenate(Concatenate('gfx/interface/icons/traits', profession), '.dds')"
}
Binary file added gfx/interface/icons/traits/profession_alchemy.dds
Binary file not shown.
Binary file not shown.
Binary file added gfx/interface/icons/traits/profession_cooking.dds
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit f4ad2d8

Please sign in to comment.